Skip to main content
Associate
June 20, 2025
Solved

How to generate a hex file for a neural network model

  • June 20, 2025
  • 1 reply
  • 758 views

Hi everyone,

I encountered problems when deploying the neural network using STM32N6570-DK.

I was deploying my model to the STM32N6570-DK development board according to the routine, but found that the code file obtained by optimizing the model using the Stedg-AI web version did not contain the hex file, that is, network_data.hex under the Binary file of any routine folder. Without this file, I cannot complete the deployment of the neural network according to the steps of the routine.

I attempted to solve this problem by downloading the ST EdgeAI software version, but for the downloaded ST EdgeAI Core 2.1.0, I couldn't find its shortcut to open it. I thought it was a version issue and tried to download ST EdgeAI Core 2.0.0, but got stuck at the step of ST Neural-ART package. I clicked on the download link of ST Neural-ART package on the installation interface. However, it returned to the download interface of ST EdgeAI Core. The download resources of the ST Neural-ART package could not be found, so ST EdgeAI Core 2.0.0 could not be installed.

May I ask how I can generate the hex file for the neural network? If it is generated using ST EdgeAI, how should I operate? If there are any other methods, could you introduce them to me? Thank you very much to all those who are willing to help

Best answer by Julian E.

Hello @Lipi,

 

The network_data.hex comes from the network_atonbuf.xSPI2.raw

JulianE_0-1750839218520.png

The .raw file is an intermediate format containing model data, and you need to use the ST Edge AI tools to compile it into a .hex file that's ready to flash onto your STM32 device.

To do so:

  • cp network_atonbuf.xSPI2.raw network_atonbuf.xSPI2.bin
  • arm-none-eabi-objcopy -I binary network_data.xSPI2.bin
    --change-addresses 0x71000000 -O ihex network_data.hex 

you should also add arm-none-eabi-objcopy path to your enviromment variables path. You can find it in your STM32CubeIDE installation folder, which is likely C:/ST/STM32CubeIDE_/STM32CubeIDE/plugins/ com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.win32_1.0 .0.202411081344/tools/bin.

(the 0x71000000 address is the external flash, where model weights should be put most of the time)

 

In the N6 Ai getting started, you can find documentation about the complete process of replacing a model:

STM32N6-AI - AI software ecosystem for STM32N6 with Neural-ART accelerator - STMicroelectronics

 

Concerning the stedgeai core 2.0, the npu addon is indeed not available anymore. It is not advised not to use the latest version. If you still wish to install it, you can find it attached

 

Have a good day,

Julian

1 reply

Julian E.
Julian E.Best answer
Technical Moderator
June 25, 2025

Hello @Lipi,

 

The network_data.hex comes from the network_atonbuf.xSPI2.raw

JulianE_0-1750839218520.png

The .raw file is an intermediate format containing model data, and you need to use the ST Edge AI tools to compile it into a .hex file that's ready to flash onto your STM32 device.

To do so:

  • cp network_atonbuf.xSPI2.raw network_atonbuf.xSPI2.bin
  • arm-none-eabi-objcopy -I binary network_data.xSPI2.bin
    --change-addresses 0x71000000 -O ihex network_data.hex 

you should also add arm-none-eabi-objcopy path to your enviromment variables path. You can find it in your STM32CubeIDE installation folder, which is likely C:/ST/STM32CubeIDE_/STM32CubeIDE/plugins/ com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.win32_1.0 .0.202411081344/tools/bin.

(the 0x71000000 address is the external flash, where model weights should be put most of the time)

 

In the N6 Ai getting started, you can find documentation about the complete process of replacing a model:

STM32N6-AI - AI software ecosystem for STM32N6 with Neural-ART accelerator - STMicroelectronics

 

Concerning the stedgeai core 2.0, the npu addon is indeed not available anymore. It is not advised not to use the latest version. If you still wish to install it, you can find it attached

 

Have a good day,

Julian

​In order 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.
LipiAuthor
Associate
June 26, 2025

Hello Julian

Thank you very much for your help. I have successfully solved this problem.

 

 

Have a good day

Lipi