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
  • Hi,

    Changing BSP_SELF_PINRESET_PIN from 19 to 18 won't work, as P0.18 is the RESET pin itself. The USB DFU trigger library requires a different GPIO to be connected to the RESET pin, in order to enter the bootloader. On the nRF52840 Dongle, GPIO P0.19 is connected to P0.18/nRESET pin. As far as I can see, there is no such connections on the Fanstel USB840F schematics.

    Best regards,
    Jørgen

  • Hi Jorgen,

    Is it possible in anyway to trigger the DFU without pressing the buttons?

    Kind regards,

    Tushar

  • 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.

  • If you enabled NRF_BL_DFU_ENTER_METHOD_GPREGRET in the sdk_config.h file of the bootloader, you should not need to set/clear the register manually, this is handled in nrf_bootloader.c (dfu_enter_flags_clear()):

    if (NRF_BL_DFU_ENTER_METHOD_GPREGRET &&
       ((nrf_power_gpregret_get() & BOOTLOADER_DFU_GPREGRET_MASK) == BOOTLOADER_DFU_GPREGRET)
            && (nrf_power_gpregret_get() & BOOTLOADER_DFU_START_BIT_MASK))
    {
        // Clear DFU mark in GPREGRET register.
        nrf_power_gpregret_set(nrf_power_gpregret_get() & ~BOOTLOADER_DFU_START);
    }

  • Yes I have enabled it in the sdk_config.h. But this does not send the device into DFU mode on every power up. Is it because my config for button press DFU is also enabled. Should I disable it?

    #ifndef NRF_BL_DFU_ENTER_METHOD_PINRESET
    #define NRF_BL_DFU_ENTER_METHOD_PINRESET 1
    #endif
    
    // <q> NRF_BL_DFU_ENTER_METHOD_GPREGRET  - Enter DFU mode when bit 0 is set in the NRF_POWER_GPREGRET register.
     
    
    #ifndef NRF_BL_DFU_ENTER_METHOD_GPREGRET
    #define NRF_BL_DFU_ENTER_METHOD_GPREGRET 1

Reply
  • Yes I have enabled it in the sdk_config.h. But this does not send the device into DFU mode on every power up. Is it because my config for button press DFU is also enabled. Should I disable it?

    #ifndef NRF_BL_DFU_ENTER_METHOD_PINRESET
    #define NRF_BL_DFU_ENTER_METHOD_PINRESET 1
    #endif
    
    // <q> NRF_BL_DFU_ENTER_METHOD_GPREGRET  - Enter DFU mode when bit 0 is set in the NRF_POWER_GPREGRET register.
     
    
    #ifndef NRF_BL_DFU_ENTER_METHOD_GPREGRET
    #define NRF_BL_DFU_ENTER_METHOD_GPREGRET 1

Children
No Data
Related