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

Why are GCC makefiles not provided for ANT samples?

I am starting development on the nRF51422. I noticed that for the non-ANT sample code (blinky and UART), a gcc makefile and windows batch files are provided for compilation and flashing. But for all the ANT sample code, only Keil project files are provided. I tried reinstalling the SDK and double checking to see if their were gcc options I missed.

Is there a reason I should be concerned with gcc / eclipse development for Ant? I don't mind paying for Keil if necessary but I prefer the flexibility of gcc + makefile for cross platform build hosts and for build servers to do daily builds.

Can anyone point me to a sample makefile for the one of the ANT demos? Thanks, David

Edit: On further research, it appears that it is a soft device issue. I looked through my downloads and it all the nRF51422 SDK's I have access to state explicitly that they only support soft device "QFAADA" but my chip is QFAAC0. Can someone please point me to the correct SDK for this chip?

Thank you, David Smoot.

  • You can easily modify makefile from blinky project to any ant project. For example this is makefile for blinky project:

    TARGET_CHIP := NRF51822_QFAA_CA
    BOARD := BOARD_NRF6310
    
    C_SOURCE_FILES += main.c
    C_SOURCE_FILES += nrf_delay.c
    
    
    SDK_PATH = ../../../../
    OUTPUT_FILENAME := blinky_gcc
    
    DEVICE_VARIANT := xxaa
    #DEVICE_VARIANT := xxab
    
    #USE_SOFTDEVICE := S110
    #USE_SOFTDEVICE := S210
    
    include $(SDK_PATH)Source/templates/gcc/Makefile.common
    
    

    And you want to change it for \s210\ant_bicycle_comb_spd_cad\sensor\ project. I think TARGET_CHIP has no use for compiler but just fix it to your chip. Change SDK path. You need to uncomment USE_SOFTDEVICE := S210 option. Change outpit filename OUTPUT_FILENAME := ant_combined_bicycle_speed_and_cadence_sensor_gcc And lastly you need to open example keil project: \nRF51 SDK_v5.1.0.36092\Nordic\nrf51422\Board\nrf6310\s210\ant_bicycle_comb_spd_cad\sensor\arm\ant_combined_bicycle_speed_and_cadence_sensor.uvproj and you need to take out all the necessary source files for the project and also include paths from keil project properties needed for this project. Final makefile will be like this:

    TARGET_CHIP := NRF51422_QFAA_DA
    BOARD := BOARD_NRF6310
    
    C_SOURCE_FILES += main.c
    C_SOURCE_FILES += main_cbsc_tx.c
    C_SOURCE_FILES += cbsc_tx.c
    C_SOURCE_FILES += retarget.c
    C_SOURCE_FILES += ../../../../../../Source/app_common/app_timer.c
    C_SOURCE_FILES += ../../../../../../Source/app_common/app_uart_fifo.c
    C_SOURCE_FILES += ../../../../../../Source/app_common/app_fifo.c
    C_SOURCE_FILES += ../../../../../../Source/app_common/app_gpiote.c
    
    INCLUDEPATHS += -I"../include"
    INCLUDEPATHS += -I"../../../../../../Include/s210"
    INCLUDEPATHS += -I"../../../../../../Include/app_common"
    
    SDK_PATH = ../../../../../../
    OUTPUT_FILENAME := ant_combined_bicycle_speed_and_cadence_sensor_gcc
    
    DEVICE_VARIANT := xxaa
    #DEVICE_VARIANT := xxab
    
    #USE_SOFTDEVICE := S110
    USE_SOFTDEVICE := S210
    
    include $(SDK_PATH)Source/templates/gcc/Makefile.common
    
    

    state explicitly that they only support soft device "QFAADA" but my chip is QFAAC0

    Where did you find this?

  • Thanks for the reply. To answer your question, If I log into the Nordicsemi.com "my pages" login and go to my downloads and click on the download for the 5.1.0 SDK, I get the following pop up:

    Please notice: nRF51 SDK v5.x.0 has tailored for, thus supports only the following devices:- nRF51822 QFAAGC- nRF51422 QFAADA Supported SoftDevices:- S110 V6.0.0 Supported boards: - PCA10000 v1.0 (Only for use with Master Emulator)

    • PCA10000 v2.1.0 and 2.2.0
    • PCA10001 v2.1.0 and 2.2.0
    • PCA10004 v2.1.0
    • PCA10005 v2.1.0

    We encourage customers that are running on older hardware or SoftDevices to use latest SDK v4.4.x For migration to SDK v5.x, please see: nWP-018 Migrating to the latest nRF51822 chip version

  • I think Nikita have answered the original question here brilliantly, so I'd recommend you to accept her answer.

    For access to previous SDK versions, take a look at this question. Be aware that this information is also stated in the release notes for the SDK, which you should always read when downloading a new SDK.

  • Trying with the ant_broadcast_tx sample.

    Nikita's Makefile edits appear to have helped find the right headers, however they seem to be in

    $(SDK_PATH)Include/ant/softdevice

    not

    $(SDK_PATH)Include/s210

    Then the compiler croaks on all usage of the SVCALL macro in all of these headers, as gcc does not have a __svc keyword.

    "E:/Downloads/gcc-arm-none-eabi-4_8-2013q4-20131204-win32/bin/arm-none-eabi-gcc" -mcpu=cortex-m0 -mthumb -mabi=aapcs -DNRF51 -DBOARD_NRF6310 -DNRF51822_QFAA_C0 --std=gnu99 -Wall -Werror -mfloat-abi=soft -DNDEBUG -O3 -I../../../../../../Include/app_common -I../../../../../../Include/ant/softdevice -I"../" -I"../../../../../../Include" -I"../../../../../../Include/gcc" -I"../../../../../../Include/ext_sensors" -c -o _build/main_broadcast_tx.o ../main_broadcast_tx.c
    In file included from ../main_broadcast_tx.c:37:0:
    ../../../../../../Include/ant/softdevice/ant_interface.h: In function '__svc':
    ../../../../../../Include/ant/softdevice/ant_interface.h:144:37: error: expected declaration specifiers before 'sd_ant_stack_reset'
     uint32_t SVCALL(SVC_ANT_STACK_INIT) sd_ant_stack_reset (void);
    
    

    I found information on how to call software services using software interrupts from gcc (in order to enter protected mode) but these are not necessarily compatible with the calling convention used to build the softdevice binary already loaded into RAM.

    www.cnblogs.com/.../3052597.html stackoverflow.com/.../cortex-m3-svc-with-gcc-inline-assembly

    Besides, it looks like a Cortex-M0 uses the older SWI instruction for syscalls and not the svc semantics introduced with Cortex-M3 and M4.

    Any ideas? Or is using the Keil compiler required for using these header files.

  • What version of SDK did you use? My example was for nRF51 SDK_v5.1.0.36092. If you using older SDK then you must alter the makefile in accordance with your SDK version example keil project.

Related