Skip to main content
Associate
March 19, 2024
Question

Errors galore after updating STM32CubeIDE

I updated to the STM32CubeIDE 1.15 WIN, and since then my project has thrown up 100+ errors. It doesn't recognise "u_char" or "uint" or "caddr_t". 

 

It throws up error "expected ')' before 'GPIO_TypeDef'" in the below statement : 

void Write_MFRC522(u_char, u_char, GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);

 

I have cleaned and built the project several times, how do I fix this?

    This topic has been closed for replies.

    6 replies

    Ghofrane GSOURI
    ST Technical Moderator
    March 19, 2024

    Hello @Abhesheksh 

    First let me thank you for posting.

    I would appreciate it if you could provide your project for further investigation.

    I will be waiting for your feedback.

    THX

    Ghofrane

    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.
    Associate
    March 19, 2024

    I have attached the full project. Please help.

    Andrew Neil
    Super User
    March 19, 2024

    @Abhesheksh wrote:

    my project has thrown up 100+ errors. It doesn't recognise "u_char" or "uint" or "caddr_t". 

    It throws up error "expected ')' before 'GPIO_TypeDef'" 


    That typically happens when there is one error early on in your code, and that one error is the cause of all the rest.

    So the thing to do is to go to the very first reported error - most likely, a missing or not-found header.

    "u_char" or "uint" or "caddr_t" are not standard types, so they must be defined somewhere in your code - presumably a header?

    And, presumably, that header is not being found?

    Clearly, that will cause every single use of any of these types anywhere in your code to fail - and you can see how that will quickly lead to loads of errors from just the one problem.

     

    EDIT:

    Here's an example of how just fixing the first-reported issue will actually solve multiple errors:

    https://community.st.com/t5/stm32-mcus-machine-learning-ai/identifier-quot-ai-ai-data-activation-1-size-quot-is-undefined/m-p/652055/highlight/true#M2018

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Andrew Neil
    Super User
    March 19, 2024

    go to the very first reported error

    You need to look in the build console output - not in the 'Problems' list:

    AndrewNeil_0-1710845578750.png

     

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    TDK
    March 19, 2024

    "u_char" is not a standard type. Find out where you're defining it, or use standard types like uint8_t or unsigned char instead.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    Pavel A.
    March 19, 2024

    > so they must be defined somewhere in your code - presumably a header?

    The simplest way to fix this IMHO is to create a small .h file somewhere and "inject" it into  compilation using GCC/G++ option -include "yourfile.h"

    #pragma once
    typedef unsigned char u_char;
    typedef unsigned int uint;
    typedef void *caddr_t;