Posted 2015-04-21 13:20:12 +0100

# Development with GCC and Eclipse

This tutorial is for developers who want to use Eclipse, the GNU compiler collection (GCC), and the GNU Debugger (GDB) to develop and debug programs on the nRF51 and nRF52 series devices.

The nRF5x series Software Development Kits (SDK) come with Makefiles for use with the GNU ARM toolchain. This makes it possible to build example projects only using command line tools on your preferred platform (Windows, Linux or OS X). In this tutorial I will go through the necessary steps to integrate these examples with Eclipse in order to get common features associated with IDEs such as jump to declarations, code completion and debugger integration.

The scope of this tutorial will be limited to Makefile managed project in Eclipse to allow the existing SDK Makefiles to be used. A Makefile managed project is as the name implies, controlled by the Makefile and also built outside of the Eclipse environment using external tools, unlike other common IDE setups where the build recipe is a made based on project configurations. This means that the build will not be affected by project settings configured in Eclipse. I.e., adding source files, defines and include paths. So to actually manage your build you need to change the Makefile itself. We will later in the tutorial use the CDT output parser to parse the output of the Makefile to have the symbols and include paths added to the Eclipse project automatically in order to get some integration between the external build and project view in Eclipse as illustrated below.

The other alternative not covered in this tutorial is Eclipse Managed projects that automatically generates Makefiles based on your project settings and therefore giving a tighter integration between Eclipse and the build process. It is an option. However, main reason for not including it here is because it takes more time to set up, and the end result is about the same in terms of usability.

## Before we begin

Before we start setting up Eclipse we need to install some software components required to build source code, and also software to load it to the target device. These components enables us to test the SDK examples from the command line in addition to Eclipse.

GNU toolchain for ARM Cortex-M

<path to install directory>/GNU Tools ARM Embedded/4.9 2015q3/bin


Adding the path makes it possible to run the toolchain executables from any directory using the terminal. To verify that the path is set correctly, type the following in your terminal:

arm-none-eabi-gcc --version


This will return the version of the C compiler if the executable is found in your path.

GNU make

Now with the toolchain installed we can build object files from source code, but to build projects based on makefiles, which can be seen as a recipes for the builds, we need to have GNU make installed on the system.

On windows it can be obtained by installing the GNU ARM Eclipse Windows Build Tools package from the GNU ARM Eclipse plug-in project. This package also adds support for shell commands such as rm and mkdir that are used by our Makefiles.

Linux and OS X already have the necessary shell commands, but GNU make may not be a part of the standard distro. Call "make -v" from the terminal to check whether it is installed or not. GNU make would need to be installed if it's not recognized as a command.

GNU make is bundled with Xcode tools if working on OS X.

On Linux it may be different ways to obtain GNU make depending on your distro, if not installed already. On Ubuntu you can get by entering this command:

sudo apt-get install build-essential checkinstall


Nordic nRF5x SDK

Download SDK 11.0.0 from http://developer.nordicsemi.com/, or SDK 10.0.0 if s110 is to be used on the nRF51.

To build an example in the SDK you first need to set the toolchain path in makefile.windows or makefile.posix depending on platform you are using. That is, the .posix should be edited if your are working on either Linux or OS X. These files are located in

<SDK>/components/toolchain/gcc


Open the file in a text editor, and make sure that the GNU_INSTALL_ROOT variable is pointing to your Gnu tools for ARM embedded Processors install directory.

Correct values for my current setup:

GNU_INSTALL_ROOT := $(PROGFILES)/GNU Tools ARM Embedded/4.9 2015q3 // Toolchain path GNU_VERSION := 4.9.3 GNU_PREFIX := arm-none-eabi  Now you can try to build one of the example projects. Will use the blinky example here to keep it simple: Open terminal and change directory to <SDK>/examples/peripheral/<board name>/blank/armgcc/  Alternatively, open the terminal in that directory. In windows, navigate to the directory in explorer, press 'Alt+D' and type 'cmd' in the address field followed by return. Type 'make'. GNU Make should start the build using the Makefile and output the result in the _build directory. If everything works you should get the output shown in the screenshot below. If you instead get an error saying something like "the sysem cannot find the files specified" it typically means that the GNU toolchain path is set incorrectly. Verify the path in makefile.windows/posix if you get this. Errors like "make: No rule to make target '_build/Nordic', needed by nrf51422_xxac". Stop can also be an indication that build tools are unable to handle whitespaces in the path. E.g, c:/nordic semicondtor/SDK/... Workaround is to remove any whitespaces you may have with underscores. nrfjprog - Programming Tool nrfjprog bundled in the nRF5x-Command-Line-Tools is a command line tool for loading FW images to target via the debug interface (SWD). This tool has now been ported to all three platforms; Linux, Windows, and osx Now you can try to load the FW image built in the previous step to your target. nrfjprog: /* Optional: erase target if not already blank */ <SDK>/examples/peripheral/<board name>/blank/armgcc/>nrfjprog --family <nRF51/52> -e /* Load FW image to target */ <SDK>/examples/peripheral/<board name>/blank/armgcc/>nrfjprog --family <nRF51/52> --program _build/<name>.hex /* Reset and run */ <SDK>/examples/peripheral/<board name>/blank/armgcc/>nrfjprog --family <nRF51/52> -r  Nrfjprog is tailored for the nRF5 series devices, but it is also possible to use Jlink commander for the same in case its needed: /* Open Jlink Commander from terminal in _build directory */ JLinkExe (jlink on windows) -device <nRF51/nRF52> > erase // Optional: erase target if not already blank > loadfile <name>.hex // loads FW > r // Reset and halt > g // Run > q // Exit  You should see blinking LEDs on your kit once you have completed the steps above. Now we are ready for the next step which is to Download Eclipse and start configuring it. Eclipse Neon IDE for C/C++ Developers Download the latest Neon C/C++ developers package for your OS at https://www.eclipse.org/downloads/packages/release/Neon ## Setting up Eclipse the first time The following steps shows the general settings configurations of Eclipse that are not project specific. Install GNU ARM Eclipse plug-in The GNU ARM Eclipse plug-in simplifies debugger integration in Eclipse significantly in addition to adding support for the GCC ARM compiler so paths to the standard toolchain libraries are set automatically. Instruction on how to install it are provided on their website: http://gnuarmeclipse.github.io/plugins/install/ Required packages are: • GNU ARM C/C++ Cross Compiler • GNU ARM C/C++ Packs • GNU ARM C/C++ J-link Debugging The other packages are optional. Install device family pack for the nRF5x series (optional) The device family pack includes CMSIS System View Description, which is basically is a memory map of all peripheral registers on the device. Although it is not required to have installed it can be quite useful for debugging purposes; it allows you to easily read and write to particular peripherals through a built in peripheral viewer (part of GNU ARM Eclipse Plug-in) without having to look up the the addresses and register descriptions in the datasheet first. Steps to install: • Select the Window item from the menu bar, and enter perspective -> open perspective -> other -> Packs. • Click the refresh button in the top right corner of the window that got opened. This will fetch all packs from the repositories. • Select Nordic Semiconductor in the list of vendors, and install the latest version of Device family pack. Configure environment Here we will set the global Eclipse configurations for development on nRF5x. Note that these configurations are not specific for a particular project, and will only be done the first time Eclipse is installed. First, click on the window item in the menubar and select preferences. Then go to C/C++->Build->Global Tools path. Check if the paths to your Build tools and Toolchain are set, otherwise add the paths where you installed these earlier. On this setup the following paths were used: C:\Program Files\GNU ARM Eclipse\Build Tools\2.7-201610281058\bin C:\Program Files (x86)\GNU Tools ARM Embedded\5.2 2015q4\bin  On OS X or Linux the following shell command can be used to find the location of make: $ which make


Then, enter Run/Debug, click on SEGGER J-link, and make sure that it is pointing to your latest version of the Segger software. In my case it was C:/Program Files (x86)/SEGGER/JLink_V502f. This is path will be needed later when debugging with the installed J-link debug plugin.

## Import existing Eclipse project to workspace

I have attached the ble_app_hrs and blinky example that can be used as a starting point, see the last section for a list of attachments. You may want to start with the blinky example first to keep it simple at first.

I guess some of you would prefer to start by integrating your own project right away instead as described in the next section. However, I would highly recommend trying one of these examples first in order to get something working first. Then if you experience problems with your project later on, you would have a working example compare against.

• Download the project you wish to use from the attachment list, extract it, copy and replace with the content into the existing ARMGCC folder in the respective SDK project. E.g., \examples\peripheral\blinky\"board name"\blank\armgcc for the blinky example. Note that the directory structure must be kept. Otherwise it will break the paths. Also make sure that your SDK copy has the same version number as the project.

• Open Eclipse.

• Enter file->import->General -> Existing Projects into Workspace.
• Browse ARMGCC folder in your SDK
• Make sure to select the project.
• Click finish button.
• The project should now be available in the project explorer including the linked sources.

Now you will see your imported project in the Project explorer window as shown in screenshot below. Notice the errors. We will get to that in the Enable auto discovery of symbols, include paths and compiler settings section

For now we just want to make sure that we can build the example as we did in the command line earlier. Right click on the project folder in project explorer, click properties, and click on the C/C++ item in the list. Then replace the default build command with make VERBOSE=1. Setting the VERBOSE variable to '1' makes the Makefile print command line options used in the build. In other words increase the verbosity level. This will later be used to parse compiler options to your Eclipse project.

Right click on project again and click on Build Project. Hopefully you will see the build output in the console window, same as when you built the example via the terminal. Note that actual build errors will be shown in the log at this point. The errors we see in Eclipse are due to the fact that Eclipse does not now what include paths to use nor symbols. E.g., -DBOARD_PCA10036 which is used to determine what board support file to include, but you can see that it is used in the build log.

## Create a new Eclipse project

This section is for those who wants to integrate an existing project into Eclipse, or just want to create a new one, but not use any of the attached examples as templates. These instructions assumes the Makefile configurations used in SDK 7.x.x. and later.

Start Eclipse, enter file -> new Makefile project with existing code in the menu bar. Name your project and browse the directory of your Makefile. Click finish once you are done.

Open and edit the SDK makefile to support debugging of your code. Locate the CFLAGS variables, and change ‘-O3’ to '-O0' for debugging to produce expected results (stack variables loaded directly to CPU registers,etc). Then add '-g3' to CFLAGS to include debug symbols in the .out file (GNU manual).

Configure the build settings and build the project, see the instructions from the Import existing Eclipse project to workspace section above and verify that there are no build errors before moving on to the next step.

Now you can start linking the source files into your project viewer, but you might want to add some virtual folders to obtain a more clear project view first.

Create virtual folders:

• Right click on the project folder and enter New->folder.
• Set folder name.
• Click Advanced and choose virtual folder.
• Click finish.

Repeat above steps until you have the folders you want. The naming of the folders should reflect the types of the source files you intend to link to. In the blinky it was sufficient to have Application, Device and nRF_Drivers, same as the Keil example for blinky, but, for larger projects with more source files you should add more folders. E.g., ble_app_hrs: Application, Board Support, Device, nRF_BLE, nRF_Drivers, nRF_Libraries and nRF_Softdevice.

Now you can start to link the source files to the respective folders. The source files to include are listed in your Makefile->C_SOURCE_FILES, and ASM_SOURCE_FILES. Source files are then linked to the folder by right clicking on any of the virtual folders and clicking on import, General->File System and browse the source files in the SDK. The path to each source file can be a good way to determine what folder to place the file in:

../../../../../../components/drivers_nrf/delay/nrf_delay.c can be classified as a driver. Thus placed in nRF_Driver, etc.

## Enable auto discovery of symbols, include paths and compiler settings

Note regarding SDK 12 9/30-16 - Makefile structure was changed in SDK 12.0.0; there are now two separate Makefiles for each example; the project makefile that defines the example dependencies/flags, and makefile.common to actually build the specified targets. It should only be necessary to modify the project makefile as before. However, apparently the CDT parser does not like that we added quoted toolchain strings. E.g., "C:/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q3/bin/arm-none-eabi-gcc".

Included a patched version of Makefile.common, see list of attachments at the end of this tutorial.

Good news is that the new makefiles support incremental builds rather than re-building every time. That is, make will only rebuild modified objects and link in those that weren't.

The following steps configure the CDT build output parser and CDT GCC Built-in Compiler Settings Cross ARM to automatically discover symbols, include paths and compiler settings based on the output produced by the Makefile. These steps also apply to imported projects as these configurations are not included in the project files.

• Enter project properties -> C/C++->Preprocessor Include Paths,etc.->Providers
• Click on CDT GCC Build Output Parser and change the compiler command pattern from (gcc)|([gc]\+\+)|(clang) to (.*gcc)|(.*[gc]\+\+) then apply changes.
• Click on CDT Built-in Compiler Settings Cross ARM and replace ${COMMAND} with arm-none-eabi-gcc and click Apply. The CDT build output parser works by parsing everything in the output string that has either a '-D' for defines and '-I' for include paths, and 'C:/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q3/bin/arm-none-eabi-gcc' will be recognized as the compiler command pattern with the settings above. Example string when compiling main.c in the blinky example: 'C:/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q3/bin/arm-none-eabi-gcc' -DCONFIG_GPIO_AS_PINRESET -DBOARD_PCA10036 -DNRF52 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs --std=gnu99 -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -I../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../.. -I../../../../../bsp -I../../../../../../components/device -I../../../../../../components/drivers_nrf/delay -I../../../../../../components/drivers_nrf/hal -c -o _build/main.o ../../../main.c  Rebuild your project to index the source files again with the CDT parser enabled. If it works you will notice a key symbol appears on the source files, and all errors should be resolved by now. In case you want to see the paths and symbols added from the output, select one of the source files, click on properties, C/C++ item and preprocessor Include Paths you can see that the paths defines have been added based on the output: ## Flash download Flash downloading and running a program on your device without debugging is possible by using flash targets included in the Makefiles. In order to execute the flash targets you first need to add a new target to the project. Here is an example with the blinky example. There are no flash softdevice target in this example as it runs independent of the softdevice. For the heart rate or other BLE examples you will need to flash the softdevice by executing the "flash_softdevice" target. Then execute the flash target(s) to load the FW to target. You will see the commands invoked in the console window. Once you have done this your application will start running. Note, makefiles from SDK 11.0.0 does not require the target name to be specified. so just 'flash'. ## Setting up a project for debugging in Eclipse The GNU ARM Eclipse plugin we installed earlier has already integrated J-link debugging with Eclipse. We only need to set the debug configurations for our project before we can launch a debug session. In the project explorer select your project in the project explorer window. Click on the Run tab in the menu bar and go to debug configurations. Right click on GDB SEGGER J-Link Debugging and select new. Project name and location of executable should be added automatically as long as you selected your project before opening debug configurations. Enter the Debugger tab, and select the device name for the device you are targeting and make sure that the jlink variables are set correctly (must point to JLinkGDBServerCL executable). The 'nogui' option may be removed from other options field to get a device selection prompt if multiple J-link programmers are connected to the PC. Lastly, set the GDB client to arm-non-eabi-gdb to ensure that the correct client is used (may default to GDB client for host if not). Then deselect SWO in startup tab unless you have configured it (not supported on the 51 series). Now you start the debug session by clicking on the Debug button. Eclipse will then show the debug view, and the application will break in main by default. Now you can start debugging; set break points, single step, read registers, etc. Using the peripheral viewer Go to project properties and select C/C++ Build item. Enter settings and click on the Devices tab. Here you must select the chip you are using to enable the view. Start a debug session and open the peripheral viewer, and select the Peripheral you want to debug. If you select the GPIO module you can get an visual indications by controlling the board LEDs (P0 on nRF52 and GPIO on nRF51). Open the Memory view and click on PIN_CNF[24] or PIN_CNF[20] to control the LED 4 GPIO on your DK kit (PCA100028 or PCA10036/40). Changing the GPIO direction in PIN_CNF[x].DIR should toggle your board LED. ## Troubleshooting Below is a brief guide on how to troubleshoot some of the common problems related to GCC and Eclipse setup with the Nordic SDK. Development with GCC and Eclipse.pdf Please post a detailed description of the problem in the questions section if the guide does not help in solving a particular issue. Also feel free to provide feedback if you think something is missing/unclear or any other suggestions. ## Attachments Tested with Eclipse Neon: Patch for SDK 12 - implements required workaround for CDT build output parser. Replace makefile.common in in$(SDK_ROOT)/components/toolchain/gcc with one of the files below:

Posted April 21, 2015, 8:42 p.m.

Nice turotial!

Any idea how to get this to compile c++ also? :) If I just add a c++ file I get:

make[1]: * No rule to make target '_build/BLEDriver.cpp', needed by 'nrf51422_xxac_s110'. Stop.

Furthermore, is it possible to make it NOT compile everything every time? and only compile the edited files.

Posted April 22, 2015, 12:52 p.m.

I have not tried to compile C++, but you will need to use arm-none-eabi-g++ when compiling C++ code. This also thread seems to be relevant for this. Unfortunately, incremental build is not supported in our current makefiles.

Posted April 23, 2015, 7:09 p.m.

Can i use the latest nrf51322-dk or dongle instead of a standalone j-link?

Posted April 24, 2015, 7:12 a.m.

This is awesome. At least I can build the project, and flash it with no problem. I think Automating the programming on Mac could be done by using RKNRFGO, which comes with nrfjprog. But for some reasons, when I make flash, I always got the message below

make flash
Flashing: _build/.hex
make: Circular flash <- flash dependency dropped.
"/usr/local/bin/nrfjprog" program -p _build/.hex)
/bin/sh: -c: line 0: syntax error near unexpected token )'
/bin/sh: -c: line 0: "/usr/local/bin/nrfjprog" program -p _build/.hex)'
make: *** [flash] Error 2


Tips: If anyone is seeing a lot of error saying symbol cannot be resolved, you can right click the project, and click Index and Rebuild.

Posted April 24, 2015, 10:24 a.m.

@kerem: Both the DK and Dongle have an onboard J-link lite so there is no need for an external debugger. Also note that the DK kit has an debug out header that you can use to program external boards targeting nRF51. E.g. programming of the beacon kit.

@bluevanilla: Did you use "nrf51422_xxac_s110 flash" as target and not "flash"? Thanks for providing the tips! RKNRFGO looks like an easier tool to use for flash programming on MAC.

Posted April 25, 2015, 2:44 a.m.

@Vidar I misread it. I was using only "flash" as target. I am still finding a way to flash the device using just command line. It seems like the nrfjprog that comes with RKNRGFO is too old or something because on RKNRGFO it shows soft device v8 but not on the command line. I guess we just have wait the update or there is some other way I didn't. But the graphics tool(RKNRGFO) with eclipse and debugger works perfect. Thanks again.

Posted May 5, 2015, 3:03 p.m.

Hi! Thank you for the post, but i am having an issue related to links to some files. Using the example you give, i added some includes to the makefile to make it work, but when i compile i still have the error that some functions are not recognized. See the following image. I added the includes in anyway, but it still does not work. Any idea what could happen?

http://i.imgur.com/ftemjb2.png

Posted May 7, 2015, 11:27 a.m.

The undefined references is likely a result of missing source files. E.g., Let say you want to include the TX Power Service in your build, then you need to add ../../../../../../components/ble/ble_services/ble_tps/ble_tps.c to C_SOURCE_FILES and INC_PATHS += -I../../../../../../components/ble/ble_services/ble_tps to the project makefile. Adding source files and include paths in the Eclipse environment (project explorer) does not have any effect on the build, but it helps indexing the files. See Notes about makefile managed projects above.

Posted May 13, 2015, 8:12 p.m.

Hi all,

Does anyone know why this error occurred?

Posted May 15, 2015, 8:59 a.m.

Did you run "make nrf51422_xxac_s110 flash" ?

Posted May 17, 2015, 8:39 a.m.

When I try to Project > Build All I get the following error

make all
rm -rf _build
process_begin: CreateProcess(NULL, rm -rf _build, ...) failed.
make (e=2): The system cannot find the file specified.

make: *** [clean] Error 2


Isn't "rm" a the Linux equivalent for Windows "del"? In any case I don't appear to have it anywhere on my computer. Any suggestions?

*edit: I managed to find a copy of the GNU rm.exe but this was never installed with the link "GNU Make and RM command line tools (GnuWin32)(for windows platforms)" above. This only downloaded the make utility...

Posted May 18, 2015, 8:35 a.m.

Sorry, I had installed these tools prior to making this post, but forgot that I had to install the core utils package as well to get the 'rm' program. I have added a link to the core utils in the tutorial now.

Posted May 26, 2015, 5:56 p.m.

There are a frighteningly high number of things that don't seem to be working with GCC/Eclipse on the nRF51. The above tutorial was a good start, but I ran into a number of issues -

1. Even after GCC output parsing was setup and everything, I am still getting some errors with unresolved symbols. For example I created a function which configured a pin, and included "nrf.h" in the header for that function. The symbols "GPIO_PIN_CNF_SENSE_Disabled" etc are not found, maybe because the GCC output parser is not setup to define NRF51?
1. There is a flagged line for my program in main.c

params.handle = p_act.actuator_position_handles[i].value_handle;

value_handle is underlined. I checked, and the type of

p_act.actuator_position_handles


is "ble_gatts_char_handles_t", which contains a value_handle attribute. The program compiles and runs (with -Wall and error on warning), so why is it being flagged?

1. Following the instructions for GDB "sort of" worked, but in the output for GDB, it complained that the output file could not be found (under /bin/thing.out). But, copying the absolute path to the .out file solved the problem. Why, if gdb is being run from the project directory?

Thanks, -Alex

Posted May 27, 2015, 12:20 p.m.

Hi, did you try the attached heart rate example? In that case, did you get any errors? Note that in this tutorial, CDT uses the makefiles provided in the SDK(makefile project) instead of a Managed Make C project. This means that CDT will not maintain the "external" makefile. Adding a source file in the Eclipse environment will for instance not be included in the build unless you edit the source list in the makefile as well. The same goes for include paths, compiler options and symbols.

GPIO_PIN_CNF_SENSE_Disabled is defined in nrf51_bitfields.h. Do you see any warnings in CDT build console when using this define, or is it just in unresolved in Eclipse?

Regarding the GDB error: using the SDK makefiles the .out file is located in the _build folder, so the correct path should be _build\.out. It will be set automatically if you click on the project before opening the debug launcher configuration.

Posted June 3, 2015, 7:45 p.m.

I think I did everything in the guide but I'm getting an error when I try to build the example:

Any help/guidance is appreciated

Thanks, David

Posted June 4, 2015, 8:14 a.m.

Did you place the project files in the \nRF51_SDK_8.x.x\examples\ble_peripheral\ble_app_hrs\pca10028\s110\ armgcc folder? It is important that makefile is located in the correct directory, otherwise the relative paths will not match the SDK folder structure.

Posted June 4, 2015, 3:03 p.m.

Thanks Vidar, that solved that issue. But now I'm getting this: 08:57:11 Incremental Build of configuration Default for project ble_app_hrs_2 make all rm -rf _build make[1]: Entering directory C:/nRF51 SDK/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc' rm -rf _build/*.o make[1]: Leaving directoryC:/nRF51 SDK/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc' make[1]: Entering directory C:/nRF51 SDK/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc' echo makefile makefile mkdir _build Compiling file: app_button.c arm-none-eabi-gcc -DSOFTDEVICE_PRESENT -DNRF51 -DS110 -DBOARD_PCA10028 -DBLE_STACK_SUPPORT_REQD -mcpu=cortex-m0 -mthumb -mabi=aapcs --std=gnu99 -Wall -Werror -O0 -g3 -mfloat-abi=soft -ffunction-sections -fdata-sections -fno-strict-aliasing -I../../../config -I../../../../../bsp -I../../../../../../components/libraries/fifo -I../../../../../../components/libraries/util -I../../../../../../components/ble/device_manager -I../../../../../../components/drivers_nrf/uart -I../../../../../../components/ble/common -I../../../../../../components/libraries/sensorsim -I../../../../../../components/drivers_nrf/pstorage -I../../../../../../components/ble/ble_services/ble_dis -I../../../../../../components/device -I../../../../../../components/libraries/button -I../../../../../../components/libraries/timer -I../../../../../../components/libraries/gpiote -I../../../../../../components/softdevice/s110/headers -I../../../../../../components/drivers_nrf/hal -I../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../../../../../components/ble/ble_advertising -I../../../../../../components/libraries/trace -I../../../../../../components/ble/ble_services/ble_bas -I../../../../../../components/softdevice/common/softdevice_handler -I../../../../../../components/ble/ble_services/ble_hrs -c -o _build/app_button.o ../../../../../../components/libraries/button/app_button.c The system cannot find the path specified. make[1]: *** [_build/app_button.o] Error 1 make: *** [all] Error 2 make[1]: Leaving directoryC:/nRF51 SDK/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc'

08:57:11 Build Finished (took 221ms)

Any ideas on what went wrong?

I also don't believe I made the targets correctly so any more detail on how to do that would be helpful.

I also seem to have a lot of unresolved inclusions. Could you provide a list of the required inclusion paths?

Any help is appreciated

Thanks, David

Posted June 5, 2015, 4:03 p.m.

Did you use SDK 8.0.0? The attached project was based on this version, which I should have specified.

Posted June 5, 2015, 5:55 p.m.

Alright I changed to the older version. For some reason I got the same error as my original post. After trying the process again, that error went away. Now I'm left with this:

I have gotten this error before but I've never been able to figure out exactly what's wrong.

Posted June 5, 2015, 8:22 p.m.

The build output shows that Eclipse is trying to run "" program while it should be trying to run "Make". You can try to fix this by right clicking on the project, enter properties -->C/C++ Build --> Builder setting. Then write "make" in the build settings field instead of the ${cross_make} variable. Posted June 8, 2015, 2:42 p.m. Vidar, Thanks for your help so far. I've been making steady progress. The project builds with no errors now. However, when trying to program the board, I run into a few errors. 1. When using the debugger I get a timeout error with the jlinkGDBserver 2. When using the target, I get this: Any ideas on what the issues might be? I should also add that I was unable to install the sources for the coreutils, receiving this error: Thanks, David Posted June 10, 2015, 8:30 p.m. Hi, An alternative for the mentioned Keppler release is to use the latest Luna and the gnuarmeclipse plugin. It gives you a managed make, so editing the makefile is done for you. It works great ( and out-of-the-box). Dig Posted June 12, 2015, 6:33 p.m. Hi, After many reinstalls / tries I seem not to be able to get rid of below error. I am using SDK Version 8, have installed the sample application and am using the make file. I assume that the directory structure should be according to the make file. Don't know how to check that. Any thoughts on how to get rid of this showstopper? The error was described before but no clear solution was provided which was working (at least not in my case). Thanks and regards, René 18:12:56 Build of configuration Default for project ble_app_hrs make all rm -rf _build make[1]: Entering directory C:/nRF51_SDK_8.0.0/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc' rm -rf _build/*.o make[1]: Leaving directoryC:/nRF51_SDK_8.0.0/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc' make[1]: Entering directory C:/nRF51_SDK_8.0.0/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc' echo makefile makefile mkdir _build Compiling file: app_button.c arm-none-eabi-gcc -DSOFTDEVICE_PRESENT -DNRF51 -DS110 -DBOARD_PCA10028 -DBLE_STACK_SUPPORT_REQD -mcpu=cortex-m0 -mthumb -mabi=aapcs --std=gnu99 -Wall -Werror -O0 -g3 -mfloat-abi=soft -ffunction-sections -fdata-sections -fno-strict-aliasing -I../../../config -I../../../../../bsp -I../../../../../../components/libraries/fifo -I../../../../../../components/libraries/util -I../../../../../../components/ble/device_manager -I../../../../../../components/drivers_nrf/uart -I../../../../../../components/ble/common -I../../../../../../components/libraries/sensorsim -I../../../../../../components/drivers_nrf/pstorage -I../../../../../../components/ble/ble_services/ble_dis -I../../../../../../components/device -I../../../../../../components/libraries/button -I../../../../../../components/libraries/timer -I../../../../../../components/libraries/gpiote -I../../../../../../components/softdevice/s110/headers -I../../../../../../components/drivers_nrf/hal -I../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../../../../../components/ble/ble_advertising -I../../../../../../components/libraries/trace -I../../../../../../components/ble/ble_services/ble_bas -I../../../../../../components/softdevice/common/softdevice_handler -I../../../../../../components/ble/ble_services/ble_hrs -c -o _build/app_button.o ../../../../../../components/libraries/button/app_button.c The system cannot find the path specified. make[1]: *** [_build/app_button.o] Fehler 1 make[1]: Leaving directoryC:/nRF51_SDK_8.0.0/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc' make: * [all] Fehler 2 18:12:57 Build Finished (took 1s.353ms) Posted June 13, 2015, 11:40 a.m. @mda789, it looks like you started the GDB server before starting the debug session in Eclipse? In that case it might be a conflict as the Segger J-link launcher will start the GDB server automatically. Suggest comparing the debug settings shown in the attached sreenshot.zip folder just to make sure you are using the same settings, then try again. Regarding the installation error, I think you can ignore that for now, you would not be able to complete the build if you were missing any of the required (rm) core utils, @rh230021, the log shows that the relative path to app_button.c does not match the folder structure you have. Although the path you are using looks correct assuming the makefile is placed in the armgcc folder -> armgcc/makefile. You could try to open the command prompt in the makefile directory, then type "cd ../../../../../../". If the makefile was placed correctly this will cd to c:/nRF51_SDK_8.0.0/. Posted June 13, 2015, 4:04 p.m. René I can advise you to do it the managed make way with the gnuarm-ecilpse plugin. I copy the file structure from the Keil examples in my eclipse project, with links to sources from the SDK for the BLE , drivers etc. Once you setup your first project you can use this as a template. It works great. See below for an example. Dig Posted June 18, 2015, 5:15 p.m. @vibe I have the same problem as René. Here's the output of the command you suggested: andrey@andrey-PC <SDK_LOCATION>/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc$ ls
_build  ble_app_hrs_gcc_nrf51.ld  Makefile

andrey@andrey-PC <SDK_LOCATION>/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc
$cd ../../../../../../components/libraries/button/ andrey@andrey-PC <SDK_LOCATION>/components/libraries/button$ ls
app_button.c  app_button.h


Also please take a look at this issue. @johnbrown 's solution works but really is a hack. Is there a better way?

Posted June 19, 2015, 4:56 p.m.

@andrey, I responded to your question here. Your paths are correct so I assume you are not seeing any errors in the "CDT Build Console" in Eclipse?

Posted June 19, 2015, 5:05 p.m.

@vibe Yes, but as far as I understand, that issue is separate from the one where headers are not being found. That is because even after implicitly telling Eclipse the location of the include folders and resolving the linked issue this error during the build stays the same:

Compiling file: app_button.c
arm-none-eabi-gcc -DSOFTDEVICE_PRESENT -DNRF51 -DS110 -DBOARD_PCA10028 -DBLE_STACK_SUPPORT_REQD -mcpu=cortex-m0 -mthumb -mabi=aapcs --std=gnu99 -Wall -Werror -O0 -g3 -mfloat-abi=soft -ffunction-sections -fdata-sections -fno-strict-aliasing -I../../../config -I../../../../../bsp -I../../../../../../components/libraries/fifo -I../../../../../../components/libraries/util -I../../../../../../components/ble/device_manager -I../../../../../../components/drivers_nrf/uart -I../../../../../../components/ble/common -I../../../../../../components/libraries/sensorsim -I../../../../../../components/drivers_nrf/pstorage -I../../../../../../components/ble/ble_services/ble_dis -I../../../../../../components/device -I../../../../../../components/libraries/button -I../../../../../../components/libraries/timer -I../../../../../../components/libraries/gpiote -I../../../../../../components/softdevice/s110/headers -I../../../../../../components/drivers_nrf/hal -I../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../../../../../components/ble/ble_advertising -I../../../../../../components/libraries/trace -I../../../../../../components/ble/ble_services/ble_bas -I../../../../../../components/softdevice/common/softdevice_handler -I../../../../../../components/ble/ble_services/ble_hrs -c -o _build/app_button.o ../../../../../../components/libraries/button/app_button.c
The system cannot find the path specified.
make[1]: *** [_build/app_button.o] Error 1
make[1]: Leaving directory <SDK_LOCATION>/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc'
make: *** [all] Error 2


EDIT:

Solution to this problem is here.

Posted June 22, 2015, 3:23 p.m.

Very nice tutorial, my two cents of observation while trying this out.

1) The line

Open nRF51_SDK_8.x.x\components\toolchain\gcc\Makefile.windows (posix on OS X and Linux)


should not be in the create new project subsection, this is valid for both new and imported projects

2) The project Makefile did not work to flash as the current version of nrfjprog did not allow to program and reset the board in one command.

3) I did not get the create new project to work from scratch. This is probably my fault, it took a loooot of time to make the directory structure and then I probably gave up too fast trying to fix problems.

Posted July 3, 2015, 8:23 p.m.

I am relatively new to eclipse-based toolchains. I have gone through the steps above, but must have missed something. I get the error shown below when I try to build all. The code is unchanged from the heartRate zip on this page and is in the SDK folder. I am using the 8.0.0 SDK.

Thanks you for your help on this.

Posted July 7, 2015, 1:31 p.m.

@Aryan,

Thanks for the feedback!

1. You are right, it makes more sense to have this in a different section as this is a one time configuration of the SDK.

2. nrfjprog v. 7+ does not support multiple command arguments. The workaround is to invoke nrfjprog once for every command.

3. It is a somewhat tedious task to create new projects from scratch as the SDK does not include the project files. A trick is to copy the Eclipse project files from the attached heart rate example, then edit the .project xml so that it includes the source files for your project.

I plan to update the blog based on the feedback I have gotten from you and others when I get the time to do it. I think the steps that are common sources of errors should be more emphasized.

@TFred,

I have not seen this one before. Do you get a more detailed error message if you click on the 'Details' button? Also, are you using the same version of Eclipse as linked to in the tutorial?

Posted July 20, 2015, 12:13 p.m.

I get the following errors while building blinky example

make[1]: Leaving directory D:/Projects/Forkbeard/Workspace/blinky1/armgcc'
echo  makefile
makefile
mkdir _build
make[1]: *** No rule to make target _build/main.o', needed by nrf51422_xxac'.
Compiling file: system_nrf51.c
The system cannot find the path specified.
make[1]: *** [_build/system_nrf51.o] Error 1
Compiling file: nrf_delay.c
The system cannot find the path specified.
make[1]: *** [_build/nrf_delay.o] Error 1
Compiling file: gcc_startup_nrf51.s
The system cannot find the path specified.
make[1]: *** [_build/gcc_startup_nrf51.o] Error 1
make[1]: Target nrf51422_xxac' not remade because of errors.
make: *** [all] Error 2


Posted July 20, 2015, 2:14 p.m.

Did you remember to set the toolchain path in makefile.windows/posix?

Posted July 20, 2015, 5:34 p.m.

I imported the project fine (thank you!). I then renamed the project test. After this, I could no longer access the files (like main.c). I'd like to start with importanting a project, then rename and start from there. Is that possible?

thank you.

Posted July 20, 2015, 5:44 p.m.

When you are creating a new project with the ble_app_hrs_s110_pca10028 makefile, did you create the new project using "Makefile Project With Existing Code" or C Project -> Makefile Project ? I'm confused mostly on how to turn off managed make?

Posted Aug. 11, 2015, 1:22 a.m.

Hi,

And so after several inclusion errors, finally a different error I got here. Unfortunately no comments similar to the error I encountered, as far as I know.

After several inclusions and GPIOTE_IRQHandler fixes...Not sure what to do next.

My error is;

Linking target: nrf51422_xxac_s110.out _build/main.o: In function sleep_mode_enter': C:\00_AMTInc\SDK9.0\examples\ble_peripheral\ble_app_hrs\pca10028\s110\armgcc/../../../main.c:625: undefined reference tobsp_btn_ble_sleep_mode_prepare' _build/main.o: In function ble_evt_dispatch': C:\00_AMTInc\SDK9.0\examples\ble_peripheral\ble_app_hrs\pca10028\s110\armgcc/../../../main.c:699: undefined reference tobsp_btn_ble_on_ble_evt' _build/main.o: In function buttons_leds_init': C:\00_AMTInc\SDK9.0\examples\ble_peripheral\ble_app_hrs\pca10028\s110\armgcc/../../../main.c:886: undefined reference tobsp_btn_ble_init' collect2.exe: error: ld returned 1 exit status make[1]: [nrf51422_xxac_s110] Error 1 make[1]: Leaving directory C:/00_AMTInc/SDK9.0/examples/ble_peripheral/ble_app_hrs/pca10028/s110/armgcc' make: [all] Error 2

I am thinking that this is related to the use of SDK9.0???

Note: Eclipse IDE for C/C++ Developers Version: Luna Service Release 2 (4.4.2) Build id: 20150219-0600

Best regards, Arthur

Posted Aug. 20, 2015, 2:40 p.m.

I am also trying to build the ble_app_hrs project in Eclipse but I am using the nRF52 SDK. At this point, I am getting this error (below), which seems to indicate that it can't find the app_button.c library file.

It is strange since the include and source paths are defined in the makefile. I followed the path of ../../../../../../components/libraries/button/app_button.c from the makefile location in \ble_app_hrs\pca10036\s132 and the path looks right.

08:30:48 Incremental Build of configuration Default for project ble_app_hrs make all rm -rf _build make[1]: Entering directory C:/downloads/Nordic/nRF52_SDK_0.9.1_3639cc9/examples/ble_peripheral/ble_app_hrs/pca10036/s132/armgcc' rm -rf _build/*.o make[1]: Leaving directoryC:/downloads/Nordic/nRF52_SDK_0.9.1_3639cc9/examples/ble_peripheral/ble_app_hrs/pca10036/s132/armgcc' make[1]: Entering directory C:/downloads/Nordic/nRF52_SDK_0.9.1_3639cc9/examples/ble_peripheral/ble_app_hrs/pca10036/s132/armgcc' echo makefile makefile mkdir _build Compiling file: app_button.c process_begin: CreateProcess(NULL, "C:/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q2/bin/bin/arm-none-eabi-gcc" -DSWI_DISABLE0 -DSOFTDEVICE_PRESENT -DNRF52 -DBOARD_PCA10036 -DCONFIG_GPIO_AS_PINRESET -DS132 -DBLE_STACK_SUPPORT_REQD -mcpu=cortex-m4 -mthumb -mabi=aapcs --std=gnu99 -Wall -Werror -O3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -I../../../config -I../../../../../../components/drivers_nrf/config -I../../../../../bsp -I../../../../../../components/libraries/fifo -I../../../../../../components/drivers_nrf/delay -I../../../../../../components/softdevice/s132/headers/nrf52 -I../../../../../../components/libraries/util -I../../../../../../components/drivers_nrf/pstorage -I../../../../../../components/drivers_nrf/uart -I../../../../../../components/ble/common -I../../../../../../components/libraries/sensorsim -I../../../../../../components/ble/device_manager -I../../../../../../components/libraries/uart -I../../../../../../components/device -I../../../../../../components/ble/ble_services/ble_dis -I../../../../../../components/libraries/button -I../../../../../../components/libraries/timer -I../../../../../../components/softdevice/s132/headers -I../../../../../../components/drivers_nrf/gpiote -I../../../../../../components/drivers_nrf/hal -I../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../../../../../components/drivers_nrf/common -I../../../../../../components/ble/ble_advertising -I../../../../../../components/libraries/trace -I../../../../../../components/ble/ble_services/ble_bas -I../../../../../../components/softdevice/common/softdevice_handler -I../../../../../../components/ble/ble_services/ble_hrs -c -o _build/app_button.o ../../../../../../components/libraries/button/app_button.c, ...) failed. make[1]: Leaving directoryC:/downloads/Nordic/nRF52_SDK_0.9.1_3639cc9/examples/ble_peripheral/ble_app_hrs/pca10036/s132/armgcc' make (e=2): The system cannot find the file specified.

make[1]: [_build/app_button.o] Error 2 make: [all] Error 2

08:30:48 Build Finished (took 240ms)

Posted Aug. 20, 2015, 5:15 p.m.

Update: I fixed my problem. I thought that the system could not find the file app_buttons.c but in fact it was the compiler executable that was not found.

If you look at this portion of the output: Compiling file: app_button.c process_begin: CreateProcess(NULL, "C:/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q2/bin/bin/arm-none-eabi-gcc"

You'll notice that there is a /bin/bin in the path to arm-none-eabi-gcc.

This path is set in Makefile.Windows for the toolchain. I had added an absolute path the executables but only a path to the root was necessary. This is the correct line in the makefile:

GNU_INSTALL_ROOT := $(PROGFILES)/GNU Tools ARM Embedded/4.9 2015q2 Now, the compilation is working in both Eclipse and via command line. Posted Aug. 25, 2015, 3:05 p.m. Hi everyone, I have compiled the program succesfully, and generated the .hex But when I load the .hex to the nRF51822 with nRFgo Studio, the beacon doesn't do anything (it isn´t detectable). Anybody knows why? Thanks Posted Sept. 4, 2015, 4:03 p.m. Hi, I have a problem when trying to debug it in eclipse for a NRF51_DK on mac. I have configured the right configurations for the NRF51_DK. There just one problem, when try to debug it i get the error: Error while launching command: gdb --version  When i run the command in terminal: gdb --version, It does say its installed: GNU gdb (GDB) 7.10 .....etc Does someone know how to fix this? Posted Sept. 5, 2015, 9:07 p.m. Hello, I have tried to follow the tutorial to the letter, using ECLIPSE-MARS on win 7-32 bit machine, but ran into troubles as I am a complete novice to ECLIPSE/GCC/J-LINK toolchain. I am unable to successfully build the project, this what I get (I guess some path definition is wrong): Please help sort things up. Many thanks in advance. Posted Sept. 22, 2015, 6:03 a.m. Hi, as screenshots in the previous comments, after importing ble_app_hrs project, main.c has undefined headers. This can be worked out by inserting header's paths manually. After that, "project-->build all" has a make error: no rule to make target all. Such problems seem to happen because Eclipse doesn't recognize Makefile. Could you please advice how Eclipse understands Makefile configuration? Thanks. Posted Sept. 22, 2015, 9:47 a.m. Hi, it is better to make a thread with a link to this post in the 'questions' section if you have any questions related to this tutorial. Reason for that is that I am not being notified when comments are added here in addition to the fact that it gets less views from other users. In other words, you can expect a quicker response by doing so. @ata, is the beacon example from the SDK? In that case you need to adjust the linker settings so that linker does place anything above 0x20004000 (16K) in RAM. @areitsma, think the correct launch command should have been 'arm-none-eabi-gdb', are you using the J-link plug-in for debugging? @Avi_H, I have not had a chance to try Mars yet, I would suggest to try Kepler instead for now. I will try Mars when I have more time. @shin, in the Kepler release you can have the CDT parser add the include paths and symbols automatically, see 'Enable auto discovery of symbols, include paths and compiler settings' for more details. However, I have only tried this with Kepler. Although adding the paths manually will also work. With regars the build error; you can try to enter project properties for you current project, then enter C/C++ Build and set the build command to 'make'. Also make sure that the build directory is set to the directory where the makefile is located. Posted Sept. 26, 2015, 1:38 a.m. Hello Vidar & Shin. I installed the Kepler version of Eclipse, followed the tutorial, but got identical results to Mars. It did not matter where I positioned the project folder or corrected the files paths, within Eclipse setup, I ended up with a make file errors and unrecognized include header files. The only thing that helped in the end, was inserting the absolute location of files and headers on the make-file AND main.c files. I also discovered that the only way, full file location were recognized by Eclipse is in the following form: C:\Users\Black-Box\workspace-kepler\nRF51882\components/libraries/button/app_button.c \ This form leads to error during make - parsing: C:\Users\Black-Box\workspace-kepler\nRF51882\components/libraries/button\app_button.c \ So eventually I got no errors, after also fixing some definitions on main.c, but still I face a run-time error which I need to figure out how to solve: [first image is the a successful build (or at lest my impression of such a build)...] [Second image is the problem I get when I hit Run button] I guess I still need to tell the Eclipse where to find the correct binary. [NOTE: I did not connect the J-Link & target yet to the computer, I intend using a different target PCB from Nordic's Dev kits, via SWD connection, I think it does not matter (Am I wrong??)] I appreciate and thank every reply. Regards. Posted Sept. 28, 2015, 6:06 p.m. Hello again, I found the source for the mistake, I set the wrong ///..._build path on debugger menu. Fixed it, now I get different error message: I will try to find answer in the questions section, but any help is still very much appreciated. Thanks. Posted Sept. 29, 2015, 10:02 a.m. @Avi_H, in order for the CDT parser to work the makefile needs to print out arm-none-eabi-gcc without the path, see makefile edit in the "edit makefile" section in the tutorial. Eclipse should be able to resolve all symbols and index all header file once this is set up correctly. I have not seen that particular launcher error before, nor able to reproduce it. Do you have the latest Segger drivers installed? Note that you need to change the${JLINK_PATH} variable to point to the correct version in case you update the drivers.

Posted Sept. 30, 2015, 1:24 a.m.

Hello Vidar,

1. I used the SDK 8.0.0, and I think I used s110 v 8.0.0, am using a custom - made PCB without leds, I can check toggled I/O if you can tell me which one is connected to Led 1.

2. I found why I could not flash using "Make target" : I had to edit makefile and rearrange the flash/ flash soft device as follows (otherwise I got an error message that flash cannot process both reset and program commands...)

Now I am able to flash from "Make target" and start a debug session but there is a problem with program execution.

I think that changes I made to softdevice_handller.c caused it: I had to manually add the definition for variable "m_ble_evt_handler" from the file "ble_stack_handler_types.h" otherwise the project would not compile.

As for the last error message, I think I left the GDB server open externally, together with explicit path on the debug configuration menu.

Once I put the string "_build\nrf51422_xxac_s110.out", it solved the problem.

I am lost this time with no more ideas, since there should be no more issues.

I attach a series of pictures of the process I use to debug, from compile to debug session

Posted Sept. 30, 2015, 2:52 p.m.

@Avi_H, did you use the example attached to this tutorial together with SDK 8.0.0, and s110 v.8.0.0? In that case, is the board advertising (led 1 will start blinking).

No source at 0x596 is to be expected as it is within the Softdevice/MBR region. I assume you are not able to reach main?

Btw, did you find the reason for the error message you had in your previous comment while running the debug launcher?

Posted Oct. 24, 2015, 9:05 p.m.

Compilation works fine, butI have similar problem with debug: Also embsysregview shows no registers :(

Segger output is: SEGGER J-Link GDB Server V5.02f Command Line Version

JLinkARM.dll V5.02f (DLL compiled Oct 2 2015 20:51:34)

-----GDB Server start settings----- GDBInit file: none GDB Server Listening port: 2331 SWO raw output listening port: 2332 Terminal I/O port: 2333 Accept remote connection: localhost only Generate logfile: off Verify download: on Init regs on start: on Silent mode: off Single run mode: on Target connection timeout: 0 ms ------J-Link related settings------ J-Link Host interface: USB J-Link script: none J-Link settings file: none ------Target related settings------ Target device: nRF51822_xxAA Target interface: SWD Target interface speed: 1000kHz Target endian: little

...Target halted (PC = 0xFFFFFFFE)

Why 0xFFFFFFFE ??? Trying to resolve...

Posted Oct. 26, 2015, 10:46 a.m.

@ekrashtan, did you remember to compile with debugging enabled. That is, change the compiler flag '-O3' to '-O0 -g3' in your makefile?

Posted Oct. 27, 2015, 10:20 p.m.

Ok, I found my problem. I have custom board with first revision chip. Changing in Makefile DEVICE_VARIANT from "xxac" to 'xxaa" probably will solve this problem, but unfortunately I have not enough RAM to check this theory.

Posted Oct. 28, 2015, 3:22 a.m.

Hi,

I followed the tutorial, and if I make either target, I get a bin and a hex file, however when I look at main.c in the Application folder, I see loads of errors in the Eclipse IDE editor window (little bug symbols on the left) for 'xxxxxx' could not be resolved.

e.g. BLE_GAP_CONN_SEC_MODE_SET_OPEN(..... ) could not be resolved.

main.c is definitely being compiled, because if I insert

# error "THIS IS AN ERROR"

In the top of main.c the compile halt showing this error.

So I presume this must just be some sort of Eclipse IDE path issue rather than something to do with the compilation / build ??

Posted Oct. 28, 2015, 11:10 a.m.

Hi, the project is being built outside of Eclipse with GNU make and the GNU toolchain. In other words, actual build errors will be shown in the build output log. The errors you're seeing are typically that Eclipse does not have the include paths and defines used in the build.

Paths and symbols can be set manually by opening project properties, click on the C/C++ General shown in the list, then Paths and symbols. In the include tab you can add the missing paths, and defines under the symbols tab.

However, it is possible to enable the CDT parser to do this automaticcally by parsing the build output. See 'Edit Makefile' and 'Enable auto discovery of symbols, include paths and compiler settings' sections above for more details.

Posted Nov. 2, 2015, 12:34 a.m.

@Roger Clark,

Ensure that you follow what Vidar presented with regards to the CDT parser. Even when I did this I had virtually the same error as what you are experiencing... The way I resolved it was to do "Project-Clean" and then a "Project-Build" ... once I did that all of the errors went away and everything compiled correctly.

Cheers,

Sam

Posted Nov. 10, 2015, 9:58 a.m.

@gaurav, when and where did you get the path error. The attachment was missing.

Posted Nov. 10, 2015, 9:27 p.m.

Hi

Kindly check my command line, it doesn't like working properly.

Posted Nov. 10, 2015, 11:55 p.m.

Hi How does core utility helps to run the program? Do i need to put core utility in a specific path or in a certain location because some how my CMD is stuck at mkdir may be then my core utility is causing problem

thanks Gaurav

Posted Nov. 11, 2015, 4:31 p.m.

Coreutil includes the mkdir program used by the makefile to create the _build directory. Please check that the mkdir.exe is located in C:\Program Files (x86)\GnuWin32\bin, and If it is, try to change directory in cmd to c:\, and type mkdir test see if you get a folder named "test" (c:\test)

Posted Nov. 12, 2015, 12:17 a.m.

Hi I have achieved that "test" folder in c drive. what next? Now again I have worked on commandprompt.thanks Gaurav

Posted Nov. 16, 2015, 2:20 p.m.

Not exactly sure why this is, but it looks like Make is not finding system_nrf52.c. Have you tried to remove the whitespace in "Nordic Semiconductor" in your path?

Posted Nov. 16, 2015, 11:21 p.m.

Hi Vidar

I am trying to connect with Jlink debugger but these error are popping up. Even I am not sure about that my code is being transferred to board or not because there is no blinky seen.

2. No source available for "0x0"

Posted Nov. 17, 2015, 11:37 a.m.

Where you to get the blinky example working by following the instructions in the "before we begin" section? Also, did you use the attached blinky example modified to support debugging?

Posted Nov. 18, 2015, 4:02 p.m.

Hello Everyone,

I've completed the setup as mentioned in the above tutorial and able to build the sample ble_app_hrs_dfu code. But, I observe a few problems as shown in the screenshot

I've installed the device family pack. I observed that the version number of installed files is different from what is expected during the build. The files installed are: NordicSemiconductor.nRF_BLE.3.0.1.pdsc NordicSemiconductor.nRF_DeviceFamilyPack.8.0.3.pdsc

But the build is expecting the below files: NordicSemiconductor.nRF_BLE.3.1.0.pdsc NordicSemiconductor.nRF_DeviceFamilyPack.8.2.0.pdsc

Can anyone suggest me how I change the version of the files required.?

Also, I find the below two errors

Your help is greatly appreciated. Thank you

Posted Nov. 18, 2015, 7:49 p.m.

Hi Ric

It seems that GCC ARM Embedded is not set properly at the desired location(check your path once again). I would also recommend using all the 32- bit tools, Don't mix 32/64 bit tools. Let me know if this help.

thanks Gaurav

Posted Nov. 18, 2015, 11:32 p.m.

Hi Vidar

I downloaded the blinky attachment. I imported that with a existing makefile. can you tell me how did you access these .cproject, .project and blinky_gcc_nrf52.ld ? May be i am messing up with those. Please give detailed process.

thanks Gaurav

Posted Nov. 19, 2015, 11:51 a.m.

Hi Gaurav and Vidar,

The location path is set correctly and I can compare them with the screenshots that Vidar has shared. The problem that I face is the C/C++ standard which is set to gnu11/gnu++11 is not located.

Any pointers as to where I can find that this standard is set by Eclipse. Thank you

Regards, Richard Lobo

Posted Nov. 19, 2015, 2:35 p.m.

@Ric, find it strange that it's looking for "arm-none-eabi-gcc-std=gnu++11". -std=gnu++11 is a compiler flag which we don't use, and it's not a program either. In our makefiles we use --std=gnu99. I was unable to reproduce it here. Wonder if it could be somehow related to the "missing" device family pack. Did you install the packs via the packs manager?

If you manage to install the packs you can try to set the nordic device in project properties -> C/C++ Buil -> Settings -> Devices, and make sure that GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc) is selected in the "toolchains" tab.

@guarav, I'm not sure I understand your question. The .cproject and the .project are project files for Eclipse. You can create your own project by following the instructions in the Create a new Eclipse project section above.

Posted Nov. 20, 2015, 12:46 p.m.

Hi Vidar,

I've got rid of the errror: Program "arm-none-eabi-gcc-std=gnu++11" not found in PATH. Not a useful solution though but deleting and importing the project again helped me fix the problem. I guess there were issues due to some code residue.

But I still face the problem of the Device family version numbers. On installing the packs via the Pack Manager, I find "NordicSemiconductor.nRF_DeviceFamilyPack.pdsc" in the folder. You can view this in the screenshot

But there is no entry in the C:......\Packages.cache folder where Eclipse is looking for. I've tried a dirty solution of renaming these files and placing them in the cache folder. But still I've no success.

Do you have any idea how I could solve this issue?

Thanks again Richard

Posted Nov. 23, 2015, 3:10 p.m.

Ric, please try to extract the attached .zip and replace it with the same folder in your Eclipse directory to see if it makes any difference(\eclipse\Packages). Still, if this works it would be good to know the root cause of this.

Attached screenshot of how I installed it here, first I clicked on the refresh button (highlighted), then right click on the device family pack to install. Please let me know if you used a different approach.

Attachment:

Packages.zip

P.S. I'd recommend posting questions to this tutorial in the questions sections with reference to this tutorial since I don't get any email notifications when comments are added here.

Posted Nov. 23, 2015, 6:52 p.m.

@Vidar: Thank you. Refreshing the pack and reinstalling worked. Cheers!!! I have problem with flashing and will post it in a seperate thread

Posted Dec. 24, 2015, 12:21 p.m.

Hi,

i tried to import existing priject, but in my case i can't able to see the main.c file .Please give any idea for this.If i want to, do some changes on example project means where i have to do?

import path file as
C:\NORDICC\examples\peripheral\123\pca20006\blank\armgcc

Where i did mistake .

Posted Dec. 28, 2015, 11:54 a.m.

i make a new "Makefile! project" using example in SDK first i use the "blinky" , it looking likes can be work then i try to use " blr_app_hrs_c " i do the same step to compile program but it can't work

like this

how to solve it help me PLZ!

Posted Jan. 4, 2016, 12:04 p.m.

@Gomathi, unless you're using the attached example projects you need to create a new project as described in the "Create a new Eclipse project" section.

@kien, I've tried to describe the steps in the "Create a new Eclipse project" section, please let me know if it's still unclear.

Posted Jan. 5, 2016, 7:28 a.m.

hi Vidar , i did as in the "Create a new Eclipse project" section. but here am getting error like this , and also in my make file i did not compile these files.

stdbool.h stdint.h nrf_gpio.h boards.h

So my doubt at this point is how to include all those files in to make file. i) as you mentioned i need to include those files in make file i.e in ASM_SOURCE_FILES & C_SOURCE_FILES path. which files i need to include here,

ii)if i want to include header files means, what should i do?

Thanks

Gomathiimage description(/attachment/6ae4383e602818b2ecb54f1441cd239f)(/attachment/a50975088b5745446a7ae5b8e7d1630d)(/attachment/810e6c820d3b5f496c711ddc5594f276)(/attachment/aa5389b834ef053d8dd2e26247e0f2f6)

Posted Jan. 13, 2016, 5:56 a.m.

How can I get readable in Console pane in Debug View. I'm seeing below unreadable characters.

Posted Jan. 13, 2016, 5:19 p.m.

Dear Nordic,

I am having trouble setting up the debugging environment, having the following error when trying to launch the debug session:

Error in final launch sequence failed to execute MI command: -exec -run Error message from debugger back end: Don't know how to run, try "help target"

I am using the PCA10028 board, should have the target nRF51422_xxACA

Any info is welcomed.

Best regards, Laszlo

Posted Jan. 14, 2016, 3:55 p.m.

Is there a way to tell Eclipse/gdb which Nordic Board/J-Link combination to use? At the moment, I need to shut down all boards but the one I want it to use. Other IDEs prompt me to select the board I want.

Posted Jan. 14, 2016, 8:54 p.m.

Dear All,

Meantime I fixed my issue. the original issue posted above was related that I configured a C/C++ debug configuration with the gdb paths, but that won't start the gdb server - obvious fail.

When configuring the J-link debug configuration, the gdb server was started but the gdb from the arm tools not, ${cross_prefix}gdb${cross_suffix} even when I selected the ARM CROSS tools and had the right prefix gdb was still not started, though I have the tools in my windows path.

As a dirty fix I just added the gdb executable to the Debugger GDB Client Setup Executable :

Br, Laszlo

Posted Jan. 18, 2016, 5:35 p.m.

Sorry for the slow response on the last comments that hasn't been answered. The reason for that is that I'm not being notified when new comments are added. So please post question to this tutorial in the questions section here: https://devzone.nordicsemi.com/questions/

@Gomathi, I'd suggest to start by importing one of the reference examples first to have a working example to compare to. One problem is that you haven't built the example with "verbosity" enabled so CDT is not able to parse the include paths.

@Jake, you can try to turn of semihosting in the debug launcher configuration. Semihosting is not supported on 51.

@Richard von Lehe, try to remove the "-nogui" option in the "other options field" in debug configuarions-> debugger. This should give you a pop-up menu asking you to select the board you want to debug.

@Laszlo, Setting the Segger path as explained in Setting up Eclipse the first time -> Configure environment should update the path variables, but the change you did will also work.

Posted Jan. 26, 2016, 11:02 a.m.

I am missing the days when we used Microsoft Visual Studio and everything worked without investing hours to setup a development environment with Eclipse + makefail (sorry, typo :D) ...

Simple question, how is this possible:

    // Main loop
while (1)
{
power_manage();

if (g_ProtocolParser.Parse(0/*TODO: replace by byte got via UART*/))
{
g_ProtocolParser.Test(2/*TODO: find reason for "could not be resolved" issue*/);

ICommand *pCommand = g_ProtocolParser.GetCommand();

if (pCommand != NULL)
{
pCommand->Execute();
}
}
}


The code compiles (so makefile is fine). But Eclipse is claiming Method 'Test' could not be resolved. even it is a method of the same class. It does not complain anything about the Parse() method ...

Cleaning, refreshing, restating Eclipse didn't help ...

Posted Feb. 2, 2016, 12:33 a.m.

This tutorial was a great help, many thanks.

I ended up getting it to work without using makefiles in native Eclipse, including JLInk Debugging, however the issue with ASM files having to be .S not .s was a problem as I could not use links to the nordic SDK, I did not want to copy all the files all the time and preferred links.

I found that by adding the assembler as a tool for .s (as well as .S) i got it to kick in and assemble ok.

However because something locks the system wide setting which seem to think .s is the same as .S this needs to be done by overriding the project type settings.

Now works fine

Posted Feb. 2, 2016, 10:26 a.m.

Thanks for the tutorial, I'm stucked with the nrfjprog part where I've to flash the firmware into the board. When I tried installing by changing to the directory where the install is found "nRF5x-Command-Line-Tools_8_2_0_Linux-x86_64/nrfjprog" and execute it using both ./libnrfjprogdll.so.8.2.0 and ./libjlinkarm_nrf52_nrfjprogdll.so.8.2.0 and end up with "segmentation fault". What have I done wrong? Thanks!

Posted Feb. 18, 2016, 10:20 a.m.

Hi all,

I'm not being notified when new comments are added here, and I forget to regularly check for new ones. Please create a new thread in the questions section of the forum to get an answer in a more timely manner.

Posted March 11, 2016, 4:51 p.m.

Hi Vidar,

What are the advantages of using the GnuWin Make32 you recommend over the one included in the GNU ARM Eclipse Windows Build Tools? (which also has a 64-bits version).

Regards,

Liviu

Posted March 11, 2016, 6:17 p.m.

Hi Liviu,

Thanks for the input. I don't think there are any. The reason I have suggested GNU make from Gnuwin is simply that it was proposed in an old application note we had on GCC and that it works well. But seems like I should consider your build tools instead, assume the 64-bit version can bring some improvements. At least it has a newer version of GNU Make. GnuWin still has v3.8.1 and it doesn't appear to be maintained anymore.

Posted March 12, 2016, 1:01 a.m.

@Vidar, the nRF5 SDK 11 lists support for GCC ARM Embedded 4.9 2015q1 however you specify using 5.2. I ran into the "Unexpected hwbreak stop reason" error in gdb 5.2 and had to revert back to 4.9 series (reference: https://devzone.nordicsemi.com/question/70735 ). You may want to consider switching the toolchain version in the tutorial.

Posted March 12, 2016, 4:24 p.m.

@Lucas, thanks for letting me know! I have actually not been able to reproduce this issue on neither my windows or ubuntu setup, but I'll suggest to use the 4.9.x release for now.

Posted March 16, 2016, 12:51 a.m.

@vidar , Nice tutorial

But How can compile C++ file using g++ ? This would be helpful , what shall i add in the Makefile to to make it work with C++

Thanks

Posted March 17, 2016, 1:20 a.m.

@Vidar, may I suggest including a debug launch configuration with your starter projects? Just one less thing to setup and get wrong (e.g. using gdb instead of the cross-gdb). You can change the launch configuration to be stored at the root of the project by going to the debug configuration Source tab and selecting "Shared file" instead of "Local file". I also check "Display is favorites menu" so it's faster to find.

Posted March 17, 2016, 10:36 a.m.

@Lucas, thanks again for the input. I wasn't aware of this, but I'll make sure try this the next time.

Posted March 30, 2016, 9:35 p.m.

@Vidar This tutorial/guide is absolutely fantastic. Being fairly green in embedded development in general and as a complete newbie to ARM and using the GNU toolchain for cross platform development, this guide is exactly what I needed to get started.

Thank you so much for it.

Moving on, I just got a development kit (PCA10040) and there is only one piece that doesn't seem to be working for me; the very last one, peripherals.

I finally got it working, and figured I'd report on what I had to do (more accurately: what I did do) to get it working.

The first issue I encountered related to this was in the packs installation. Initially I had installed the latest version of the device family pack (8.5.0) as you had suggested. However, with that version installed, when I go to Project Properties > C/C++ Build > Settings > Devices, there are no devices available -- it indicates that a device pack has to be installed to select a device.

I have to go down to version 8.3.2 to get the devices to show up:

So, going with 8.3.2, everything seems to work fine until I try to actually open the peripherals view when in the debug perspective:

I also see this message in the console when I get the peripheral error message:

Parsing SVD file "C:\Users\astewart\dev\c\Packages\NordicSemiconductor\nRF_DeviceFamilyPack\8.5.0\SVD\nrf52.svd"...

It looks like it's trying to load version 8.5.0 of the peripheral info.. possibly because I downloaded that one first? (Even though I uninstalled it later)

So, there were 3 more steps I went through before I got it working:

Update the ".cproject" file.

For some reason, the ".cproject" file (in the same folder as Makefile) still had the following:

        <storageModule moduleId="ilg.gnuarmeclipse.managedbuild.packs">
<option id="cmsis.device.name" value="nRF52832_xxAA"/>
<option id="cmsis.family.name" value="nRF52 Series"/>
<option id="cmsis.device.vendor.name" value="Nordic Semiconductor"/>
<option id="cmsis.device.vendor.id" value="54"/>
<option id="cmsis.device.pack.vendor" value="NordicSemiconductor"/>
<option id="cmsis.device.pack.name" value="nRF_DeviceFamilyPack"/>
<option id="cmsis.device.pack.version" value="8.5.0"/>
<option id="cmsis.core.name" value="Cortex-M4"/>
<option id="cmsis.compiler.define" value="NRF52"/>
<memory section="IRAM1" size="0x10000" start="0x20000000" startup="0"/>
<memory section="IROM1" size="0x80000" start="0x00000000" startup="true"/>
</storageModule>


Note the "8.5.0" above. I changed that to a "8.3.2" to match the version I had installed. Unfortunately, even with that change I still got the same error and this message in console:

Parsing SVD file "C:\Users\astewart\dev\c\Packages\NordicSemiconductor\nRF_DeviceFamilyPack\8.5.0\SVD\nrf52.svd"...

Well, that's annoying. It looks like it's trying to use the most recent version, regardless of what's actually installed..

Delete newer versions of "nRF_DeviceFamilyPack" from the packs cache.

Does not seem to be enough to uninstall them.. if it sees version 8.5.0, it seems to want to try to load the info from 8.5.0.

To delete them, find your Packages folder (for me it's a sibling to my eclipse workspace folder). In [Packages]/.cache , delete the .pack or .pdsc files for nRF_DeviceFamilyPack with a version greater than 8.3.2.

In the same folder, there is a file called: .content_www_keil_com_pack.xml. Within this file, search for <package name="nRF_DeviceFamilyPack">.

That element has descendant <version> elements. Delete each <version> element (and its descendants) with a version (the name attribute) greater than "8.3.2".

And that's it!.... not.

Modify the .installed_devices_boards_books.xml file

Now, if you try to load the peripheral view, it complains that it can't find the file at [Packages]/SVD/nrf51.svd. That's because that file doesn't exist. There is another XML file to edit, at [Packages]/.cache/.installed_devices_boards_books.xml.

Within this file, find the line:

<property name="svd.file">SVD/nrf52.svd</property>


And change it to:

<property name="svd.file">NordicSemiconductor/nRF_DeviceFamilyPack/8.3.2/SVD/nrf52.svd</property>


Now you should be all set. I don't know if every one of these steps was actually necessary, once I got it working I didn't bother backtracking to check.

Posted March 31, 2016, 3:40 p.m.

@astewart, thanks for taking the time to write all this up! I have actually experienced the same with the newer device family packs. I suspect this is a problem with the Eclipses packs manager, it is experimental after all, but I am not sure. Have filed a bug report to their github repo.

Posted June 6, 2016, 11:52 p.m.

Hi

Thanks for the tutorial. I am getting an error while debugging, having the following error when trying to launch the debug session:

Error in final launch sequence Error executing step execute method: stepStartTrackingBreakpoints java.lang.reflect.InvocationTargetException

I am using the PCA10028 board.

Regards!

Posted June 8, 2016, 8:32 a.m.

solution was to uninstall, and reinstall in a user directory ensuring no whitespace in the path directory. This also requires editing the makefile.windows correctly and replacing the path environment variables.

It does not seem necessary to run in an Admin window for successful target build

Can Nordic comment whether the toolset was tested in a Windows environment? I'm using Win 10 64 bit.

Posted June 13, 2016, 10:56 a.m.

@johnmcdnz, I've tested it on W7 64, but it has the same problem with whitespaces. One workaround is to remove any whitespaces from the path as mentioned in Before we begin -> Nordic nRF5x SDK section

Posted June 14, 2016, 8:20 p.m.

Is there an easier method to import all the Source-Files? In some examples I need about half an hour to find and import all sources from the Makefile o.O

Posted June 20, 2016, 12:24 p.m.

Unfortunately we do not have a build script to generate eclipse project, so for now the only option is to do it manually.

CMAKE (https://cmake.org/Wiki/Eclipse_CDT4_Generator) may be an option, but have not had time to evaluate it.

Posted June 23, 2016, 11:01 a.m.

I have been trying to follow example program since 2 weeks. but i am getting this error always

make: * [_build/system_nrf51.o] Fehler 2 Also I am facing this error also. I cant open nrf_delay.c Error retrieving content description for resource '/blinky/Application/main.c'.

Posted June 24, 2016, 3:57 p.m.

Do you have system_nrf51.c in this directory: C:/nRF51_SDK_8.1.0_b6ed55f/components/toolchain/system_nrf51.c?

Posted June 28, 2016, 8:43 p.m.

I had some issues in starting GDB. If you have more than one DK connected, in 'Debugger' tab, 'Connection' you should add the USB number of the chosen DevKit.

Posted June 30, 2016, 3:20 p.m.

Thanks for the feedback. Another option is to remove the "-nogui" option so that you get asked which device to connet to when opening a new debug session.

Posted July 11, 2016, 4:36 p.m.

@vidar, just to add my experiences to the comments about the experimental pack manger. I also had problems getting the peripherals display working similar, but not quite the same, as @astewart. I manged to resolve part of the problem using the suggestions provided by @astewart. However, the final issue was a little different and is definitely related to a bug in the pack manager. Specifically, the version of the nRF_DeviceFamily pack that was installed in my case was 8.6.1. I updated the references mentioned by @astewart to version 8.6.1 but Eclipse still failed to find it. I then determined the path where the packs were installed (this was not obvious and was indeed different than described by others but I did find it.) There was a file named NordicSemiconductor.nRF_DeviceFamilyPack.8.6.1.pack. However, the corresponding .pdsc file was named NordicSemiconductor.nRF_DeviceFamilyPack.8.3.2.pdsc. I opened the .pdsc file with a text editor and found that it did contain the XML descriptions of all released packs up to 8.6.1 as I expected. I then renamed that file to NordicSemiconductor.nRF_DeviceFamilyPack.8.6.1.pdsc and the peripheral display then worked as expected.

Posted July 17, 2016, 9:21 a.m.

This is a great tutorial!

It helped alot when I had to port the firmware development from Linux to windows.

Thank you very much!

Posted July 18, 2016, 2:36 p.m.

Hey Vidar,

Thank you for your awesome Eclipse/NRF SDK Tutorial. I get nearly anything to work except of the auto discovering of all the include files.

I set up the "CDT GCC Build Output Parser" to >>(.gcc)|(.[gc]++)<< and the "CDT GCC Built-in Compiler Settings Cross ARM" to >>arm-none-eabi-gcc ${FLAGS}${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"<< and he does find the includes stored in GNU Tools ARM Embedded (like stdint.h) but not the NRF includes (like nrf_gpio.h) I use SDK 11.0. Do I have to set up all include paths (so recursively all directories in SDK/components (241 directories!!)) manually? Or did I do something stupid? Thanks in advance, GtaSpider Posted July 19, 2016, 11:15 a.m. Hello guys for any one having problems with the hard fault before main : Check the version of the chip if it says: n51822xxaa you have version with less memory, then it is specified in the in linker file: blinky_gcc_nrf51.ld change: RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 to: RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4000 to prevent putting stack (which is put at the end of memory) out of memory bounds. I belive OP should put this into the tutorial or better tell to use correct linker file from the: SDK_PATH/components/toolchain/gcc Posted July 20, 2016, 2:15 p.m. @Ben Schleimer, thanks for the feedback and glad you found the tutorial useful. @gtaspider, problem was resolved, VERBOSE was not set so CDT was not able to parse the output of the build process. @Chobot_CZ, thanks! I've been planning to update the tutorial with this and other common problems for awhile now. Will do that as soon as time permits. Posted Aug. 3, 2016, 8:50 a.m. how to add soft device hex file to eclipse and flash both app.hex, s110.hex to the board. Posted Aug. 3, 2016, 9:29 a.m. please refer to the "flash download" section in the tutorial. The example makefile include flash targets for both application FW and softdevice. Posted Aug. 5, 2016, 2:27 p.m. Hi, I followed the tutorial up to "Nordic nRF5x SDK" section, but when I try to use the commande "make -v" on the terminal I have to following message : " 'make' is not recognized as an internal or external command". And when I try to use the make command to compile the projet, the same error comes up. I checked if the PATH variable was correctly configured, and I downloaded all of the gnuwin files, but I still don't understand why there is a such error. My OS is Windows 10, I use SDK 7.2.0 and S110 softdevice, and my target is a NRF51822 QFAC. Could you please help me to solve that issue ? Best regards, Guillaume Posted Aug. 5, 2016, 3:36 p.m. Hi, It looks like windows is not finding make.exe in your environmental paths. Please try the following: • Open cmd and type set PATH=%PATH%;"C:\Program Files (x86)\GnuWin32\bin" (change path if it is not correct in your case) • Close and open a new cmd instance and type make -v to see if you still get the same error Posted Aug. 8, 2016, 9:55 a.m. Hi, Thank you for your answer. I am now to the "Enable auto discovery of symbols, include paths and compiler settings" section, I follewed the instruction and tried to build the blinky project with SDK v11, and I have the following error : "make[1]:* no rule to make target « _build/WB », needed by « nrf51422_xxac »." I have also a few errors concerning unresolved symbols like LEDS_LIST for example. Could you please help me to solve this problem ? Guillaume Posted Aug. 9, 2016, 3:41 p.m. Hello Vidar, thanks for the answer. I replaced my 8.7.1 pack with the 8.6.0 attached to the other thread and it's correctly shown as installed in the Packs perspective, but I still have the same issue in the Device selection. Actually the list of devices is still the same as before (and each board appears multiple times in the list). Would it be possible that this list is cached somewhere and not taken from the Packs folder ? Because the Family Pack is in the Packages folder. For the other errors, yes I have replaced the toolchain variable. I have the exact same settings as you here. Anyway I've already had the same kind of issue with another cross-gcc compiler on another eclipse installation, and the only way I found not to have this error was to hide all the errors of this type. So that's not as much of a problem for me than the empty peripherals ones. I guess we all like eclipse for its intelligent editor even though there's a bit less stability than with others IDEs. (I was still on the same webpage than yesterday and it seems I edited the question with my answer instead of adding a new one. Is it possible to restore the question ? ) Posted Aug. 10, 2016, 8:18 a.m. You can try to use the package I uploaded to this thread. This is an older version, but that should not matter as we only use it for the peripheral viewer (no effect on build process). I think the errors might be related to the CDT GCC Built-in compiler Settings Cross ARM configuration. Have you replaced the "toolchain" variable with "arm-none-eabi-gcc" as shown below? Posted Aug. 10, 2016, 2:31 p.m. Hello, I mistakenly answered by editing my original question as I was still on the same webpage with the post edit in the URL :/ Is it possible to restore my question ? I tried your pack 8.6.0 and I still have the same issue. I also tried a few solutions given by astewart in the comments but none of these did the trick. I think this is a problem with the Pack manager itself. Anyway I still can debug with Keil so I guess it's ok. For the other erros I had correctly replaced$(COMMAND) by the toolchain command but I had removed the space before the flags, hence the two toolchain errors. Now they have disappeared but the error about 'true' that couldn't be resolved is still there (and has no effect so it's ok too).

Tim.

Posted Aug. 15, 2016, 8:51 a.m.

@Guillaume Levant, sorry, I overlooked you question. The error you get is likely related to whitespaces in your path:

Errors like "make: No rule to make target '_build/Nordic', needed by nrf51422_xxac". Stop can also be an indication that build tools are unable to handle whitespaces in the path. E.g, c:/nordic semicondtor/SDK/... Workaround is to remove any whitespaces you may have with underscores.

The include paths and symbols should be resolved once you are able to build without errors.

@Tim, enabling the peripheral viewer makes it easier to access peripheral registers, but is not a requirement, you can lookup the address in the nRF5x PS and access the register manually if needed.

I agree, it's most likely a bug bug with the packs manager in Eclipse. I will try to look more into it when I have more time.

Unfortunately, I don't think it's possible to restore your initial question.

Posted Aug. 16, 2016, 1:16 a.m.

I'm following the note and have successfully gotten the tools and the SDK installed. I can make the example but next step is the problem.

Problem with nrfjproj. I downloaded the program from the site listed above. I can run it and get the help. But if do this:

nordic@ubuntu:~/bin/nRF5x-Command-Line-Tools_9_0_0_Linux-x86_64/nrfjprog_SRC$./nrfjprog --family nRF52 -e I get this: ERROR: JLinkARM DLL not found. Please reinstall latest JLinkARM. Any suggestions. Also the Eclipse Mars is an older version. Should I install this or the latest version ? I needed to install JAVA (running on Ubuntu 14.2) and when I try to run Eclipse I get this: Eclipse: JVM terminated. Exit code=13 /usr/bin/java -Dosgi.requiredJavaVersion=1.7 -XX:MaxPermSize=256m -Xms256m -Xmx1024m -jar /home/nordic/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar -os linux -ws gtk -arch x86 -showsplash /home/nordic/Downloads/eclipse//plugins/org.eclipse.platform_4.5.2.v20160212-1500/splash.bmp -launcher /home/nordic/Downloads/eclipse/eclipse -name Eclipse --launcher.library /home/nordic/Downloads/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.300.v20150602-1417/eclipse_1612.so -startup /home/nordic/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar --launcher.appendVmargs -exitdata 83001c -product org.eclipse.epp.package.cpp.product -vm /usr/bin/java -vmargs -Dosgi.requiredJavaVersion=1.7 -XX:MaxPermSize=256m -Xms256m -Xmx1024m -jar /home/nordic/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar Thanks for the help. --jim schimpf Posted Aug. 16, 2016, 2:52 p.m. @Jim, please refer to Håkon's answer in this thread Posted Aug. 17, 2016, 12:23 p.m. (1) Got Eclipse Mars going, finally got the install right and I can open projects and compile (with errors but the make works...) (2) The command line tools available are now nRF5x-Command-Line-Tools_9_0_0_Linux-x86_64 not the _5 referred to in the note and the files Håkon referred to are not there. Also how do files get into /opt/... The download is only a TAR file and just expands into the directory with name above. There is only a release note and no other installation instructions. (3) I got the plug-ins and marketplace items for Eclipse but I cannot find the SEGGER stuff to link to as referred to in the note. Is there another plug in ? I got the JLink stuff from the marketplace but I did a "find / -name ..." and cannot find SEGGER or JLink in my file system. Thank you for the help. --jim schimpf Posted Aug. 17, 2016, 12:37 p.m. Found the answer to (3) above here https://gnuarmeclipse.github.io/debug/jlink/install/ This is how to install the SEGGER stuff. Posted Aug. 17, 2016, 12:44 p.m. Also now (2) is fixed nrfjprog now runs with the SEGGER stuff installed. The installation made that work now. --jim schimpf Posted Aug. 18, 2016, 5:37 a.m. I got the Blinky project (pca10036) to build by copying your Blinky Zip files into the none/armgcc folder of pca10036. But that failed to compile the nf_delay.c function. I couldn't find nrf.h. I fixed this by copying the original Makefile back to here. The original make file has abspath in all the Makefile paths while the original does not. Now it builds just fine. When I try to debug after building the debug configuration as shown in the note I get a GDB error . Any suggestions --jim schimpf Posted Aug. 18, 2016, 6:03 a.m. I found I had to "sudo apt-get install lib32ncurses5" and then arm-none-eabi-gdb would run and --version would work from the command line but I still get the above window when I try to debug the blinky application. Posted Aug. 20, 2016, 6:23 p.m. Hi, I followed the procedure to make a file using gcc but at the end I am getting this error while doing make on all of the example projects. C:\Users\ASUS1\Desktop\nRF5_SDK_11.0.0_89a8197(1)\examples\peripheral\blinky\pca10040\s132\armgcc>make rm -rf _build echo Makefile Makefile mkdir _build Linking target: nrf52832_xxaa_s132.out c:/program files (x86)/gnu tools arm embedded/4.9 2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol Reset_Handler; defaulting to 0001c000 make[1]: Entering directory C:/Users/ASUS1/Desktop/nRF5_SDK_11.0.0_89a8197(1)/examples/peripheral/blinky/pca10040/s132/armgcc' Preparing: nrf52832_xxaa_s132.bin Preparing: nrf52832_xxaa_s132.hex '' text data bss dec hex filename 120 12 28 160 a0 _build/nrf52832_xxaa_s132.out '' I am getting the same output for all different applications, is there something wrong with the installation? Posted Aug. 23, 2016, 10:08 p.m. Thanks for the tutorial. I've got every thing to work except the debugging, it stops every time at : ffffffff: add %al,%al no matter where is my breakpoint and shows : No source available for 0xffffffff I'm using the -O0 -g3 flags SEGGER J-Link GDB Server V5.12e Command Line Version JLinkARM.dll V5.12e (DLL compiled Apr 29 2016 15:06:27) -----GDB Server start settings----- GDBInit file: none GDB Server Listening port: 2331 SWO raw output listening port: 2332 Terminal I/O port: 2333 Accept remote connection: localhost only Generate logfile: off Verify download: on Init regs on start: off Silent mode: off Single run mode: on Target connection timeout: 0 ms ------J-Link related settings------ J-Link Host interface: USB J-Link script: none J-Link settings file: none ------Target related settings------ Target device: nRF51822_xxAA Target interface: SWD Target interface speed: 1000kHz Target endian: little Connecting to J-Link... J-Link is connected. Firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46 Hardware: V8.00 S/N: 308622870 Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFULL Checking target voltage... Target voltage: 3.33 V Listening on TCP/IP port 2331 Connecting to target...Connected to target Waiting for GDB connection...Connected to 127.0.0.1 Reading all registers Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) Reading 64 bytes @ address 0xFFFFFFC0 Reading 8 bytes @ address 0xFFFFFFFF Reading 7 bytes @ address 0xFFFFFFFF Target interface speed set to 1000 kHz Select auto target interface speed (2000 kHz) Flash breakpoints enabled Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) Reading 8 bytes @ address 0xFFFFFFFF Reading 7 bytes @ address 0xFFFFFFFF Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) Reading 64 bytes @ address 0x000184C0 Read 1 bytes @ address 0x00018508 (Data = 0x3B) Reading 64 bytes @ address 0x000188C0 Read 1 bytes @ address 0x00018924 (Data = 0x18) Reading 64 bytes @ address 0x000187C0 Reading 64 bytes @ address 0x00018800 Read 1 bytes @ address 0x00018802 (Data = 0x15) Read 1 bytes @ address 0x000184F0 (Data = 0x80) Read 1 bytes @ address 0x00018506 (Data = 0x36) Read 1 bytes @ address 0x0001856C (Data = 0x02) Reading 64 bytes @ address 0x00018840 Read 1 bytes @ address 0x0001886C (Data = 0x14) Read 1 bytes @ address 0x000187F4 (Data = 0x80) R0 = 00000007, R1 = 00000000, R2 = 00000190, R3 = 00000007 R4 = 00000000, R5 = 00000000, R6 = FFFFFFFF, R7 = 20003FF0 R8 = FFFFFFFF, R9 = FFFFFFFF, R10= 1FFF4000, R11= 00000000 R12= FFFFFFFF, R13= 20003FF0, MSP= 20003FF0, PSP= FFFFFFFC R14(LR) = 000186EB, R15(PC) = 00018802 XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000 CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00 Reading all registers Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) Reading 8 bytes @ address 0xFFFFFFFF Reading 7 bytes @ address 0xFFFFFFFF Performing single step... ...Breakpoint reached @ address 0x00018804 Reading all registers Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) Reading 64 bytes @ address 0xFFFFFFC0 Reading 8 bytes @ address 0xFFFFFFFF Reading 7 bytes @ address 0xFFFFFFFF Reading 64 bytes @ address 0x00000000 Reading 64 bytes @ address 0x00000040  please help! Posted Sept. 6, 2016, 10:36 a.m. Apologies for not responding sooner, I have been out of the office. It's better to create a new thread in the forum rather than posting a comment so that more people sees the question. @jim, have you tried to add the toolchain directory to your PATH? Also, do you get the version number if you call arm-none-eabi-gdb --version in the terminal from any directory but the toolchain directory? @KK, are you still experiencing this issue? In case not, please create a new question and include the SDK version in your description. @KnightYusuf, please check if the GDB executable is set to arm-none-eabi-gdb as shown here: https://devzone.nordicsemi.com/question/90734/unable-to-flash-elf-file-in-nrf51-development-kit-using-eclipse/?answer=90790#post-id-90790 Posted Sept. 12, 2016, 3:23 p.m. This problem is solved, I fogot to install the Core Utils for Windows. I leave my quesion to help others to eliminate the possile agony. Hi Vidar, I have successfully installed the tools on both windoes 10 and mac, and now I need to install them on boot camp. I have installed maker and arm-none-eabi-gcc, they work well, then when I tried to compile the blinky example in the terminal, I always get rm -rf _build process_begin: CreateProcess(NULL, rm -rf _build, ...) failed. make (e=2): The system cannot find the file specified. make: * [clean] Fehler 2 According the tutorial, the tool chain is not properlly configured, but actually I have changed the Makefile.windows file in C:\NordicSemiconductors\SDK\nRF5_SDK_11.0.0_89a8197\components\toolchain\gcc as follows, ifeq ($(findstring 86, $(ProgramFiles)), ) PROGFILES := C:/Program Files else PROGFILES := C:/Program Files (x86) endif GNU_INSTALL_ROOT :=$(PROGFILES)/GNU Tools ARM Embedded/5.4 2016q2

GNU_VERSION := 5.4.2

GNU_PREFIX := arm-none-eabi

The system path should also be right, by typing 'path' in the terminal, I get:

.....
C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q2\bin;C:\Program Files (x86)\GnuWin32\bin
.....


I have installed and reinstalled the gnu and make tools for several times, now I start to doubt th e feasiblity to install them in boot camp.

Could you give me any hints? Many thanks!

Uly

Posted Sept. 13, 2016, 3:47 p.m.

@uly, does rm -rf TESTFOLDER work from the command line?

Posted Sept. 20, 2016, 3:05 p.m.

New update,

It will work with sdk11. Just not SDK12.

I saw another issue. The hex file which eclipse made will work with 51422 on pca10028. but not work on a 51822 board. But the hex file came with sdk in blinky directory will work with both boards.

After programming, the led will blink on pca10028 but not 51822 board. but the hex come with sdk works both board.

Any help will be appreciated.

Thanks,

Ty

old post:

Hi, When I tried the blinky example with sdk12. I still have the "No rule to make target" error make[1]: * No rule to make target _build/nrf_delay.o', needed bynrf51422_xxac'. Stop.

I am sure there is no space in the directory.

How I can solve this problem?

Thanks.

Ty

Posted Sept. 20, 2016, 3:52 p.m.

@folinc, are you using the Makefile included in SDK 12? Makefiles from older SDKs will not work as the build 'recipe' has changed.

Posted Sept. 27, 2016, 2:58 p.m.

I am having trouble building using the Makefile as described under "Nordic nRF5x SDK". When attempting to make, the cmd will not recognize the command.

I have verified that I installed the toolchain and updated the path correctly:

And that I have updated the makefile.windows toolchain path:

And I have reinstalled the GNU Make Utility and Core Utilities Package as well, in an attempt to resolve the problem. Any advice I could get on this issue would be very helpful.

Posted Sept. 29, 2016, 2:18 p.m.

Hi, have you added the path to make in your env. path? Default install directory is C:\Program Files (x86)\GnuWin32\bin

Posted Oct. 4, 2016, 7:17 a.m.

Hello all,

this is a great tutorial! Very glad to see the effort put into setting up Eclipse for dev with Nordic's great family of devices. I've pretty much gone through the whole tutorial and gotten everything to work, except for debugging...

Everytime I start the debugger, I get the dreaded "no source available for main()..." error. I've, to my knowledge, followed the tutorial almost word for word, trying to get my own ble_hrs example running. Everything builds/compiles nicely, and I am able to download to my device. I just can't seem to get past this debugging issue.

Currently I am using a PCA10028, and trying to use SDK8.0 with soft device 8. Furthermore I am using the 4.9.3 toolchain, and my JLINK version is 5.12. In my makefile, I have set my -O0 and -g3 flags. What else could my problem possibly be?

Posted Oct. 4, 2016, 11:39 a.m.

Hello,

Thanks for the feedback! "no source available for main()..." indicates that there is no debug symbols in the .out file. I think the problem may be that we used link time optimization in SDK 8, which used to strip away the debug symbols despite having built with the 'g3' option. Please try to remove -flto from CFLAGS. Ref. https://gcc.gnu.org/wiki/LinkTimeOptimization

Posted Oct. 4, 2016, 11:13 p.m.

Just wanted to confirm that Vidar's solution fixed my problem incase anyone else might run into the same issue. Thanks again.

Posted Oct. 5, 2016, 9:42 p.m.

I'm continually having issues getting the ble_app_hrs example to debug properly.

1) peer_manager_init(erase_bonds); is causing the debugger to lose focus. No source available for "0xfffffffe"

2) If I bypass peer_manager_init(erase_bonds); the code will execute up until power_manager(); However again here the debugger drops again with No source available for "0xfffffffe"

Makefile: I altered the default settings for Debug: CFLAGS += -Wall -Werror -O0 -g3

Linkerfile - I am developing on nRF51822 QFAA there I altered the Linkerfile to:

SEARCH_DIR(.) GROUP(-lgcc -lc -lnosys) MEMORY { FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000 RAM (rwx) : ORIGIN = 0x20002500, LENGTH = 0x1B00 } SECTIONS { .fs_data : { PROVIDE(start_fs_data = .); KEEP(*(.fs_data)) PROVIDE(stop_fs_data = .); } > RAM } INSERT AFTER .data; INCLUDE "nrf5x_common.ld"

My JLink debug settings should be fine as they work fine on SDK6.1 and SDK10.

I was told that there are bugs in the nrf5x_common.ld file, but I have not found any response from Nordic on this.

I have spent 2 days simply trying to get this SDK12 example to debug. This shouldn't be this difficult.

Posted Oct. 6, 2016, 9:11 a.m.

I couldn't reproduce this with the hrs example in SDK 12.0.0 with your linker configurations, have you done any other changes to the example?

Please include a dump of the core registers, I'm particularly interested in what the the exception number is in the program status register when you get the 'No source available for "0xfffffffe"' error.

Posted Oct. 12, 2016, 6:45 p.m.

One quick note for people with Eclipse having auto-complete troubles with SDK 12: in Makefile.common, in function prepare_build, line #78: -I"$(folder)" needs to be changed to -I$(folder)

Posted Oct. 14, 2016, 3:39 p.m.

@peter, thanks for posting this comment! This actually seems to solve problems related to whitespaces in the toolchain path as well (thread). Not exactly sure why that is, but will convey it to our developers.

Posted Oct. 15, 2016, 7:33 p.m.

Hi,

Attachments examples works with Eclipse Neon.1 ?

I'm trying import blinky example to pca10028 but Eclipse say "No projects are found to import"

With mbed Yotta I have some examples that works well but I would try to nRF5_SDK

Best regards

Posted Oct. 16, 2016, 1 p.m.

Hi,

After switching to SDK 12 it seems eclipse doesn't resolve the -DBOARD_PCA10040 from the makefile. I followed all the steps in this tutorial, the project builds fine, and most include paths are resolved, but if I open boards.h I see that BOARD_PCA10040 is not defined. I double checked an my makefile (I'm just building the blinky_freertos example) contains the compile and assembly flag. Eclipse therefore gives me semantic errors which is anoying. Under SDK 11 this all worked fine. Does anyone have a solution for me?

Thanks!

Jules

Posted Oct. 18, 2016, 3:06 a.m.

Hello, Mike here

 I'm having trouble compiling the blinky example from the command line.

I am using Windows 10, and I have installed
a) gnu win32 in the directory = "D:\Program Files (x86)\GnuWin32\bin"
b) arm-none-eabi in the directory "D:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\arm-none-eabi\bin"

Both have been verified in the path.
a) "make" is version "i686-pc-msys"
b) Gnu arm embedded is version 5.4.1 20160919  revision240496  (see the first picture)

I use the following makefile.windows script in "D:\nRF5_SDK\components\toolchain\gcc"


///start makefile.windows///////// ifeq ($(findstring 86,$(ProgramFiles)), )

PROGFILES := d:/Program Files (x86)

endif

GNU_INSTALL_ROOT := $(PROGFILES)/GNU Tools ARM Embedded/5.4 2016q3 GNU_VERSION := 5.4.1 GNU_PREFIX := arm-none-eabi /// end makefile.windows///////// After I type make, I get the following error (and mkdir.exe pops up an error message makefile:173: cannot find include folder: ../../../config/blinky_pca10028 makefile:173: cannot find include folder: ../../../config Any suggestions for how to fix this? Posted Oct. 18, 2016, 8 a.m. Hello all, I am using Windows 7. Eclipse Neon. nRF51. I have successfully ran the makefile on the cmd prompt. I have been having problems with eclipse when importing the blinky project. I could not. Instead I imported as Makefile project with exsisting code. -The Make file does not have$(MAKE) defined. This is not a problem in the cmd prompt, but it seem to be a problem for windows eclipse. (I may have something set up wrong in eclispse as well), but I just place an extra var at the end of the toolchain description.

# Toolchain commands

CC := '$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-gcc'

AS := '$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-as'

AR := '$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-ar' -r

LD := '$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-ld'

NM := '$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-nm'

OBJDUMP := '$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-objdump'

OBJCOPY := '$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-objcopy'

SIZE := '$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-size

MAKE := 'make'

I have make in my PATH.

Hope this helps some others.

Posted Oct. 19, 2016, 11:03 a.m.

With the CDT Build Output Parser, in order to discover the include paths the regex must be changed.

New regex (.*arm-none-eabi-gcc)|([gc]++)|(clang).

Orignial regex was (gcc)|([gc]++)|(clang)

(I have only tested the regex on ble_app_template) Windows, Eclipse Neon

Posted Oct. 19, 2016, 1:34 p.m.

@meekthegeek, Your 'Make' program is built for i686-pc-msys while the one I have used is built i386-pc-mingw32. Did you install Make from the following link: http://gnuwin32.sourceforge.net/packages/make.htm ?

@Patrick, thanks for taking the time to add these comments. I just tried with Neon and was able to use the old command pattern string, but the one you provided should give the same result. Regarding the Make problem you mentioned, did you remember to set the build command as shown below?

Posted Oct. 20, 2016, 6:31 a.m.

Getting an error as follows, any suggestions? Thanks! Using SDK12

e:/program files/gnu arm eclipse/build tools/2.6-201507152002/bin/sh: syntax error: unexpected "("

Cannot find: C:/Program Files (x86)/GNU Tools ARM Embedded/5.4 2016q2/bin/arm-none-eabi-gcc. Please set values in: "E:/SDK/components/toolchain/gcc/Makefile.windows" according to the actual configuration of your system.

../../../../../../components/toolchain/gcc/Makefile.common:26: * Cannot continue. Stop.

My makefile,windows is set as follows: ifeq ($(findstring 86,$(ProgramFiles)), )

PROGFILES := C:/Program Files (x86)

endif

GNU_INSTALL_ROOT := $(PROGFILES)/GNU Tools ARM Embedded/5.4 2016q2 GNU_VERSION := 5.4.1 GNU_PREFIX := arm-none-eabi Posted Oct. 20, 2016, 10:49 a.m. @nordic_user101, have you confirmed that the '5.4 2016q2' folder exists in C:/Program Files (x86)/GNU Tools ARM Embedded/? Posted Oct. 20, 2016, 12:22 p.m. Yes. I confirmed that path is correct. Is the 'unexpected "(" error due to not finding the tool chain? Posted Oct. 20, 2016, 12:44 p.m. Ok, looks like I got further along now by adding quotes " around the path as follows in makefile.windows GNU_INSTALL_ROOT := "$(PROGFILES)/GNU Tools ARM Embedded/5.4 2016q2"

I'm getting a new error now though - any suggestions?

E:\SDK\examples\peripheral\blinky\pca10028\blank\armgcc>make mkdir _build process_begin: CreateProcess(NULL, mkdir _build, ...) failed. make (e=2): The system cannot find the file specified. ../../../../../../components/toolchain/gcc/Makefile.common:105: recipe for target '_build' failed make: * [_build] Error 2

Posted Oct. 20, 2016, 12:47 p.m.

Got it to build now by adding quotes " on line 105 as follows: $(MK) "$@". Progress! Builds in both the command prompt, and in Eclipse!

Posted Oct. 20, 2016, 12:58 p.m.

I'd like to build up the ble hrs example. How would you suggest to best do that? has it been updated for SDK12? Can I just use the files and setup under here - SDK12\examples\ble_peripheral\ble_app_hrs\pca10031\s130\armgcc ? Thanks!

Posted Oct. 20, 2016, 1:48 p.m.

Unfortunately, I haven't had time to create the eclipse project for the hrs example in SDK 12 yet. Recommend that you try the blinky example and get that working first so you have a working example to use as reference, then follow the instructions given in the 'Create a new Eclipse project' to create a new project with the Makefile in SDK12\examples\ble_peripheral\ble_app_hrs\pca10031\s130\armgcc.

Posted Oct. 21, 2016, 12:50 a.m.

How do I fix my formatting?

Posted Oct. 22, 2016, 2:14 a.m.

Hi Vidar,

first of all thanks for this fantastic work !!!

I followed the tutorial step by step on two different PCs (win 10 and 7). As far as the Blinky project is concerned, I always get a semantic error (uint8_t could not be resolved) on the win 10 PC, while on the other everything looks just fine (apart from the problem related to the device not found in the packs). Note that if I try another type, e.g. uint16_t, the error disappears.

Do you have any suggestion?

Thanks,

Ale.

Posted Oct. 26, 2016, 1:47 p.m.

@meekthegeek, edited the formatting a bit. I have tried the version of Make that I linked to earlier on W10 without any problems.

toolchain and make does not need to be in the global path, it is sufficient to have a lokal path variable in Eclipse.

@Ale, it sounds like the toolchain paths are not being included automatically. Installing the device family pack may help => https://devzone.nordicsemi.com/question/80508/there-are-no-peripheral-descriptions-available-assign-a-device-to-the-project/

Posted Oct. 26, 2016, 1:57 p.m.

@meekthegeek, edited the formatting a bit. I have tried the version of Make that I linked to earlier on W10 without any problems.

toolchain and make does not need to be in the global path, it is sufficient to have a lokal path variable in Eclipse.

@Ale, it sounds like the toolchain paths are not being included automatically. Installing the device family pack may help => https://devzone.nordicsemi.com/question/80508/there-are-no-peripheral-descriptions-available-assign-a-device-to-the-project/

Posted Oct. 27, 2016, 8:46 a.m.

Eclipse Nano - No projects file are found

Following the steps to import the blinky project.

1. Open Eclipse
2. Enter file->import->General -> Existing Projects into Workspace.
3. Browse ARMCC folder in your SDK
5. Make sure to select the project

No projects file are found....I am not able to find project file in other folders as well.

Posted Oct. 27, 2016, 8:50 a.m.

The SDK doesn't include project files for Eclipse, which is why I have attached some example projects in this tutorial. Did you copy the .project and .cproject file from the nRF51_SDK_12.0.1_blinky_blank_pca10028.zip attachment into your armgcc folder first?

Posted Oct. 27, 2016, 9:41 a.m.

Hi Vidar, solved with Index > Freshen all files

Thanks, Ale

Posted Oct. 28, 2016, 3:35 a.m.

Vidar, I have just imported the .project and .cproject file from the nRF51_SDK_12.0.1_blinky_blank_pca10028.zip and the make.common file into the armgcc folder. Then, Project folder>Build project. I had the error of

and fixed it by adding the link into the PATH environmental variable. Not sure when this was deleted. Used to work when I installed it. Now

• path = C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\bin

Now 2 new errors :

Posted Oct. 28, 2016, 4:23 a.m.

Just resolved the error above. May be it is good to capture a picture or mention arm-none-eabi-gcc needs a space there. I am still having symbols error:

• Symbol 'LEDS_LIST' could not be resolved
• Symbol 'LEDS_MASK' could not be resolved
• Symbol 'LEDS_NUMBER'could not be resolved

Wasted a lot of time to get this eclipse setup to run a simple program. Some instructions aren't up to date sometimes.

Posted Oct. 28, 2016, 7:05 p.m.

Hi, as the same as @ale and @daniel77, my Eclipse Neon doesn't recognize stdint.h nor stdbool.h and, although including boards.h is not marked as error, doesn't recognize LEDS_CONFIGURE and LEDS_INVERT macros. Any opinion on that?

Screenshot from 2016-10-28 12:04:29.png

Posted Oct. 29, 2016, 12:05 p.m.

I've managed to get everything working, apart from the CDT parser.

If I right-click the project, click properties and look at the CDT GCC Build Output Parser, all of the folders do not have a path prefix:

http://imgur.com/h3WM0u6

If I use the new makefile, I get the following (with the same result in CDT):

http://imgur.com/yQmITXa

The original makefile will build fine, but with errors in Eclipse for LEDS_NUMBER and LEDS_LIST.

Any ideas?

Posted Nov. 2, 2016, 1:56 a.m.

I've just set up Neon with SDK 12.1. I got the same error for LEDS_NUMBER and other symbols. Reinitialized the indexes and now it seems to work fine:

Right click on project -> Index -> Rebuild


The other options in the Index menu may be working too.

Posted Nov. 3, 2016, 11:38 p.m.

I was having problems with the CDT not working in Eclipse Neon on Windows. I had to:

• Set the build command to: "make V=1". The "make VERBOSE=1" does not work for my version of make on windows.
• In "Preprocessor Include Paths, Macros etc.", click on "CDT GCC Build Output Parser", and ensure "Use heuristics to resolve paths" is unticked.

Then do a clean, rebuild the project, and rebuild the indexing (Right click on project -> Index -> Rebuild)

If you are still having problems, right-click on one of your source files -> Index -> Create Parser Log Files. Save the file and examine it, pay special attention to the paths it thinks it has found to files.

Posted Nov. 13, 2016, 8:27 p.m.

using macOS I got : ERROR: JLinkARM DLL not found. Please reinstall latest JLinkARM. when trying to use nrfjprog

Posted Nov. 20, 2016, 9:53 a.m.

Hi Vidar, I am still stuck with the problem above.

Posted Nov. 20, 2016, 1:45 p.m.

Is there an explanation of the folder structure for the latest SDK 12, this would be a very useful piece of documentation?

I could be wrong however it would appear that there have been some changes compared with earlier SDK's and this tutorial is perhaps somewhat out of date?

everything builds ok, and all of a sudden uint8_t, LEDS_NUMBER and LEDS_LIST are now resolving in the IDE (I have no idea what change got that working!) however I am getting the following:

Makefile:214: Cannot find include folder:  ../../../config/blinky_pca10040_s132
mkdir _build
Makefile:214: Cannot find include folder:  ../../../config


I am not aware of any such directory as blinky_pca10040_s132

Posted Nov. 20, 2016, 10:14 p.m.

I have the make target erase & flashing working, having modified the makefile as can be seen in the screen shot (path modification to nrfjprog). However I am then getting the strange gdb --version command! is this behaviour perhaps a direct result of the previous error in the makefile:

$(foreach target,$(TARGETS), $(call define_target,$(target)))

Any wisdom gratefully accepted.

Posted Nov. 21, 2016, 11:33 a.m.

@daniel77, did you replace Makefile.common included with the SDK with the one attached?

@steve, the missing include paths can be ignored or deleted as they are not relevant for this build. This was a bug in our build system, which will be fixed in the upcoming SDK release.

You want the debug launcher to invoke arm-none-eabi-gdb and not ggdb. Please try to change the executable as shown in screenshot below:

Btw, the flash targets assume that the path to nrfjprog is added to the env. variable (PATH), but adding the path as you did should not have any side effect.

Posted Nov. 21, 2016, 10:24 p.m.

@Vidar many thanks for your wisdom, I have progressed. Strangely I needed a "/" between ${jlink_path} & ${jlink_gdbserver} (I am using Mars.2 which appears to have a slightly different GDB Seggar dialog). I was using arm-none-wabi-gdb however had to explicitly add the path too, even though it is in the path env variable.

So the problem now is that GDB doesn't appear to connect.

Posted Nov. 22, 2016, 10:07 a.m.

I've not seen this error before, but looks like it could be related to semihosting. Suggest to disable it in the debug launcher configuration.

Also, attached a few screenshots of my debugger configuration. Please compare this with your setup and see if there are any differences that may be relevant.

Attachment: debug_conf.zip

Posted Nov. 22, 2016, 11:30 a.m.

@vidar I have updated that file.

Posted Nov. 22, 2016, 11:32 a.m.

Posted Nov. 22, 2016, 11:46 a.m.

Build error:

Parser:

Posted Nov. 22, 2016, 12:49 p.m.

But seems like I should consider your build tools instead, assume the 64-bit version can bring some improvements. At least it has a newer version of GNU Make. GnuWin still has v3.8.1 and it doesn't appear to be maintained anymore.

@vidar, the GNU ARM Eclipse Windows Build Tools not only have a new 64-bits version of make, but also come with a shell, which overcomes the 8192 char limit of the Microsoft cmd.exe.

Highly recommended! If you have reasons to keep other tools, at least you can add it to the tutorial as an alternate solution.

Posted Nov. 22, 2016, 3:03 p.m.

@Liviu, would it be possible to include mkdir.exe in this package? Our makefiles requires this to create the 'build' directory. Looks like I can make one by calling 'ln -s busybox.exe mkdir.exe' in windows, not sure if it the appropriate way of doing it though, and I'm also a bit hesitant to add another step to this tutorial.

@daniel77, the build output parser is working partially at least. The 'key' symbol on the source files means the the CDT parser has added include paths and pre-preprosessor definitions, but maybe not all of them.

You should get a list of symbols and include paths that were parsed if you right click on main.c and enter properties -> C/C++ General -> Preprocessor Include paths, and then expand the 'CDT GCC Buil output parser' entry. Does it include all the include paths defined in the Makefile and the BOARD_PCA10028 symbol?

Posted Nov. 22, 2016, 9:02 p.m.

... include mkdir.exe

please check v2.8 and let me know if it is ok.

'ln -s busybox.exe mkdir.exe'

you can copy/link busybox.exe to any other supported name and get the specific functionality.

Posted Nov. 22, 2016, 10:12 p.m.

@Vidar, many thanks for your help. The problem appeared to be caused by the Preferences > C/C++ > Debug > GDB settings which appeared to take precedence over the Debug Configuration settings.

It was in this Preference area that I discovered the reference to ggdb so once I had nullified these settings the Debug Configuration settings started to work.

So stepping through code started to work :O) together with viewing variables.

Posted Nov. 23, 2016, 8:10 a.m.

@vidar All those include files in the makefile are included in the CDT parser. Showing a section here. By the way, I will be exploring the Keil IDE then. This is not really progressing much for me.

Posted Nov. 23, 2016, 8:45 a.m.

@daniel77, please try to tick the 'Use heuristics to resolve paths' box in the 'CDT GCC Build Output Parser' settings and click 'Apply'. Then run Clean project followed by Build project.

Also, are you seeing any pre-processor definitions below the include paths?

Posted Nov. 23, 2016, 10:40 a.m.

@vidar, heuristic was set previously. But, after cleaning project and build project again, the include files show more additional files now. There is no pre-processor definition at all like yours. e.g. #BOARD_PCA10040=

Posted Nov. 23, 2016, 10:43 a.m.

I was using nRF52 DK kit (BOARD_PCA10040), should be BOARD_PCA10028 in your case. You can also try to rebuild index (project properties -> index -> rebuild)

Posted Nov. 23, 2016, 10:49 a.m.

@vidar after rebuilding the index, the errors stay the same, no pre-processor definition at all.

Posted Nov. 23, 2016, 11:30 a.m.

That explains the unresolved symbols. However, not sure why it would parse all the include paths, but not the pre-processor definitions.

Below is the compiler arguments when building main.c in my project. As you can see, all pre-processor definitions have '-D' as prefix (e.g., -DBOARD_PCA10040). The CDT parser should recognize these as pre-processor definitions and add them to the project. In your case, do you see any equation marks around these arguments?

C:/Program Files (x86)/GNU Tools ARM Embedded/5.4 2016q3/bin/arm-none-eabi-gcc
-std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DSWI_DISABLE0 -
DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52_PAN_31 -DNRF52_PAN_30 -DNRF52_PAN_51 -
DNRF52_PAN_36 -DNRF52_PAN_53 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -    DNRF52_PAN_55 -
DNRF52_PAN_62 -DNRF52_PAN_63 -DBOARD_PCA10040 -DNRF52 -DNRF52832 -DBSP_DEFINES_ONLY -
mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -
ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -MP -MD
-I../../../../../../components
-I../../../../../../components/ble/ble_services/ble_hrs_c
...
I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_main.c.o ../../../main.c


Posted Nov. 23, 2016, 11:34 a.m.

@vidar, did you check the new version of GNU ARM Eclipse Windows Build Tools?

http://gnuarmeclipse.github.io/blog/2016/11/22/windows-build-tools-v2-8-20161122-released/

Posted Nov. 23, 2016, 11:41 a.m.

@Liviu, thanks for adding mkdir! I have a better understanding of busybox now.

I'm testing with these tools now, but I'm getting the following error if I keep sh.exe:

 make VERBOSE=1 all
c:/program files/gnu arm eclipse/build tools/2.7-201610281058/bin/sh: syntax error:
unexpected "("


Not sure why sh is being invoked at all, but will replace the gnuwin package with this if I can get it to work.

Posted Nov. 23, 2016, 11:51 a.m.

Not sure why sh is being invoked at all

make invokes each command in a separate shell. if you do not provide a sh.exe, it'll use Windows cmd.exe, which is limited to 8192 chars.

unexpected "("

does your makefile build properly on GNU/Linux? this message makes me think you have parenthesis in a string (for example in an echo), which have special meaning in sh. one easy workaround is to replace double quotes with single quotes for that string, to prevent substitutions.

Posted Nov. 23, 2016, 11:56 a.m.

@vidar, one more warning: be sure you do not have other make/sh/rm/mkdir/etc tool in the system path, and you use only one set of tools.

messing tools from different packages is the major source of troubles when using GNU ARM Eclipse on Windows.

Posted Nov. 23, 2016, 12:21 p.m.

Thanks for the explanation. So the problem is that I've patched our makefiles to work with the CDT parser by removing double quotations around the toolchain path, and not replaced them with single quotes. So I guess the parenthesis in "Program Files (x86)" was causing this. Will upload a new patch and link to your package instead.

Posted Nov. 23, 2016, 12:27 p.m.

I've patched our makefiles to work with the CDT parser

I don't know what this is all about, but I guess, by GNU/Linux requirements, your makefiles were broken; they might have worked on Windows, if the non-standard cmd.exe was used.

it is always a good idea to run your builds on more standard platforms.

Posted Nov. 23, 2016, 1 p.m.

@vidar Is that the output from the console?

Posted Nov. 23, 2016, 1:14 p.m.

@Liviu, I didn't test the changes on GNU/linux this time, but I think it would only be a problem if there were parenthesis in the toolchain paths. But agree that it should be tested on more standard platforms. Have update the links now btw.

@Daniel77, yes, but it looks like you haven't replaced makefile.common with the one I included in this tutorial => SDK 12.x.x - replace this with makefile.common.zip

Posted Nov. 23, 2016, 2:16 p.m.

@steve, thanks for the update, will keep this in mind if I see reports of similar problems in the future.

Posted Nov. 23, 2016, 9:37 p.m.

@Vidar, I need to ensure that I can repeat the process. Previously I used Mars so I am doing it again with Neon. Can you just confirm that it is only the nRF_DeviceFamilyPack that needs to be installed from Packs?

Posted Nov. 23, 2016, 10:26 p.m.

@vidar You can refer to my previous screen capture it shows the makefile.common there. Here is the folder of my project with all the files you provided copied there.

My settings

I wish I could share my desktop like google hangout/chrome remote desktop with you so that you can take a look.

Posted Nov. 24, 2016, 9:02 a.m.

I have posted the Makefile.common in that directory in (SDK_ROOT)/components/toolchain/gcc as you said. There is some improvement on the preprocessor as the picture shown below. Those # were never there before. However, the error is still the same after index rebuild and project clean and build. Posted Nov. 24, 2016, 12:36 p.m. @Steve, yes it's only the device family pack that you need (optional - enables the peripheral viewer in debug mode). However, there is a bug in the packs manager or in the links provided by us/keil (device does not get listed even if you have installed it), The comments by @astewart and @RHTPaul explains how you can work around this. Posted Nov. 24, 2016, 12:41 p.m. A packs manager bug was recently fixed, you can try the pre-release version available from http://gnuarmeclipse.sourceforge.net/updates-test Please let me know if it helped. Posted Nov. 26, 2016, 4:48 p.m. I am using Mac and able to install GCC and Eclipse successfully. On bash shell using gcc compiled blinky example successfully. Then I tried to use Eclipse and imported blinky example as project successfully. I tried to compile blinky and it went through successfully. Here is the output of console. 07:39:19 Build of configuration Default for project blinky make all nrf52832_xxaa Makefile:204: Cannot find include folder: ../../../config/blinky_pca10040 Makefile:204: Cannot find include folder: ../../../config mkdir _build Assembling file: gcc_startup_nrf52.S Compiling file: system_nrf52.c Compiling file: main.c Compiling file: app_error.c Compiling file: app_error_weak.c Compiling file: app_fifo.c Compiling file: app_timer.c Compiling file: app_util_platform.c Compiling file: hardfault_implementation.c Compiling file: nrf_assert.c Compiling file: nrf_drv_clock.c Compiling file: nrf_drv_common.c Compiling file: nrf_nvic.c Compiling file: nrf_soc.c Linking target: _build/nrf52832_xxaa.out text data bss dec hex filename 4872 112 84 5068 13cc _build/nrf52832_xxaa.out Preparing: _build/nrf52832_xxaa.hex Preparing: _build/nrf52832_xxaa.bin make: Nothing to be done for nrf52832_xxaa'. 07:39:22 Build Finished (took 3s.740ms) But in the problems window, I have the following errors. Description Resource Path Location ID Type Cannot find include folder: ../../../config Makefile /blinky/pca10040/blank/armgcc line 204 83 C/C++ Problem Cannot find include folder: ../../../config/blinky_pca10040 Makefile /blinky/pca10040/blank/armgcc line 204 82 C/C++ Problem Field 'LEDS_INVERT(1 << leds_list[i])' could not be resolved main.c /blinky line 44 111 Semantic Error Field 'LEDS_INVERT(1 << leds_list[i])' could not be resolved main.c /blinky line 44 113 Semantic Error Field 'LEDS_INVERT(1 << leds_list[i])' could not be resolved main.c /blinky line 44 115 Semantic Error Program "-std=gnu++11" not found in PATH blinky Project Properties, C++ Preprocessor Include.../Providers, [CDT GCC Built-in Compiler Settings Cross ARM] options 101 C/C++ Scanner Discovery Problem Program "-std=gnu11" not found in PATH blinky Project Properties, C++ Preprocessor Include.../Providers, [CDT GCC Built-in Compiler Settings Cross ARM] options 100 C/C++ Scanner Discovery Problem Symbol 'LEDS_LIST' could not be resolved main.c /blinky line 29 104 Semantic Error Symbol 'LEDS_MASK' could not be resolved main.c /blinky line 37 106 Semantic Error Symbol 'LEDS_NUMBER' could not be resolved main.c /blinky line 29 103 Semantic Error Symbol 'LEDS_NUMBER' could not be resolved main.c /blinky line 42 108 Semantic Error Symbol 'NRF_GPIO' could not be resolved main.c /blinky line 44 110 Semantic Error Symbol 'NRF_GPIO' could not be resolved main.c /blinky line 44 112 Semantic Error Symbol 'NRF_GPIO' could not be resolved main.c /blinky line 44 114 Semantic Error Symbol 'true' could not be resolved main.c /blinky line 40 107 Semantic Error Type 'LEDS_CONFIGURE(LEDS_MASK)' could not be resolved main.c /blinky line 37 105 Semantic Error Type 'LEDS_INVERT(1 << leds_list[i])' could not be resolved main.c /blinky line 44 109 Semantic Error Type 'uint8_t' could not be resolved main.c /blinky line 29 102 Semantic Error Please help me to fix these errors. Thanks. Posted Nov. 30, 2016, 2:46 p.m. @Thinksmart, the project must be built with 'make VERBOSE=1' so that the include paths and symbols are printed out to the build log (CDT output parser reads these and adds them to the project). @Liviu, appreciate the effort, and I'd be happy to try it, but haven't been able to install the plugin yet. Here is the error log reported from the Eclipse installer : log.txt. Will look more into it when time permits. Assume it might be possible to install it manually.. Posted Nov. 30, 2016, 2:53 p.m. @Vidar The problem has nothing to do with the plug-ins, your Eclipse cannot connect to SourceForge, due to some firewall, antivirus, etc. Posted Nov. 30, 2016, 5:18 p.m. @Liviu, thanks! The update seems to have solved this issue. I can now select nordic devices in the device selection. Yes, the download errors I was seeing was likely related to the network configuration at work, had no problems when I tried at home. Posted Nov. 30, 2016, 5:33 p.m. @Vidar As for the network configuration, it looks like SourceForge changed something in their security settings, and access to the update site from abusively restrictive firewalls is now problematic. Posted Dec. 5, 2016, 9:14 p.m. Followed this tutorial with SDK 12.1.0 on Windows. Toward the beginning, when trying to make blinky, make failed with this error: Makefile:173: Cannot find include folder: ../../../config/blinky_pca10028 Makefile:173: Cannot find include folder: ../../../config ... mkdir _build process_begin: CreateProcess(NULL, mkdir _build, ...) failed. make (e=2): The system cannot find the file specified. ../../../../../../components/toolchain/gcc/Makefile.common:104: recipe for target '_build' failed  The ../../../config/ folder did not exist. I ignored this error, and it didn't seem to cause any problems. However, the CreateProcess() error did need to be fixed. To fix it, go to ../../../../../../components/toolchain/gcc/Makefile.common and on line 35, change MK := mkdir  to MK := cmd /c mkdir  This is a fix needed only for Windows. The problem is described here. Posted Dec. 22, 2016, 7:18 a.m. Version: Neon.1a Release (4.6.1) Build id: 20161007-1200 Windows-8: 64bit - Gobs of RAM! Modulo a few typos, instructions worked like a charm. Many thanks for what must have been a tedious effort to get the details right. Eclipse hangs after correctly loading blinky, and launching gdb. This is not your usual wrong/missing ".S", or some fossil code. It is quite repeatable for nRF52, and nRF51 flavors, after complete erase. Specifics: Blinky compiles, and gdb debugs perfectly from (my) makefile, and from the eclipse build with my same makefile. However, to make sure I had the install process nailed, I tediously repeated on my own laptop. Everything works perfectly as before, but on laptop Eclipse hangs when trying to start debugging. Code is flashed OK, and will run apparently correctly on reset. I have compared every setup parameter I can find for the smallest of discrepency between two machines' configs. After two days, I have fallen back exhausted. Does someone recognise this problem please? Any suggestions? Happy Christmas! Posted Jan. 1, 2017, 11:13 p.m. I wonder if I have solved my own problem... only took me a week! Found this note in: http://gnuarmeclipse.github.io/plugins/install/ Neon currently has several problems and is not-recommended: on macOS there is a bug in the Eclipse rendering code, and some fonts are not aligned properly; this is completely unrelated to GNU ARM Eclipse plug-ins; on Windows, the OpenOCD debugging hangs while starting on all platforms, the debugging consoles do not show. Go to the Eclipse packages and get the Eclipse IDE for C/C++ Developers archive appropriate for your platform, preferably the 64-bits version. Posted Jan. 1, 2017, 11:55 p.m. Unfortunately I do not know yet if the missing functionality in Neon.2 can be compensated by changes in the plug-ins, or Neon itself needs some fixes. I informed the CDT developers, but did not receive an answer, I need to insist. As a workaround, I suggest you use Mars.2. Posted Jan. 2, 2017, 10:34 a.m. @mikster, sorry for delayed response, have been on holiday. It looks like this problem may have been introduced in CDT v.9.2. I have updated the tutorial with Liviu's recommendation for now. Posted Jan. 2, 2017, 5:28 p.m. Thanks Vidar, I rolled back to being a Martian and everything miraculously started working again. I think putting a note in the head of the tutorial is a great first step. Choosing the eclipse version is a strategic decision, and knowing that CDT is a possible issue would make be choose not to upgrade that far. I tend to let major revs. pass be by until a development hiatus, and I'm not fighting fires, so this time I jumped from Luna to Neon in one go. Would Neon work with an earlier version of CDT, or are they incompatible? Thanks again for your support. Two brownie points for you! Posted Jan. 2, 2017, 6:34 p.m. Thanks Liviu Posted Jan. 4, 2017, 10:55 p.m. Hi Vidar, Thank you for this Tutorial. I have gone through your instructions successfully until the point where you are going to Import the project blinky or ble_heart_rate into the workspace. On my end (using nRF5_SDK ver 12.2), I see the folder to those projects. However, in importing into the Eclipse, the .project file for the armgcc does not exist! All the other related files are there. Where can I get the .project/.cproject so it could get imported? Thanks. Posted Jan. 5, 2017, 3:45 p.m. @Mikster, I started seeing reports of this after some recent updates in Eclipse Neon, and I have not managed to reproduce with the Neon.1 version I had installed earlier (forgot to note the exact version numbers before I updated to Neon.2). Will however recommend to use Mars.2 until Neon or a future release is recommended by the GNU ARM eclipse plug-in. @Rakhsh, I've uploaded the project files for the hrs example in SDK 12.2.0: nRF5_SDK_12.2.0_ble_app_hrs_pca10040_s132.zip Posted Jan. 11, 2017, 3:48 p.m. Hi Vidar, Thank you for the tutorial. I have gone through your instruction until the setting eclipse. when blinky example is imported, no linked sources are found in project explorer as the picture below. blinky example is picked up from "\examples\peripheral\blinky\pca10040\blank\armgcc" and sdk is "nRF5_SDK_12.2.0_f012efa". The value of PROJECT_LOC in Lincked Resources equals the folder above, could you give me to fix it? Thanks. import_existingproject.tif Posted Jan. 11, 2017, 3:55 p.m. Hi, The SDKs do not include project files for Eclipse, but I have included some example projects at the end of the tutorial that you can use. Note that only the heart rate example is included for SDK 12.2.0 Steps to import the hear rate example: Posted Jan. 11, 2017, 4:26 p.m. Hi, Good news from the Neon.2 front: with 'a little help from my (CDT) friends', we found a solution to avoid the problems related to the debugger consoles, introduced by Neon.2. The debug consoles are split between two tabs, with the GDB client console on a separate tab. On http://gnuarmeclipse.sourceforge.net/updates-test I published a pre-release; I would appreciate someone confirming it is OK for your usage too (especially on Windows and Linux). If so, I'll shortly prepare the new release. Posted Jan. 12, 2017, 10:19 a.m. Hi, This is good news, thanks! Have verified it to work on Linux (ubuntu). I have not had a chance to try it on Windows as I haven't been able to update the plug-ins lately (guess it is blocked by my firewall configuration as you indicated earlier) Posted Jan. 12, 2017, 10:58 a.m. Hi, Thank you for this tutorial. I installed and edited files and softwares according to this tutorial. Then, I tried to compile ble_app_hrs example but it failed saying that "../../../../../../components/softdevice/common/softdevice_handler/softdevice_handler.c:542:11: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t {aka long unsigned int}' [-Werror=format=]". I tried not on ecliplse, but on command prompt in the armgcc dir, just typing "make" . My arm-none-eabi-gcc version is 5.4.1. Do you have any idea to fix this? Posted Jan. 12, 2017, 11:12 a.m. Hi, uint32_t should be a typedef of unsigned_int on Cortex M0 and M4 (http://www.keil.com/support/man/docs/armcc/armcc_chr1359125009502.htm). Are you testing with a clean copy of the SDK? I was unabled to reproduce this with the 5-2016-q3-update release Posted Jan. 12, 2017, 1:39 p.m. it is blocked by my firewall configuration this is easy to fix, just update your JDK and it should work. Liviu Posted Jan. 12, 2017, 2:30 p.m. Thanks again. I can now debug and install the packages on windows as well Posted Jan. 12, 2017, 10:42 p.m. Hey guys, I think I have the same problem as daniel77. Eclipse says (among other things) • Unresolved inclusion: "nrf_delay.h" When building the project, I get 22:26:55 Incremental Build of configuration Default for project blinky_blank_pca10040 make VERBOSE=1 all rm -rf _build C:/Program Files (x86)/GNU ARM Eclipse/Build Tools/2.8-201611221915/bin/make -f Makefile -C ./ -e cleanobj c:/program files (x86)/gnu arm eclipse/build tools/2.8-201611221915/bin/sh: syntax error: unexpected "(" C:/Program Files (x86)/GNU ARM Eclipse/Build Tools/2.8-201611221915/bin/make -f Makefile -C ./ -e nrf52832_xxaa c:/program files (x86)/gnu arm eclipse/build tools/2.8-201611221915/bin/sh: syntax error: unexpected "(" 22:27:01 Build Finished (took 6s.916ms) I'm using eclipse Mars and my GNU Tools ARM Embedded is 6.2 2016q4 (that's what the directory inside GNU Tools ARM Embedded is called anyway). Furthermore, I am somewhat confused about the whole "make target" thing in that I don't know what to do from the tutorial (I'm a total beginner at this). My goal is to have some programs running on the NRF52-DevKit that is sitting next to me. Thanks for the help! Cheers, Alexej Posted Jan. 13, 2017, 4:35 a.m. @Vidar Thank you for your quick answer. What you said is right. I newly tried to decompress the SDK and compile the source code, and it worked fine. So there is something wrong in my SDK. Thank you very much again. Posted Jan. 13, 2017, 9:01 a.m. Hi Thank you for your support and "ble_app_hrm" build is ongoing, but firmare looks not work well due to errors below. there was similar question and answer that setting Paths and symols in project property, but I'm not familir with eclipse setting. Could you let me know how to set the property in such error case actually? Thanks a lot! tani Posted Jan. 16, 2017, 9:06 a.m. GNU ARM Eclipse plug-ins functional on Neon.2: http://gnuarmeclipse.github.io/blog/2017/01/14/plugins-v3.2.1-201701141320-released/ Posted Jan. 16, 2017, 9:06 a.m. GNU ARM Eclipse plug-ins functional on Neon.2: http://gnuarmeclipse.github.io/blog/2017/01/14/plugins-v3.2.1-201701141320-released/ Posted Jan. 16, 2017, 11:25 a.m. @Alexej Gerstmaier, Eclipse relies on the build output of a successful build to resolve errors such as missing include paths. However, in this case the build fails with what looks to be related to the issue mentioned in my comment on Nov. 23. I'd suggest to temporary remove sh.exe from the build tools directory to see if it helps. @tani, did you use the Makefile.common file included at the end of this tutorial? @Liviu Ionescu, thanks! Posted Jan. 17, 2017, 2:46 a.m. Hi Vidar, Yes, Makefile.common was replaced as the end of the tutorial, then build is ok this morning without any change. Is eclipse reboot needed when makefile.common is replaced? Thank you! tani Posted Feb. 10, 2017, 10:55 p.m. Well... I done all the steps above here in a VirtualBox with lubuntu. I try to setup a complete VM to work with the nRF chips. I have a nRF52 DK board here. After setting up the toolchain, java -> eclipse -> GNU ARM GCC for Eclipse I try to import a project as described above. If I click on compile I get the following error: ...../nrf52.h:137:130: fatal error: core_cm4.h: No such file or directory Before I change the default SDK makefile I tried to compile a project with make - with success. Then I copied the new makefile linked above in the folder, imported the project into Eclipse and tried to compile - not working. Any tips on that? Would be very helpful! I can share the whole VM after setup if anyone is interested. Regards, Dennis Posted Feb. 27, 2017, 1:19 p.m. It's probably worth adding that nrfjprog won't be able to find your device if it's set up for mbed programming - you'll need to go into the bootloader setup and flash the JLink bootloader instead. Posted March 7, 2017, 1:32 a.m. Hi, Thank you for the great tutorial. I follow the steps and install the sample attachment, nRF5_SDK_12.2.0_ble_app_hrs_pca10040_s132.zip. It compiles and builds without problem, it loads to the debugger without issue. However, when the code executes to the line SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL); in ble_stack_init(), it just hangs. Any idea?  I am using SDK 12.2, the nRF52DK, Eclipse Mars 4.5.2, gcc 5.4. Thanks for your help. Posted March 7, 2017, 2:24 a.m. I found the answer, I need to flash the S132 image first. Posted March 7, 2017, 7:13 a.m. Joe, that does not makes sense, if you have not flashed the S132 image then there is no way the program would run until SOFTDEVICE_HANDLER_INIT. Without the softdevice , there are no means to correctly jump to your application. Posted March 7, 2017, 6:02 p.m. Before I flashed the S132 image, I was able to single step the program before the SOFTDEVICE_HANDLER_INIT. Perhaps I had some other sample programs in there before that make it go a little further. I found the answer by searching "SOFTDEVICE_HANDLER_INIT hangs" in the "Question" section. Someone else had a very similar experience. Posted March 15, 2017, 9:11 p.m. Does anything need changed in this when moving to SDK13.0? Is the makefile.common OK to use or will we need an updated version (LIke 12.1 and 12.2)? Posted March 27, 2017, 1:39 p.m. Hello, I have been struggling with unresolved < ... > includes (see below). All of the "..." includes are resolved. I have installed Mars Eclipse along with SDK 11.0.0 (as indicated in your tutorial) and followed and rechecked the instructions to import your attached project (blinky_blank_pca10040) and to also create the pwm_test_for_led project via the Makefile Project with Existing Code procedure defined in the tutorial. The pwm_test_for_led project is a renamed version of the pwm_driver example in the SDK. I cannot seem to find where to define the correct paths to find the unresolved includes. Notice that the blinky_blank_pca project has the created includes subdirectory - if I could create that in my pwm_test_for_led project It may resolve my errors. I have also checked my preferences in the Preprocesor Include Paths... area as follows: Any help on this issue would be greatly appreciated. I am anxious to proceed with Nordic development using the nRF58832 BLE SoC. Thank you in advance. GaryD Posted March 27, 2017, 1:53 p.m. @Bryan H, have added a new example project for SDK 13.0.0. You can use the same makefile.common that I created for the SDK 12.2.0 release. @GaryD, looks like you are only missing global paths for the toolchain. I.e., those that are included in the 'includes' directory for the blinky_blank project above. They should have been added automatically when you selected CDT GCC Built-in Compiler settings Cross ARM. Do you see any error messages in the console if you enable 'Allocate console in the console view' for this entry? Posted March 27, 2017, 1:53 p.m. @Bryan H, have added a new example project for SDK 13.0.0. You can use the same makefile.common that I created for the SDK 12.2.0 release. @GaryD, looks like you are only missing global paths for the toolchain. I.e., those that are included in the 'includes' directory for the blinky_blank project above. They should have been added automatically when you selected CDT GCC Built-in Compiler settings Cross ARM. Do you see any error messages in the console if you enable 'Allocate console in the console view' for this entry? Posted March 27, 2017, 3:45 p.m. @Vidar, I am not familiar with the 'Allocate console in console view' terminology. I did use msys for my console and was able to build and load the pwm_driver project into the dev kit. Posted March 27, 2017, 3:54 p.m. @Vidar, Correction - I installed MingW32 to get the cmd line system working. I believe using your tutorial, I could not find the 'make' command. Posted March 27, 2017, 4:12 p.m. Sorry, I was a bit unclear on that, but there is a check box called 'Allocate console in console view' in the CDT GCC Built-in Compiler settings Cross ARM entry, as shown in your second screenshot. This should route error any messages from this entry to the console view in Eclipse . Can also suggest to reset the toolchain configuration in project settings, and see if that helps (properties -> settings -> restore defaults). Posted March 27, 2017, 4:13 p.m. @Vidar, I went back to the CDT GCC Built-in Compiler settings Cross Arm, checked the 'Allocate console in the console view' for the entry. No errors when I said Apply, rebuilt the project but includes still not resolved. Posted March 27, 2017, 4:19 p.m. Strange that the blinky example you had appears to have the correct include paths. Do you get any unresolved errors if you add the toolchain paths manually as shown below? Posted March 27, 2017, 8:31 p.m. @Vidar, I also reloaded the build tools and can now build again, checked the system path variable, the other include files are now a problem (and it also affects the blinky_blank_pca10040 includes broken the same way. I also went back and re-installed the SDK11.0.0 and modified the makefile.windows for the path. I then fired up the cmd window and got the following after navigating to the blinky makefile directory. The arm-none-eabi-gcc --version command worked fine from that directory. There must be something basic I am missing. I looked over the SDK install instructions from developer.Nordic.com and see the following. What is the nRF MDK that is referred to in last line of the screen capture below? Regards, GaryD Posted March 27, 2017, 8:48 p.m. Path management was, is, and probably will continue to be a tricky issue. :-( The GNU ARM Eclipse plug-ins are intended for managed projects, and for this use case the path management is automatic, you need to tell Eclipse where the toolchain is and where the build tools are, and everything should be fine; in this case the documentation specifically asks not to include the toolchain and build tools in the system path, since it creates lots of problems. For make projects, things are slightly more tricky; of course you can configure the system path and run make from a terminal, but if you want Eclipse indexer to work properly (a notoriously difficult requirement for make projects in itself), you still need to configure the paths correctly inside Eclipse. I do not say it cannot be done, but GNU ARM Eclipse do not actively support make projects, you need to manually adjust various settings here and there. Posted March 29, 2017, 12:07 a.m. Well, I ended up reloading everything (except Eclipse). I carefully worked all the paths as you said and was able to get the import project to work properly. Thanks for your help. I think that the experience of having done several installations in attempting to make this work along with your guidance I was able to work the Blinky demo all the way to debug. Thank you, Gary DeWitt By the way, do I need to "close" this item in some way? Posted March 29, 2017, 11:03 a.m. Hi Gary, glad to hear that you got it to work, and thanks for the update. Path related problems can be difficult to sort out, as @Liviu also pointed out. It's not possible to close items here in the comment section, so we can leave it as is, but suggest to use the questions section in this forum if you encounter new problems to make it more visible. Posted April 1, 2017, 12:25 a.m. Hi I am able to build/deploy and debug the blinky code without issue. I wanted to strip out all of the code from the examples directories and create my own project using all the same files. I am able to build and deploy. However, I cannot debug. I get the same error as @areitsma which is: Error while launching command: gdb --version I have tried using the hard coded path to arm-none-eabi-gdb but instead I get: Error while launching command: arm-none-eabi-gdb --version If I take the original blinky project and debug that it works. If I then change the project setting in the debug configuration dialog box to point instead to my new project using the same code, it throws the same error. Thus I don't think it's in the project settings but maybe in the code ? I am rather stumped. ;-) Thanks J Posted April 3, 2017, 8:12 a.m. Hi, please include the full error message. Do you get the same error if you just add 'arm-none-gdb' to the executable field in the debug config, and have you set the toolchain path globally in preferences-> C/C++ -> Build -> Global Tools Paths? Posted April 4, 2017, midnight Hi Believe it or not, that was the only error messages in the log for eclipse. There was no more then that. I had taken the blinky project and took out only the required files, built that and got the above error.. Finally I realized that something was different in the way the build was running. The binary at the end was different in size as were many of the object files. Finally after fighting with it for 7 or so hours, I did the reverse and took the original blinky project and just deleted whatever I didn't need and that worked. No idea why it works now, but there you go. Posted April 5, 2017, 5:12 p.m. Hi Great tutorial, thanks! I got everything working except for flashing. This is not a crisis since I can use nRFGo Studio to do this, but would like to understand what I am doing wrong. Firstly, I am using SDK 13.0.0 and using Eclipse Mars 2 on Windows 10 (for what its worth). When attempting to flash, I get the following errors: make: * [flash] Error -11 Recipe for target 'flash' failed. and it points me to the location in the Makefile where 'flash' is defined. Here is my make target for flashing: Before I even got to setting up eclipse, I also could not get nrfjprog to work properly and had to reference it using its full path. Here is a screenshot of what I got when I just called nrfjprog, followed by when I called it using the full path: I tried adding the location of nrfjprog.exe to the PATH variable, but that did not do anything. What am I doing wrong or missing? Thanks TT Posted April 5, 2017, 5:12 p.m. Hi Great tutorial, thanks! I got everything working except for flashing. This is not a crisis since I can use nRFGo Studio to do this, but would like to understand what I am doing wrong. Firstly, I am using SDK 13.0.0 and using Eclipse Mars 2 on Windows 10 (for what its worth). When attempting to flash, I get the following errors: make: * [flash] Error -11 Recipe for target 'flash' failed. and it points me to the location in the Makefile where 'flash' is defined. Here is my make target for flashing: Before I even got to setting up eclipse, I also could not get nrfjprog to work properly and had to reference it using its full path. Here is a screenshot of what I got when I just called nrfjprog, followed by when I called it using the full path: I tried adding the location of nrfjprog.exe to the PATH variable, but that did not do anything. What am I doing wrong or missing? Thanks TT Posted April 6, 2017, 6:53 p.m. I am getting this error whenever I try to run make for any of the examples! I have the SDK13 Posted April 19, 2017, 1:16 a.m. Hello, I've done all those steps and that's what is shows when I try to build it and I've configured all Paths: It seems like it can't find the libraries what should I do? Posted April 19, 2017, 9:02 a.m. @Tielman, it looks like you have a old version of nrfjprog in your env. path. You can verify by running nrfjprog -v. @Mohsen, the error message says that NRF52 is redefined in the nrf.h header at line 49, but this line is blank. Is it possible that this file has been modified? Suggest to try with a clean copy if you haven't already. @MikeLemon, looks like the 'generate makefile automatically' option has been enabled. Can be disabled in project properties -> C/C++ Build. Posted April 20, 2017, 2:02 a.m. Ok thanks the makefile.windows wasn't set to the correct location of the folder. Posted April 20, 2017, 2:20 a.m. Hi so it seems like after configuring the makefile.windows correct it's able to start building the blinky code provided in cmd but now it say's it can't find the "boards.h" header file: No such file or directory # include "boards.h" compilation terminated. make: * [_build/main.o] 1 error Posted April 20, 2017, 2:20 a.m. Hi so it seems like after configuring the makefile.windows correct it's able to start building the blinky code provided in cmd but now it say's it can't find the "boards.h" header file: No such file or directory # include "boards.h" compilation terminated. make: * [_build/main.o] 1 error Posted April 29, 2017, 10:46 p.m. The code builds deploys and then stops at what would appear to be somewhere in main.c however there it stops (@1aff4) and stepping functionality fails to work. > The console output appears fine: > SEGGER J-Link GDB Server V6.12a > Command Line Version > > JLinkARM.dll V6.12a (DLL compiled Dec > 2 2016 16:46:57) > > -----GDB Server start settings----- GDBInit file: none > GDB Server Listening port: 2331 > SWO raw output listening port: 2332 > Terminal I/O port: 2333 > Accept remote connection: > localhost only Generate logfile: > off Verify download: on > Init regs on start: on > Silent mode: off > Single run mode: on > Target connection timeout: 0 ms > ------J-Link related settings------ J-Link Host interface: USB > J-Link script: none > J-Link settings file: none > ------Target related settings------ Target device: nrf52 > Target interface: SWD > Target interface speed: 1000kHz > Target endian: little > > Connecting to J-Link... J-Link is > connected. Firmware: J-Link > OB-SAM3U128-V2-NordicSemi compiled Mar > 2 2017 12:22:13 Hardware: V1.00 S/N: > 682336494 Checking target voltage... > Target voltage: 3.30 V Listening on > TCP/IP port 2331 Connecting to > target...Connected to target > > Reading all registers Read 4 bytes @ > address 0x000008E4 (Data = 0x47184B06) > Read 2 bytes @ address 0x000008E4 > (Data = 0x4B06) Setting breakpoint @ > address 0x00025C56, Size = 2, BPHandle > = 0x0001 Starting target CPU... ...Target halted (DBGRQ, PC = > 0x0001AFF4)  Anyone seen this failure before? ideas anyone? Posted May 1, 2017, 6:30 p.m. Please note that the "softdevice" link in the "Flash download" section doesn't appear to work. Atleast in Safari. Posted May 1, 2017, 7:21 p.m. For those users who experienced the issue reported: Posted April 29, 2017, 10:46 p.m. Make sure that the board is correctly programmed. This could require updating the Makefile I had to add: NRFJPROG_DIR := nRF5x-Command-Line-Tools_9_0_0_OSX/nrfjprog and then had to prepend (SDK_ROOT)/../$(NRFJPROG_DIR)/ to all occurrences of nrfjprog Posted May 3, 2017, 11:26 a.m. Hi Steve, Have you had any progress on the debugging problem? If not, please let me know which softdevice version you are using and include a screenshot of the CPU registers. Thanks for letting me now about the dead link, have fixed it know. The nrfjprog issue should be possible to solve by adding nrfjprog to your env. path, or had you tried that already? Posted May 3, 2017, 5:23 p.m. nRF52 SDK12.2 fails SOFTDEVICE_HANDLER_INIT when debugging using eclipse Mars in Ubuntu 16.04. Workaround appears to be, edit debug configurations, go to Startup tab, and uncheck "Load executable". sd_softdevice_enable now returns 0 when debugging. https://devzone.nordicsemi.com/question/126696/nrf52-sdk122-fails-softdevice_handler_init-when-debugging/?comment=131619#comment-131619 Posted May 3, 2017, 6:24 p.m. @Vidar - this part of the story has a happy ending :O) was able to get stepping functionality working. Got this far last year, but failed this year! however had to put the project on hold. Posted May 24, 2017, 6:06 a.m. to compile using g++ from the commandline, should I be changing the toolchain path for the entire sdk under components/toolchain, or can i do this by just changing the makefile for the project? Posted June 5, 2017, 10:31 p.m. Hi, I installed the "GNU Tools ARM Embedded" and the "GNU ARM Eclipse", My Makefile.windows looks like this: " GNU_INSTALL_ROOT := C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q1-update GNU_VERSION := 6.3.1 GNU_PREFIX := arm-none-eabi " and i added to path both: C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q1-update C:\Program Files\GNU ARM Eclipse\Build Tools\2.8-201611221915\bin when i write "make" inside the armgcc folder(of blinky) i get: Makefile:204: Cannot find include folder: ../../../config/blinky_pca10040 Makefile:204: Cannot find include folder: ../../../config make: Nothing to be done for 'default'. Anyone has an idea why? Posted June 11, 2017, 9:49 a.m. Question! Since the Makefile already defines the source file and include file locations, is it necessary to import them into eclipse? If so is there any point to it other than the ability to view and edit the code? Posted June 23, 2017, 3:40 p.m. Hii Vidar Its reallly a nice tutorial I'm able to build and run the example but seeing one wierd issue like in my console I'm seeing this data can any one please help me in this regards Thanks in advance Posted June 28, 2017, 12:34 p.m. @etamar, this warning can be ignored. Was an issue in the SDK build system that caused these unused include paths to be added to the makefile. 'Nothing to be done for 'default'.' means that the build is already up to date. You can run 'make clean && make' to force a re-build. @Abhishek Satish, no it is not necessary, project is built externally with GNU make and Makefile. but it makes it easier to edit and debug you code as you said. @Pavan kumar, this is probably the output from SWO (we typically use UART or Segger RTT for logging). Disable semihosting and SWO in your debug configuration to avoid this. Posted June 28, 2017, 12:49 p.m. Thank you Vidar It helps me alot Posted July 2, 2017, 10:08 a.m. Thank you so much, Vidar Berg. After several attempts, I can do it. Nice tutorial !! Posted Aug. 4, 2017, 6:04 p.m. I installed the GNU toolchain and GNU make in win 10 but if I use the cmd window in the SDK and type 'make' I get the error: 'The command "make" is either misspelled or could not be found.' Went something with the GNU make Installation wrong or am I using the wrong SDK (nRF5_SDK_13.1.0_7ca7556) ? Anyone has an idea why? Posted Aug. 4, 2017, 6:04 p.m. I installed the GNU toolchain and GNU make in win 10 but if I use the cmd window in the SDK and type 'make' I get the error: 'The command "make" is either misspelled or could not be found.' Went something with the GNU make Installation wrong or am I using the wrong SDK (nRF5_SDK_13.1.0_7ca7556) ? Anyone has an idea why? Posted Aug. 4, 2017, 11:26 p.m. You must set the path for the build tools in your enviorment variables, for example: C:\Program Files\GNU MCU Eclipse\Build Tools\2.9-20170629-1013\bin\bin Posted Aug. 5, 2017, 12:30 a.m. Hey, if I make the blinky example I get this in my _build folder, I think its wrong or? But I setted up the right path the makefile.windows file Another question is, can I use Eclipse Oxygen? Thank you in advance Posted Aug. 5, 2017, 2:35 p.m. I think I did something wrong with the enviorment variables. It Looks like: enviorment variables.png I tried to et a user variable for the admin account and a System variable but both didnt work. Is the variables Name incorrect? Thanks... Posted Aug. 7, 2017, 2:05 p.m. You need to add the path to your existing 'path' variable. Posted Aug. 7, 2017, 2:12 p.m. Hi Vidar, Do you have any recommanded tutorial for continuing yours but to flash and debug the NRF52832 chip with a ST LINK/V2 configured as a J link from a Discovery board? (Stopped the tutorial at Flash download(Couldn't find that build file but managed to build the Blink example with no errors) Posted Aug. 8, 2017, 1:28 p.m. Hi all, I can't build any of the examples from SDK12.3.0 Could you help a little bit? When I run make, I get: make: Nothing to be done for default' Tried different makefile.common files, changed their contents, installed different versions of GCC.. I am sure that the code is not compiled - there are no .o files, no _build directory and I have deleted all the .hex files. Thanks Posted Aug. 8, 2017, 1:28 p.m. Hi all, I can't build any of the examples from SDK12.3.0 Could you help a little bit? When I run make, I get: make: Nothing to be done for default' Tried different makefile.common files, changed their contents, installed different versions of GCC.. I am sure that the code is not compiled - there are no .o files, no _build directory and I have deleted all the .hex files. Thanks Posted Aug. 9, 2017, 5:20 p.m. Are there any major change if going to SDK 14 ? Will SDK 13 makefile.common work for SDK14 ? Can you upload an example attachment for SDK14 (hrs) ? Thanks! Posted Aug. 17, 2017, 8:07 p.m. I tried to build the blinky example while Setting up eclipse for the first time. I got the error 'Program "make" not found in PATH'. The Environment variable path is set correctly and I can build the example by typing 'make' in the cmd window in the example Folder of the SDK. Something must be set incorrect in eclipse...but what? The build Tools Folder is: E:\Programme\Build Tools GNU MCU\bin the tollchain Folder: E:\Programme\GNU ARM 6 2017-q2-update\bin the build command for the Project is set to 'make VERBOSE=1' Anyone has an idea? Posted Sept. 6, 2017, 12:45 p.m. dont go mergehex.exe if i put it in the end of Makefile.Only when i run mergehex.exe from the comand line this is script in the end of Makefile of my project merge: @echo Merging app and SoftDevice mergehex.exe --merge$(SDK_ROOT)/components/softdevice/s132/hex/s132_nrf52_3.0.0_softdevice.hex C:/nordic/dev/nRF5_SDK_12.3.0_d7731ad/examples/peripheral/blinky/pca10040/s132/armgcc/_build/nrf52832_xxaa.hex --output C:/nordic/dev/nRF5_SDK_12.3.0_d7731ad/examples/peripheral/blinky/pca10040/s132/armgcc/_build//merge_nrf52832_xxaa.hex

Posted Sept. 12, 2017, 7:37 a.m.

Can someone PLEASE update this tutorial for Eclipse Neon? This tutorial is outdated and even the GNU MCU Eclipse plugin doesn't work with Mars now.

Posted Sept. 12, 2017, 7:37 a.m.

Can someone PLEASE update this tutorial for Eclipse Neon? This tutorial is outdated and even the GNU MCU Eclipse plugin doesn't work with Mars now.

Posted Sept. 12, 2017, 8:19 a.m.

Hi, I changed the link to Eclipse Neon last week when I was made aware of this. The steps to configure Neon are mostly the same.

Posted Sept. 13, 2017, 5:36 p.m.

Hi Vidar, Thanks for the great tutorial. I just met a problem when starting debug. Project Build and Jlink works good. And after I terminate I notice there are some red rect show below.I am using SDK13.1.0 and nRF52832 on Windows. What might be the problem before entering the main function?

Posted Oct. 11, 2017, 8:59 p.m.

Hi,

It wont show me that nrf52 tab at projects :

Posted Oct. 17, 2017, 5 a.m.

I followed this tutorial and is stuck at the section 'Enable auto discovery of symbols, include paths and compiler settings'.

I imported the source files from the picture below to the virtual folders.

Then according to the tutorial, I did the necessary things as follow:

After which, I right click on the project and click 'build project'. But the only thing output on the console is:

There is no 'key' symbol on the source files after the build.

And a check on one of the source file shows that the CDT Build Output Parser is not even present there to include any paths.

How do I fix this? Of not having the key and the paths to be automatically included by the CDT Build Output Parser?

Posted Oct. 17, 2017, 6:13 a.m.

I managed to fix the above error I mentioned earlier. Now my CDT Build Output Parser has included the paths as expected.

However I encounter another error after the successful build (with key symbol shown). After the successful build, I skipped the 'flash download' section and proceed to 'Setting up a project for debugging in Eclipse' section.

I followed the debugging steps accordingly and managed to get the debug window out. But I realized in the Project Explorer panel, my main.c file under the debugging project has a small red cross on it. Upon opening up, there are many red underline of words with the error ''Symbol xxx could not be resolved'.

How can I go about resolving it?

Posted Oct. 17, 2017, 10:05 a.m.

@jj, have you tried to rebuild the "index": right click on project folder in project explorer-> index -> rebuild? Also, which SDK version are you using? Remember that you must used the patched makefile.common file attached to this tutorial if you are using SDK 12 or SDK 13.

Posted Oct. 17, 2017, 11:10 a.m.

@vidar I tried rebuilding the index but it did nothing. But after including the patched makefile.common I think it is resolved. Thank you!

Posted Oct. 20, 2017, 3:52 p.m.

Is there a makefile.common for SDK 14? Is it required? Build failed with makefile.common SDK13.

Posted Oct. 23, 2017, 4:47 p.m.

.cproject(/attachment/7875011e0bc377ae64cad5c0b5a005b3)This tutorial was difficult for us so once we got it to work, we decided it would be nice to post our notes in case it helps others. We did not verify these notes we took during the process.

Install GCC and Eclipse and get make working: (https://devzone.nordicsemi.com/tutorials/7/)

1. Install Nordic SDK.

2. Install GNU Tools ARM gcc-arm-none-eabi-6-2017-q2-update-win32.exe from (https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads). installs to C:\Program Files (x86)\GNU Tools ARM Embedded

3. Install GNU ARM Eclipse Build Tools (make/rm/mkdir) gnu-mcu-eclipse-build-tools-2.9-20170629-1013-win64-setup.exe from https://github.com/gnu-mcu-eclipse/windows-build-tools/releases. installs to C:\Program Files\GNU MCU Eclipse

4. Edit {Your Nordic path}\components\toolchain\gcc\Makefile.windows and change GNU_INSTALL_ROOT to install path above (C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update)

5. open cmd prompt and run "c:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin\gccvar.bat"

7. in above cmd prompt: "C:\Program Files\GNU MCU Eclipse\Build Tools\2.9-20170629-1013\bin\bin\make.exe". It should build OK.

8. Unzip GNU ARM Eclipse (neon.3 + version of eclipse with plugins already installed) to c:\eclipse\neon.3 from http://gnuarmeclipse.github.io/plugins/install/ (20170711-2049-gnumcueclipse-4.1.1-neon-3-win32.win32.x86_64.zip)

9. run C:\eclipse\eclipse\eclipse.exe in command prompt opened above (so env vars are set)

10. window->perspective->open perspective->other select packs

11. Click the refresh button in the top right corner of the packs view (will fetch all packs from the repositories)

12. Select Nordic Semiconductor in the list of vendors, and install the Device family pack.

13. window->preferences input "global" into the search box at the top left. click on "Global ARM Toolchains Paths" and notice that the Toolchain folder: is correctly set to the path where "GNU toolchain for ARM" was installed above (correct this if it isn't). click on "Global Build Tools Path" and click the browse button and browse to the location where the "GNU ARM Eclipse Windows Build Tools" was installed above (mine was C:\Program Files\GNU MCU Eclipse\Build Tools\2.9-20170629-1013\bin) with \ changed to /. then click ok.

14. note that the paths of GNC MCU Eclipse and GNU Tools ARM Embedded will be present in project properties->c/c++ build->build variables->path.

15. removed C:/Program Files/GNU MCU Eclipse/Build Tools/2.9-20170629-1013/bin/ from global build tools. but later it seems to have restored itself.

17. copy the .project & .cproject from C:\Nordic\nRF5_SDK_11.0.0_89a8197\examples\peripheral (since that is the only place .proj/.cproj files exist) to C:\Nordic\Nordic.orig\examples\peripheral\blinky\pca10040\blank\armgcc. NOTE THAT THIS DID NOT INCLUDE THE MAKEFILE! Note that we were already successfully building this project via command line

18. file->import->General -> Existing Projects into Workspace, nagivate to folder where working command line build above was done. it will import since .proj/.cproj files present

19. in Makefile, replace "TEMPLATE_PATH = ../../../../../../components/toolchain/gcc" with "TEMPLATE_PATH = C:/Nordic/Nordic.orig/components/toolchain/gcc". Also in the makefile, change the -O3 to -O0 (disable optimization)

20. in eclipse, project properties->C/C++ Build, builder settings tab, change build command from make to: /Program Files/GNU MCU Eclipse/Build Tools/2.9-20170629-1013/bin/bin/make VERBOSE=1

21. right mouse click project and select build. should make without errors (like it already did above) but will display an error in main on LEDS_NUMBER and some includes will have ? on them. this is because the IDE can't find includes since it does not know how to build (makefile does). this can be ignored for now as it does not prevent successful builds, only the IDE is complaining.

22. window->show view->build targets, click on project at top of this view, click the icon "green circle+" (which is New Build Target), enter "flash nrf52832_xxaa" as target name: and click ok. double click this newly created build rule target and it will erase and flash the file.

23. right mouse click project and select properties->C/C++ Build->settings click devices tab. expand Devices, Nordic Semi, nRF52832 and select nRF52832_xxAA and click ok.

24. right mouse click project and select debug as->debug configurations. Right click on GDB SEGGER J-Link Debugging and click the new icon at the top of the dialog. click debugger tab and remove -noGui from Other Options: and replace Executable: field (under GDB Clienet Setup) with "arm-none-eabi-gdb". Click the Startup tab and unclick Enable SWO.Click Debug button in lower right of dialog. Debugging will be launched.

25. project properties -> C/C++->General->Preprocessor Include Paths, Macros etc., click providers tab. Click on CDT GCC Build Output Parser and change the compiler command pattern from (gcc)|([gc]++)|(clang) to (.gcc)|(.[gc]++) then click apply. Click on CDT ARM Cross GCC Built-in Compiler Settings and replace ${COMMAND} with arm-none-eabi-gcc and click Apply. all .c source files now have key icon except nrf_delay.c which does not exist in the version of sdk in use so right mouse click it, choose properties, click C/C++ Build and click the box Exclude resource from build. Build clean and then build and all builds ok and errors are gone. this concludes the setup of neon eclipse for nordic** how to bring another nordic project into eclipse: copy .project and .cproject from working project and paste into new armgcc project folder (there must be a Makefile already present). looking at the keil project, delete the virtual folders not needed. add virtual folders that are needed. change C:\Nordic\nRF5_SDK_14.1.0_1dda907\components\toolchain\gcc\Makefile.windows GNU_INSTALL_ROOT from C:/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q3/bin/ to C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q2-update/bin/ (MUST INCLUDE THE LAST SLASH AT THE END). doing this with another project open appears to MOVE that other project's flash to this one? window->show view->build targets, click on project at top of this view, click the icon "green circle+" (which is New Build Target), enter "flash nrf52832_xxaa" as target name: and click ok. double click this newly created build rule target and it will erase and flash the file. repeat this process (New Build Target) but enter flash_softdevice. double click this newly created build rule and it will erase and flash the softdevice. project properties -> C/C++->General->Preprocessor Include Paths, Macros etc., click providers tab. Click on CDT GCC Build Output Parser and change the compiler command pattern from (gcc)|([gc]++)|(clang) to (.gcc)|(.[gc]++) then click apply. Click on CDT ARM Cross GCC Built-in Compiler Settings and replace${COMMAND} with arm-none-eabi-gcc and click Apply. all .c source files now have key icon except nrf_delay.c which does not exist in the version of sdk in use so right mouse click it, choose properties, click C/C++ Build and click the box Exclude resource from build. Build clean and then build and all builds ok and errors are gone. actually it seems like the errors go away after a debug or something.

right mouse click project and select debug as->debug configurations. Right click on GDB SEGGER J-Link Debugging and click the new icon at the top of the dialog. Click Debug button in lower right of dialog. Debugging will be launched.

Attached to this post are the .project and .cproject files for ble_peripheral\ble_app_uart

Posted Oct. 23, 2017, 7:31 p.m.

If like me you received: "Cannot find: C:\Program Files (x86)\GNU_Tools_ARM_Embedded\6_2017-q2-update...ect" according to the actual configuration of your system." error message, one thing to try is to create a folder with no spaces and ensure the /bin is included in the makefile.windows install root. This is my setup that I finally got to build: GNU_INSTALL_ROOT :=C:/Users/jgraham/Desktop/GNU_ARM/GNU_Tools_ARM_Embedded/6_2017-q2-update/bin/ GNU_VERSION := 6.3.1 GNU_PREFIX := arm-none-eabi

Becareful with backslashes versus forward slashes. Also I'm using SDK 12 on windows 7 professional.

Posted Nov. 8, 2017, 3:43 p.m.

I'm taking my first steps with nRF, since I've identified that I'll have to work with nRF51 with SoftDevice S110, because I'll use BLE with peripheral to send little data streams with a custom profile. However I am having errors when executing the make command, I am using SDK 10.0.0 Release Date: Week 46 and GCC 6.3.1, the latter configured correctly, and the make error can be seen below:

What procedure should I follow to correct this error?

Posted Nov. 8, 2017, 3:54 p.m.

Do you get the same error try to build other makefiles (blinky example for instance) ?

Posted Nov. 8, 2017, 5:08 p.m.

@Vitar Berg, thanks for attention.

I forgot to set the path to make, I was using make that comes with another tool (Ruby Tools)

Posted Nov. 8, 2017, 5:46 p.m.

The error: Makefile:154: *** Recursive variable 'remduplicates' references itself (eventually). Stop. again, with uart and beacon projet:

My makefile.windows:

PROGFILES := C:/Program Files (x86)

GNU_INSTALL_ROOT := \$(PROGFILES)/GNU Tools ARM Embedded/6 2017-q2-update
GNU_VERSION := 6.3.1
GNU_PREFIX := arm-none-eabi


Posted Nov. 8, 2017, 10:45 p.m.

Find the solution to the Make problem, it's no good that the path to make` is added manually, it only worked correctly without conflicts with other versions when I added it to the system path.

Posted Nov. 9, 2017, 1:12 p.m.

I have not managed to reproduce this. Suggest that you try to use make.exe included in this package found here: http://gnuarmeclipse.github.io/windows-build-tools/ and remove paths to other build tools that you may have from your env. path. Another alternative is to not use "remduplicates" I guess.

Posted Nov. 9, 2017, 10:40 p.m.

Yes I am with this already installed the use a long time, what I am strange is the fact that it has to be in the system path, only the path defined manually.

but I confess that the author himself has commented on me with some strange problems that only occur on my windows.

Posted Nov. 10, 2017, 11:26 a.m.

I saw references to cygdrive in your image, and assumed that you were using a different version of make. The fact that make works if you move it the path to the system path could indicate that you have multiple build tools in your search path. Have you tried to remove Cygwin, etc from your env. path?

Posted Nov. 10, 2017, 4:35 p.m.

Exactly, there are 3 different versions of Make on my windows, I did as you suggested, I removed the other versions. Livius has warned me about this problem other times, but my environment is quite heterogenous, since I work with various tools and languages.

I can already compile without problems from the command prompt.

Posted Nov. 10, 2017, 5:46 p.m.

Thank you so much,!

Step Successfully, Eclipse Oxygen + GNU MCU GCC was a success using the Blink example.

Thank you one more time!

Posted Nov. 11, 2017, 4:24 p.m.

If I try to build the blink example, the following error appears in eclipse mars:

has anyone an idea? Would it help to update to the latest eclipse Version?

thanks ...

## Recent blog posts

• ### Estudando Projetos do SDK 10 para nRF5x com Eclipse Oxygen (Portuguese)

Posted 2017-11-12 00:08:55 by Carlos Delfino
• ### Configurando o Eclipse Oxygen para Desenvolvimento com nRF5x (Portuguese)

Posted 2017-11-10 21:15:47 by Carlos Delfino
• ### How to use Git for embedded software development

Posted 2017-11-06 13:21:55 by Yaniv Nis
• ### Thingy:52 based Weather Station

Posted 2017-10-29 22:31:15 by Krzysztof Szewczyk
• ### How to build continuous integration and delivery process for embedded SW development

Posted 2017-10-03 11:01:29 by Yaniv Nis

## Recent questions

• ### Issues running imported Keil project in Segger Studio

Posted 2017-11-19 08:21:24 by Nick