This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What's the non-Windows way to flash an nRF51882? (POSIX nrfjprog?)

I'm just getting started with the nRF51 Eval Kit, I have the 5.1 SDK installed, using Mac OS X for development. I also have the GCC ARM toolchain installed. Firstly, I had to hack the Makefile.common to properly pick up the Makefile.posix (rather than Makefile.windows) and was able to build the example(s) I am interested in.

Next, I need to program/flash the pca10000/pca10001 boards. I tried "make flash", but it's looking for a tool called 'nrfjprog' which is not in the SDK. A quick bit of searching in the forums here says that you get it by running the MSI installer ... which is Windows only.

Any ideas? Is the source available for nrfjprog? Is there some alternative?

Thanks.

Parents
  • I got JLinkExe installed and working (had to unload the OS X CDC usb drivers to get JLinkExe to see the PCA10001).

    I tried flashing the blinky_example, but it doesn't appear to work (at least there are no LEDs blinking).

    I used @ahmed's solution (above, thanks!) which generates the same script as found in the github repos mentioned elsewhere.

    Here' the results of "make flash":

    
    macbookpro:gcc snowball$ make flash
    "/Users/snowball/Work/gcc-arm-none-eabi-4_7-2013q2/bin/arm-none-eabi-gcc" -L"/Users/snowball/Work/gcc-arm-none-eabi-4_7-2013q2/arm-none-eabi/lib/armv6-m" -L"/Users/snowball/Work/gcc-arm-none-eabi-4_7-2013q2/lib/gcc/arm-none-eabi/4.7.4/armv6-m" -Xlinker -Map=_build/blinky_gcc_xxaa.map -mcpu=cortex-m0 -mthumb -mabi=aapcs -L ../../../..//Source//templates/gcc/ -Tgcc_nrf51_blank_xxaa.ld  _build/main.o _build/nrf_delay.o _build/system_nrf51.o _build/gcc_startup_nrf51.o  -o _build/blinky_gcc_xxaa.out
    "/Users/snowball/Work/gcc-arm-none-eabi-4_7-2013q2/bin/arm-none-eabi-objcopy" -O binary _build/blinky_gcc_xxaa.out _build/blinky_gcc_xxaa.bin
    echo "power on" > _build/upload.script
    echo "r" >> _build/upload.script
    echo "loadbin _build/blinky_gcc_xxaa.bin 0x00014000" >> _build/upload.script
    echo "r" >> _build/upload.script
    echo "qc" >> _build/upload.script
    JLinkExe -Device nrf51822 -If SWD _build/upload.script
    SEGGER J-Link Commander V4.80 ('?' for help)
    Compiled Dec 20 2013 19:44:36
    
    Script file read successfully.
    Info: Device "NRF51822" selected (257 KB flash, 16 KB RAM).
    DLL version V4.80, compiled Dec 20 2013 19:44:31
    Firmware: J-Link OB-SAM3U128 V1 compiled Dec 11 2013 20:20:11
    Hardware: V1.00
    S/N: *redacted* 
    VTarget = 3.300V
    Info: Found SWD-DP with ID 0x0BB11477
    Info: Found Cortex-M0 r0p0, Little endian.
    Info: FPUnit: 4 code (BP) slots and 0 literal slots
    Found 1 JTAG device, Total IRLen = 4:
    Cortex-M0 identified.
    Target interface speed: 100 kHz
    Processing script file...
    
    
    Reset delay: 0 ms
    Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    
    Loading binary file... [_build/blinky_gcc_xxaa.bin]
    Writing bin data into target memory @ 0x00014000.
    Info: J-Link: Flash download: Flash programming performed for 1 range (4096 bytes)
    Info: J-Link: Flash download: Total time needed: 1.240s (Prepare: 0.509s, Compare: 0.011s, Erase: 0.000s, Program: 0.663s, Verify: 0.004s, Restore: 0.051s)
    
    Reset delay: 0 ms
    Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    
    
    Script processing completed.
    
    make: *** [flash] Error 1
    
    

    I'm not 100% sure why Make reports an error since there's no error message. Could it just be JLinkExe returns 1 for whatever reason?

    Also, it's my understanding that I don't need a Softdevice to programmed? It's not set in the makefile, I just have a DEVICE_VARIANT of "xxaa".

    Thanks!

  • This isn't really something that's officially supported, so there isn't a Nordic-canonical repository. However, I maintain http://github.com/hlnd/nrf51-pure-gcc-setup in my spare time, and usually point people at that if they need this functionality. I'd therefore be happy if you submit pull requests there! :-)

Reply Children
No Data
Related