STM32N6570-DK – debug keeps failing (error 32 / load failed), not sure if I should debug FSBL or Appli
Hi all,
I'm stuck on debugging with the STM32N6570-DK and could use some help. I've spent a few days on it and I'm running out of ideas.
My setup:
- Board: STM32N6570-DK (Rev B, device ID 0x486)
- STM32CubeIDE 2.2.0 (ST-LINK GDB server 7.14.0)
- STM32CubeProgrammer 2.23.0
- ST-LINK FW: V3J17M11
- CubeN6 FW package V1.4.1
- Project made in CubeMX with FSBL + Appli (Appli runs from external flash)
- Boot switches set for dev boot (BOOT1 = 1)
What's happening:
Most of the time the debug session doesn't even start. I get:
"Target unknown error 32
Error in initializing ST-LINK device.
Reason: Unknown. Please check power and cabling to target."
Sometimes it does connect. When I launch the Appli debug config, it programs the Appli into external flash fine (I can see it erasing sectors and downloading), but then it stops with "Setup exceptions" and the core is sitting at 0x18003a1a (boot ROM area, no source).
When I launch the FSBL debug config (with the Appli .elf added in the Startup tab), the GDB server connects, but then I get "Load failed" for the Appli .elf and then for the FSBL .elf, and the log says "Target is not responding, retrying..." again and again.
After one failed attempt, the next attempts usually fail with error 32 until I unplug the board.
What I have already tried:
- Two different DK boards – same problem on both
- Different USB cables
- Uninstalled and reinstalled CubeIDE, CubeMX and CubeProgrammer
- Checked the boot switches (earlier I had them wrong by mistake, now they're right)
- Updated the ST-LINK firmware
- Changed reset mode from "connect under reset" to "software system reset" – this helped with connecting, but loading still fails
CubeProgrammer connects fine in Hot Plug mode (shows 3.29 V, board detected), so the board and ST-LINK seem OK.
My questions:
1. With an FSBL + Appli project where the Appli runs from external flash, which one should I debug – the FSBL or the Appli? Is it right to launch the FSBL config and add the Appli .elf to it?
2. Do I need to add the external loader (MX66UW1G45G_STM32N6570-DK) in the FSBL debug config too, or is it better to flash the Appli with CubeProgrammer first and only load symbols in the debugger?
3. Is error 32 a known issue on the N6? Do I really have to unplug the board after every failed session?
4. Which reset mode and SWD speed do you recommend for this board?
If there's a step-by-step guide or example project for debugging FSBL + Appli on the N6570-DK, please point me to it. I can share the full logs and screenshots if needed.
Thanks in advance!
SoonuVerma
