Actually I was wrong about it, the function is defined in a
.cpp file and not a
.c file as I originally thought
./variants/BLACK_F407XX/variant.cpp:WEAK void SystemClock_Config(void)
So not adding extern “C” (explanation) is actually correct.
This is weird but still correct if the header file is only included once by one
.cpp file. If the header file is not included then the function is also not compiled. However, adding this function directly to
main.cpp should also work. What error did it throw?
This is expected since on reset, the MCU stops the USB peripheral, your computer gets a disconnect for that USB device, the serial monitor gets a “closed port” error. There is no way known to me which prevents this from happening on a power cycle. You’d have to disconnect and reconnect the serial monitor before and after the reset. That’s why hardware UART ports are kinda neet.