2026-02-03 12:42 PM
I have been trying for hours to upload code to the STM32-N6 and I am simply out of ideas. I only managed to upload debug code to RAM once, then I tried erasing the flash on the PCB using STM32CubeProgrammer (which worked, the standard code is not on there anymore) but now I cannot even use the debug option. Every time I try to upload code (I tried all BOOT pin combinations) it simply doesn't work. sometimes it has a timeout while trying to connect and really often I get the following output:
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 7184
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Info : default port : 7184
Info : Remote address: 127.0.0.1
Info : stlinkserver already running, exit
Target unknown error 32
Error in initializing ST-LINK device.
Reason: Unknown. Please check power and cabling to target.
I am using the 5V_STLK header connection for power. Right now, I cannot do anything with it anymore. not even running in dev mode works. Could the STM32N6 have gotten bricked when I tried to erase its flash? do I need an external ST-Link programmer to try and fix this?
I should also mention that, when trying to upload the firmware to the ST-Link, it failed multiple times before finally working (this was before the RAM loading worked the first time) and after that last time, I was able to upload the firmware 2 times with no problems.
I even tried using a converter between the controller and my laptop just in case the USB protocol was too fast or my laptop did anything weird with newer USB protocols.
System:
Apple Macbook Pro M4 with MacOS 26.2
STM32CubeMX v6.16.1
STM32CubeIDE v2.0.0
STM32CubeProgrammer v2.21.0
2026-02-03 12:47 PM
Some information I forgot:
Trying to connect using the STM32CubeProgrammer leads to it connecting, trying to read the flash, encountering some kind of error and then disconnecting. Every time.
Furthermore (since some might recommend this) I also tried adding the memory map (MX25UM51245G_STM32N6570-NUCLEO.stldr) with enable and initialize both turned on (and with enable on and initialize off)
I truly cannot think of any reason why it wont work. I would theoretically have an ST-Link to my disposal for a bit if I have to re-upload the firmware or something like that but I still need a fix which would let the PCB be programmed over the built-in ST-Link