RKNRFGO

About

RKNRFGO is a simple GUI OSX application which shows a list of connected Seggers and allows you to flash code and optionally a soft device and a boot loader onto an nrf51822 chip. It supports more than one connected Segger and does some minimal error checking on the files it's asked to flash.

Installation

Prerequisites

RKNRFGO requires J-Link Commander to be installed on the machine. It uses this program to read and write the connected board. It has been tested with versions 4.78 and 4.80. You can find J-Link software here, you need a Segger serial number to download it which is on the nrf51822 board or the Segger programmer in the kit.

Installing

Download the installer and run it. You have an option whether or not to install nrfjprog and cdccontrol. You will need an administrator account to install.

Uninstalling

To uninstall just drag RKNRFGO.App from /Applications to the Trash. If you installed nrfjprog and cdccontrol then the following commands will remove them

sudo rm /usr/local/bin/nrfjprog
sudo rm /usr/local/bin/cdccontrol

Running

Main screen

Main Screen Image

The main screen has a dropdown box for selecting which Segger you want to use, boxes to select code, a SoftDevice and a Bootloader, a path to your installation of J-Link Commander and buttons to program and wipe the device. There is also an optional line showing the state of the CDC USB drivers. (see the screenshots on the main page).

Segger Selection

This drop down box shows all currently connected Seggers by serial number and device information if available. Select which of the devices you wish to program. The list auto-refreshes anytime a JLink device is plugged in or unplugged, if you wish to refresh it unplug and re-plug a device.

CDC Driver Status

Update: as of version 4.88 of the Segger JLink tools this issue is fixed. RKNRFGO now attempts to detect the version of JLink Commander you are running and if it's greater than 4.88, doesn't check CDC status as it's no-longer necessary. The menu items are also disabled.

OSX has built-in drivers for a number of standard USB devices, when one is seen which matches a known type, the driver is automatically started. The nrf51822 boards, when connected by USB, present themselves as a CDC device (they show up under /dev/tty.usbmodem*). However the system driver demands exclusive access to the device so when it starts up, it prevents anything else from accessing it. The J-Link Commander uses a different way of connecting to the attached Segger and if the CDC driver has already claimed it exclusively, it doesn't work and gives an error that it cannot connect to the device.
So in order to use J-Link Commander on OSX, it's necessary to disable the CDC drivers.

When RKNRFGO checks for devices and finds none it also checks to see if the CDC drivers are loaded. If they are, that means that J-Link Commander will not work. In this case it shows the CDC driver information line just below the Segger selector. You can also show this line permanently by going to the View menu and selecting CDC Driver Status. As well as the current status there are Enable, Disable and Refresh buttons. To program the device the CDC drivers need to be disabled, if you are using the USB UART functions, you must re-enable them. tempts to detect the version of JLink Commander you are running and if it's greater than 4.88, doesn't check CDC status as it's no-longer necessary. The menu items are also disabled.

Code

You must select a code file to flash into the device. Select a .hex file. When a file has been parsed it shows the load address and size and some other information.

The file at the code path is monitored for changes, so if you rebuild it after a source code change, it will enable the reload button and show the file needs reloading. You can also set RKNRFGO to auto-reload the file every time it's been rebuilt, then you just have to hit the program button and re-program the device. The auto-reload is under Preferences, see the image below.

SoftDevice

If you are using a SoftDevice, enable the Use SoftDevice checkbox and select the .hex file. Information about each of the sections in the SoftDevice are shown after it has been parsed.

RKNRFGO keeps an internal database of softdevices it knows about. If you load a recognised hex file the version will be shown and the app will know where the user code should be loaded. Refer to the image above which shows the app with a recognised device.

If the file isn't known, you have to tell RKNRFGO the basic type and version of the softdevice from a dropdown which will show in that case.

softdevice dropdown

The internal database of known softdevices is maintained separately from the program and will be updated as new ones are released. The app is set up initially to automatically check on launch for a new version and update it, you can disable that in Preferences and you can also force an update check from there.

softdevice dropdown

If you have updated the database and your softdevice is still unknown, please file a ticket asking for it to be added.

The list of currently-known softdevices is shown on the About box

softdevice dropdown

Bootloader

If you are using a SoftDevice and Bootloader, enable the Use Bootloader checkbox and select a .hex file for the Bootloader.

JLinkExe

The default path for J-Link Commander is /usr/bin/JLinkExe. If you installed it somewhere else, browse to the path so RKNRFGO can find it.

Errors

If there are errors preventing the device being flashed, they are shown below the JLinkExe path. For example, if there is no SoftDevice, the code should start at 0x00000000. If there is a SoftDevice, the software works out where the code should start by reading the SoftDevice hex file and ensures that it starts there.

Warnings

Warnings don't prevent programming, if there are any they are shown in blue underneath errors.

Wipe

As long as there is a connected Segger, the Wipe button is active and clears the device.

Program

As long as there is a connected Segger and there are no errors, the Program button is active and will program the code plus the SoftDevice and Bootloader if selected.

Command Log

On the Window menu is an entry for Command Log. When selected a window shows the log of all commands sent to J-Link Commander or the driver loading/unloading software.


Related

Wiki: Home
Wiki: cdccontrol
Wiki: nrfjprog