We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I use CLion to write my code, and uVision to compile and flash the device. I want to integrate the compiling and flashing process to CLion (CMake).
I integrated ARMclang successfully in CMake.
How can I link and create the binary .hex with fromELF.exe? Does anyone have already set up a full toolchain to replace uVision?
Hi devnewb B..,
unfortunately, I forfeited my vision to compile in a CMake environment using the Keil Toolchain.
Reason:
- no support from Keil side (no sample project providing a CMake File that compiles with ARMClang)
- limited time I wanted to investigate in this topic.
My compiling worked, but fixxing the linking was the start of the end.
My results:
You need to have a Toolchain.cmake file which you embedded in your CMake "-DCMAKE_TOOLCHAIN_FILE=Toolchain.cmake"
*Toolchain.cmake*SET(CMAKE_SYSTEM_NAME Generic)SET(CMAKE_SYSTEM_PROCESSOR cortex-m4) # The name of the cpu #Compiler SetupSET(ARMCLANG_PATH "${KEIL_PATH}/ARM/ARMCLANG")SET(CMAKE_C_COMPILER "${ARMCLANG_PATH}/bin/armclang.exe")SET(CMAKE_CXX_COMPILER ${CMAKE_C_COMPILER})#CompilerSettingsSET(CXX_COMPILER_OPTIONS "<copyhere all options from Keil uVision5 -> options for target -> C/c++ -> compiler string control") SET(C_COMPILER_OPTIONS "-std=gnu99 ${CXX_COMPILER_OPTIONS}")SET(CMAKE_C_FLAGS ${C_COMPILER_OPTIONS})SET(CMAKE_CXX_FLAGS ${CXX_COMPILER_OPTIONS})SET(CMAKE_LINKER "${ARMCLANG_PATH}/bin/armlink.exe")SET(FROMELF "${ARMCLANG_PATH}/bin/fromelf.exe")
If you have any success with linking, please share it