Program blank NRF52480 without Segger /nrfutil vs nrfjprog

I am working on adapting a project that compiles/flashes the code with a makefile that uses nrfjprog in a cmd line to program a blank nrf52480 with the softdevice and application (no mentioned bootloader).

It doesnt appear that the code utilizes anything specific about the jlink connection, other than that the chip is recognized/linked to the cmd line device via the j-link. Would this same code then work with any 'link' device to get the nrf recognized by the cmd line? or is there something about the nrfjprog that requires specifically j-link? what is the difference between nrfutil and nrfjprog? or is there documentation that I could look up for the code behind nrfjprog? 

In poking around trying to utilize a different type of debugger/swd flasher, i managed to get nrfutil to output a compiled softdevice and application zip, with included .dat, .bin, and a .json file. If i were to try 'bit banging' the output files onto the chip, which address would i put each .dat/.bin at? is the json relevant? I would expect the softdevice segment to be at 0x0, and per docs, the soft device being used looks for the application at 0x27000, would i put the .dat files (which appear to be binary) before or after each .bin file? or does the .dat file just get used by nrfutil to flash to the right locations? 

In trying to smash the code onto the chip/flash so far "manually" setting the soft device in any .bin format (directly converted from hex or with nrfutil) and the app from nrfutil no combination of 0x0 soft device and 0x27000 seem to give a responsive chip but im not sure where .dat goes if anywhere. i dont have a way with the 'manual' flasher to set ram addresses, is that necessary?

Please let me know what other information I should be using/needing!

Thanks

Parents
  • This may or may not help, but the two things that worked for me were:

    1. Flashing the merged.hex file using pyocd or nrfjprog, through a J-Link Mini EDU and through one of the V9 J-Link AliExpress clones.  pyocd is open source so that would help if you're interested in the protocol.
    2. Flashing a .zip bundle to an nRF52840 Dongle using nrfutil and the default Open Bootloader.

    Which other probes, besides J-Link, were you interested in using?

Reply
  • This may or may not help, but the two things that worked for me were:

    1. Flashing the merged.hex file using pyocd or nrfjprog, through a J-Link Mini EDU and through one of the V9 J-Link AliExpress clones.  pyocd is open source so that would help if you're interested in the protocol.
    2. Flashing a .zip bundle to an nRF52840 Dongle using nrfutil and the default Open Bootloader.

    Which other probes, besides J-Link, were you interested in using?

Children
  • Thanks! I have a j-link edu mini on backorder for worst-case, but the issue log in the repo we are trying to find alternatives as they are scarce now. the flashing part i think is straightforward, to some extent, im curious what specifically nrfjprog does vs nrfutil, if anything. we're just looking to find another probe that will work.

    The probe im using now to play with it is an ESP-32 flasher off youtube that i have been able to write/erase/ etc from, but the interface with that probe is either over or under complicated - i can rxw to specific flash addresses, but not to RAM, im not sure if thats important? the main issue i think here is that this probe is wireless/its own unit/not interfaced with the pc with all the goodies, so no specific command line to run the nrfutil/etc through. my impression is if i can just get the pc to recognize the nrf as existing through the cmd line it will run fine. to that end, i also have a ESP-Prog on the way shortly that seems to have the same jtag type interface or at least will give me SWD capability that should be directly interfacable with the pc

    what would i merge with the hex editor? the s140 softdevice hex and the nrf52840_xxaa.hex? and flash to 0x0?

  • Hi, 

    Sorry for the delay. I am not familiar with ESP-Prog and not sure whether it can support nRF52840 or not. 

    Since most of our tools like nRF Command Line Tools, nRF Connect Programmer, and Power Profiler Kit relay on J-link firmware, my recommendation is to use our DK (including on-board debugger) or the SEGGER J-Link debugger to connect the device.

    chucknorris10101 said:
    im curious what specifically nrfjprog does vs nrfutil

    The nRF Command Line Tools are used for developing, programming, and debugging of Nordic Semiconductor's SoCs (System on Chip).

    The nRF Util application is a Python package and command-line utility that supports Device Firmware Update (DFU) and cryptographic functionality.

    chucknorris10101 said:
    what would i merge with the hex editor? the s140 softdevice hex and the nrf52840_xxaa.hex? and flash to 0x0?

    It depends on your application. If your application requires SD, you should program them together. When you use a SoftDevice which includes the MBR. From flash, you then have the MBR from address 0x0, and the SoftDevice from address 0x1000 and upwards. The application starts on the first available flash page after the SoftDevice. See the Memory resource map and usage

    Regards,
    Amanda

Related