2023-09-26 11:50 AM
Hi there,
Looking into the TRM for the STM32L412xx board, I was wondering if I could use a DMA to copy constant data from the Flash to SRAM. The system architecture block diagram connects the DMAs to Flash through the DCode path:
However, while reading the document it is explicit mentioned this for the DMA bus:
This bus connects the AHB master interface of the DMA to the BusMatrix.The targets of this bus are the SRAM1 and SRAM2, the AHB1 peripherals including the APB1 and APB2 peripherals, the AHB2 peripherals and the external memories through the QUADSPI.
This got me confused. Can someone explain these details? Is it possible or not to read from Flash using the DMAs, and if not, why is the DMA seems to be connected to the embedded Flash through the DCode path?
Solved! Go to Solution.
2023-09-26 12:02 PM - edited 2023-09-26 12:06 PM
Yes, you can use the DMA to transfer from FLASH to SRAM.
2023-09-26 12:02 PM - edited 2023-09-26 12:06 PM
Yes, you can use the DMA to transfer from FLASH to SRAM.
2023-09-26 12:04 PM - edited 2023-09-26 12:23 PM
2023-09-27 02:41 AM
Thanks for the clarification!
2023-11-03 10:31 AM - edited 2023-11-03 10:34 AM
Hi TDK,
I was doing some random experiments and during a series of stress tests I encountered some results that I can't fully understand.
The experimental setup is simple: the CPU is running a sequence of 100 nop instructions while I would enable/disable the number of active DMAs and mix-and-match acceleration options of the Flash controller (instruction cache, data cache, and prefetching). DMAs are configured to be reading data from flash and writing it to the SRAM. When the transfer is over, the DMA's interrupt is triggered, and I reconfigure them all over again and start the transfer again. I use the systick to measure the time taken to execute that 100 nop instructions
When doing that, I achieve some results that I can't explain:
Notably, when only the data cache was enabled, the system's performance improved compared to having only the instruction cache active.
Given these observations, I am curious to understand the underlying reasons for this behavior. So, I'm shooting these questions:
Any technical insights, guidance, or suggestions for further experimentation would be greatly appreciated. Thank you for your time and sorry for the long explanation.