This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

cmake sample

Hi,

As of now we are using SEGGER Embedded Studio for compilation and Flashing.

Now we would like to copile using Cmake tool, can you please provide template Cmake for any of the existing any of the example project so that I can look into it and build for our project.

Thanks in advance

Parents
  • Hi again! Here is a template.

    Best regards,

    Heidi

  • Hi Heidi,

    Thank you for your response. I have modified the above temple for ble_app_blinky in SDK-15.3 version.

    I have installed arm-none-eabi on my laptop which is running on Windows 10 OS and below variable definitions  I have added in Environment variables.

    ARM_NONE_EABI_TOOLCHAIN_PATH = C:\Program Files (x86)\GNU Tools Arm Embedded\9 2019-q4-major

    CC = C:\Program Files (x86)\GNU Tools Arm Embedded\9 2019-q4-major\bin\arm-none-eabi-gcc.

    I am getting the below error 

    Here is my modified CMakeLists.txt file

    Log files

    Please advice me on my running the Cmake step and how to fix the above issue.

    Thanks,

    Kulkarni

     

  • Hi Heidi,

    Thank you for the response. Also I need  CMAKE_CXX_FLAGS as I am including some C++ files.

  • Hi, in addition to the previous CMakeLists.txt, I'm including the following file to setup the toolchain:

    Not sure if everything is needed, but at least make sure that the arm-none-eabi include directories are included, similar to the last 5 lines above

  • Hi Stian,

    Thanks for your response. 

    Now C and C++ compilers are identified.

    But getting below error

    segger_rtt/SEGGER_RTT_Syscalls_SES.c:75:10: fatal error: __libc.h: No such file or directory

    When I looked into Segger installation folder 

    C:\Program Files\SEGGER\SEGGER Embedded Studio for ARM 4.10\include

    we can find __libc.h file

    but in the ARM tool chain installation which I am using doesn't have __libc.h file

    C:\Program Files (x86)\GNU Tools Arm Embedded\9 2019-q4-major\arm-none-eabi\include.

    Please advice how to fix this.

  • Looks like I need to use SEGGER_RTT_Syscalls_GCC.c.

  •  Building ASM object BLE/nRF52/modules/CMakeFiles/MODULES.dir/nrfx/mdk/gcc_startup_nrf52.S.obj

    gcc_7_2_1\tools\bin\arm-none-eabi-as.exe: unrecognized option `-BOARD_PCA10040'

    I don't know while compiling asm code getting this error.

    Any suggestions would be grateful!

Reply
  •  Building ASM object BLE/nRF52/modules/CMakeFiles/MODULES.dir/nrfx/mdk/gcc_startup_nrf52.S.obj

    gcc_7_2_1\tools\bin\arm-none-eabi-as.exe: unrecognized option `-BOARD_PCA10040'

    I don't know while compiling asm code getting this error.

    Any suggestions would be grateful!

Children