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 "Audio_playback_and_record" example, hoping they will not conflict with ChibiOS too much.
Additionally, I changed the following lines in mcuconf.h:
#define STM32_I2SSRC STM32_I2SSRC_PLLI2S
#define STM32_PLLI2SN_VALUE 258
#define STM32_PLLI2SR_VALUE 3
After that, I actually get audio noise from the speakers if I continously write PCM data to the DAC using STs EVAL_AUDIO_Play() method.
The most obiously problem left now is: How can I configure SPI3 to I2S mode in ChibiOS to actually get the ChibiOS IRQ handler for SPI3 called when the its outgoing DMA buffer gets empty? The IRQ handler in the ST code ("SPI3_IRQHandler") is obiously not called since that part of the ST library is not initialized (I don't think that would be a good idea). I believe I somehow would have to let ChibiOS initialize SPI3 using spiStart().
Edit: OK it looks like a DMA IRQ handler is set up by the SD code, but also not called. I should be able to setup this in ChibiOS somehow....need to look at some examples.
Has anyone any hints or maybe even example code for using the STM32 I2S interface with ChibiOS ?
Thx,
Watz