4 days, 20 hours ago.
How to compile mbed library from source files?
I was facing an issue on STM Nucleo F103RB board with combination of SPI and PWM not working together in a specific case. To debug the issue, I decided to download the source files and compile those instead of using the pre-compiled mbed library. Surprisingly, the issue was not present when using the source files.
So, my guess is that something is going wrong in the way the mbed library is being compiled. To reproduce that on my end, I installed the mbed CLI tool and used the following command:
mbed compile -target NUCLEO_F103RB -toolchain GCC_ARM -v -library -build ..\mbed-rev144-lib
But when I use the generated '.a' file, nothing is working at all. Even a simple GPIO toggle program is not giving any output on the hardware.
Can anyone tell what is the correct way of compiling mbed library from source files?
3 days, 10 hours ago.
Hello, You're missing a few "-"s but since you were able to generate the .a file, you might have dropped those when you typed the question.
Any way, this is how I do it:
target NUCLEO_F103RB toolchain GCC_ARM -v library build ../mbed-rev144-lib
If you use this command, the library generated from the latest source code will be Mbed OS 5 release. Are you expecting Mbed OS 2? It probably won't work if the rest of your code is compatible with OS 2.
Also, it should be easier to debug if you build your code and Mbed OS source code together.
mbed compile -m NUCLEO_F103RB -t GCC_ARM
To post an answer, please log in.