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.

  • I had to fall back to the 4.4.0 SDK to support the read only softdevice in my chips. I'm not sure if the newer SDK would change the problem I am facing or not but still working on it.

    I'd still like to see a single working GCC compatible makefile for any of the examples that interface with the soft device. Maybe it is possible but so far I have not been able to get an ANT example to work outside of Keil.

    I understand the theory of what you suggest is correct, but have you actually been able to make a makefile build a working binary with GCC?

  • I'm sorry, but I forgot one essential part of my previous answer. In SDKs before version 5.0.0 (i.e. all that work with revision C0/CA), the ANT header files are not on the right format. Take a look at this for information on what you need to change: https://devzone.nordicsemi.com/index.php/how-to-set-up-a-project-with-eclipse-for-the-nrf51422

  • First Nikita, Ole, thank you for your patience in helping me.

    Second, I confused things because at first I did not know I was facing more than one mistake / problem. The silicon I have requires the older SDK, 4.4. But I believe I will get newer silicon very soon. . So forgive me for confusing the matter but I was confused. Makefiles should work for either SDK version but should be slightly easier for SDK 5 because the SVCALL definition issue has been fixed.

    Third, Nikita I tried your sample makefile and either I have another mistake somewhere else or it has issues. I went into the example folder you referenced and created a "gcc" folder. I created a makefile in that folder and copy and pasted the text from your post into the makefile and got errors about redefining printf and implicitly defined function so probably just an include issue.

    Fourth (and finally), I did successfully create (with the help of a much smarter coworker) a makefile for the ant broadcast tx example. I created a makefile in a subfolder named gcc and here are the contents:

    TARGET_CHIP := NRF51822_QFAA_C0
    BOARD := BOARD_PCA10003
    
    C_SOURCE_FILES += main_broadcast_tx.c
    C_SOURCE_FILES += nrf_delay.c
    #C_SOURCE_FILES += system_nrf51422.c
    
    INCLUDEPATHS += -I"../include"
    INCLUDEPATHS += -I"../../../../../../Include/s210"
    INCLUDEPATHS += -I"../../../../../../Include/app_common"
    
    OUTPUT_FILENAME := main_broadcast_gcc
    SDK_PATH = ../../../../../../
    
    
    #Uncomment correct line if you have softdevice programmed on the chip.
    DEVICE_VARIANT := xxaa
    #DEVICE_VARIANT := xxab
    
    #USE_SOFTDEVICE := S110
    USE_SOFTDEVICE := S210
    
    include $(SDK_PATH)Source/templates/gcc/Makefile.common
    

    This of course assumes that you have done all the steps necessary for gcc compilation (installed GCC, modified the makefile with the windows information, set up the environment variables, etc).

    I have not tested the resulting binary in hardware because I lack silicon that supports SDK5. But I might end up porting it to 4.4 and will update if I do.

    Thanks again David

Related