CMake support for RAK5205 WisTrio

Hello Everyone,

I’m delighted to share my work on the addition of CMake utility to build the firmware for WisTrio board without the use of any proprietary IDE link Keil. The resulting firmware from CMake can be flashed using stm32flash opensource utility.

Following is the link to my tree: https://github.com/Mani-Sadhasivam/RAK5205-WisTrio-LoRa/tree/cmake

Instructions for building and flashing the firmware has been provided in README itself.

Note You need to have recent version of CMake (>3.13) and stm32flash utilities.

Finally a blog which describes the work: https://www.96boards.org/blog/wistrio-cmake/

Hope that this will benefit the entire WisTrio community.

PS: The CMake support added is an initial one and the community is more welcome to improvise it!

Thanks,
Mani

1 Like

Hi, Mani

That’s great!
It is very useful for developers to use RAK5205, because Keil has a limited size and so expensive.:grinning:

Actually, we’ve tested your cmake project, and it works well. Really thank you!

BTW, i have another idea, do you think there is any chance that this cmake project can work with VS code? even if work with PlatformIO.

Hi @Fomi,

Sorry, I don’t have any knowledge about these. The goal of this project is to remove any dependency with IDE’s and provide users a more opensource friendly way of building and flashing the firmware.

Hi @mani,

First I want to thank you for sharing your helpful work. I have been trying to compile the Keil firmware using your CMake utility in Ubuntu 18.04. I can compile the firmware for high frequency boards but fail to do the compilation for lower frequency boards. I adjust the target board by commenting/un-commenting the right target board within the CMakeLists.txt file:

#add_definitions( -DLORA_LF_BOARD=1 )
add_definitions( -DLORA_HF_BOARD=1 )

I do not see any errors during the execution of ‘cmake -DCMAKE_TOOLCHAIN_FILE=…/toolchain.cmake …’

and this is the end-log (I have only copied the problematic part) that I get once I try to ‘make’ the project for LF-boards:

[ 61%] Building ASM object src/board/RAK811/cmsis/CMakeFiles/cmsis.dir/arm-gcc/startup_stm32l1xx_md.s.obj
/usr/bin/arm-none-eabi-as: invalid option – ‘O’
src/board/RAK811/cmsis/CMakeFiles/cmsis.dir/build.make:62: recipe for target ‘src/board/RAK811/cmsis/CMakeFiles/cmsis.dir/arm-gcc/startup_stm32l1xx_md.s.obj’ failed
make[2]: *** [src/board/RAK811/cmsis/CMakeFiles/cmsis.dir/arm-gcc/startup_stm32l1xx_md.s.obj] Error 1
CMakeFiles/Makefile2:176: recipe for target ‘src/board/RAK811/cmsis/CMakeFiles/cmsis.dir/all’ failed
make[1]: *** [src/board/RAK811/cmsis/CMakeFiles/cmsis.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2

I will be very thankful if you could help me with this issue.