Skip to main content
Associate
August 4, 2026
Solved

Trouble at generationg code with my .onnx model

  • August 4, 2026
  • 3 replies
  • 45 views

In file included from Middlewares/ST/AI/Misc/Src/ai_device_adaptor.c:19:
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:655:8: error: unknown type name 'UART_HandleTypeDef'; did you mean 'DMA_HandleTypeDef'?
  655 | extern UART_HandleTypeDef UartHandle;
      |        ^~~~~~~~~~~~~~~~~~
      |        DMA_HandleTypeDef

Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_get':
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:664:12: error: implicit declaration of function 'HAL_UART_Receive' [-Wimplicit-function-declaration]
  664 |   status = HAL_UART_Receive(&UartHandle, (uint8_t *)c, 1, timeout);
      |            ^~~~~~~~~~~~~~~~

Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_write':

Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:676:12: error: implicit declaration of function 'HAL_UART_Transmit' [-Wimplicit-function-declaration]
  676 |   status = HAL_UART_Transmit(&UartHandle, buff, count, HAL_MAX_DELAY);
      |            ^~~~~~~~~~~~~~~~~

make: *** [Makefile:188: build/ai_device_adaptor.o] Error 1
make: *** Waiting for unfinished jobs....

In file included from Middlewares/ST/AI/Misc/Inc/aiTestUtility.h:27,
                 from Middlewares/ST/AI/Misc/Src/aiTestUtility.c:81:
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:655:8: error: unknown type name 'UART_HandleTypeDef'; did you mean 'DMA_HandleTypeDef'?
  655 | extern UART_HandleTypeDef UartHandle;
      |        ^~~~~~~~~~~~~~~~~~
      |        DMA_HandleTypeDef

Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_get':
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:664:12: error: implicit declaration of function 'HAL_UART_Receive' [-Wimplicit-function-declaration]
  664 |   status = HAL_UART_Receive(&UartHandle, (uint8_t *)c, 1, timeout);
      |            ^~~~~~~~~~~~~~~~

Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_write':

Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:676:12: error: implicit declaration of function 'HAL_UART_Transmit' [-Wimplicit-function-declaration]
  676 |   status = HAL_UART_Transmit(&UartHandle, buff, count, HAL_MAX_DELAY);
      |            ^~~~~~~~~~~~~~~~~

In file included from Middlewares/ST/AI/Misc/Inc/aiTestUtility.h:27,
                 from Middlewares/ST/AI/Misc/Src/aiTestHelper_ST_AI.c:33:
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:655:8: error: unknown type name 'UART_HandleTypeDef'; did you mean 'DMA_HandleTypeDef'?
  655 | extern UART_HandleTypeDef UartHandle;
      |        ^~~~~~~~~~~~~~~~~~
      |        DMA_HandleTypeDef

make: *** [Makefile:188: build/aiTestUtility.o] Error 1

Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_get':
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:664:12: error: implicit declaration of function 'HAL_UART_Receive' [-Wimplicit-function-declaration]
  664 |   status = HAL_UART_Receive(&UartHandle, (uint8_t *)c, 1, timeout);
      |            ^~~~~~~~~~~~~~~~

Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_write':

Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:676:12: error: implicit declaration of function 'HAL_UART_Transmit' [-Wimplicit-function-declaration]
  676 |   status = HAL_UART_Transmit(&UartHandle, buff, count, HAL_MAX_DELAY);
      |            ^~~~~~~~~~~~~~~~~

make: *** [Makefile:188: build/aiTestHelper_ST_AI.o] Error 1

Run failed: Error: Build process exited with code 2. 
Error log: In file included from Middlewares/ST/AI/Misc/Src/ai_device_adaptor.c:19:
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:655:8: error: unknown type name 'UART_HandleTypeDef'; did you mean 'DMA_HandleTypeDef'?
  655 | extern UART_HandleTypeDef UartHandle;
      |        ^~~~~~~~~~~~~~~~~~
      |        DMA_HandleTypeDef
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_get':
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:664:12: error: implicit declaration of function 'HAL_UART_Receive' [-Wimplicit-function-declaration]
  664 |   status = HAL_UART_Receive(&UartHandle, (uint8_t *)c, 1, timeout);
      |            ^~~~~~~~~~~~~~~~
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_write':
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:676:12: error: implicit declaration of function 'HAL_UART_Transmit' [-Wimplicit-function-declaration]
  676 |   status = HAL_UART_Transmit(&UartHandle, buff, count, HAL_MAX_DELAY);
      |            ^~~~~~~~~~~~~~~~~
make: *** [Makefile:188: build/ai_device_adaptor.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from Middlewares/ST/AI/Misc/Inc/aiTestUtility.h:27,
                 from Middlewares/ST/AI/Misc/Src/aiTestUtility.c:81:
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:655:8: error: unknown type name 'UART_HandleTypeDef'; did you mean 'DMA_HandleTypeDef'?
  655 | extern UART_HandleTypeDef UartHandle;
      |        ^~~~~~~~~~~~~~~~~~
      |        DMA_HandleTypeDef
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_get':
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:664:12: error: implicit declaration of function 'HAL_UART_Receive' [-Wimplicit-function-declaration]
  664 |   status = HAL_UART_Receive(&UartHandle, (uint8_t *)c, 1, timeout);
      |            ^~~~~~~~~~~~~~~~
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_write':
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:676:12: error: implicit declaration of function 'HAL_UART_Transmit' [-Wimplicit-function-declaration]
  676 |   status = HAL_UART_Transmit(&UartHandle, buff, count, HAL_MAX_DELAY);
      |            ^~~~~~~~~~~~~~~~~
In file included from Middlewares/ST/AI/Misc/Inc/aiTestUtility.h:27,
                 from Middlewares/ST/AI/Misc/Src/aiTestHelper_ST_AI.c:33:
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:655:8: error: unknown type name 'UART_HandleTypeDef'; did you mean 'DMA_HandleTypeDef'?
  655 | extern UART_HandleTypeDef UartHandle;
      |        ^~~~~~~~~~~~~~~~~~
      |        DMA_HandleTypeDef
make: *** [Makefile:188: build/aiTestUtility.o] Error 1
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_get':
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:664:12: error: implicit declaration of function 'HAL_UART_Receive' [-Wimplicit-function-declaration]
  664 |   status = HAL_UART_Receive(&UartHandle, (uint8_t *)c, 1, timeout);
      |            ^~~~~~~~~~~~~~~~
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h: In function 'port_io_write':
Middlewares/ST/AI/Misc/Inc/ai_device_adaptor.h:676:12: error: implicit declaration of function 'HAL_UART_Transmit' [-Wimplicit-function-declaration]
  676 |   status = HAL_UART_Transmit(&UartHandle, buff, count, HAL_MAX_DELAY);
      |            ^~~~~~~~~~~~~~~~~
make: *** [Makefile:188: build/aiTestHelper_ST_AI.o] Error 1

Best answer by EsmanurJK

Hi, 
I solved the problem bu using X CUbe-AI package on Cube Mx. 

Thanks for attention. 
Esmanur 

3 replies

Julian E.
ST Technical Moderator
August 7, 2026

HI ​@EsmanurJK,

 

Could you please provide more context on what you are doing?

Which board are you using?

These are the logs when you click Run I suppose?

 

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.
EsmanurJKAuthorBest answer
Associate
August 7, 2026

Hi, 
I solved the problem bu using X CUbe-AI package on Cube Mx. 

Thanks for attention. 
Esmanur 

Julian E.
ST Technical Moderator
August 10, 2026

Hi  ​@EsmanurJK,

 

I’m glad you solved your issue.

For X Cube AI, this is not recommended to use it as it is deprecated.


We now have a new tool called STM32CubeAI Studio: STM32Cube AI Studio- The next-gen stand-alone tool for embedded AI - STMicroelectronics

 

This is simpler to use and should help you avoid potential issues that you may encounter with X Cube AI 

 

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.