cancel
Showing results for 
Search instead for 
Did you mean: 

DMA fails with IRAM1/IRAM2 settings

JBond.1
Senior

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:

0693W00000Y8qzDQAR.pngwith 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:

0693W00000Y8qzDQAR.pngwith 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?

5 REPLIES 5
gbm
Lead III
  1. What's the exact type number of your MCU?
  2. You cannot set these arbitrarily, the values must be copied from the memory map in the Reference Manual; only in some MCUs you may play A LITTLE with them (mostly L4, H7 series supporting double mapping of some RAM areas, don't know about other series).
My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

I have corrected it in the question, its "STM32F407VETx".

After generating code with STM32CubeMX v6.6.1 I get these settings:

0693W00000YA00qQAD.pngAfter an update generating code with STM32CubeMX v6.7.0 I get these settings:

0693W00000Y8qzDQAR.png 

With the latest STM32CubeMX v6.7.0 settings SDIO DMA no longer work, I get failures when reading files.

gbm
Lead III

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?).

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

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:

0693W00000YA08BQAT.png

gbm
Lead III

Check the memory usage and stack usage in the tabs of bottom-right pane of the CubeIDE window.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice