cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-N657X0-Q: failed to start GDB server

cersoy
Associate II

I am trying to start a debugger session to my new NUCLEO-N657X0-Q and getting the following error:

STMicroelectronics ST-LINK GDB server. Version 7.9.0
Copyright (c) 2024, 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.

 I am using the latest version of STM32CubeIDE (1.17.0)

The STM32CubeProgrammer (v2.18.0) is also unable to program any binaries on the board.  After changing the Reset Mode to "Hardware reset" I am able to connect to the board, but immediately get the error message: 

15:09:28:207 : UR connection mode is defined with the HWrst reset mode
15:09:28:364 : ST-LINK SN : 002F00453433511830343835
15:09:28:365 : ST-LINK FW : V3J15M7
15:09:28:365 : Board : NUCLEO-N657X0-Q
15:09:28:365 : Voltage : 3.27V
15:09:28:365 : SWD freq : 8000 KHz
15:09:28:365 : Connect mode: Normal
15:09:28:365 : Reset mode : Hardware reset
15:09:28:365 : Device ID : 0x486
15:09:28:365 : Revision ID : Rev A
15:09:28:365 : reset ap 1
15:09:28:365 : Reading data...
15:09:28:365 : r ap 1 @0x00000000 0x00000004 bytes Data 0x00000018
15:09:28:365 : r ap 1 @0x00000000 0x00000004 bytes Data 0x00000018
15:09:28:365 : Database: Config 0 is active.
15:09:28:461 : UPLOADING ...
15:09:28:461 : Size : 1024 Bytes
15:09:28:461 : Address : 0x8000000
15:09:28:462 : Read progress:
15:09:28:462 : Reading data...
15:09:28:462 : r ap 1 @0x08000000 0x00000400 bytes Data 0x00000018
15:09:28:541 : r ap 1 @0x08000000 0x00000400 bytes Data 0x00000011
15:09:28:541 : Error: Data read failed

 Unfortunately link to user manual UM3417, which is https://www.st.com/resource/en/user_manual/dm01122391.pdf (per STM32 Nucleo-144 boards data brief) is currently unavailable.  

I don't understand what I am doing wrong from the error messages, and can't access the user manual.  I would appreciate if someone can shed light on the issue I am seeing.

19 REPLIES 19

Hello @tjaekel 

Yes STM32N6 only works with:

STM32CubeProgrammer V2.18.0
STM32CubeMX V6.13.0
STM32CubeIDE V1.17.0
The corresponding firmware package is STM32Cube_FW_N6_V1.0.0

For firmware development, I can also suggest to refer to UM3249: 

https://www.st.com/resource/en/user_manual/um3249-getting-started-with-stm32cuben6-for-stm32n6-series-stmicroelectronics.pdf

Let me answer to your questions:
The image has to be signed, e.g. via:
STM32_SigningTool_CLI.exe -bin Appli_FW.bin -nk -of 0x80000000 -t fsbl -o Appli_FW-trusted.bin -hv 2.3 -dump Appli_FW-trusted.bin
What is this of 0x80000000? The external flash starts at 0x70000000. Does it mean, the code image at 0x80000000 and it is concatinated with the bootloader header at 0x70000000?

Let check our STM32 Signing Tool Wiki page: 
STM32 SigningTool - stm32mcu

0x80000000 is not an address, it's preceded by -of meaning option flag for the binary image.

It requires to build the MCU FW as Appli:
Have a sub-project *_Appli and build this one.
But which Linker Script to use?
The STM32N657X0HXQ_LRUN.ld seems to build in the same way to load (via debugger) and execute from internal SRAM (loading and debugging with ST-LINK, with the BOOT1 changed, works as before, with the FSBL file generated, intended to be loaded and for debug when loaded and executed on internal SRAM)

In complement to my explanations here: LRUN application are linked and executed as below:

  • FSBL (or Boot) binary runs in AXISRAM2 (address 0x34180400)
  • Appli binary runs in AXISRAM1 (address 0x34000400)

I tried to flash this file (after signing) - but power on does not executed my code:
a) We have to use STM32CubeProgrammer
b) We have to activate the external bootloader (for this board!)
c) OK: I can erase entire chip (necessary to do manually?!)
d) I can flash the signed image

There are 3 possible reasons why the code does not execute after flashing to external memory:
1. The STM32N6 device is not in Flash_BOOT properly (BOOT0=0 and BOOT1=0)
2. The FSBL binaries is not signed, or the applied header is not matching with the AXISRAM2 address 0x34180000 + header 0x400
3. The FSBL binary is not programmed into the external Flash memory, this step must be always do when the STM32N6 device is in DEV_BOOT.

Could you check, share the log when you perform STM32_SigningTool.exe?
Same when you programmed the external NOR Flash, have you used the external loader compatible with your memory?
After reading external memory at 0x70000000, what do you read?

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.

Amel NASRI
ST Employee

@cersoy wrote:

I am trying to start a debugger session to my new NUCLEO-N657X0-Q and getting the following error:

STMicroelectronics ST-LINK GDB server. Version 7.9.0
Copyright (c) 2024, 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.

 I am using the latest version of STM32CubeIDE (1.17.0)

The STM32CubeProgrammer (v2.18.0) is also unable to program any binaries on the board.  After changing the Reset Mode to "Hardware reset" I am able to connect to the board, but immediately get the error message: 

15:09:28:207 : UR connection mode is defined with the HWrst reset mode
15:09:28:364 : ST-LINK SN : 002F00453433511830343835
15:09:28:365 : ST-LINK FW : V3J15M7
15:09:28:365 : Board : NUCLEO-N657X0-Q
15:09:28:365 : Voltage : 3.27V
15:09:28:365 : SWD freq : 8000 KHz
15:09:28:365 : Connect mode: Normal
15:09:28:365 : Reset mode : Hardware reset
15:09:28:365 : Device ID : 0x486
15:09:28:365 : Revision ID : Rev A
15:09:28:365 : reset ap 1
15:09:28:365 : Reading data...
15:09:28:365 : r ap 1 @0x00000000 0x00000004 bytes Data 0x00000018
15:09:28:365 : r ap 1 @0x00000000 0x00000004 bytes Data 0x00000018
15:09:28:365 : Database: Config 0 is active.
15:09:28:461 : UPLOADING ...
1Unfortunately link to user manual UM3417, which is https://www.st.com/resource/en/user_manual/dm01122391.pdf (per STM32 Nucleo-144 boards data brief) is currently unavailable.  

I don't understand what I am doing wrong from the error messages, and can't access the user manual.  I would appreciate if someone can shed light on the issue I am seeing.


 

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.

Amel NASRI
ST Employee

@cersoy wrote:

Unfortunately link to user manual UM3417, which is https://www.st.com/resource/en/user_manual/dm01122391.pdf (per STM32 Nucleo-144 boards data brief) is currently unavailable.  

Please note that the UM3417 is currently available.

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.

I am currently working with the STM32N657X0H3Q device on the NUCLEO-N657X0-Q board.

Following the official Template_FSBL_LRUN example, I successfully generated and signed both FSBL and Appli binaries using STM32CubeIDE and STM32_SigningTool_CLI v2.19.0.

 

In DV Mode (BOOT1 = High), I programmed:

  • The trusted FSBL binary to address 0x70000000
  • The trusted Appli binary to address 0x70100000

 

After programming, I set the BOOT1 jumper back to low (BOOT1 = 0) to boot from external XSPI Flash.

However, after reset, the board appears unresponsive — no LED blinking or visible activity from the Appli.

 

As suggested in the documentation, I have enabled the NO_OTP_FUSE preprocessor macro in the FSBL project.

 

You will find the signed binaries and project files attached for your reference.

I would appreciate your help in identifying why the application does not execute after the FSBL handover.

 

Best regards,

Han

Hello @HANITALY 

I just checked to program the secure signed binaries attached in your Template_FSBL_LRUN.zip

  • Template_FSBL_LRUN\STM32CubeIDE\Boot\Debug\Template_LRUN_FSBL-trusted.bin @0x7000 0000
  • Template_FSBL_LRUN\STM32CubeIDE\AppS\Debug\Template_LRUN_AppS-trusted.bin @0x7010 0000

I used STM32CubeProgrammer 2.19.0 and program  at the address indicated previously here.

On my NUCLEO-N657X0-Q, I confirm the Green Led blinking. No issue on my side.

Could you send a picture of your board and showing all black jumper settings?

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.

@HANITALY 

Before trying again on your side, could you check the sequence below:

  1. Set STM32N6 in DEV_BOOT using JP2.
  2. Erase the external serial flash using the STM32_Programmer_CLI.exe. 
    Make sure STM32CubeProgrammer is in your PATH environment variables and accessible in cmd terminal.
    Open a cmd and run the following command (Windows OS)
    STM32_Programmer_CLI.exe -c port=SWD ap=1 -el C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\ExternalLoader\MX25UM51245G_STM32N6570-NUCLEO.stldr -e [0 20] 
  3. Try to program again FSBL and AppS trusted binaries.
  4. Check in Flash Boot

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.

@RomainR.  

 

Thank you very much for your response!

Yes, I tried again under your instructions, but it ended up with the same result.

I would like to share with you what I did step by step.

 

  1. Picture 'Board 1' is the condition before the ST-link connection under DV_Model.
  2. After the ST-Link connection. The LD9 light(right top) blinks between green and red after ST-Link connection.
  3. From the Picture 'APPLI and FSBL Programme', you can see that I have successfully programmed them into the corresponding addresses. Meanwhile, the LD2 turned off from the red light after the programming.
  4. In the end, I set the Boot1(JP2) back to 0, after pressing reset button and repower , the board still looks like Picture ' Board 3', without LED blinking.
  5. From the Picture 'Result' ,  I am still not able to connect with the Board under Flash Boot.

 

Since you have confirmed it worked on board, I assume I might have done something wrong that I did not notice.

 

Thank you for your time and commitment!

Best Regards

Han

 

 

 

 

 

 

Hi @HANITALY 

All seems to be correct in the last pictures you shared.

Could you confirm the backside stickers of the board?
Screenshot 2025-04-26 at 08.24.59.png

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.

@RomainR. 

 

Yes, of course.

You can find it in the attached picture.

 

Best Regards

Han

 

 

@HANITALY 

Thank you for the picture, I used the same CR4 versions to program your signed binaries.

Your hardware seems to be correct for me.

Let's check OTP11 and OTP124 configuration of your Nucleo board.

  1. Set STM32N6 in DEV_BOOT.
  2. Run these commands in a cmd terminal:
    STM32_Programmer_CLI.exe -c port=SWD ap=1 -otp displ word=11
    STM32_Programmer_CLI.exe -c port=SWD ap=1 -otp displ word=128
  3. Compare the values with mines in the capture bellow:

    OTP11: BOOTROM_CONFIG2 here default configuration is is serial NOR on XSPI.

RomainR_2-1745683302405.png

OTP124: HCONF1 here the Bit 15 HSLV_VDDIO3 and Bit 16 HSLV_VDDIO2 are set

RomainR_3-1745683372882.png

In the last solution you can follow this Knowledge Base article to flash OTP124  0x0001 8000:
https://community.st.com/t5/stm32-mcus/how-to-program-the-otp-fuse-bits-in-the-stm32n6/ta-p/782353

In attachment, you can try to use the bat script to sign and flash your binaries using STM32_Programmer_CLI.exe.
You should update the path of the compiled binaries and their names.
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.