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

Build and flash nordic boards on ARM Linux (raspberry pi - like) devices

Hi,

I have a ARM core device like raspberry pi / orange pi etc, where I run a build and deploy server  - basically compiling code and flashing to a target. 

I have the build figured out, so I can compile my app on the arm-linux based device. However, I am missing some tools to complete the flashing bit, namely nrfutil, mergehex, nrfjprog. 

Has anyone figured this part out? These tools are shipped as binaries and an arm-linux binary is not available.

Jlink I think has an armlinux binary, so I could look at ways to program the nordic board using Jlink instead of nrfjprog. Any ideas on how to go about doing this?

Next step is getting nrfutil and mergehex tools. Any alternatives or suggested workarounds?

EDIT: 

I have a workable solution with the following:

- I used the JLink armlinux binary found here. Use "loadfile" command to flash softdevice, bootloader, app

- Build nrfutil from source by replacing the "pc_ble_driver_py" module with a dummy class

- Used the hexmerge script from intelhex python library to combine the application settings page with the app

  • You can use OpenOCD to program the NRF Chip, either via JLINK or via GPIOs on the RPi.

    Side node: You can also use arm-none-eabi-gdb and JlinkGDBServer to flash the chip from the .elf file directly.

    Megehex is trivially replaced by some console command (like "head"), because all you need to do when stitching two intel hex files together is to cut the last line away from the first file. The last line in an intel hex file just contains an "end of file" record.

  • Thanks for the suggestions!

    Yes, OpenOCD is a good choice, there are no resources to get started though. Anyways I will find out.

    I can run gdb server and flash the chip so I can consider that too

    nrfutil helps generate settings page for dfu, so I will still need that somehow. I will consider building from source

Related