<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Why are GCC makefiles not provided for ANT samples?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1378/why-are-gcc-makefiles-not-provided-for-ant-samples</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Jan 2014 22:23:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1378/why-are-gcc-makefiles-not-provided-for-ant-samples" /><item><title>RE: Why are GCC makefiles not provided for ANT samples?</title><link>https://devzone.nordicsemi.com/thread/6243?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2014 22:23:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afe7e7eb-fd3e-43b8-ae46-a1497b9d5df4</guid><dc:creator>David Smoot</dc:creator><description>&lt;p&gt;First Nikita, Ole, thank you for your patience in helping me.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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 &amp;quot;gcc&amp;quot; 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.&lt;/p&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;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&amp;quot;../include&amp;quot;
INCLUDEPATHS += -I&amp;quot;../../../../../../Include/s210&amp;quot;
INCLUDEPATHS += -I&amp;quot;../../../../../../Include/app_common&amp;quot;

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
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;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).&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Thanks again
David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are GCC makefiles not provided for ANT samples?</title><link>https://devzone.nordicsemi.com/thread/6236?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2014 09:20:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94256d55-0c71-4193-ba38-08dd321fd167</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;If you use an SDK version before 5.0.0, you&amp;#39;ll also have use in taking a look at this:
&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/how-to-set-up-a-project-with-eclipse-for-the-nrf51422" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/how-to-set-up-a-project-with-eclipse-for-the-nrf51422&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are GCC makefiles not provided for ANT samples?</title><link>https://devzone.nordicsemi.com/thread/6241?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2014 09:20:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b77f7d47-5047-4fb3-8bc8-e3ce58dc3b07</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;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:
&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/how-to-set-up-a-project-with-eclipse-for-the-nrf51422" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/how-to-set-up-a-project-with-eclipse-for-the-nrf51422&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are GCC makefiles not provided for ANT samples?</title><link>https://devzone.nordicsemi.com/thread/6239?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2014 05:14:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e6ec6bb-289b-4025-b2ab-c5bdad60aeff</guid><dc:creator>David Smoot</dc:creator><description>&lt;p&gt;I had to fall back to the 4.4.0 SDK to support the read only softdevice in my chips.  I&amp;#39;m not sure if the newer SDK would change the problem I am facing or not but still working on it.&lt;/p&gt;
&lt;p&gt;I&amp;#39;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.&lt;/p&gt;
&lt;p&gt;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?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are GCC makefiles not provided for ANT samples?</title><link>https://devzone.nordicsemi.com/thread/6242?ContentTypeID=1</link><pubDate>Sat, 18 Jan 2014 06:46:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff84ab36-ef90-4b48-9845-06bcc19d897c</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are GCC makefiles not provided for ANT samples?</title><link>https://devzone.nordicsemi.com/thread/6240?ContentTypeID=1</link><pubDate>Sat, 18 Jan 2014 02:14:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9638c409-c713-4276-88e1-7c505778792d</guid><dc:creator>David Smoot</dc:creator><description>&lt;p&gt;Trying with the ant_broadcast_tx sample.&lt;/p&gt;
&lt;p&gt;Nikita&amp;#39;s Makefile edits appear to have helped find the right headers, however they seem to be in&lt;/p&gt;
&lt;p&gt;$(SDK_PATH)Include/ant/softdevice&lt;/p&gt;
&lt;p&gt;not&lt;/p&gt;
&lt;p&gt;$(SDK_PATH)Include/s210&lt;/p&gt;
&lt;p&gt;Then the compiler croaks on all usage of the SVCALL macro in all of these headers, as gcc does not have a __svc keyword.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;quot;E:/Downloads/gcc-arm-none-eabi-4_8-2013q4-20131204-win32/bin/arm-none-eabi-gcc&amp;quot; -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&amp;quot;../&amp;quot; -I&amp;quot;../../../../../../Include&amp;quot; -I&amp;quot;../../../../../../Include/gcc&amp;quot; -I&amp;quot;../../../../../../Include/ext_sensors&amp;quot; -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 &amp;#39;__svc&amp;#39;:
../../../../../../Include/ant/softdevice/ant_interface.h:144:37: error: expected declaration specifiers before &amp;#39;sd_ant_stack_reset&amp;#39;
 uint32_t SVCALL(SVC_ANT_STACK_INIT) sd_ant_stack_reset (void);

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.cnblogs.com/shangdawei/archive/2013/04/30/3052597.html"&gt;www.cnblogs.com/.../3052597.html&lt;/a&gt;
&lt;a href="http://stackoverflow.com/questions/16785135/cortex-m3-svc-with-gcc-inline-assembly"&gt;stackoverflow.com/.../cortex-m3-svc-with-gcc-inline-assembly&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Any ideas?  Or is using the Keil compiler required for using these header files.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are GCC makefiles not provided for ANT samples?</title><link>https://devzone.nordicsemi.com/thread/6238?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2014 10:24:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f51bcbdb-93be-490f-a8cd-d60b1674fd37</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I think Nikita have answered the original question here brilliantly, so I&amp;#39;d recommend you to accept her answer.&lt;/p&gt;
&lt;p&gt;For access to previous SDK versions, take a look at &lt;a href="https://devzone.nordicsemi.com/index.php/access-to-earlier-nrf51-sdk-for-ev-kit"&gt;this question&lt;/a&gt;. 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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are GCC makefiles not provided for ANT samples?</title><link>https://devzone.nordicsemi.com/thread/6237?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2014 09:23:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cef54ec-1783-4f62-a7d3-f3882b6cae51</guid><dc:creator>David Smoot</dc:creator><description>&lt;p&gt;Thanks for the reply.  To answer your question, If I log into the Nordicsemi.com &amp;quot;my pages&amp;quot; login and go to my downloads and click on the download for the 5.1.0 SDK, I get the following pop up:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;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)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PCA10000 v2.1.0 and 2.2.0&lt;/li&gt;
&lt;li&gt;PCA10001 v2.1.0 and 2.2.0&lt;/li&gt;
&lt;li&gt;PCA10004 v2.1.0&lt;/li&gt;
&lt;li&gt;PCA10005 v2.1.0&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;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&lt;/p&gt;
&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are GCC makefiles not provided for ANT samples?</title><link>https://devzone.nordicsemi.com/thread/6235?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2014 05:15:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8428a2c2-fb91-453b-8dc4-09bc8270232a</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;You can easily modify makefile from blinky project to any ant project.
For example this is makefile for blinky project:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;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

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;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&amp;quot;../include&amp;quot;
INCLUDEPATHS += -I&amp;quot;../../../../../../Include/s210&amp;quot;
INCLUDEPATHS += -I&amp;quot;../../../../../../Include/app_common&amp;quot;

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

&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;state explicitly that they only support soft device &amp;quot;QFAADA&amp;quot; but my chip is QFAAC0&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Where did you find this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>