2024-03-11 10:15 AM
I made external flash loader for STM32H735G-DK. I’m able to read, write and erase flash. However, programming 1M of flash takes ~ 50 seconds. STM provided loader takes around 7 sec for the same. Octo SPI in both cases, clocks are the same- verified, DTR in both cases- verified. I am testing on the same board, the same STLINK, so hardware is not limiting factor.
Would anyone have an idea what method STM loader uses for such a huge speed improvement?
Solved! Go to Solution.
2024-03-12 11:03 AM
Seems to be working well in the loader context. I can not take credit for this. I did see it in one of the examples from “stm32-external-loader-main”. What surprises me a bit is that constant value used in the Delay does not influence speed of any of the processes (erase, program, verify). I tried few radically different values with no noticeable difference. I guess bulk of the time is used by self-timed operations in the memory.
2024-03-11 10:33 AM
Maybe you are using some blocking HAL stuff?
I would grab a scope and compare some signals.
2024-03-11 10:46 AM
> STM provided loader takes around 7 sec for the same.
Does this include erase of 1 MB?
2024-03-11 11:03 AM
Hard to know..
ST uses 64KB sector erase, and 1 KB pages.
If ST's is smaller in RAM there is more for payload data. Perhaps less initialization / reset, repeatedly?
Some comparative logs at Verbose Level 3 might be informative.
2024-03-11 11:52 AM
AS per MX25LM51245G data sheet programming page is 256 bytes. Are you saying that somehow ST uses 1KB?
2024-03-11 12:00 PM
14:59:38 : Memory Programming ...
14:59:38 : Opening and parsing file: testbinary1M.bin
14:59:38 : File : testbinary1M.bin
14:59:38 : Size : 1.13 MB
14:59:38 : Address : 0x90000000
14:59:38 : Erasing memory corresponding to segment 0:
14:59:38 : Erasing external memory sectors [0 18]
14:59:43 : Download in Progress:
14:59:46 : File download complete
14:59:46 : Time elapsed during download operation: 00:00:07.732
Yes
2024-03-11 12:12 PM
Actually is reports taking multiples of 0x1000 / 4KB (16 x 256) per Write() operation, so there are some operational efficiencies there, it decomposes to 256-byte pages internally.
2024-03-11 12:53 PM
logs included, if you wish to take a look.
Thanks
2024-03-11 12:55 PM
2024-03-11 02:50 PM
Definitely a lot slower. The your loader is 6x larger than ST's
In your own BSP code how fast is a 64KB erase, and how fast is the 1KB (4 page) write taking?