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

Is it possible to flash S110 from Linux or OS X?

We're working on a project with the nRF51822, but most of our developers are working from OS X and Linux. Is it possible to flash the softdevice from these platforms? Also, how does debugging work on these platforms?

  • Yes, this is most definitely possible. Segger deliver their tools for both OS X and Linux, so you first have to install them, available here.

    Having done this, you should be able to use the flash targets in the attached Makefile to flash both the softdevice and an application. You will have to do tweak the path to the J-Link tools, but afterwards you should be able to do

    
    make flash-softdevice SOFTDEVICE=../path/to/softdevice/without/spaces.hex
    
    

    to flash the softdevice.

    Debugging is also possible, by starting the J-Link GDB server with the -if swd command line argument, and then using either command line GDB or GDB integrated into Eclipse or similar to connect to the server, by doing a "target remote localhost:2331". How to set this up for Eclipse is described in nAN-29, and even though it is written for Windows, the Eclipse setup should be very similar on OS X and Linux.

    Makefile.posix.txt

  • Thanks Ole. Why not include the Makefile.posix (it's mentioned, but commented out in Makefile.common too), and the above information in the official SDK; even if under experimental 'label', ?

  • I've been quite happy with my gcc experience so far on windows. I have not been able to reproduce a working linux environment, and for now intend to stick to windows. Some facts:

    • An ubuntu 12.04 LTS host running on an atom netbook
    • Launchpad gcc-arm-none-eabi-4.7-2013q1 (same as on the windows host)
    • Identical Makefile Makefile.common, with the exception of Makefile.jlink for linux-based flashing / debugging

    The application is the ble_app_uart (sdk4.3 edit). It compiles successfully on either host, and seems to flash ok. The linux flashed version does not run, and spits out the following in gdb:

    Breakpoint 1 at 0x14d04: file ../main.c, line 531.
    Resetting target
    Resetting target
    (gdb) continue
    Continuing.
    Setting breakpoint @ address 0x00014D04, Size = 2, BPHandle = 0x0001
    Starting target CPU...
    ...Target halted (PC = 0xFFFFFFFE)
    Reading all registers
    
    Program received signal SIGTRAP, Trace/breakpoint trap.
    Removing breakpoint @ address 0x00014D04, Size = 2
    Read 4 bytes @ address 0xFFFFFFFE (Data = 0x401C59F9)
    0xfffffffe in ?? ()
    

    Additionally the linked output files are not the same (in md5 or size); even though the build environment and toolchains are identical!

    If you have any pointers, or what I describe / paste has any obvious giveaways, please share.

    Working in Windows in the meantime, Mike

Related