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

Openthread: USB DFU Trigger library with Fanstel USB840F dongle

Hello,

I am currently using Fanstel dongle, where I am trying to trigger the USB DFU with nrf connect programmer (buttonless). The example which is provided works on the nrf52840 dongle but the same does not on Fanstel dongle because of different pin config on Fanstel. I am not able to trigger it with just changing the BSP_SELF_PINRESET_PIN (from 19 to 18). 

The application builds and runs on the Fanstel dongle but when I choose the device it does not send the device to DFU mode but gets stuck here,

11:17:07.112
Using nrf-device-lib-js version: 0.4.5
11:17:07.112
Using nrf-device-lib version: 0.11.0
11:17:07.112
Using nrfjprog DLL version: 10.15.1
11:17:07.113
Using JLink version: JLink_V7.64e
11:17:07.113
Installed JLink version does not match the provided version (V7.58b)
11:17:29.573
Using @nordicsemiconductor/nrf-device-lib-js to communicate with target via USB SDFU protocol

I exactly do not know how to move forward with it. I have tried many solutions provided here. I am using the OpenThread module (ot-nrf528xx). 

Kind regards,

Tushar Diggewadi

Parents Reply Children
  • I was able to enable GPREGRET enter method and rebuild bootloader and flash it onto the dongle. I have the default mbr 

    The created bootloader is 

    At start as I do not have the application flashed it re enters the bootloader every 15 seconds. (as I have set #define NRF_BL_DFU_INACTIVITY_TIMEOUT_MS 15000)

    In my application main.c, I added this function and call it in main()

    void otSysDfuMode(void)
    {
        #define BOOTLOADER_DFU_GPREGRET                 (0xB0)      
        #define BOOTLOADER_DFU_START_BIT_MASK           (0x01)  
        #define BOOTLOADER_DFU_START    (BOOTLOADER_DFU_GPREGRET | BOOTLOADER_DFU_START_BIT_MASK)      
        sd_power_gpregret_clr(0,0xffffffff);
        sd_power_gpregret_set(0, BOOTLOADER_DFU_START);
        NVIC_SystemReset();
    }

    But now nothing is running on the device. I cannot see the COM port. I am a bit confused on this part.

    It would be really helpful if you could guide me with this in detail. 

    Kind regards,

    Tushar

  • What I am currently trying to do is, everytime the USB dongle is plugged in it should enter the bootloader for 15 sec and then start the application. 

  • void otSysDfuMode(void)
    {
        #define BOOTLOADER_DFU_GPREGRET                 (0xB0)      
        #define BOOTLOADER_DFU_START_BIT_MASK           (0x01)  
        #define BOOTLOADER_DFU_START    (BOOTLOADER_DFU_GPREGRET | BOOTLOADER_DFU_START_BIT_MASK)      
        nrf_power_gpregret_set(BOOTLOADER_DFU_START);
        NVIC_SystemReset();
    }

    Hi Jorgen,

    With some changes in the function I was able to enter the DFU mode. But the problem I have now is it repeatedly enters the DFU mode for 15 sec and goes off, it is not moving to the application after trying the DFU once and after 15 sec start the application. 

    I know I have to make some changes so that it understands it, but I am not able to figure that out. 

    Kind regards,

    Tushar Diggewadi

  • Is there a valid application present?

    Have you debugged the bootloader to see where it fails to load the application? Does the device reset in the bootloader after the timeout and again start the DFU process?

  • Yes there is a valid application present. 

    Yes I had a long debug session. I set

    nrf_power_gpregret_set(BOOTLOADER_DFU_START);

    in my bootloader (main.c) so that the device should enter the DFU mode everytime it starts. But now it is in a loop. 

    As you asked, the device makes a reset after timeout and again starts the DFU.

    Where exactly I should use nrf_power_gpregret_set(BOOTLOADER_DFU_START) ? whether in bootloader main.c or in my application? Both ways if I do it I am going into a loop. 

    I just want the device to go into DFU for the first time on power up and then start the application.

Related