2023-02-04 07:01 AM
Hi, I am trying to use SDIO with DMA and TIM1 PWM with DMA on STM32F407VETx.
After generating code with STM32CubeMX v6.6.1 I get these settings:
with these settings SDIO with DMA works, but TIM1 PWM with DMA fails.
After an update generating code with STM32CubeMX v6.7.0 I get these settings:
with these settings TIM1 PWM with DMA starts working, but SDIO with DMA fstarts failing.
How do I make both DMA work? What IRAM1/IRAM2 do I need to set?
2023-02-04 07:20 AM
2023-02-04 07:29 AM
I have corrected it in the question, its "STM32F407VETx".
After generating code with STM32CubeMX v6.6.1 I get these settings:
After an update generating code with STM32CubeMX v6.7.0 I get these settings:
With the latest STM32CubeMX v6.7.0 settings SDIO DMA no longer work, I get failures when reading files.
2023-02-04 09:18 AM
The setting with base address of 0x10000000 is incorrect.The one with 128 KiB at 0x20000000 is usually more convenient that the one splitting the RAM into 112 + 16 KiB; both these are correct. I don't think your problem is related to the RAM address setting.
Check the Figure 1. in Reference Manual - look at DMA module connections. Maybe you are trying to transfer data to/from a peripheral to which a given DMA module has no connection. If this is the case, while debugging you will see DMA transfer error flag set in DMA status register. If you need more help, describe which DMA module is used and what are the source and destination locations (memory/peripheral - which one?).
2023-02-04 10:24 AM
But why does SDIO DMA work then old version RAM settings are set? And the other way around TIM1 PWM DMA work when new RAM settings are set?
I think the issue must be with RAM. Maybe when new settings reduce IRAM1 from 0x20000 to 0x1C000 SDIO DMA has not enough RAM? How could I debug that?
My DMA settings in STM32CubeMX:
2023-02-04 12:21 PM
Check the memory usage and stack usage in the tabs of bottom-right pane of the CubeIDE window.