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

Command Line Programming nRF52840 Dongle

I've been trying to find a way to program a hex file onto the dongle via the command line on linux.

I would very much prefer not having to touch the mouse in order to program the dongle, so the Programmer App is out of the question. Also, it doesn't work. Instead it just throws a warning about the start of the program being located at address 0x0.

I've tried creating a package using nrfutil, but that didn't work either. After having managed to put together a package like so:
    nrfutil pkg generate --debug-mode --application ot-ncp-ftd.hex --hw-version 52 --sd-req 0xA7,0x67,0x80,0x81,0x87,0x88,0x8C,0x91,0x95,0x98,0x99,0x9E,0x9F,0x9D,0xA5,0xA8,0xA9 ftd.zip
and trying to program like so
    dfu usb_serial --package ftd.zip -p /dev/ttyACM0
it just threw me this error: pc_ble_driver_py.exceptions.NordicSemiException: Response Code InvalidObject

It would be great to have support for the dongle in nrfjprog

Cheers,
Andri

Parents
  • HI Andrii, 

    I sincerely apologize for the late reply. 

    You should be able to generate an application firmware image that uses the S140 v6.0.0 using the following command

    nrfutil pkg generate --application ble_app_blinky_pca10059_s140.hex --application-version 5 --hw-version 52 --sd-req 0xA9 ble_app_blinky.zip

    Note: You need to set the FLASH length so that ORIGIN+ LENGTH < 0xE0000 (start address of the bootloader)

  • Hi Bjørn,

    It's understandable given the fellesferie.

    You wouldn't happen to know how I can configure the FLASH start address in Zephyr? They have quite a complicated build system. Editing the linker script does not seem to be a straight-forward task.

  • just to make sure, if you plan to use Zephyr then you should not have the Softdevice programmed, seems the suggestion from Bjørn used this.

    The Dongle will always have the MBR from the Softdevice in the first block (unless you use an external SWD programmer for programming) so your Zephyr application needs to work despite this, that means work with the MBR interrupt forwarding scheme. You may use VTOR to change the location of the interrupt table as an option.

Reply
  • just to make sure, if you plan to use Zephyr then you should not have the Softdevice programmed, seems the suggestion from Bjørn used this.

    The Dongle will always have the MBR from the Softdevice in the first block (unless you use an external SWD programmer for programming) so your Zephyr application needs to work despite this, that means work with the MBR interrupt forwarding scheme. You may use VTOR to change the location of the interrupt table as an option.

Children
No Data
Related