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

App does not work via DFU

I have a nRF51822 device which has softdevice and bootloader. And I'm trying upload my app with following steps:

  1. make .bin file with gcc
  2. Push the DFU button, and entering DFU mode. (Seen as DfuTarg)
  3. Upload bin file via iOS nRF Loader.
  4. The upload completed successfully.
  5. My app does not run.

Therefore, I have a question. Are there any special code or special settings for DFU on the app code side? Thanks in advance.

Parents
  • The UICR must be set up correctly. You may check that with your Jtag adapter. If using S110 SoftDevice it looks like this:

    $ JLinkExe -Device nrf51822 -If SWD
    ...
    J-Link>mem 10001000 20
    10001000= 00 40 01 00 FF FF FF FF FF FF FF FF FF FF FF FF
    10001010= 49 00 FF FF 00 A0 03 00 FF FF FF FF FF FF FF FF
    
    
    • "00 40 01 00" is the beginning of your application code = 14000h.
    • "00 A0 03 00" is the beginning of the bootloader code = 3A000h. (3A000h is not the standard value here, you may see a 3C800h instead)

    Normally, the UICR should set up correctly, but it may depend on the way you flashed your SoftDevice and/or your bootloader (did you used Windows nRFgo Studio or Segger JLinkExe from Linux Command line ...?).

    The UICR is used by the SoftDevice for e.g.

    • Starting the bootloader at poweron
    • Switching the interrupt redirections to the application when the bootloader starts it

    You may also check the bootloaders persistent data which is located in the last flash sector (3FC000h):

    $ JLinkExe -Device nrf51822 -If SWD
    ...
    J-Link>mem 3FC00 10
    0003FC00= 01 00 00 00 F5 61 00 00 FF 00 00 00 DC 0A 00 00
    
    

    Check bootloader_settings_t (in bootloader_types.h of the bootloader example) for the meaning of the values.

  • Thank you so much for your detail comment, Joe. I understood your workaround to setup UICR.

    Actually, I could flash and run my bootloader and app with Nordic Windows tools. So, I will try it with pure-gcc environment in MacOSX.

    Thank you.

Reply Children
No Data
Related