Monday, January 23, 2017

Developing for the NRF51822 on Mac OS X

Over the weekend I worked on trying to get a development environment up and running for the Nordic nRF51822 system on a chip.

This outlines how I did it:

Need to Download Segger JLink. This is used to flash the board.

J-Link Software and Documentation pack for MacOSX

For Mac I installed: JLink_MacOSX_V612f.pkg

After it was installed I was able to run JLinkExe (it put it in my path)

$ JLinkExe 
SEGGER J-Link Commander V6.12f (Compiled Jan 13 2017 16:41:09)
DLL version V6.12f, compiled Jan 13 2017 16:40:56

Connecting to J-Link via USB...Updating firmware:  J-Link OB-SAM3U128-V2-NordicSemi compiled Nov 14 2016 16:58:29
Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled May  4 2015 13:48:48
Waiting for new firmware to boot
New firmware booted successfully
Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Nov 14 2016 16:58:29
Hardware version: V1.00
S/N: 681696138
VTref = 3.300V

Type "connect" to establish a target connection, '?' for help


I had to use SWD:

JLinkExe -device nrf51822 -if swd -speed 2000

J-Link>loadfile nrf51422_xxac.hex
Downloading file [nrf51422_xxac.hex]...
Comparing flash   [100%] Done.
Erasing flash     [100%] Done.
Programming flash [100%] Done.
Verifying flash   [100%] Done.
J-Link: Flash download: Flash programming performed for 1 range (4096 bytes)
J-Link: Flash download: Total time needed: 0.132s (Prepare: 0.043s, Compare: 0.004s, Erase: 0.000s, Program: 0.075s, Verify: 0.001s, Restore: 0.008s)


No comments: