Skip to main content
Visitor II
October 9, 2024
Question

called object is not a function or function pointer in stm32f103xb.h

  • October 9, 2024
  • 2 replies
  • 1337 views

Hi, 

when i try to build my current project i get: called object is not a function or function pointer in the stm32f103xb.h for whatever peripheral i use. For example 

 

stm32f103xb.h:657:29: error: called object is not a function or function pointer

657 | #define I2C2 ((I2C_TypeDef *)I2C2_BASE)

 

even though it appears to be properly defined in stm32f103xb.h.

any ideas why this happens?

 

thanks in advance

 

MCU: STM32f103C8T6

CubeIDE Version: 1.16.1

    This topic has been closed for replies.

    2 replies

    Super User
    October 9, 2024

    One or more of the above identifiers are probably defined elsewhere in your code with a different meaning. Try to start with a minimal project including stm32f103xb.h only. You may also use your IDE search functions or grep or such to find all occurences of those identifiers in your project

    hth

    KnarfB

    Graduate II
    October 10, 2024

    Check stm32f1xx_hal_conf.h is pulling in I2C modules via the defines.