STM32F4Discovery + CS43L22
Posted: Wed Sep 11, 2013 11:53 am
Hi,
I know this topic has been on the board multiple times and I definitely read all those threads. The one that seems to come closest to my symptoms seems to be viewtopic.php?f=8&t=745, but unfortunately that one doesn't contain any solution.
I'm trying to output audio through the onboard DAC using ChibiOS 2.6.1 (the latest stable), but so far all my attempts fail. I started with the code of 3 different MP3 player projects (from here and on the web) and they all have different initialization code, but it boils down to basically the same initialization sequence. I've the I2C set up correctly and working (reads back DAC register contents and the ID correctly) and my code also sets up a shell via USB-CDC. I added some commands to my shell to do on-board diagnosis without gdb (e.g. read memory / register locations).
I already nailed it all down to the fact that the master clock is missing, so MCLK and SCLK pins stay silent whatever I do. PLL does work, I checked PLLI2SRDY and PLLI2SON and as well routed it to MCO2 and checked it via a scope. I've checked my code multiple times and in addition checked register contents via GDB on my and other examples (including those from ST) and the register contents of the I2CPLL source, SPI3 clock enable and the SPI3 config do all match. However, the only code I ever saw a master clock on my scope was with the one from ST (then also playing audio). All Chibios-based MP3 player examples including my code never manage to enable MCLK. However, I don't see differences in the initialization of the devices anymore (except maybe order of initialization, but I2S is the last stuff I enable and configure).
I'm only asking wether this rings a bell, because I've spent some 10 hours on this already to debug it and I start running out of ideas. Is there something I till miss to setup? Do I need to follow a specific order of initialization? Overall, I was surprised how easy it was to set up USB-CDC with ChibiOS, but this I2S setup of the audio codec drives my nuts.
I can provide source code if needed, there's not too much in it so far.
Best,
STYLON
I know this topic has been on the board multiple times and I definitely read all those threads. The one that seems to come closest to my symptoms seems to be viewtopic.php?f=8&t=745, but unfortunately that one doesn't contain any solution.
I'm trying to output audio through the onboard DAC using ChibiOS 2.6.1 (the latest stable), but so far all my attempts fail. I started with the code of 3 different MP3 player projects (from here and on the web) and they all have different initialization code, but it boils down to basically the same initialization sequence. I've the I2C set up correctly and working (reads back DAC register contents and the ID correctly) and my code also sets up a shell via USB-CDC. I added some commands to my shell to do on-board diagnosis without gdb (e.g. read memory / register locations).
I already nailed it all down to the fact that the master clock is missing, so MCLK and SCLK pins stay silent whatever I do. PLL does work, I checked PLLI2SRDY and PLLI2SON and as well routed it to MCO2 and checked it via a scope. I've checked my code multiple times and in addition checked register contents via GDB on my and other examples (including those from ST) and the register contents of the I2CPLL source, SPI3 clock enable and the SPI3 config do all match. However, the only code I ever saw a master clock on my scope was with the one from ST (then also playing audio). All Chibios-based MP3 player examples including my code never manage to enable MCLK. However, I don't see differences in the initialization of the devices anymore (except maybe order of initialization, but I2S is the last stuff I enable and configure).
I'm only asking wether this rings a bell, because I've spent some 10 hours on this already to debug it and I start running out of ideas. Is there something I till miss to setup? Do I need to follow a specific order of initialization? Overall, I was surprised how easy it was to set up USB-CDC with ChibiOS, but this I2S setup of the audio codec drives my nuts.
I can provide source code if needed, there's not too much in it so far.
Best,
STYLON