2025-10-01 8:44 AM - last edited on 2025-10-01 8:56 AM by Andrew Neil
Hello,
(ST-LINK + CubeProgrammer UART/USB both failing)
I am using a NUCLEO-N657X0-Q board. I cannot flashing my code via the ST-Link ( ST-Link windows driver is installed and detected through device manager and I had already updated the stlink). it throws this error:
STMicroelectronics ST-LINK GDB server. Version 7.11.0
Copyright (c) 2025, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Target unknown error 32
Error in initializing ST-LINK device.
Reason: Unknown. Please check power and cabling to target.
Then tried with CubeProgrammer to connect via STlink but it connects then quickly drops , here is the log :
17:22:24 : STM32CubeProgrammer API v2.20.0 | Windows-64Bits
17:22:39 : UR connection mode is defined with the HWrst reset mode
17:22:40 : UR connection mode is defined with the HWrst reset mode
17:22:40 : ST-LINK SN : 004600433234511233353533
17:22:40 : ST-LINK FW : V3J16M8
17:22:40 : Board : NUCLEO-N657X0-Q
17:22:40 : Voltage : 3.27V
17:22:40 : SWD freq : 8000 KHz
17:22:40 : Connect mode: Under Reset
17:22:40 : Reset mode : Hardware reset
17:22:40 : Device ID : 0x486
17:22:40 : Revision ID : Rev Z
17:22:40 : UPLOADING ...
17:22:40 : Size : 1024 Bytes
17:22:40 : Address : 0x8000000
17:22:40 : Read progress:
17:22:40 : Error: Data read failed
17:22:40 : Warning: Connection to device 0x486 is lost
17:22:40 : Warning: Connection to device 0x486 is lost
17:22:41 : Disconnected from device.
17:22:41 : Disconnected from device.
Since IDCODE access still worked, but flash was blocked, this matched the typical behavior of RDP Level 1. To confirm, I switched the board to BOOT0=1 so it enters the system ROM bootloader (UART/USB), which bypasses user flash and should still allow mass erase. In this mode, CubeProgrammer connected and reported “Chip ID: 0x486, Bootloader v3.1” but also explicitly printed “Device is under Read Out Protection,” and every read/memory command afterwards timed out. This double-checked that the device is indeed in RDP Level 1.
this is the log :
15:09:30:501 : RTS low
15:09:30:502 : DTR Low
15:09:30:507 : Serial Port COM5 is successfully opened.
15:09:30:509 : Port configuration: parity = even, baudrate = 115200, data-bit = 8, stop-bit = 1.0, flow-control = off
15:09:30:510 : No Init bits value is : 0
15:09:30:510 : Sending init command:
15:09:30:510 : #byte 0x7F sent successfully to target
15:09:30:511 : Wait ends after 1 loop, dataready = 1, delay = 0
15:09:30:511 : #ack Received response from target: 0x79
15:09:30:512 : Double ACK issue detected!
15:09:30:512 : Activating device: OK
15:09:30:512 : Board : --
15:09:30:513 : Sending GetID command and its XOR:
15:09:30:513 : #byte 0x02 sent successfully to target
15:09:30:513 : #byte 0xFD sent successfully to target
15:09:30:513 : Wait ends after 1 loop, dataready = 1, delay = 0
15:09:30:513 : #ack Received response from target: 0x79
15:09:30:513 : Received 4 data bytes from target : 0x01048679
15:09:30:513 : Chip ID: 0x486
15:09:30:513 : Sending Get command and its XOR:
15:09:30:513 : #byte 0x00 sent successfully to target
15:09:30:514 : #byte 0xFF sent successfully to target
15:09:30:514 : Wait ends after 1 loop, dataready = 1, delay = 0
15:09:30:514 : #ack Received response from target: 0x79
15:09:30:514 : Received 1 data bytes from target : 0x07
15:09:30:514 : size of bytes in the response: 7
15:09:30:514 : Received 9 data bytes from target
15:09:30:515 : Full received response: 07310001020321311279
15:09:30:515 : BootLoader protocol version: 3.1
15:09:30:515 : #byte 0x11 sent successfully to target
15:09:30:515 : #byte 0xEE sent successfully to target
15:09:30:585 : Warning: Device is under Read Out Protection
15:09:30:586 : Sending GetID command and its XOR:
15:09:30:587 : #byte 0x02 sent successfully to target
15:09:30:588 : #byte 0xFD sent successfully to target
15:09:31:588 : Wait ends after 1 loop, dataready = 0, delay = 1000
15:09:31:588 : Timeout error occured while waiting for acknowledgement.
15:09:31:588 : No response from target received
15:09:31:588 : Error: GETID command not acknowledged!
15:09:31:708 : Reemission of GetID command
15:09:31:708 : Sending GetID command and its XOR:
15:09:31:708 : #byte 0x02 sent successfully to target
15:09:31:709 : #byte 0xFD sent successfully to target
15:09:32:709 : Wait ends after 1 loop, dataready = 0, delay = 1000
15:09:32:709 : Timeout error occured while waiting for acknowledgement.
15:09:32:709 : No response from target received
15:09:32:710 : Error: GETID command not acknowledged!
15:09:32:830 : Reemission of GetID command
15:09:32:830 : Sending GetID command and its XOR:
15:09:32:830 : #byte 0x02 sent successfully to target
15:09:32:832 : #byte 0xFD sent successfully to target
15:09:33:830 : Wait ends after 1 loop, dataready = 0, delay = 1000
15:09:33:830 : Timeout error occured while waiting for acknowledgement.
15:09:33:830 : No response from target received
15:09:33:830 : Error: GETID command not acknowledged!
15:09:33:952 : #byte 0x11 sent successfully to target
15:09:33:952 : #byte 0xEE sent successfully to target
15:09:35:055 : UART PORT CLOSE
15:09:35:098 : Disconnected from device.
So what should be done now exactly? and why is device in Read Out Protection mode in the first place , i ordered the Nucleo-N657X0-Q and this is the first time I am using it out of the box!
I think a full chip erase can help but cannot even do it becaause the connection keeps getting dropped.
Best Regards,
Youssef