cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to erase memory on Nucleo-FR446RE

Edzzio
Associate

Hello, 

A small disclaimer before beginning, this is my very first project on STM32, and my experience (currently being a student) with embedded systems as a whole is quite limited, so if I omit any important information, please indicate it for me. 

I'm currently trying to familiarize myself with the Nucleo-FR446RE, building the project seems to go on pretty nicely, but whenever I try to debug the code in order to flash it on the FR446, I get the following error : 

Problem during debugging (1)Problem during debugging (1)

More specifically I get the following error related to the failure to erase the memory :


Debugging error (2)Debugging error (2)

Other, maybe unrelated potential solutions that I've tried would be : 

  • Use STM32CubeProgrammer in order to verify the flash memory protection, I have correctly disabled the protection
  • The ST-LINK firmware is up-to-date (tried downgrading it as well)
  • I have replaced the cable numerous times, and verified the correct placement of jumpers on the board
  • Tried debugging on an entirely new board and on a new, completely unrelated project

What's weird is that whenever I try to flash the .elf file using STM32CubeProgrammer for the first time after connecting the ST-LINK, it works correctly. However, if I attempt to flash it again later, the aforementioned error occurs.

If anyone could provide some pointers on other potential solutions, I would greatly appreciate it.

 

On a sidenote, the debugging settings are as follows : 


Debugging settingsDebugging settings

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

Its seems the write protection is enabled in the option bytes.

This is what I have as configuration:

SofLit_0-1740042541127.png

Unchecked: the sector is write protected.

I'm attaching the option bytes that you can upload to your board in attachment.

You can read this article on how to upload it.

 

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.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

View solution in original post

8 REPLIES 8
mƎALLEm
ST Employee

Hello @Edzzio and welcome to the community,

Did you try to connect and erase the MCU with STM32CubeProgrammer tool? try it and tell us what do you get?

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.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

Hello @mƎALLEm,

Thanks for the quick response !

I did try to erase the entire chip's flash memory, as well as manually erasing individual sectors to find the culprit (if that is of any use), and in both cases I had the same error.

More specifically, here would be the error message : 

Error messageError message

Could it be a hardware issue ? Or maybe I could try the ST-LINK Utility to check on the R-W permissions (although I have read that it wasn't recommended).

Hello,

When you connected with STM32CubeProgrammer, what is the target voltage shown:

SofLit_0-1740038326453.png

What about the availability of these jumpers?

SofLit_1-1740038397109.png

How did you power the board? over STLINK? or VIN pin?

Did you modify options bytes?

Did you modify something on the board?

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.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

@mƎALLEm wrote:

When you connected with STM32CubeProgrammer, what is the target voltage shown :


Target VoltageTarget Voltage

Note : I did the firmware upgrade on multiple occasions, but it never did truly update (despite indicating that the upgrade was successful) : 

Firmware upgradeFirmware upgrade

 


@mƎALLEm wrote:

What about the availability of these jumpers?

The jumpers are correctly used at each target pins (according to the documentation) : 

20250220_094115.jpg

 


@mƎALLEm wrote:

How did you power the board? over STLINK? or VIN pin?

Did you modify options bytes?

Did you modify something on the board?


I powered the board via the ST-LINK, no modifications were done on the board, I did not modify any options bytes only verified them : 

Option bytesOption bytes

 

If this could help you in your analysis, I had the chance to test the debugger on another board, the Nucleo-L432KC, and it did work properly, no errors occurred. 

 

Hello,

Its seems the write protection is enabled in the option bytes.

This is what I have as configuration:

SofLit_0-1740042541127.png

Unchecked: the sector is write protected.

I'm attaching the option bytes that you can upload to your board in attachment.

You can read this article on how to upload it.

 

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.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

Hello, 

My mistake I misread the description, thanks for the indication. I had the chance to modify the option bytes yet again : 
Changed option bytesChanged option bytes

Unfortunately, I still get the same error, for both programming and a full chip erasure : 

Error messageError message

I also tried to import your attached option bytes without any success (imported them correctly, but the error above persists).

mƎALLEm
ST Employee

I had the same message by activating the write protection:

SofLit_0-1740047711960.png

Please ensure you apply the changes you set in the option bytes by clicking "Apply" button. Then you can disconnect and reconnect again and recheck the write protection option bytes.

So, please follow the steps described in the article I shared above o, how to restore the option bytes.

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.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

The change of Option Bytes seemed to have worked on STM32CubeIDE but not on STM32Programmer, as I am now able to debug my project, and the flash memory is correctly erased. 

I thank you for your time, I will mark the Option Bytes change as the main solution.