Need Guidance to Create a Simple STM32N6 NPU Project Using CubeIDE (and CubeMX)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-30 05:50 AM - edited ‎2025-01-30 06:04 AM
Hello,
I need guidance to create a very simple AI project using CubeIDE (CubeMX) and Neural-ART runtime. I can use all the example projects successfully but failed to create one from scratch till now. I faced no challenge earlier when using H7 for my AI projects.
I am using STM32N6570-DK. I tried using different ways, but I either got strange compilation/linking errors or got stuck in the neverending "Generating code" screen.
Anyway, my latest attempt is as follows:
- Create a new FSBL project by selecting my DK
- Chose not to initialize default peripherals
- Selected X-CUBE-AI 10.0 core and template application from the Middleware section
- Selected a MobileNetV2-based tflite model and Neural-ART runtime.
- Analyzed using "n6-allmems-O3" and generated code. Everything is OK so far.
- Tried to build and got errors and warnings.
Errors and warnings:
RIF-related error/warning in app_x-cube-ai.c.
./X-CUBE-AI/App/app_x-cube-ai.c: In function 'MX_X_CUBE_AI_Init':
../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);
| ^~~~~~~~~~~~~~~~~
NOTE:
This is just one of my many attempts to create a simple FSBL code to use the NPU. If I do not use "X-CUBE-AI template application", then I am getting XSPI-related errors and warnings.
I'd highly appreciate a very basic guide to creating a simple application using CubeIDE, X-XUBE-AI, and NPU.
I am also sharing my last attempt project code in zipped format.
- Labels:
-
STM32CubeIDE
-
STM32CubeMX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-05 12:06 AM
Hi,
Seems to be solved about the same or similar issue, how about using my project files ?
I created the code with CubeMx and built in CubeIDE.
hope to be done well for you.
https://drive.google.com/file/d/1etH_FyRxUyEPAl92u3qWFnIFeYOpCEMq/view?usp=drive_link
have a good day.
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-05 12:12 AM
Hello @edmond yun ,
Thank you very much for your contribution. Is that possible to compress your project and attach it to the conversation.
Thanks
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.
