Search found 8 matches

by watz
Thu Mar 15, 2012 3:26 pm
Forum: User Projects
Topic: STM32F4 Discovery MP3 player working - with source code
Replies: 15
Views: 63706

STM32F4 Discovery MP3 player working - with source code

Hi,

I've enabled my STM32F4 Discovery Board to play MP3 files (using ChibiOS and I2S support from ST libs). There is no display support yet. However, I think the code may already be a good start for people trying to do something similar. Some code for reading ID3v2 tags has been added, too.

The ...
by watz
Wed Mar 14, 2012 2:19 am
Forum: General Support
Topic: STM32F4 Discovery - How to set up SPI3 for I2S
Replies: 19
Views: 20492

Re: STM32F4 Discovery - How to set up SPI3 for I2S

I2SConfig holds all the secrets Any details available ?

I switched to circular tx dma buffer usage for I2S. Again, unbelievably, it worked right away. No more random stuttering on SD reads
Once I cleaned up the mess I'll post the Project somewhere online. It might be a good starting point for ppl ...
by watz
Tue Mar 13, 2012 3:28 pm
Forum: General Support
Topic: STM32F4 Discovery - How to set up SPI3 for I2S
Replies: 19
Views: 20492

Re: STM32F4 Discovery - How to set up SPI3 for I2S

Now the fun part begins...cleaning up the hacking mess, removing as much from the ST lib as possible...

I wonder....would that DAC abstraction layer also do the I2S initialization work (= all in one solution) ?
by watz
Tue Mar 13, 2012 2:56 pm
Forum: General Support
Topic: STM32F4 Discovery - How to set up SPI3 for I2S
Replies: 19
Views: 20492

Re: STM32F4 Discovery - How to set up SPI3 for I2S

Found it! The reason why it would play back too slow is this little bug in hal_lld.c:

#if STM32_ACTIVATE_PLLI2S
/* PLLI2S activation.*/
// RCC->PLLI2SCFGR = STM32_PLLI2SR_VALUE | STM32_PLLI2SN_VALUE;
RCC->PLLI2SCFGR = STM32_PLLI2SR | STM32_PLLI2SN;
RCC->CR |= RCC_CR_PLLI2SON;
while (!(RCC->CR ...
by watz
Tue Mar 13, 2012 1:06 pm
Forum: General Support
Topic: STM32F4 Discovery - How to set up SPI3 for I2S
Replies: 19
Views: 20492

Re: STM32F4 Discovery - How to set up SPI3 for I2S

Woohooo! I can't believe it....implemented the TC IRQ handling in spi_lld_serve_tx_interrupt() using my own double buffer algo (DMA circle not use yet) and it f***ing worked on the first run
MP3s sound really good but only half as fast as they should...I guess I2S is using the wrong sample rate ...
by watz
Tue Mar 13, 2012 9:43 am
Forum: General Support
Topic: STM32F4 Discovery - How to set up SPI3 for I2S
Replies: 19
Views: 20492

Re: STM32F4 Discovery - How to set up SPI3 for I2S

I'm looking forward to some official DAC interface in ChibiOS :-)
I just noticed that, in my case, spi_lld_serve_tx_interrupt() is already called for SPI3 with flags=HTIF0 | TCIF0 | FEIF0 (half transfer + transfer complete + fifo underrun). Seems like a good start to me.
by watz
Mon Mar 12, 2012 11:57 pm
Forum: General Support
Topic: STM32F4 Discovery - How to set up SPI3 for I2S
Replies: 19
Views: 20492

Re: STM32F4 Discovery - How to set up SPI3 for I2S

Good news.

About the hacking....I do believe I need to change the SPI3 setup for I2S and extend spi_lld_serve_tx_interrupt() for checking half/full flags and calling back the user code just like adc_lld_serve_rx_interrupt(), which seems to do the same thing on receiving data. Right ?

Thx,
Watz
by watz
Mon Mar 12, 2012 9:44 pm
Forum: General Support
Topic: STM32F4 Discovery - How to set up SPI3 for I2S
Replies: 19
Views: 20492

STM32F4 Discovery - How to set up SPI3 for I2S

Hi

I'm quite new to STM32 and ChibiOS and trying to hack that board to play MP3s from SD. I can sucessfully read and decode MP3s from an SD Card attached to SPI1. Because streaming the PCM data to the onboard DAC is not as trivial as I thought, I simply added all absolutely necessary party of STs ...