2014-07-10 02:11 AM
2014-07-11 06:56 AM
Ok, I do have the same situation here with SRC4392 and STM32F427. From what I have understood the situation is as follows:
1) there is a SRC4392 with an 24,576 MHz external oscillator or something like that (maybe half that frequency?) 2) a STM32F427 with an 8MHz HSE running at a multiple of 42MHz (possible 168MHz) as sysclock. 3) you use the transmit clock out of the SRC4392 as I2S clock in to clock the output stage of the I2S peripheral of the STM32F427. 4) The DAC connected in parallel to the SRC4392 on the same I2S. --EDIT: read what i was missing above. What I find interesting is that you have 32bit data but set hdma_i2s2_ext_tx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; As the memory bus and internal memory are 32bit I'd at least try to set that to WORD and let the DMA do the conversion.2014-07-11 08:27 AM
2014-07-11 08:51 AM
The STM32 does resynchronize input signals, you could run the part off the TCXO clock too
2014-07-11 09:01 AM
Hi clive
what do you mean?
you could run the part off the TCXO clock too
2014-07-11 09:37 AM
If you wanted a common clock domain, the STM32 can be clocked by an external 1-50 MHz source. Given the inflexibility in the clocking scheme within the device, this can be desirable to hit magic frequencies, or act as a master.
2014-07-12 05:33 AM
You are right. I took this option as a backup.
However. Today I figured it out :) The ''shift'' problem is because of my power source. If I short-circuit the power for a very very short time before the voltage regulator I get to reproduce the scenario. At some point in time the power source(SMPS) is interrupting the current to the MCU. The capacitors hold the power for a short amount of time which causes the MCU to pause it's execution. Maybe at that point HSE is not oscillatiog anymore. After power is stabilized again the MCU continues the execution, no reset is triggered, but it is too late. The I2S stream advances while MCU is in standby and there it's my WS vs DATA desync problem. A big capacitor 1000uF solved the problem. But I will replace the PSU soon. I will do some more tests. And i'll be back the conclusion or more questions. :)2014-07-13 09:41 AM
Ok, the problem continues.
The big capacitor added didn't solved the issue. The ''shift'' still occurs, but now I have to wait even longer to happen. But I'm on the right track. So there are two clock domains which needs to stay online: 1. HSE clock 2. I2S external MCLK input The DMA is the ''bridge'' between them. The problem after all is not the power source. Is that the HSE PLL oscillator is loosing lock at some point in time for about 1-16fs. Thats's why when using PLL clock to fed I2S MCLK, the audio stream stays in sync forever(when HSE pauses, the internal I2S MCLK pauses too). Because my MCU is on a adapter board and I'm working with trough-hole parts, the crystal (8Mhz) is as close as possible to the chip(1.5cm) but not closer enough I think. To put crystal closer and add proper grounding to the current design is impossible. So now I'm thinking to replace the crystal,resistor and capacitors from the PH0/PH1 pins with a crystal oscillator(TCXO) and fed the signal to PH0 pin. I'm really optimistic that this will solve the problem for good this time. I will update soon about this...2014-07-14 08:26 AM
I'm happy to read that you were able to make a few steps forward. The last day I had an issue with a permanent shift of 16bit to the right in the I2S stream.
I have a situation where the I2S stream is (possibly) restarted and after the second streaming start all data was shift right by 16bit. It helped me to reset the peripheral (via reset register) after stopping it and reconfigured it before starting again. I have the DMA configured to do the word <-> half word conversion with FIFO and SINGLE bursts (currently). This is acutally working without issues, I'm going to change to INCR4 anyway.2014-07-14 10:35 AM
Hi bs
How are you running the I2S port? master/slave? receive/transmit? Who is the second stream? You are running full-duplex? or both I2S ports? Are you running on internal or external clock for the I2S MCLK? Maybe you are having the same issue as I did. As I learnt my lesson. Left shift represent pin overdrive(probably on I2Sx_CK). Right shift represents HSE/AHB clock instability issue. Make sure none of this is happening. In 32bit data frame only half word works to the peripheral In my case only this options works for I2S: 1.half(peripheral) , half(memory), 4 increment 2.half(periph), word(memory), single But the 2nd option would keep the bus more busy. My problem got solved for good. I replaced the crystal with an external 25Mhz TCXO, changed the divider before PLL and switched to BYPASS mode. Now the HSE clock is stable.2014-07-15 06:30 AM
I run the I2S2 port as follows:
- SPI2 part as Master Receiver - I2S2ext as Slave Transmitter The STM32 has a HSE quartz with 24MHz and the internal I2S PLL is fed with a 1MHz clock derived from the HSE. The I2S PLL out is output via the MCO2 pin to the SRC4392 and provides the master clock to it. The DMA's are configured as - msize: word - mburst: incr4 - with fifo - psize: halfword - pburst: single Currently runnning without issues since yesterday evening.