Nrf52 dongle programming using nrf52dk

Testing nrf52 dongle programming using nrf52dk with blinky example.  If I compile code and flash the dongle using boot loader nrf52 dongle it works and blinks led correctly, but if I tried to flash it with nrf52 dk after erasing chip it programs and does not complains. But code does not work and it seems that it hangs.  So, I copied flash memory using dk from another nrf52 dongle and then flashed the copied flash memory followed by  blinky application area into  the first locked dongle it recovered and started blinking it worked. 

I have tried this procedure several times  and came up with conclusion that in order for it to work I need to keep the boot loader! And it fails running after a complete erase. 

do I have to change something in the configuration to get it to boot correctly without the boot loader? 

knowing that reconfigured the dk to by soldering sb47 to power externally. 

  • To clarify the steps I have taken:

    1) Compiled BLINKY code using VScode and nRF sdk 

    2) Programmed nRF52 Dongle using  the Open USB bootloader through the nRF programmer app.  (worked with Problem)

    3) Using the nRF52 DK (After adding soldering SB47 to power USB dongle) completely erased USB Dongle and reprogrammed only the LED Blinky code.  It did not work I think it hangs

    4) To troubleshoot the issue, with nRF52 DK read the flash from another good USB dongle,

    5) Programmed the Dongle with the read flash from good USB dongle, and then reloaded the Blinky code and it worked. 

    I can debug the code with no problem as long as I do not erase the chip and keep the bootloader, using the nRF52 DK

    I think I would reword my question to what is the configuration changes needed to run the code without the Bootloader?

    Thanks for support

  • The issue was as expected is the bootloader, App address was mapped to a default offset of 0x1000, when I added the following config 

    CONFIG_FLASH_LOAD_OFFSET=0x0
    to force mapping the app to start from address 0x00 it worked.
    Is that the proper wat to boot simple application that does not need bootloader?
  • Hello Haj,

    Yes, you nailed it. The dongle comes preloaded with an nRF5 SDK bootloader so that one could've flashed it using a DFU. Along with it comes the MBR, which is what you are struggling with being removed. Normally when you build something for the dongle, it takes into account that the MBR is there, and moves the application over.

    You could make a custom board for a version of the dongle which does not have the MBR, or simply by adding the configurations CONFIG_FLASH_LOAD_OFFSET=0 or CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n.

    Regards,

    Elfving

Related