2021-10-23 03:51 PM
Hi everyone,
I have a noob question regarding using "printf" on STM32F4 boards. I found a library made by Shawn Hymel which will let me use the function "printf" to the serial port:
The error I'm getting is shown in the attached image named "stm32_error". The image "stm32_structure" shows how I successfully excluded "syscalls.c" like the tutorial suggested. I'm also uploading the main CPP file for my project, in case I missed any errors there.
The library seems really convenient, but it is based off <stdio.h>, and I'm using C++. I think there shouldn't be a problem, since a few forum posts I've found stated that <stdio.h> is backwards compatible with C++. I still can't explain the error though.
Anyway, thank you for your support.
2021-10-23 04:19 PM
The error says RetargetInit is not defined. Do you define it somewhere? If it's in a C++ file, you'll need to declare it as extern "C".
extern "C" {
void RetargetInit(...) {
...
}
}