This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Enter DFU mode battery-powered not working

Hi,

I currently got the DFU mode working with my nrf52832 while it is being connected to the PC using the Particle Debugger.

I use the GPREGRET method and while connected to the PC the device enters the DFU mode as expected by executing this code after a button press:

uint32_t err_code;
err_code = sd_power_gpregret_clr(0, 0xffffffff);
APP_ERROR_CHECK(err_code);
err_code = sd_power_gpregret_set(0, BOOTLOADER_DFU_START);
APP_ERROR_CHECK(err_code);
sd_nvic_SystemReset();

The problem now is, if I disconnect the 10-pin cable, the GPREGRET register is set as expected (I verified this by reading the register again before doing a system reset), but the device seems to not enter the bootloader/DFU mode but instead simply turns off.

Why does it make a difference when having the 10-pin cable connected and not having it connected in terms of being able to enter the DFU mode? Any suggestions?

Further information:
I use the Nordic SDK 17.0.2 and softdevice 7.2.0.

Parents
  • Hello,

    I can't think of any obvious reasons for this. After the device is "turned off", could you try to attach the debugger again and read the CPU regs with nrfjprog --readregs to find out what state the chip is in?

    Best regards,

    Vidar

  • Hello Vidar,

    After installing nrfjprog I tried running your command with no success:

    As written above I use the Particle Debugger (see here for an image of this debugger: https://github.com/particle-iot/debugger) to connect my board to the PC via USB. I currently use pyocd to flash the soft device and application, which works fine. I am not 100% sure, but I think pyocd flashes the .hex files using CMSIS-DAP currently. Is there something I have to change in order to be able to use nrfjprog? Or is there an alternative I can use to read the registers?

    Best regards,
    John

  • Hello John,

    Sorry, I forgot that you were using another debugger. nrfjprog only works with J-link programmers. Is there compatible command line tool for this debugger you can use to read the CPU registers. Alternatively, do you have a setup for debugging with GDB, etc?

    Best regards,

    Vidar

Reply
  • Hello John,

    Sorry, I forgot that you were using another debugger. nrfjprog only works with J-link programmers. Is there compatible command line tool for this debugger you can use to read the CPU registers. Alternatively, do you have a setup for debugging with GDB, etc?

    Best regards,

    Vidar

Children
Related