cancel
Showing results for 
Search instead for 
Did you mean: 

Issue to Write/Erase the External Memory using STM32CubeProgrammer

IBR
Associate

I work on a custom board based on stm32f446x MCU. I'm having trouble when writing to external flash using STM32CubeProgrammer. After powering on the board, I can connect and read the external memory correctly. However, when I try to write, the operation fails, and all memory values change to 0x555555. Deconnect/Reconnect from StProgrammer doesn't fix it, but after a power cycle, the correct data is readable again until I attempt another write.

Below the output of the command:
STM32_Programmer_CLI.exe -c port=swd -ob displ

-------------------------------------------------------------------
STM32CubeProgrammer v2.13.0
-------------------------------------------------------------------

ST-LINK SN : 005300303137510A39383538
ST-LINK FW : V3J9M3B5S1
Board : STLINK-V3SET
Voltage : 1.76V
SWD freq : 8000 KHz
Connect mode: Normal
Reset mode : Software reset
Device ID : 0x421
Revision ID : Rev A
Device name : STM32F446xx
Flash size : 256 KBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : 0x90


UPLOADING OPTION BYTES DATA ...

Bank : 0x00
Address : 0x40023c14
Size : 4 Bytes

██████████████████████████████████████████████████ 100%


OPTION BYTES BANK: 0

Read Out Protection:

RDP : 0xAA (Level 0, no protection)

PCROP Protection:

SPRMOD : 0x0 (PCROP disabled. nWPRi bits used for Write protection on sector i)

BOR Level:

BOR_LEV : 0x3 (BOR OFF reset threshold level from 1.80 to 2.10 V)

User Configuration:

WDG_SW : 0x1 (Software watchdog)
nRST_STOP : 0x1 (No reset generated)
nRST_STDBY : 0x1 (No reset generated)

Write Protection:

WRP0 : 0x1 (Write protection not active)
WRP1 : 0x1 (Write protection not active)
WRP2 : 0x1 (Write protection not active)
WRP3 : 0x1 (Write protection not active)
WRP4 : 0x1 (Write protection not active)
WRP5 : 0x1 (Write protection not active)
WRP6 : 0x1 (Write protection not active)
WRP7 : 0x1 (Write protection not active)

I also noticed that the target voltage (1.76V) after having the issue is lower than expected.
Has anyone experienced this or know what might be causing it? Any advice would be appreciated!
Thanks!

4 REPLIES 4
TDK
Guru

If voltage droops when you try to program flash, probably the power supply for the board is insufficient, or there is some other design error. Can you share the schematic?

If you feel a post has answered your question, please click "Accept as Solution".
IBR
Associate

Hello,

Thank you for your reply.

No, the voltage does not drop only during the writing operation. On the CubeProgrammer interface, I can see the target voltage after powering on the board and before connecting; it shows a value of 1.76V.

                                 voltage_issue.png

Let me provide more context: It was functioning correctly with an older version of the external loader. The issue started after creating and testing with a new QSPI loader created using STM32CubeIDE to improve certain aspects. However, even after reverting to the previous loader, the problem persists.

I suspect that some default configurations in STM32CubeIDE (example: forgetting to comment out protection settings or ...) during the creation of the new loader might have introduced write protection or caused a hardware issue leading to the lower-than-expected voltage.
Could this be the case?

Hello @IBR ,

Make sure you are using the latest version of the tools you are using.

I advise you follow these resources on how to develop and add your own external loader :

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

If voltage drops *at all*, or otherwise not at its intended level, that's not something the software is going to be able to fix. If 1.76V is low, what is it supposed to be? Likely that's the source of your issues.

If you feel a post has answered your question, please click "Accept as Solution".