Skip to main content
BFaru.1
Associate II
April 2, 2023
Solved

I am trying to run my project using X-CUBE-AI library and its throwing me this error. I am using B-U585I-IOT02A discovery kit. "/STM32CubeIDE_1.10.0/Major Project/Debug/../X-CUBE-AI/App/app_x-cube-ai.c:61: undefined reference to `MX_USART1_UART_Init

  • April 2, 2023
  • 2 replies
  • 2123 views

..

    Best answer by fauvarque.daniel

    If you look in the project I sent this function is defined in the main.c.

    It means that you probably disabled in MX the USART1 that is needed to communicate back with the PC.

    Just rectify your main.c and add the the USART/CRC/GPIO init from the ones I sent in the project.

    Regards

    2 replies

    fauvarque.daniel
    ST Employee
    April 3, 2023

    Here is a System Performance project for the B-U585I-IOT02A as a reference.

    Maybe your network was not understood by X-CUBE-AI that causes code generation issues.

    Regards

    BFaru.1
    BFaru.1Author
    Associate II
    April 3, 2023

    This is the code snippet in app_x-cube-ai.c file which is throwing an error. It says undefined reference to `MX_USART1_UART_Init'. Can you please explain how to solve it?

    0693W00000bhPVmQAM.png

    Associate
    December 12, 2024

    same error with me , for some reason in the main.c the MX_USART1_UART_Init(void) function was declared as static , limiting its visibility to only the main.c file , so the app_x-cube-ai.c file cannot see it 

    fauvarque.daniel
    fauvarque.danielBest answer
    ST Employee
    April 3, 2023

    If you look in the project I sent this function is defined in the main.c.

    It means that you probably disabled in MX the USART1 that is needed to communicate back with the PC.

    Just rectify your main.c and add the the USART/CRC/GPIO init from the ones I sent in the project.

    Regards