cancel
Showing results for 
Search instead for 
Did you mean: 

STM32IDE's flash upload is limited to 128kb.

gg_silver96
Visitor

Hello,

I am experiencing a flash upload issue with STM32CubeIDE(v1.19.0).

The MCU I am using is STM32C091GCU6 with 256 KB of internal Flash.
I am currently developing code to display image (IMG) data on an LCD.

The image data is stored in Flash, copied to SRAM using memcpy(), and then transmitted to the LCD via SPI DMA.
From the MAP file, I can confirm both the Flash addresses of the image data and the SRAM copy destination.

The relevant MAP file entries are shown below:

 

.rodata.IMG_HORIZONTAL
0x08004840 0xfd20 ./Core/Src/font.o
0x08004840 IMG_HORIZONTAL

.rodata.IMG_VERTICAL
0x08014560 0xfd20 ./Core/Src/font.o
0x08014560 IMG_VERTICAL


After this configuration, when I build and debug using STM32CubeIDE, the reported uploaded memory size is only 128 KB.

Because my code accesses image data located above the 128 KB Flash boundary, a HardFault occurs when running under CubeIDE debug.

However, when I take the same build output file and program it using STM32CubeProgrammer(v2.19.0), the firmware is correctly written beyond 128 KB, up to the proper Flash size, and the code runs without any issues.

Summary

When building and debugging in STM32CubeIDE, only 128 KB of Flash is programmed

The same build output, when flashed using STM32CubeProgrammer, works correctly

When connecting the board in STM32CubeProgrammer, the detected Flash size is correctly shown as 256 KB

The FLASH.ld file in STM32CubeIDE is correctly configured for 256 KB Flash

Has anyone experienced a similar issue?
I would appreciate any guidance or suggestions on how to resolve this problem.

Thank you.

3 REPLIES 3
Ghofrane GSOURI
ST Employee

Hello @gg_silver96 

Yes, I confirm that this issue exists in STM32CubeIDE 1.19.0 and has been escalated to the development team under internal ticket 213275. It has been fixed in the latest release, STM32CubeIDE 2.0.0.

Link to download  STM32CubeIDE 2.0.0 in case of need :STM32CubeIDE | Software - STMicroelectronics

THX

Ghofrane

 

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.

Ozone
Principal III

> When building and debugging in STM32CubeIDE, only 128 KB of Flash is programmed

> The same build output, when flashed using STM32CubeProgrammer, works correctly

This sounds like CubeIDE has a wrong memory definition file for your MCU variant.

I had something similiar with a C031 a while ago, in the SeggerES toolchain.
However, this toolchain has the memory definitions created from ST's SVD files AFAIK.

And the CubeProgrammer comes with it's own set of SVD files.

Ozone
Principal III

In my case, the respective file was copied into the project and thus became part of it.
And for the RAM size was incorrect, thus the stack included non-existing RAM, and the application failed at startup.

Ozone_0-1768381778742.png

Not sure how it is handled within Cube IDE.
You can at least check and probably edit the respective in the CubeIDE context.