2025-02-19 08:51 AM - last edited on 2025-02-20 02:40 AM by mƎALLEm
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)
More specifically I get the following error related to the failure to erase the memory :
Debugging error (2)
Other, maybe unrelated potential solutions that I've tried would be :
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 settings
Solved! Go to Solution.
2025-02-20 01:11 AM
Hello,
Its seems the write protection is enabled in the option bytes.
This is what I have as configuration:
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.
2025-02-19 08:54 AM - edited 2025-02-19 08:55 AM
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?
2025-02-19 12:45 PM
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 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).
2025-02-20 12:02 AM
Hello,
When you connected with STM32CubeProgrammer, what is the target voltage shown:
What about the availability of these jumpers?
How did you power the board? over STLINK? or VIN pin?
Did you modify options bytes?
Did you modify something on the board?
2025-02-20 12:52 AM - edited 2025-02-20 12:56 AM
@mƎALLEm wrote:When you connected with STM32CubeProgrammer, what is the target voltage shown :
Target Voltage
Note : I did the firmware upgrade on multiple occasions, but it never did truly update (despite indicating that the upgrade was successful) :
Firmware upgrade
@mƎALLEm wrote:What about the availability of these jumpers?
The jumpers are correctly used at each target pins (according to the documentation) :
@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 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.
2025-02-20 01:11 AM
Hello,
Its seems the write protection is enabled in the option bytes.
This is what I have as configuration:
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.
2025-02-20 01:47 AM
Hello,
My mistake I misread the description, thanks for the indication. I had the chance to modify the option bytes yet again : Changed option bytes
Unfortunately, I still get the same error, for both programming and a full chip erasure :
Error message
I also tried to import your attached option bytes without any success (imported them correctly, but the error above persists).
2025-02-20 02:35 AM - edited 2025-02-20 02:41 AM
I had the same message by activating the write protection:
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.
2025-02-20 02:45 AM
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.