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

4 REPLIES 4

>>How can I locate the cause and solve this problem?

Hard to know with the detail presented, you look to be looking in the right places.

Perhaps attach the .ELF / .STLDR, or a structure dump via OBJDUMP, OBJCOPY, or whatever.

Perhaps the address or attributes of the function? The case?

Perhaps compare the structure of how your's dumps vis-a-v all the other examples in the ExternalLoader subdirectory.

Screen shots of error, showing loader that's loaded, the Log at Verbosity Level 3..

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

thank you for your replay!

this is my Screen shots and error message

keanlee0721_0-1740839208415.png

This stldr file can help me perform external flash read, write, and fast erase functions, but full chip erase cannot be used.

I saved the output of objdump and readelf commands in CMDobjdump.txt and CMDreadlef.txt files. It can be found that the masserase function exists in both files. However, when executing external full chip erase, the error shown in the figure above is always prompted. I put part of these two files here for easy display, as well as my cubeide project. By the way, the cubeide I use is the Linux version, and the development environment is ubuntu22.04.5LTS.
This problem has bothered me for a week
Thank you again for your reply

keanlee0721_1-1740840189367.png

keanlee0721_2-1740840215903.png

 this is source code screen shots

keanlee0721_3-1740840351250.png

about of the cubeprogrammer

keanlee0721_4-1740840853885.png

about of the cubeide

keanlee0721_5-1740840920803.png

keanlee0721_6-1740841405832.png

 

 

I'll take a look. Make sure the most current version of your loader is in the STM32 Cube Programmer External Loader directory

This is the one I built as a constrast

https://github.com/cturvey/stm32extldr/blob/main/h7_w25q64/CLIVEONE-W25Q64_STM32H7XX-PB2-PB6-PD11-PD12-PE2-PD13.stldr

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

I have used the stldr file you provided, It can perform left and right external flash operations normally in ubuntu environment without any errors, and I sent an email to ask if I could donate to get the source code, remember?^_^
Last night, I used the stldr file I made to do some other tests and found some new problems. The same stldr file can be used in cubeprogrammer under windows environment, all functions are normal, but in ubuntu, cubeprogrammer only reports an error for full external flash erase. However, in ubuntu command line, using the command "STM32_Programmer_CLI -c port=SWD freq=4000 -el /home/user/keanlee/stm32/hope/hope_h750_w25q64jv_stldr/hope_h750_w25q64jv_stldr/Debug/hope_h750_w25q64jv_stldr.stldr -e all", the mass erase function can be executed normally to complete the full chip erase. I don't know why this happens. I hope to get some supplements and solutions in this regard. Thank you again for your reply, which is very important to me.

In the Ubuntu CubeIDE environment, I set up the CubeIDE project as follows:

keanlee0721_0-1740918818329.pngkeanlee0721_1-1740918833751.pngkeanlee0721_2-1740918848559.png

keanlee0721_3-1740918997411.png

Is it possible that these settings may cause errors?