2025-06-04 11:35 PM - last edited on 2025-06-05 1:43 AM by Andrew Neil
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:
After the transplantation was completed, an error occurred:
./../../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.
Solved! Go to Solution.
2025-06-05 1:20 AM
Hello @dianzijun,
When you copied files from the model training project to your TouchGFX-based CubeIDE project, you likely:
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:
Go to Project Properties in STM32CubeIDE:
Right-click your project → Properties → C/C++ General → Paths and Symbols → Includes
Add the following (if not present):
Any custom middleware paths like:
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:
Make sure these are added to your project and paths are included
You can also:
Have a good day
2025-06-05 1:20 AM
Hello @dianzijun,
When you copied files from the model training project to your TouchGFX-based CubeIDE project, you likely:
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:
Go to Project Properties in STM32CubeIDE:
Right-click your project → Properties → C/C++ General → Paths and Symbols → Includes
Add the following (if not present):
Any custom middleware paths like:
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:
Make sure these are added to your project and paths are included
You can also:
Have a good day
2025-06-05 11:49 PM
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.
| 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)
2025-06-06 1:53 AM
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?
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
2025-06-06 6:51 PM