cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with programming STM32 mcu with stm32cubeIDE (failed to erase memory)

Apand.1
Associate II

Hello,

I am using STM32G030F6P6 in one of my projects. I am using STM32 CubeMx as my IDE.

In the datasheet I can see that it has 64KB of flash. However IDE perceives this as 32KB and I can not upload my code. This is what I read from the console. Does anyone know how to fix this issue.

Thanks

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a02624.srec

 File     : ST-LINK_GDB_server_a02624.srec

 Size     : 47.18 KB 

 Address    : 0x08000000 

Erasing memory corresponding to segment 0:

Error: Operation exceeds memory limits.

1 ACCEPTED SOLUTION

Accepted Solutions
RomainR.
ST Employee

Hello @Apand.1 (Community Member)

DS12991 Rev 4 in Table 2. STM32G030x6/x8 family device features and peripheral counts.

STM32G030F6P6 has 32kb of flash memory and 8kb of SRAM.

Your code executable cannot fit in the memory, try to optimize your code and with compiler for size or use 64kb device such STM32G031F8 or 051F8.

Best regards,

Romain,

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

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.

View solution in original post

4 REPLIES 4
RomainR.
ST Employee

Hello @Apand.1 (Community Member)

DS12991 Rev 4 in Table 2. STM32G030x6/x8 family device features and peripheral counts.

STM32G030F6P6 has 32kb of flash memory and 8kb of SRAM.

Your code executable cannot fit in the memory, try to optimize your code and with compiler for size or use 64kb device such STM32G031F8 or 051F8.

Best regards,

Romain,

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

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.

Javier1
Principal

STM32G030F6P6

That 6 means 32K flash memory https://www.digikey.com/en/maker/blogs/2020/understanding-stm32-naming-conventions

If you want your code to fit your flash, the lazy way is to play with the compiler options in CubeIDE, as an example , the "release" build will be smaller in size than the "debug" build

we dont need to firmware by ourselves, lets talk

Tanks for you clarifications.

thank you @Javier Muñoz​