2026-01-31 3:41 AM - edited 2026-01-31 3:51 AM
IAR version: 9.70.2
Board: MB1930-N6570-C02
Project: STM32Cube_FW_N6_V1.2.0\Projects\STM32N6570-DK\Templates\Template
Board is in DEV mode, LED2 is on after reset.
Hi, I'm unable to debug the template project, once debug session is launched the core just stucks in the bootrom:
Also there are some error in the log:
Sat Jan 31, 2026 12:25:55: IAR Embedded Workbench 9.70.2 (C:\iar\ewarm-9.70.2\arm\bin\armproc.dll)
Sat Jan 31, 2026 12:25:55: Loaded macro file: C:\iar\ewarm-9.70.2\arm/config/debugger/ST/STM32N6xx_DBG.dmac
Sat Jan 31, 2026 12:25:55: Loaded macro file: C:\iar\ewarm-9.70.2\arm/config/debugger/ST/STM32N6xx_Trace.dmac
Sat Jan 31, 2026 12:25:55: Loaded macro file: E:\mcu\STM32Cube\STM32Cube_FW_N6_V1.2.0\Projects\STM32N6570-DK\Templates\Template\EWARM\FSBL\setup.mac
Sat Jan 31, 2026 12:25:55: PC-locked license - IAR Embedded Workbench for ARM
Sat Jan 31, 2026 12:25:57: Connected to ST-LINK/V3 [SWD mode 1000 kHz] [Access port: 1] Firmware V3.J17.M10 (Probe no: 002900304142501820353451)
Sat Jan 31, 2026 12:25:57: Hardware reset with strategy 1 was performed
Sat Jan 31, 2026 12:25:57: Initial reset was performed
Sat Jan 31, 2026 12:25:57: DMAC: DBGMCU_APB1LFZR was modified. DBG_WWDG1_STOP bit is set.
Sat Jan 31, 2026 12:25:57: DMAC: DBGMCU_APB4FZR was modified. DBG_IWDG_STOP bit is set.
Sat Jan 31, 2026 12:25:57: DMAC: DBGMCU_CR was changed (old=0x0, new=0x300007)
Sat Jan 31, 2026 12:25:57: Failed to read CPUID for Cortex device
Sat Jan 31, 2026 12:25:57: Loaded debugee: E:\mcu\STM32Cube\STM32Cube_FW_N6_V1.2.0\Projects\STM32N6570-DK\Templates\Template\EWARM\FSBL\Template_FSBL\Exe\Template_FSBL.out
Sat Jan 31, 2026 12:25:57: 9288 bytes downloaded (133.39 Kbytes/sec)
Sat Jan 31, 2026 12:25:57: Download completed.
Sat Jan 31, 2026 12:25:57: Hardware reset with strategy 1 was performed
Sat Jan 31, 2026 12:25:57: Write failed (CPU data abort) at Memory address 0xe000'edfc
Sat Jan 31, 2026 12:25:57: Target reset
Sat Jan 31, 2026 12:25:57: 9288 bytes downloaded (127.75 Kbytes/sec)
Sat Jan 31, 2026 12:25:57: Loaded extra image: E:\mcu\STM32Cube\STM32Cube_FW_N6_V1.2.0\Projects\STM32N6570-DK\Templates\Template\EWARM\FSBL\Template_FSBL\Exe\Template_FSBL.out, image ID 2
Sat Jan 31, 2026 12:25:57: E:\mcu\STM32Cube\STM32Cube_FW_N6_V1.2.0\Projects\STM32N6570-DK\Templates\Template\EWARM\FSBL\setup.mac(16,10): Error: Write error.
Sat Jan 31, 2026 12:25:57: Error while calling macro execUserSetup
Sat Jan 31, 2026 12:25:57: There were 1 error and 3 warnings during the initialization of the debugging session.
The RAM content is correct:
The board is brand new, I've also attached OPT config is hasn't been modified.
Seem like the macro didn't set PC & SP correctly ? If I set SP & PC manually then the code can be run.
Solved! Go to Solution.
2026-01-31 8:19 AM
Hello @MasterPhi
Sorry for this issue. Could you try to change RESET mode in Debugger STLink Options of IAR-EWARM ?
Refer to the screenshot below:
Change Reset to System (default), it will normally fix your issue and halt the cpu in the Reset Handler as defined
in setup.mac (PC at 0x34180404)
For a full debug capabilities, change also the C/C++ optimization from "High Size" to "None" and set a soft break point at the beginning of main.
Let me know if it fix the issue.
Best regards.
Romain
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-01-31 8:19 AM
Hello @MasterPhi
Sorry for this issue. Could you try to change RESET mode in Debugger STLink Options of IAR-EWARM ?
Refer to the screenshot below:
Change Reset to System (default), it will normally fix your issue and halt the cpu in the Reset Handler as defined
in setup.mac (PC at 0x34180404)
For a full debug capabilities, change also the C/C++ optimization from "High Size" to "None" and set a soft break point at the beginning of main.
Let me know if it fix the issue.
Best regards.
Romain
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-01-31 9:47 AM
Hi @RomainR. , thank you, setting Reset to System (default) indeed solved the issue.
Also I suggest change execUserSetup into execUserReset in setup.mac, as execUserSetup is only executed once debug session is launched, while execUserReset is also executed when Reset button is pressed.
Since AXIRAM2 is erased on reset code need to be redownloaded.
Before:
After: