Skip to main content
Visitor II
July 10, 2023
Question

linker claims "undefined reference to osTimerCreate()" despite #include "cmsis_os.h"

  • July 10, 2023
  • 1 reply
  • 1065 views

Hello,

I am setting up just a simple task with a timer in CMSIS V.2 that triggers a periodic call of a callback function.
Despite the fact that I am including "cmsis_os.h", which is part of my project, I get the linker error "undefined reference to `osTimerCreate'".

Does anybody have an idea other than "switch to CMSIS V.1"?

Thanks in advance
Wilfried

    This topic has been closed for replies.

    1 reply

    Graduate II
    July 10, 2023

    An include file typically ISN'T CODE, it describes the interface expectations, find the file with the backing source code for the function, and add that to the project.

    WPles.1Author
    Visitor II
    July 10, 2023

    thanks, Tesla DL, but the root of the problem was that I was mislead to CMSIS 1, when I was googling for osTimerDef at Keil. The 'osTimeCreate' function was replaced by 'osTimeNew' in CMSIS 2.

    Thanks for your willingness to support,
    Wilfried