Skip to main content
WPles.1
Associate
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

Tesla DeLorean
Guru
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.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
WPles.1
WPles.1Author
Associate
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