cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect the STM32N6 using STLINK and serial interface

oumaimadinari
ST Employee

Summary

This article explains how to connect STM32N6 devices using STLINK (JTAG/SWD) and boot ROM (USB/UART) interfaces. It details two methods to program the external flash memory: via STLINK using an external flash loader, and via boot ROM using STM32CubeProgrammer with a TSV file. Step-by-step instructions, configuration settings, and useful resources are provided to help you successfully program your STM32N6 device.


Introduction

STM32N6 devices support multiple programming interfaces and methods to facilitate flexible development. You can program the external flash memory either through STLINK or boot ROM. Understanding these methods is crucial for efficient firmware development and deployment.

This method uses the STLINK interface (JTAG/SWD) and an external flash loader. 

1. Ensure that the BOOT1 pin is set to 1. For custom boards, consult your board schematic to identify the exact pin.

oumaimadinari_0-1762181449748.png

 


BOOT1.jpg

2. In STM32CubeProgrammer:
Select STLINK and try to connect.
Select the external loader for the STM32N6570-DK(NOR_FLASH). 
Presentation title.jpg

3. Add the .bin file.

In this article, a simple GPIO_Toggle example with a trusted binary is used. Refer to the example readme file on how to add a header to the generated binary.

Note: The NOR Flash start address is 0x70000000. 

oumaimadinari_1-1762183658373.png

To run your program, ensure that the BOOT pins are configured as follows: BOOT0 = 0 and BOOT1 = 0, then reset the board.

Method 2: Programming via boot ROM

This method is used to load the partitions requested by the boot ROM sequentially. To achieve this, STM32CubeProgrammer requires the TSV file. The TSV file contains the OpenBootloader for the external memory programming, the corresponding external flash loader, and the data to be loaded.

Follow the instructions below to enable serial boot mode.  

1. Configure BOOT pins for serial boot:

  • BOOT0 = 1
  • BOOT1 = 0

oumaimadinari_2-1761662229718.png

2. Select the UART interface in STM32CubeProgrammer.

If you are using a Nucleo board or the STM32N6570-DK, the default interface is the Virtual COM Port (VCP), where the UART functions over USB. If you are using a custom board, you need an external UART connection compatible with the STM32N6 series boot ROM pins.


½.png

 

3. Navigate to the "Memory & File editing" tab and select [Open file].

2.png

 

4. Open the FlashLayout.tsv file located at:
STM32Cube_FW_N6_V1.2.0\Projects\STM32N6570DK\Applications\OpenBootloader\Binaries\NOR_Binary\

5. Browse the \Binaries\ path and download the file.

6. Click [Download]. This action loads the new first stage bootloader (FSBL).

oumaimadinari_1-1762261151926.png

oumaimadinari_2-1762261187549.png

Set the device to FLASH boot mode to execute the new FSBL.
oumaimadinari_7-1761662596995.png

Conclusion

This article provided a detailed step-by-step guide on how to connect the STM32N6 microcontroller using STLINK and boot ROM. It covered essential procedures including hardware setup, configuring the STLINK interface, and utilizing the boot ROM for firmware programming and debugging. By following these instructions, you have gained practical knowledge to establish a reliable communication link with the STM32N6, enabling efficient firmware flashing and troubleshooting. 

Related links

 

Version history
Last update:
‎2025-11-13 5:01 AM
Updated by: