2026-04-02 12:50 AM
Dear,
When running the FSBL that includes HAL XSPI initialization logic on the Nucleo-N657X0-Q board (MB1940-N657X0Q-C02), the flash erase with the STM32CubeProgrammmer v2.22 sometimes fails. However, if I leave out the XSPI initialization logic for accessing the NOR flash, flash erase always succeeds. BOOT pin 1 is set to DEV and I am loading the FSBL firmware directly into RAM.
Do you have any idea why XSPI Init causes the flash erase to fail ?
BR,
EdwinD
2026-04-09 3:00 AM
Hello @edwind and welcome to the community;
Could you please share a screenshot of the error and the .log file.
Which XSPI clock are you using?
Thank you.
Kaouthar
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.
2026-04-15 1:31 PM
Hi @KDJEM.1
We are using XSPI with following clock config:
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_XSPI2;
PeriphClkInitStruct.Xspi2ClockSelection = RCC_XSPI2CLKSOURCE_IC3;
PeriphClkInitStruct.ICSelection[RCC_IC3].ClockSelection = RCC_ICCLKSOURCE_PLL1;
PeriphClkInitStruct.ICSelection[RCC_IC3].ClockDivider = 24;
Please find attached requested logging and screenshot.
BR,
Edwin
2026-04-16 8:42 AM
Hello @edwind ,
Thank you for sharing the error issue and the log file.
Could you please check the dummy.
Thank you.
Kaouthar
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.
2026-04-16 9:56 AM
2026-04-22 12:19 AM
2026-04-22 12:40 AM
Hello @edwind ;
You need to check the XSPI2 configuration. May be this STM32CubeN6/Projects/NUCLEO-N657X0-Q/Examples/XSPI/XSPI_NOR_MemoryMapped_DTR at main · STMicroelectronics/STM32CubeN6 · GitHub example help you for verification.
Please try to disable the I/O compensation cell (EN = 0, CS = 1) on the relevant power domains (VDD, VDDIO2, VDDIO3,VDDIO4, and VDDIO5) and use fixed compensation values for the RAPSRC[3:0] and RANSRC[3:0] bitfields as mentioned in the errata sheet.
Thank you.
Kaouthar
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.
2026-04-22 2:35 AM
It could happen that you configure the NOR Flash with FSBL into non-default mode (change SOPI/DOPI, dummy cycles, etc.) and STM32CubeProgrammer connection isn't making hardware reset to MCU, so the Flash which uses same MCU NRST signal, doesn't get reset to default mode and CubeProgrammer external Flash loader just can't talk to it. Check your debug connection mode and reset modes, try out hardware reset.
2026-04-23 8:40 AM
Hi @KDJEM.1
I have tested with the XSPI_NOR_MemoryMapped_DTR project found in ST's repo at location: STM32CubeN6\Projects\NUCLEO-N657X0-Q\Examples\XSPI. This example was compiled by STM32CubeIDE v2.1.0 loaded into RAM by the embedded ST-Link on the Nucleo, executed and after some time stopped. After this, I used STM32CubeProgrammer v2.22.0 to program something into flash memory, after I connect to it using the Hardware Reset option when connecting. When trying to program emb-platform-nxg-e6-fsbl-trusted.bin (another binary), STM32CubeProgrammer would halt and report the following in its log file:
11:25:44 : UR connection mode is defined with the HWrst reset mode 11:25:46 : ST-LINK SN : 002500283234511233353533 11:25:46 : ST-LINK FW : V3J17M10 11:25:46 : Board : NUCLEO-N657X0-Q 11:25:46 : Voltage : 3.25V 11:25:46 : SWD freq : 8000 KHz 11:25:46 : Connect mode: Normal 11:25:46 : Reset mode : Hardware reset 11:25:46 : Device ID : 0x486 11:25:46 : Revision ID : Rev Z 11:25:46 : Revision ID : Rev Z 11:25:46 : UPLOADING ... 11:25:46 : Size : 1024 Bytes 11:25:46 : Address : 0x8000000 11:25:46 : Read progress: 11:25:46 : Data read successfully 11:25:46 : Time elapsed during the read operation is: 00:00:00.002 11:25:54 : Opening and parsing file: emb-platform-nxg-e6-fsbl-trusted.bin 11:25:54 : Memory Programming ... 11:25:54 : File : emb-platform-nxg-e6-fsbl-trusted.bin 11:25:54 : Size : 92.34 KB 11:25:54 : Address : 0x70000000 11:25:54 : Erasing memory corresponding to segment 0: 11:25:54 : Download in Progress: 11:25:54 : Error: failed to download Sector[0] 11:25:54 : Error: failed to download the File 11:25:54 : Warning: Connection to device 0x486 is lost 11:26:06 : Disconnected from device.
I made certain the hardware reset was performed by both the ST link as the Segger j-link. I even measured with an oscilloscope to verify that the reset was driven. No change in observable behavior was noticed, the device's flash was not approachable through the either Segger's JFlash and STM32CubeProgrammer.
Best regards,
Edwin
PS. ST's example does not use the compensation cells.
2026-04-23 8:41 AM
Hi @Mikk Leini
A hardware reset (verified the reset line on the scope) didn't solve the problem.
Best regards,
Edwin