cancel
Showing results for 
Search instead for 
Did you mean: 

Help in creating a simple Application for Nucelo-N6 with NPU

LukasOst
Associate II

Hello everbody

I am struggling creating a project which uses the ART-Accelerator and compiles. There are always some errors. It feels like i searched every possible document from ST but i haven't found a basic get started guide or something like that which uses the Nucleo-N6. I also tried multiple combination of FSBL, Application (even though i am not sure when to use which but thats a other topic).
The basic template which auto generates when making a new project ran. I wasted already so much time on this so any help is welcome.
How i am creating a project in CubeIDE:
- New project and choose Nucelo-N6 with FSBL only
- Go to .ioc choose X-Cube-AI 10.0.0, tick core and choose application template
- load model and run analyze, validate on desktop and take a look at the Graph: Graph looks weird with blocks not connected, if i choose MCU runtime Graph looks fine but i want to use NPU
- Save and generate Code
- Try to compile -> Errors


../X-CUBE-AI/App/app_x-cube-ai.c:100:5: warning: implicit declaration of function 'HAL_RIF_RISC_SetSlaveSecureAttributes' [-Wimplicit-function-declaration]
100 | HAL_RIF_RISC_SetSlaveSecureAttributes(RIF_RISC_PERIPH_INDEX_NPU, RIF_ATTRIBUTE_PRIV | RIF_ATTRIBUTE_SEC);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../X-CUBE-AI/App/app_x-cube-ai.c:100:43: error: 'RIF_RISC_PERIPH_INDEX_NPU' undeclared (first use in this function)
100 | HAL_RIF_RISC_SetSlaveSecureAttributes(RIF_RISC_PERIPH_INDEX_NPU, RIF_ATTRIBUTE_PRIV | RIF_ATTRIBUTE_SEC);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../X-CUBE-AI/App/app_x-cube-ai.c:100:43: note: each undeclared identifier is reported only once for each function it appears in
../X-CUBE-AI/App/app_x-cube-ai.c:100:70: error: 'RIF_ATTRIBUTE_PRIV' undeclared (first use in this function)
100 | HAL_RIF_RISC_SetSlaveSecureAttributes(RIF_RISC_PERIPH_INDEX_NPU, RIF_ATTRIBUTE_PRIV | RIF_ATTRIBUTE_SEC);
| ^~~~~~~~~~~~~~~~~~
../X-CUBE-AI/App/app_x-cube-ai.c:100:91: error: 'RIF_ATTRIBUTE_SEC' undeclared (first use in this function)
100 | HAL_RIF_RISC_SetSlaveSecureAttributes(RIF_RISC_PERIPH_INDEX_NPU, RIF_ATTRIBUTE_PRIV | RIF_ATTRIBUTE_SEC);
| ^~~~~~~~~~~~~~~~~
make: *** [X-CUBE-AI/App/subdir.mk:22: X-CUBE-AI/App/app_x-cube-ai.o] Error 1
"make -j24 all" terminated with exit code 2. Build might be incomplete.

I tried to get rid of the errors by configuring the .ioc:
Pintout -> CHACHEAXI -> tick FSBL

But then even more erros occure:
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v8-m.main+dp/hard/libc_nano.a(libc_a-closer.o): in function `_close_r':
(.text._close_r+0xc): warning: _close is not implemented and will always fail
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v8-m.main+dp/hard/libc_nano.a(libc_a-lseekr.o): in function `_lseek_r':
(.text._lseek_r+0x10): warning: _lseek is not implemented and will always fail
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v8-m.main+dp/hard/libc_nano.a(libc_a-readr.o): in function `_read_r':
(.text._read_r+0x10): warning: _read is not implemented and will always fail
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v8-m.main+dp/hard/libc_nano.a(libc_a-writer.o): in function `_write_r':
(.text._write_r+0x10): warning: _write is not implemented and will always fail
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: ./Core/Src/main.o: in function `MX_CACHEAXI_Init':
/home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../Core/Src/main.c:224: undefined reference to `HAL_CACHEAXI_Init'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: ./X-CUBE-AI/App/app_x-cube-ai.o: in function `MX_X_CUBE_AI_Init':
/home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/app_x-cube-ai.c:100: undefined reference to `HAL_RIF_RISC_SetSlaveSecureAttributes'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/app_x-cube-ai.c:105: undefined reference to `npu_cache_init'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: ./X-CUBE-AI/App/app_x-cube-ai.o: in function `MX_X_CUBE_AI_Process':
/home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/app_x-cube-ai.c:118: undefined reference to `LL_ATON_RT_RuntimeInit'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/app_x-cube-ai.c:127: undefined reference to `LL_ATON_RT_Init_Network'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/app_x-cube-ai.c:130: undefined reference to `LL_ATON_RT_RunEpochBlock'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/app_x-cube-ai.c:139: undefined reference to `LL_ATON_RT_DeInit_Network'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/app_x-cube-ai.c:144: undefined reference to `LL_ATON_RT_RuntimeDeInit'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: ./X-CUBE-AI/App/network.o: in function `LL_ATON_End_EpochBlock_2':
/home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:179: undefined reference to `ll_sw_forward_conv'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:188: undefined reference to `mcu_cache_clean_range'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: ./X-CUBE-AI/App/network.o: in function `LL_ATON_End_EpochBlock_3':
/home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:248: undefined reference to `ll_sw_forward_arith'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:257: undefined reference to `mcu_cache_clean_range'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: ./X-CUBE-AI/App/network.o: in function `LL_ATON_End_EpochBlock_5':
/home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:307: undefined reference to `ll_sw_forward_activ'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:316: undefined reference to `mcu_cache_clean_range'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: ./X-CUBE-AI/App/network.o: in function `LL_ATON_End_EpochBlock_7':
/home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:339: undefined reference to `mcu_cache_invalidate_range'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:397: undefined reference to `ll_sw_forward_conv'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:406: undefined reference to `mcu_cache_clean_range'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: ./X-CUBE-AI/App/network.o: in function `LL_ATON_End_EpochBlock_8':
/home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:427: undefined reference to `mcu_cache_invalidate_range'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:480: undefined reference to `ll_sw_forward_arith'
/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /home/lukasschoepf/STM32CubeIDE/workspace_1.17.0/Testing_NUCELO_N6/FSBL/Debug/../X-CUBE-AI/App/network.c:489: undefined reference to `mcu_cache_clean_range'
collect2: error: ld returned 1 exit status
make: *** [makefile:68: Testing_NUCELO_N6_FSBL.elf] Error 1
"make -j24 all" terminated with exit code 2. Build might be incomplete.

Can someone please help? Is there a problem with the NPU and CubeMX?

1 ACCEPTED SOLUTION

Accepted Solutions
Julian E.
ST Employee

Hello @LukasOst,

 

Sorry for the lat answer.

There are indeed some errors coming from cubeMX. We are addressing some of them in the next patch of X Cube AI (end of april).

 

We are working on a simple example of running a model on the Nucleo N6 as we don't have that for now.

 

You probably have seen this already, but I would suggest you use the example AI applications of the DK: STM32N6-AI - AI software ecosystem for STM32N6 with Neural-ART accelerator - STMicroelectronics

And the basic application example for the nucleo: 

STM32CubeN6 - STM32Cube MCU Package for STM32N6 series (HAL, CMSIS devices, and examples running on ST boards) - STMicroelectronics

(in STM32Cube_FW_N6_V1.1.0\Projects\NUCLEO-N657X0-Q)

 

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.

View solution in original post

1 REPLY 1
Julian E.
ST Employee

Hello @LukasOst,

 

Sorry for the lat answer.

There are indeed some errors coming from cubeMX. We are addressing some of them in the next patch of X Cube AI (end of april).

 

We are working on a simple example of running a model on the Nucleo N6 as we don't have that for now.

 

You probably have seen this already, but I would suggest you use the example AI applications of the DK: STM32N6-AI - AI software ecosystem for STM32N6 with Neural-ART accelerator - STMicroelectronics

And the basic application example for the nucleo: 

STM32CubeN6 - STM32Cube MCU Package for STM32N6 series (HAL, CMSIS devices, and examples running on ST boards) - STMicroelectronics

(in STM32Cube_FW_N6_V1.1.0\Projects\NUCLEO-N657X0-Q)

 

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.