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
  • I found out that the nRF Connect programmer will work if I edit the GCC linker script. Replace:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x0, LENGTH = 0x100000
      RAM (rwx) :  ORIGIN = 0x20000000, LENGTH = 0x40000
    }

    with

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1000, LENGTH = 0xff000
      RAM (rwx) :  ORIGIN = 0x20000008, LENGTH = 0x3fff8
    }

    It does not help with nrfutil, so I'm still missing a way to do it on the command line.

Reply
  • I found out that the nRF Connect programmer will work if I edit the GCC linker script. Replace:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x0, LENGTH = 0x100000
      RAM (rwx) :  ORIGIN = 0x20000000, LENGTH = 0x40000
    }

    with

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1000, LENGTH = 0xff000
      RAM (rwx) :  ORIGIN = 0x20000008, LENGTH = 0x3fff8
    }

    It does not help with nrfutil, so I'm still missing a way to do it on the command line.

Children
No Data
Related