cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX can't recognize the flash size correctly and the debugger won't start

高健一.1
Associate

[ The text uses a translation tool. ]

Flash size is the default and no more programs can be loaded.

environment

Windows10 + STM32CubeMX + ST-Link2

************** Console log

     -------------------------------------------------------------------

                      STM32CubeProgrammer v2.4.0                 

     -------------------------------------------------------------------

ST-LINK SN : 53FF6D064882505226101587

ST-LINK FW : V2J36S7

Voltage    : 3.23V

SWD freq   : 4000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID  : 0x436

Device name : STM32L15xxD/STM32L162xD

Flash size : 128 KBytes (default)

Device type : MCU

Device CPU : Cortex-M3

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a20796.srec

 File         : ST-LINK_GDB_server_a20796.srec

 Size         : 137888 Bytes

 Address      : 0x08010000

Erasing memory corresponding to segment 0:

Error: Operation exceeds memory limits

Error: failed to erase memory

Encountered Error when opening C:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.3.0.202002181050\tools\bin\STM32_Programmer_CLI.exe

Error in STM32CubeProgrammer

Debugger connection lost.

Shutting down...

*************

I'm using an STM2L151DTx, so there's plenty of flush

Why is it [Flash size: 128 KBytes (default)]?

The STM32 ST-LINK Utility can be recognized and written normally.

Am I doing something wrong?

21 REPLIES 21

Hello @FARSL.1​ ,

First of all Welcome to ST Community!

In order to ensure a follow-up of your request, could you please submit it in a new thread?

You can provide link to current question if you think that both cases are similar.

Thanks for your understanding!

-Amel

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.

Thanks for your answer @Amel NASRI​ .

I did not want to open another thread. Because I get same problem with @高橋 �?�一​ . This problem still going on. I could not find any solutions about wrong flash size detect.

The same tool, the same MCU and the same bug - incorrect flash size. It does not need a new thread, because at least from a user's perspective it is exactly the same issue, which is still not fixed or has been broken again.

OK then let us keep it here 🙂 and ping our STM32CubeProgrammer Expert (@Houda GHABRI​ ) in order to provide a status for this issue.

-Amel

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.

Houda GHABRI
ST Employee

Hi @FARSL.1​ ,

I confirm for STM32L151RD (Device ID 0x436 ) there is an issue of Flash size :128KB displayed in STM32CubePRogrammer instead of 384KB.

This issue is already under debugging by CubePRogrammer development team and will be fixed soon.

I will come back with the latest updates.

Hope this helps you.

Houda

herca.1
Associate II

Hello I have the same problem.

I contacted you about this maybe 6-7 months ago. Can you even imagine all the trouble i had to deal with? I couldnt debug my software fully. I had to comment out some parts in order to use debugger with STM32 cubeMX ide.

Check out my post

https://community.st.com/s/question/0D53W00000Laws9SAB/stm32l15xxdstm32l162xd-error-operation-exceeds-memory-limits

How can you be so neglecting I jsut dont get it.

Please find a solution to this issue. When will you do this?

Thanks

DThom.3
Associate II

Workaround: use ST-LINK_CLI.exe or the gdb debugger built into the IDE rather than STM32CubeProgrammer.

herca.1
Associate II

Hello ST Team,

Any fixes on this issue?

Thank you.

Houda GHABRI
ST Employee

Hi @herca.1​ ,

Did you try with the last CubeProgrammer version 2.8.0 ?

Issue should be fixed in this release.

Houda

herca.1
Associate II

Hello,

Using 2.8.0 and using STM32L15xx microcontroller

This is the output of Cube Programmer. Verbosity level 3. Is this also fixed for CubeMX IDE, I want to be able to debug my software.

 14:40:51:303 :  Size     : 263956 Bytes

 14:40:51:303 :  Address    : 0x08000000 

 14:40:51:303 : Erasing Segment <0> Address <0x08000000> Size <263956>Bytes

 14:40:51:303 : Erasing memory corresponding to segment 0:

 14:40:51:303 : Memory erase...

 14:40:51:322 : halt ap 0 

 14:40:51:322 : w ap 0 reg 15 PC  (0x20000000)  

 14:40:51:331 : w ap 0 reg 17 MSP (0x20000500)  

 14:40:51:331 : w ap 0 reg 16 xPSR (0x01000000)  

 14:40:51:336 : w ap 0 @0x20000E20 0x00000200 bytes Data 0x00000000

 14:40:51:336 : w ap 0 @0x20000000 0x00000004 bytes Data 0x0000BE00

 14:40:51:362 : w ap 0 @0x20000004 0x000009EC bytes Data 0xF8DFB580

 14:40:51:363 : Error: Operation exceeds memory limits

 14:40:51:381 : Error: failed to erase memory