STM32 I2S ADC DMA & Double Buffering - Digital Audio Processing with STM32 #4 - Phil's Lab #55

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 75

  • @PhilsLab
    @PhilsLab  2 года назад +15

    I'm looking for some suggestions for upcoming videos! I currently have planned: final EKF sensor fusion part, PCB tips for EMC/SI, DDR layout and routing (Zynq), PCB build-up and stack-up, and a few other ideas. I'd love to do a design review or two as well but open to your suggestions. Thanks for watching! :)

    • @guruG509
      @guruG509 2 года назад +6

      Maybe do a video on Camera interfacing with stm 32 for live drone feed, using MIPI protocol

    • @biswajit681
      @biswajit681 2 года назад +1

      Please include Thermal management and simulation

    • @mucahityldrm5420
      @mucahityldrm5420 2 года назад +1

      im waiting for a long time ekf video. maybe TCP/ip stack can become good video series

    • @isaacclark9825
      @isaacclark9825 2 года назад

      I am looking forward to the EKF video. I'll enjoy any DSP videos you get around to doing. How about reverb or some kind of echo effect?

    • @marcorademan8433
      @marcorademan8433 2 года назад +2

      Hi Phil, I'm doing your course on Fedeval and I'm enjoying it so far! I'm using an STM32F7 for my project, and it turns out that I2S does not have full duplex available for the F7 series. To mimic full duplex, one can synchronise 2 SAI blocks with the I2S protocol. There's barely any example code on the internet for this, and ST has side-stepped this lack of functionality and only provides vague powerpoint presentations. I think SAI for the F7 series could be a much needed topic for some clarity on the internet!
      Thanks for your great tutorials!

  • @paulinmt2185
    @paulinmt2185 2 года назад +16

    As a consulting Engineer, I've been really impressed with the STM32CubeIDE. It makes my life much simpler since I cannot dedicate all my brain cells to learn just one processor family. Phil's done a great job illustrating all the pieces that make up a basic signal processing system. Very clear and concise explanations. A pleasure to watch. Bravo Phil!

    • @PhilsLab
      @PhilsLab  2 года назад

      Thank you very much, Paul! Completely agree that STM32CubeIDE makes life a lot easier as a consultant and when designing hardware.

    • @i2c_jason
      @i2c_jason 2 года назад

      Agreed... but I happen to be using MPLABX IDE with MCC... it has a similar configuration. I've gone back and forth with one of my software consultants who prefers to just use an ESP with C libraries (so no UI with check boxes, ets). My position lately has been that it's best to leverage the IDE / UI / auto-generate workflow and let it generate the configuration code and library code rather than try to do all of this manually from the datasheets (as I used to do 15 years ago). So I'm interested in revisiting ST Micro too, since I gave up on ST at one point years ago when I didn't value the IDE and congiuration UI / auto generate workflow. So, this brings a question for a fellow consultant... Do you have any thoughts on the ESP products? They claim something like 600 DMIPS over the 200 or so that Microchip and ST seem to top out at. But I trust Microchip and ST more, for some reason. Thoughts from your perspective? - Jason

  • @digitalghosts4599
    @digitalghosts4599 4 месяца назад +2

    This tutorial is a true golden nugget! There's just one remaining thing I wondered about while watching it - why do you keep checking the flag in the while loop and enter the audio processing code rather than running the audio processing code in the callback that sets up the flag directly? Wouldn't that waste less cycles and be faster and more efficient?

  • @KSITREVS
    @KSITREVS 2 года назад +6

    Phil, thank you for demonstrating the low level implementation, it wasn’t as hard as I first thought. Another great video, look forward to more if any in the series :)

    • @PhilsLab
      @PhilsLab  2 года назад

      Thank you very much, Trevor!

  • @Mr.Leeroy
    @Mr.Leeroy 2 года назад +8

    Would you maybe consider making a STM32 based USB-I2S transport video? It would definitely make for a unique content.
    It should not require OS drivers these days (for both linux, mac and windows), only hardware and MCU firmware design.

  • @thanosprionas6919
    @thanosprionas6919 5 месяцев назад

    No words about your explanation on these peripherals! Keep up the good work Phil!

    • @PhilsLab
      @PhilsLab  5 месяцев назад

      Many thanks!

    • @ESEben10
      @ESEben10 4 месяца назад

      indeed very straightforward

  • @BM-jy6cb
    @BM-jy6cb 2 года назад

    Fantastic video - thanks Phil, but PHEW! you don't half rattle through at a rate of knots. I've already done this, but it was still a challenge keeping up! Nice to have confirmation that I got it about right though - the amount of info one has to comprehend with these modern devices can be quite intimidating, but you always manage to explain it in a way that gets me past the "where do I start" stage.

  • @1over137
    @1over137 Год назад

    The other suggestion from practical play with this STM setup is... cast up in bit width to do your calculations then detect peaks and overflows in the signal and correct them before casting back down. Over flows result in a sample flipping polarity and cause horrible pops, cracks and 'fart' noises. Even the input ADC I have has no limiter on it's analouge input, so if you go past about 60% line volume it pops and farts. That will need addressed in the input stage for that ADC is I recreate the circuit or just borrow the module. An analogue hard limiter. Probably an audio front end IC design specifically for protecting ADC inputs.

  • @yaghiyahbrenner8902
    @yaghiyahbrenner8902 2 года назад +1

    I would recommend you look at using a JLink + System Viewer and do a video on profiling execution of code.

  • @dieSpinnt
    @dieSpinnt 2 года назад

    Thanks for the understandable explanation with depth of this very interesting topic, so your whole DAP series of great videos, Phil!:)
    But I'm also here as an addict. To at least see the chips in motion ... as a picture **tears** , which you either don't get at the moment or have to sell a kidney for them. Of course that was a joke.
    Dankscheeee und weiter so:)
    (For the following generations and Aliens: There was a pandemic and a chip shortage. Example: A Waveshare STM32H743 development board in February 2021: 67,99€, In April 2022: 339,99€ **blush** )

  • @L2.Lagrange
    @L2.Lagrange 5 месяцев назад

    As it turns out, not all chips seem to support DMA. I am messing around with the NUCLE-F446RE board at the moment, and the chip on this board does not support DMA. I tried with some other chips in the IDE and managed to easily get those settings working. My plan is to use FreeRTOS to somewhat mimic DMA for similar applications on this board. In the future I will get my hands on some devboard with multicore STM32 chips and DMA capabilities. Once I'm satisfied with my learning progress I will start mapping STM32 circuits to PCBs.

  • @billajwu4467
    @billajwu4467 2 года назад

    Very thank you for your video!

    • @PhilsLab
      @PhilsLab  2 года назад

      Thank you for watching!

  • @fano72
    @fano72 Месяц назад

    I wonder that you made a while loop where you check the buffer ready variable. Wouldn't it be smoother to do processing in the interrupt handler like DMA1_Stream4_IRQHandler, so the CPU is not so busy all the time? I know, the irq handler should not be to expensive to get a overload, but it would work, wouldn't it?

  •  2 года назад +1

    Can u make tutorial how to decode mp3 format on stm32. Thanks

  • @Sx107music
    @Sx107music 7 месяцев назад

    Thanks for tye video! Why process in the while loop, when you can just call the process data() function inside the interrupt? Most open-source projects do it that way, while an update function with potentially heavier in instructions things (like updating filter parameters) are in the whole loop.

  • @Kronkulus9282
    @Kronkulus9282 Год назад +2

    Hey Phil! If you see this, I was wondering if you could point me in the right direction for setting up the DMA and buffering/processing chain for the situation where its two different I2S busses. I have a situation where I have a separate external DAC and ADC, and the STM32 MCU only has half-duplex I2S capability, but two half-duplex peripherals. I am using one I2S to receive from the ADC and one I2S to transmit to the DAC. How would this setup look for this case?

    • @Seventhsu
      @Seventhsu Год назад

      Did you get this figured out? I'm also doing the same thing you are

  • @TheGsxr100045
    @TheGsxr100045 8 месяцев назад

    Hello, thank you for this very interesting sharing. Where can we find the code of this example ? I don't see in your video the use of the prototype 'void processData'. Thank you for your answer.

  • @abdulrahmankhazma6104
    @abdulrahmankhazma6104 2 года назад

    Awesome as expected. As STM32CubeIDE supports C++ could you make a guide video for implementing c++ driver with STM32CubeIDE?

  • @NeonFXFusion
    @NeonFXFusion 5 месяцев назад +1

    It is possible to change the master clock of I2S while its running to get a sort of bit-crunch effect. I know reducing the sample size can be done but I'm interested if it is also possible to change the bitrate and have it controlled via a potentiometer. Thank you.

    • @NeonFXFusion
      @NeonFXFusion 5 месяцев назад +1

      For anyone wondering the same, the approach I have in mind is just average every x ammount of samples derived from a value of the input freqency (96kHz) divided by the target frequency. To get which values to skip you have a counter and using a modulo of the previously calculated division compare them to 0. This is just in theory and I havent tested it out yet.

  • @shashi_logic
    @shashi_logic 6 месяцев назад

    hello phil, these videos are amazing but can you please make this video with SAI interface

    • @PhilsLab
      @PhilsLab  6 месяцев назад

      Thanks! SAI interface will be covered at some point in the future, yes.

  • @mihapeterle204
    @mihapeterle204 5 месяцев назад

    Wait a minute, but why do you write dacData to adcData? Dont you read adcData and process it and then write it to dacData useing pointers. Why then useing DMA you are sending it back?

  • @dnkreative
    @dnkreative Год назад

    Thank you! You're doing great explanations. I have couple questions regarding this video:
    Is there any way to use something like x86 HLT instruction in a main while loop till the interrupts from DMA wake a CPU so processing starts only when ready flag is already set within interrupt handler, so while DMA works CPU cycles won't be burned?
    I scratched some surface about STM chips and looks like they have MCUs with DRAM support and saw you have video briefly showing some device with dedicated RAM, but it lacks some detail and it's not really clear about how much memory it could handle (it would be nice to have 1 - 2 gigs or at least enough megabytes to keep 10 - 20 minutes of PCM audio data). Do you plan to release more videos about building devices with dedicated memory chips?
    Recently I'm obsessed with building some sort of dedicated hardware audio processing thing (something like synth or drum machine/sampler) and this info helps a lot, since I'm not really into hardware. I definitely can do high level software part (DSP, control, etc.) but I'm struggling with hardware. Existing boards are too weak (like these STM or arduino chips) or too complex to work with without OS (like raspberry pi and more powerful mini PCs), but they become weak on RAM when setting with the OS like linux which almost takes all of their RAM and building custom linux for this looks like more complicated stuff (and less fun) than building custom hardware.

  • @ltlt6117
    @ltlt6117 Месяц назад

    Hi how I can move or copy data from a 16bit buffer to an 8 bit buffer?

  • @user-yl6fh2xo7r
    @user-yl6fh2xo7r Год назад

    Hey Phil. Any chance you provide 1 to 1 lessons ?

  • @mursalaboobacker3593
    @mursalaboobacker3593 Год назад

    i have done adc dma timer in the same way you have done in this video
    I am using stm32h743 nucleo one but doesn't happen timer not trigerred

  • @MikeHudsontek
    @MikeHudsontek 2 года назад

    Hey Phil, have you ever played with Max and ~gen? I'd love to see a video that goes from Max patch to STM32 implementation as stand alone hardware

  • @obregr
    @obregr 2 года назад +1

    ny er somw aimplw fi stm32 for totoal beginner

  • @theonlyari
    @theonlyari 2 года назад

    Can you explain the reason for using static volatile variables?

  • @karama5478
    @karama5478 2 года назад

    Hi, how about flight controller pcb, hardware and firmware tutorial?

  • @jose6417
    @jose6417 2 года назад

    Hey Phil! What are the odds you could make PICx versions of your STM32 tutorials at some point? Think It'd be cool to use a small PIC12 as a bypass controller for guitar pedals that don't have a MCU already in them (an analog overdrive, for example).

    • @PhilsLab
      @PhilsLab  2 года назад +1

      Hey Jose, I'm afraid I don't really use PIC microcontrollers. Was looking at making some tutorials for ESP32s though.

  • @all.n.1
    @all.n.1 9 месяцев назад

    I can not find this firmware on your git repo.

  • @exprymer
    @exprymer 2 года назад

    What is the order of magnitude of the latency?

  • @rachelchow4512
    @rachelchow4512 2 года назад

    I would like to know the business cooperation conditions in your channel.

  • @cryzz0n
    @cryzz0n 2 года назад

    Can u make tutorial how to decode mp3 format on stm32. Thanks