Issues when generating a ML inference project for the Nucleo STM32N657
Dear ST community,
I'm trying to setup a ML inference project on the STM32N6 Nucleo in order to do latency and accuracy evaluation of models as well as power measurements. I've been stuck at setting up a project that builds for a few days now.
Environment:
- Nucleo STM32N657 X0h3Qu
ST CubeIDE 1.18
X-Cube-AI 10.0.0
From CubeIDE create new project
File -> New -> STM32 Project
Select N6 Nucleo board
Name=N6_Test_02, Target language=C, Project structure=Secure and Non secure domain, FSBL only
In the embedded cubeMX, Add X-Cube-AI and add my model
Pinout & Configuration -> X-CUBE-AI
Select context FSBL, check X-Cube-AI -> Core and select device application application template, hit ok
Pinout & Configuration -> X-CUBE-AI -> Add network TFLITE, Neural Art runtime, select my custom model, Analyze, model fits on device (800Kb Flash, 125KB RAM)
Fix the clock configuration manually
- CPU clock MUX SYSA is said to have 600Mhz max although the IC1 source is selected and in the PLL1, I can see that the IC1 has a /2 divider and 800Mhz , at this stage select /1 then select back /2 fix the issue, SYSA gets the desired 800Mhz and the warning disappear
Save and generate the code
Fix the missing aton library
Build the FSBL -> ../X-CUBE-AI/App/network.c:46:10: fatal error: ll_aton_NN_interface.h: No such file or directory
Copy files and folder from /home/%USER/STM32Cube/Repository/Packs/STMicroelectronics/X-CUBE-AI/10.0.0/Middlewares to the FSBL
Add /N6_Test_02_FSBL/Middlewares/ST/AI/Npu/ll_aton and /N6_Test_02_FSBL/Middlewares/ST/AI/Npu/Devices/STM32N6XX to the include path
Fix the RIF_RISC_PERIPH_INDEX_NPU issue
Build the FSBL -> ../X-CUBE-AI/App/app_x-cube-ai.c:100:43: error: 'RIF_RISC_PERIPH_INDEX_NPU' undeclared (first use in this function)
From the project top level, move everything in Drivers in the Drivers view of the project, Add the includes /N6_Test_02_FSBL/Drivers/STM32N6xx_HAL_Driver/Inc, /N6_Test_02_FSBL/Drivers/CMSIS/Device/ST/STM32N6xx/Include, /N6_Test_02_FSBL/Drivers/CMSIS/Include, /N6_Test_02_FSBL/Drivers/BSP/STM32N6xx_Nucleo
Copy /home/$USER/STM32Cube/Repository/Packs/STMicroelectronics/X-CUBE-AI/10.0.0/Projects/STM32N6570-DK/Applications/hello_world/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal_rif.h (and .c ) to /N6_Test_02_FSBL/Drivers/STM32N6xx_HAL_Driver/Inc (/Src for the .c)
Add NPU_PRESENT to the preprocessor
Add #include "stm32n6xx_hal_rif.h" Line 46 of /N6_Test_02_FSBL/X-CUBE-AI/App/app_x-cube-ai.c
Fix the make: *** No rule to make target '/work/PSEE/stm32_2/N6_Test_02/Drivers/BSP/STM32N6xx_Nucleo/stm32n6xx_nucleo.c', needed by 'Drivers/BSP/STM32N6xx_Nucleo/stm32n6xx_nucleo.o'. Stop. issue
I'm stuck at the last issue mentioned.
any help would be appreciated,
Thanks,
Etienne

