cancel
Showing results for 
Search instead for 
Did you mean: 

Transplant STM32N6 Model Zoo AI camera code into Touchgfx project

dianzijun
Associate II

I have been using STM32N6 to conduct model training and deployment for the model zoo. Now, I want to transfer the generated code to my TouchGFX project for embedded use in the CubeIDE environment. However, when I am transferring several files, before the transfer, the original files did not have this error, but after the transfer, there is this error and it is particularly common, mostly for the official-generated code. As follows:

  When these files are transferred:

dianzijun_0-1749105274335.png

 

After the transplantation was completed, an error occurred:

dianzijun_1-1749105274333.png

 

./../../Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:893:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

893 | HAL_StatusTypeDef HAL_SYSCFG_GetWriteQosNP1(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

../../../Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:895:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

895 | HAL_StatusTypeDef HAL_SYSCFG_GetReadQosNP1(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

../../../Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:898:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

898 | HAL_StatusTypeDef HAL_SYSCFG_GetWriteQosNP2(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

../../../Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:900:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

900 | HAL_StatusTypeDef HAL_SYSCFG_GetReadQosNP2(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

../../../Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:903:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

903 | HAL_StatusTypeDef HAL_SYSCFG_GetwriteQosCPUSS(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

../../../Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:905:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

905 | HAL_StatusTypeDef HAL_SYSCFG_GetReadQosCPUSS(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

../../../Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:934:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

934 | HAL_StatusTypeDef HAL_SYSCFG_ConfigVDDIOCompensationCell(uint32_t Selection, uint32_t Code,

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

../../../Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:937:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

937 | HAL_StatusTypeDef HAL_SYSCFG_GetVDDIOCompensationCell(uint32_t Selection, const uint32_t *pCode, uint32_t *pNmosValue,

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

../../../Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:946:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

946 | HAL_StatusTypeDef HAL_SYSCFG_ConfigVDDCompensationCell(uint32_t Code, uint32_t NmosValue, uint32_t PmosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

../../../Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:951:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

951 | HAL_StatusTypeDef HAL_SYSCFG_GetVDDCompensationCell(uint32_t Code, uint32_t *pNmosValue,

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

In file included from C:/Users/dell/Desktop/N6/n6_touchgfx/n6_cs/STM32CubeIDE/Appli/AI_bsp/Camera_Middleware/inc/cmw_camera_conf.h:33,

from C:/Users/dell/Desktop/N6/n6_touchgfx/n6_cs/STM32CubeIDE/Appli/AI_bsp/Camera_Middleware/inc/cmw_camera.h:29,

from C:/Users/dell/Desktop/N6/n6_touchgfx/n6_cs/STM32CubeIDE/Appli/AI_bsp/Camera_Middleware/inc/cmw_utils.h:23:

C:/Users/dell/Desktop/N6/n6_touchgfx/n6_cs/STM32CubeIDE/Appli/AI_bsp/Camera_Middleware/STM32N6570-DK/inc/stm32n6570_discovery_bus.h:28:10: fatal error: stm32n6570_discovery_conf.h: No such file or directory

28 | #include "stm32n6570_discovery_conf.h"

| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.

make[1]: *** [AI_bsp/Camera_Middleware/src/subdir.mk:25: AI_bsp/Camera_Middleware/src/cmw_utils.o] Error 1

make: *** [makefile:101: all] Error 2

"make -j20 all" terminated with exit code 2. Build might be incomplete.

 

14:29:56 Build Failed. 467 errors, 8 warnings. (took 22s.603ms)

 

And there are over four hundred such error reports scattered across multiple folders.

Looking forward to the answers from the experts.

1 ACCEPTED SOLUTION

Accepted Solutions
Julian E.
ST Employee

Hello @dianzijun,

 

When you copied files from the model training project to your TouchGFX-based CubeIDE project, you likely:

  • Missed important HAL/driver headers, or
  • Lost include path settings in .cproject, .project, or Makefile.

These headers and types are not auto-discovered — they depend on include paths configured in the CubeIDE or Makefile.


Check that these files exist in your project:

  • Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal_def.h
  • Drivers/STM32N6xx_HAL_Driver/Src/stm32n6xx_hal.c
  • Any other HAL .h/.c files that are referenced in the .h file showing errors.

 

Go to Project Properties in STM32CubeIDE:

Right-click your project → Properties → C/C++ General → Paths and Symbols → Includes
Add the following (if not present):

  • ${ProjDirPath}/Drivers/STM32N6xx_HAL_Driver/Inc
  • ${ProjDirPath}/Drivers/CMSIS/Device/ST/STM32N6xx/Include
  • ${ProjDirPath}/Drivers/CMSIS/Include

Any custom middleware paths like:

  • ${ProjDirPath}/AI_bsp/Camera_Middleware/inc
  • ${ProjDirPath}/AI_bsp/Camera_Middleware/STM32N6570-DK/inc

 

Ensure stm32n6570_discovery_conf.h Exists:
Search your original project for the file stm32n6570_discovery_conf.h and copy it to the appropriate location, for example: <YourProject>/AI_bsp/Camera_Middleware/STM32N6570-DK/inc/
If it's board-specific, you might also need to copy:

  • stm32n6570_discovery.c
  • stm32n6570_discovery.h

Make sure these are added to your project and paths are included

 

You can also:

  • Do a Project > Clean
  • Then Project > Build

Have a good day


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

4 REPLIES 4
Julian E.
ST Employee

Hello @dianzijun,

 

When you copied files from the model training project to your TouchGFX-based CubeIDE project, you likely:

  • Missed important HAL/driver headers, or
  • Lost include path settings in .cproject, .project, or Makefile.

These headers and types are not auto-discovered — they depend on include paths configured in the CubeIDE or Makefile.


Check that these files exist in your project:

  • Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal_def.h
  • Drivers/STM32N6xx_HAL_Driver/Src/stm32n6xx_hal.c
  • Any other HAL .h/.c files that are referenced in the .h file showing errors.

 

Go to Project Properties in STM32CubeIDE:

Right-click your project → Properties → C/C++ General → Paths and Symbols → Includes
Add the following (if not present):

  • ${ProjDirPath}/Drivers/STM32N6xx_HAL_Driver/Inc
  • ${ProjDirPath}/Drivers/CMSIS/Device/ST/STM32N6xx/Include
  • ${ProjDirPath}/Drivers/CMSIS/Include

Any custom middleware paths like:

  • ${ProjDirPath}/AI_bsp/Camera_Middleware/inc
  • ${ProjDirPath}/AI_bsp/Camera_Middleware/STM32N6570-DK/inc

 

Ensure stm32n6570_discovery_conf.h Exists:
Search your original project for the file stm32n6570_discovery_conf.h and copy it to the appropriate location, for example: <YourProject>/AI_bsp/Camera_Middleware/STM32N6570-DK/inc/
If it's board-specific, you might also need to copy:

  • stm32n6570_discovery.c
  • stm32n6570_discovery.h

Make sure these are added to your project and paths are included

 

You can also:

  • Do a Project > Clean
  • Then Project > Build

Have a good day


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.

My problem has not been solved yet.Several files in the compilation project report the error "unknown type name 'HAL_StatusTypeDef'". When pressing F3, the definition can be seen. Redefining it in other .h files results in a duplicate definition error. I don't know what the reason is?Could you please show me? I'm really confused right now.

dianzijun_0-1749191612674.png

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:880:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

880 | HAL_StatusTypeDef HAL_SYSCFG_ReEnableWritePostingErrorCapture(void);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:892:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

892 | HAL_StatusTypeDef HAL_SYSCFG_GetWriteQosNP1(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:894:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

894 | HAL_StatusTypeDef HAL_SYSCFG_GetReadQosNP1(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:897:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

897 | HAL_StatusTypeDef HAL_SYSCFG_GetWriteQosNP2(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:899:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

899 | HAL_StatusTypeDef HAL_SYSCFG_GetReadQosNP2(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:902:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

902 | HAL_StatusTypeDef HAL_SYSCFG_GetwriteQosCPUSS(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:904:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

904 | HAL_StatusTypeDef HAL_SYSCFG_GetReadQosCPUSS(uint32_t *pQosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:933:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

933 | HAL_StatusTypeDef HAL_SYSCFG_ConfigVDDIOCompensationCell(uint32_t Selection, uint32_t Code,

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:936:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

936 | HAL_StatusTypeDef HAL_SYSCFG_GetVDDIOCompensationCell(uint32_t Selection, const uint32_t *pCode, uint32_t *pNmosValue,

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:945:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

945 | HAL_StatusTypeDef HAL_SYSCFG_ConfigVDDCompensationCell(uint32_t Code, uint32_t NmosValue, uint32_t PmosValue);

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

C:/Users/dell/Desktop/n6touchgfx/MyApplication/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx_hal.h:950:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'HAL_TIM_StateTypeDef'?

950 | HAL_StatusTypeDef HAL_SYSCFG_GetVDDCompensationCell(uint32_t Code, uint32_t *pNmosValue,

| ^~~~~~~~~~~~~~~~~

| HAL_TIM_StateTypeDef

make[1]: *** [STM32Cube_FW_N6/Drivers/BSP/STM32N6570-DK/src/subdir.mk:31: STM32Cube_FW_N6/Drivers/BSP/STM32N6570-DK/src/stm32n6570_discovery.o] Error 1

make: *** [makefile:115: all] Error 2

"make -j20 all" terminated with exit code 2. Build might be incomplete.

 

14:21:53 Build Failed. 523 errors, 11 warnings. (took 24s.913ms)

 

 

Hello @dianzijun,

HAL_StatusTypeDef is declared and defined in the file stm32n6xx_hal_def.h.

This file is located in <your_project>/Drivers/STM32N6xx_HAL_Driver/Inc/stm32n6xx8hal_def.h.

Did you include <your_project>/Drivers/STM32N6xx_HAL_Driver/Inc on "Paths and Symbols" under the "Includes" window?

  • Right click on your project in STM32CubeIDE

JulianE_0-1749199772871.png

  • Click properties
  • Go to C / C++ general
  • Path and includes

JulianE_1-1749199931360.png

  • Add the path to the files missing, for example: <your_project>/Drivers/STM32N6xx_HAL_Driver/Inc
  • (You may have to add others)

 

If this is already set or does not work, you may try ask this forum board in the meantime: STM32 MCUs Software development tools - STMicroelectronics Community

 

 

Havea 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.

Sorry, it hasn't been resolved yet. I can send the file to you. Could you please take a look and let me know if there are any issues? I've been stuck like this for a week and I'm really grateful to you.