cancel
Showing results for 
Search instead for 
Did you mean: 

cubeprogrammer can not find masserase function

keanlee0721
Associate II

I created an external flash STLDR file for my board, with STM32H750VB chip and W25Q64 QSPI FLASH. After copying the STLDR file to the cubeprographer directory, it can perform normal external flash read/write and sector erase functions. However, when selecting full chip erase, the cubeprographer prompts me "please select external loader before performing external full chip erase". But I am sure that my code contains the correct int MassErase (void) function, and I used the readelf command in Ubuntu environment to read the STLDR file I created, which also includes the MassErase function. But it seems that this function cannot be correctly detected by the cubeprographer. How can I locate the cause and solve this problem?
Wishing you peace

14 REPLIES 14
BMB
Associate II

Upgraded to STM32CubeProgrammer v2.19.0. Same behavior.

Need to work on the Linker Script so isr_vector gets placed on 0x200 aligned boundary (notionally 0x20000200)

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

Not sure what the ISR vector table gets to do with all that. I had problems with interrupts (messing up already difficult debug) so I disabled and adjusted the code that it works completely without them. I am not exactly sure though at which moment of the story I did that. Let me see if that makes a diff (I doubt it :) ).

Put back the ISR table there ... and ... 

BMB_0-1751305237309.png

:)

My bet is that since MassErase is described as "optional" in the template .. it was not tested at some point of STM32CubeProgrammer, at least not with stld files made by STM32CubeIDE (I noticed most of them look like made with IAR ...

nonoriri
Associate III

STM32CubeProgrammer GUI External Loader Full Chip Erase Failure Issue

I'm experiencing an issue with External Loaders created using CubeIDE when using STM32CubeProgrammer GUI:

Problem Description:

  • STM32CubeProgrammer GUI fails to execute "Full chip erase" with custom External Loader
  • Error message: "Please select external loader before performing external full chip erase"
  • Issue occurs on both STM32CubeProgrammer v2.19.0 and v2.20.0

However, CLI works perfectly:

STM32_Programmer_CLI.exe -c port=SWD freq=4000 -el .\MyExternalLoader.stldr -e all
-------------------------------------------------------------------
                   STM32CubeProgrammer v2.19.0                    
-------------------------------------------------------------------
ST-LINK SN  : xxx
ST-LINK FW  : V3J15M7B5S1
Board       : STLINK-V3SET
Voltage     : 3.26V
SWD freq    : 3300 KHz
Connect mode: Normal
Reset mode  : Software reset
Device ID   : 0x450
Revision ID : Rev V
Device name : STM32H7xx
Flash size  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M7
BL Version  : 0x91
Mass erase ...
Mass erase successfully achieved
  • CLI executes mass erase successfully
  • Flash memory is properly erased to 0xFF (verified)

My Analysis: I suspect this might be a compatibility issue between STM32CubeProgrammer GUI and External Loaders built with CubeIDE (GCC toolchain). Official ST External Loaders appear to be built with IAR Embedded Workbench for ARM (EWARM), which may create binaries with different structures that the GUI specifically expects.

Could this be a bug where STM32CubeProgrammer GUI only recognizes MassErase functionality in EWARM-built binaries?

What are your thoughts on this issue?