Тёмный

Fixing The STM32 CubeMX Bug When Using The I2S With The DMA 

Tripplikit Electronics
Подписаться 1,5 тыс.
Просмотров 6 тыс.
50% 1

Опубликовано:

 

28 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 30   
@samitabbakh8409
@samitabbakh8409 2 года назад
Thank you very much!! Spent 2 days without any progress, until I watched your video. You are awesome for sharing this :)
@TripplikitElectronics
@TripplikitElectronics 2 года назад
I spent two days too finding this problem - nice to be able to pass the solution on.
@alexbarrett6656
@alexbarrett6656 3 года назад
Great video, probably saved me a lot of pain. I like your approach. Very many thanks for taking the time & effort to share your experiences.
@TripplikitElectronics
@TripplikitElectronics 3 года назад
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.
@alexbarrett6656
@alexbarrett6656 3 года назад
@@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.
@HaddockHants
@HaddockHants Год назад
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.
@TripplikitElectronics
@TripplikitElectronics Год назад
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.
@Synthetech
@Synthetech 3 года назад
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.
@TripplikitElectronics
@TripplikitElectronics 3 года назад
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.
@johnsaeid95
@johnsaeid95 4 года назад
great video. Is the PicoScope is a software interfaced with USB of Nucleo or it is an actual Oscilloscope ?
@TripplikitElectronics
@TripplikitElectronics 4 года назад
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
@wingunder
@wingunder 4 года назад
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?
@TripplikitElectronics
@TripplikitElectronics 4 года назад
Just installed 6.0.1 and I still have the problem. I'm curious to know what you're doing different to me.
@arm7292
@arm7292 3 года назад
​@@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?
@MrCkkwok456
@MrCkkwok456 2 года назад
Thank You Very Much..... You solved my problem.
@TripplikitElectronics
@TripplikitElectronics 2 года назад
I'm glad that someone else has benefited from the considerable time I put in to solving this obscure bug.
@BareMetalProgramming
@BareMetalProgramming 4 года назад
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.
@frankbuss
@frankbuss Год назад
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.
@TripplikitElectronics
@TripplikitElectronics Год назад
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.
@haythemjelassi4766
@haythemjelassi4766 3 года назад
Is't possible to make Echo cancelation with STM32 when the microphone and speaker work in the same time ? (like application of intercom)
@TripplikitElectronics
@TripplikitElectronics 3 года назад
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.
@arm7292
@arm7292 3 года назад
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?
@TripplikitElectronics
@TripplikitElectronics 3 года назад
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.
@s_i_m_o_n_e_n_g_e_l
@s_i_m_o_n_e_n_g_e_l 2 года назад
Bug fix ist at 14:17 if you want to see if you have the same problem. Awesome video though! I feel like I relie on the hal way to much.
@TripplikitElectronics
@TripplikitElectronics 2 года назад
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.
@johnsaeid95
@johnsaeid95 4 года назад
another weird thing is that I was using I2S with STM32F413 and it worked perfectly with no problems !
@TripplikitElectronics
@TripplikitElectronics 4 года назад
Strange why it gave a problem with my Nucleo and not yours. Still possible I've done something wrong setting it up but I don't think so.
@johnsaeid95
@johnsaeid95 4 года назад
@@TripplikitElectronics may be MCU is different from dev boards in APIs ?
Далее
DMA on STM32 HAL with 2 example projects | VIDEO 36
1:03:17
Voy shetga man aralashay | Million jamoasi
00:56
Просмотров 161 тыс.
Using I2C for any device on STM32 with HAL | VIDEO 26
37:51
What in the world is I2S?
7:11
Просмотров 37 тыс.
HAL #13: ADC with DMA
10:15
Просмотров 41 тыс.
I Made A Rotary Vane Engine Prototype
31:27
Просмотров 205 тыс.
ESP32 Sound - Working with I2S
46:04
Просмотров 342 тыс.
When you Accidentally Compromise every CPU on Earth
15:59