flashing external SPI Flash with STM32CubeProgrammer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-13 1:37 AM
Hi, i have recognize some odd behavior inside the CubeProgrammer external flashing feature.
When flashing files less or equal to 128KB, then it flashes size at boundary of the block size of the Flash device which is 64K. As soon i get bigger than that it no more send data in that boundary but 67072 bytes. Why is that? I had to rewrite my APIs to get that working properly. I mean it is working now but sounds strange too me.
Thanks
- Labels:
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-13 7:31 AM
Hello @MOtto.1 ,
Could you please provide any logs and error details related to the flashing process?
Thank you,
Maryem.
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-27 6:30 AM
Hello @MOtto.1 ,
I was wondering if you have any updates or feedback regarding the flashing issue?
Maryem.
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-27 7:51 AM
Well, usually i would expect that flash sizes are on some even boundaries like "0xffff". But those downloads sizes are a little bit odd. Size is 0x10700 but also changeing.
Printf from my code.
Here the write address and amount of bytes.
Write addr=0x00000000 size=67328
Write addr=0x00010700 size=67328
Write addr=0x00020e00 size=67328
Write addr=0x00031500 size=67328
Write addr=0x00041c00 size=67328
Write addr=0x00052300 size=67328
Write addr=0x00062a00 size=67328
Write addr=0x00073100 size=67328
Write addr=0x00083800 size=67328
Write addr=0x00093f00 size=67328
Write addr=0x000a4600 size=67328
Write addr=0x000b4d00 size=67328
Write addr=0x000c5400 size=67328
Write addr=0x000d5b00 size=67328
Write addr=0x000e6200 size=52992
Write addr=0x000f3100 size=52992
But not a big deal for me you can mark it as resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-27 9:36 AM
> at boundary of the block size of the Flash device which is 64K
STM32F4 has flash blocks of several sizes: from 16K to 128K. Please see the RM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-27 9:51 AM
Not sure, but generally it depends on the available RAM, the loader consumes a portion of it, perhaps 512 bytes for a stack, and it then splits the remaining into Ping-Pong buffers the SWD/JTAG can fill whilst you're Write()'ing to the external FLASH.
The QSPI NOR typically have 256-byte page buffers, and you can't write directly across page boundaries, the code in the loader needs to manage/handle the spanning. The ERASE sizes can be 4KB, 32KB and 64KB in most cases, and their are outliers which are non-uniform in size, and perhaps larger.
Up vote any posts that you find helpful, it shows what's working..
