Ok, so the reason is the name mangling of C++.
As my interrupt handlers use C++, I needed to rename the stm32wlxx_it.c
(generated by Stm32CubeMx) file to stm32wlxx_it.cpp
. This invokes the C++ compiler, but also mangles the names of the functions. Doing nm stm32wlxx_it.o
revealed that the actual name of function in the object file is _Z17USART1_IRQHandlerv
.
When you declare the function in stm32wlxx_it.h
it is no longer mangled : if you create the project as C++ project in STM32CubeMx, it will automatically add extern "C"
around the declarations.