The development environment that comes with Nordic's Development Kit is based on Keil (a very expensive commercial IDE), which has a limit of 16K code to use in circuit debugging. Therefore I want to set up a development environment on my Mac using free and open source tools. Nordic has an application note, nAN-29, which describes doing this for Windows.
I will try installing the GCC ARM Embedded, because according to this post on the Nordic forums (quote):
- a new gcc toolchain based on gcc ARM embedded instead of Codesourcery (As Nordic has chosen to support it and not the other)
- Codesourcery on Mac OSX is only a great trouble, as this toolchain lacks of S3 Mentor libs)
- Nordic has released new linker scripts for gcc ARM embedded.
I'm going to try to use Eclipse rather than XCode, so that the project won't depend on OS X.
I downloaded the "Mac Installation Tarball", which didn't contain an installer. I'm not sure where to put it, so for now I'll put it in my Eclipse workspaces folder.
I created a symbolic link (not an alias) called "gcc-arm-none-eabi" so I wouldn't have to change paths in the project if I update the cross compiler version.
I installed Eclipse according to nAN-29. When I build, it tries and fails to use "C:/Program Files/GNU Tools ARM Embedded/4.7 2013q1/bin/arm-none-eabi-gcc" to compile the project. I need to find where to change this path. nrf51_sdk_v5_0_0_34603/nrf51822/Source/templates/gcc/Makefile.common uses a GNU_INSTALL_ROOT environment variable, I wonder where it is set.
The file nrf51_sdk_v5_0_0_34603/nrf51822/Source/templates/gcc/Makefile.common references Makefile.posix, which does not seem to exist.
GNU_INSTALL_ROOT is set in Makefile.windows, but I don't see why Makefile.windows is used. I'll try to make a Makefile.posix and see if it works better.
I made a Makefile.posix as follows:
GNU_INSTALL_ROOT := /Users/erlandlewin/Eclipse-workspaces/gcc-arm-none-eabiGNU_VERSION := 4.7.4I had to edit the Makefile.common as follows:
GNU_PREFIX := arm-none-eabi
#ifeq ($(OS),Windows_NT)I can now build the project in Eclipse and from the command line!
#include $(TEMPLATE_PATH)Makefile.windows
#else
include $(TEMPLATE_PATH)Makefile.posix
#endif
I will download the J-Link software for Mac from here.
Followed the instructions in nAN-29 to set up the debugging. In the "GDB command" field of the Debug Configurations dialog, I used the Browse button to find the arm-none-eabi-gdb binary. This way I don't have to set up any paths.
I start the gdb server using the terminal from the /Application/SEGGER directory, using the following command line:
./JLinkGDBServer -if SWD -device nRF51822(Thanks to info from Christopher Mason)
Woohoo! I can now run debug the ble_app_hrs project from Eclipse via the JLinkGDBServer!