on 2025-11-13 5:02 AM
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.
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.
2. In STM32CubeProgrammer:
Select STLINK and try to connect.
Select the external loader for the STM32N6570-DK(NOR_FLASH).
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.
To run your program, ensure that the BOOT pins are configured as follows: BOOT0 = 0 and BOOT1 = 0, then reset the board.
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:
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.
3. Navigate to the "Memory & File editing" tab and select [Open file].
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).
Set the device to FLASH boot mode to execute the new FSBL.
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.