cancel
Showing results for 
Search instead for 
Did you mean: 

Slow performance of custom external flash loader on STM32H735G-DK.

AS1956
Associate II

            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?

1 ACCEPTED SOLUTION

Accepted Solutions
AS1956
Associate II

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.

View solution in original post

17 REPLIES 17
LCE
Principal

Maybe you are using some blocking HAL stuff?

I would grab a scope and compare some signals.

Pavel A.
Evangelist III

STM provided loader takes around 7 sec for the same. 

Does this include erase of 1 MB?

 

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
AS1956
Associate II

AS per MX25LM51245G data sheet programming page is 256 bytes. Are you saying that somehow ST uses 1KB?

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

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

logs included, if you wish to take a look.

Thanks

too fast

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?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..