Glad you found it useful. It certainly took me quite a while to figure it out mostly because for a long time I was assuming it must be something I was doing wrong.
@@TripplikitElectronics I'm now struggling with an error trap lockup on my project, on my "Black Pill" board. It seems the i2s pll init is hitting a timeout. Starting a fresh project with Blinky and then adding back functions, it works. I notice the sequence of the MX_INIT calls is different. I guess this sequence depends upon the sequence of steps taken in the configuration tool? Much the same problem as you had with the DMA init.
Thanks for this video. This issue is corrected in later versions of STM32 CUBE MX (certainly in version 1.10.1) but I had missed the DMA setup in the I2S setup and, when using the DMA setup, had selected the wrong peripheral.
I did try a later version of Cube MX (can't remember which) and the problem was still there. Soon I will be doing a new video on the "Mean Green" synthesizer project where the problem occurred. I will check the latest version of Cube MX then.
Why did you set the Communication Standard in CubeMX for your I2S settings to LSB First (right justified)? It looks like you are using a Adafruit UDA1334A clone from AliExpress. Those DAC's should be set from factory as default Standard Phillips I2S format, which should be MSB first(left justified) format. Did you change any jumpers to go high on the other side of that DAC board? I always set Communication Standard to "I2S Phillips" when using a STM32F4 with a PCM5102 DAC module, which uses that Standard. If you're trying to create a DMA stream, you should be using Mode: Circular, Use Fifo, Threshold Full, Half Word for 16 bit and Burst Size of Single. Use Hal_i2S_Transmit_DMA() to init the stream and use the TxHalfCplt and TxCplt callbacks to call a function that will keep reloading your buffer.. the Circular buffer.
The point of this video was that I couldn't get the DMA to work at all - all it's settings were blank. I traced this to the fact that the code CUBEMX generated was attempting to set the DMA settings before turning on the DMA peripheral clock. Once I'd got the DMA to function I did go over to using a circular buffer as you suggest. Yes, you are correct, I set the jumpers on the DAC board to SFO HIGH, SF1 LOW -LSB justified 16 bits. Can't recall why I went for this over the I2S.
The picoscope is nothing to do with the Nucleo. It is an oscilloscope that connects to a PC via USB and displays on the monitor. They're really good -web site is here www.picotech.com/products/oscilloscope
Well done for finding it. It however seems that CubeMX Ver 5.0.6 generates the code correctly, just like you described your fix at 13min, 56sec into the video. What version of CubeMX did you use?
@@TripplikitElectronicsHi, does it work for version 6.0.1, i am trying to receive and transmit I2S data in half duplex it is not working, but it works fine for full duplex Can you give me some inputs to solve this problem?
They have more issues with forgetting to enable the clock on peripherals. If I generate a stock project for the NUCLEO-H745ZI-Q and tell it to configure all the default peripherals, it won't enable the clock on a number of the GPIO registers, meaning that even the LED's don't work.
CubeMX is nice with all the GUI configuration, but sometimes I think it would be just easier to read the datasheet and set the register values on my own. When there are bugs like yours, it needs probably more time to find out where CubeMX messed it up than setting it all by hand.
When I was doing this kind of thing for a living I always set the register values directly as I didn't trust any HAL type middleware. These days I just want to get on with the project and CubeMX / HAL is an easy way to get up and running quickly. This is the only real bug I've found so far but you're right - it did cost me a considerable amount of time tracking it down. Maybe the next STM32 project I'll do without CubeMX / HAL by way of comparison.
I'm sure it is possible to do echo cancellation. The STM32s are pretty powerful. For audio work I'd go for one of the faster ones - I'm using an STM32F4 which goes up to 180MHz. A built in floating point unit is also very useful.
Hi, does it work for version 6.0.1, i am trying to receive and transmit I2S data in half duplex it is not working, but it works fine for full duplex Can you give me some inputs to solve this problem?
Hi. The problem still seems to be there on Cube MX 6.0.1. The problem was with the DMA not being turned on before it was set up. This just stopped the I2S working all together. Sounds like your problem is something to do with the way you set up the I2S for half duplex. I am only sending data out to my audio interface so it doesn't affect me.
Thanks. In the past I've always been wary of things like the HAL preferring to work by accessing the registers myself. The HAL is just too easy though.