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

Keep USB enabled while in bootloader

Hi,

I am using SDK_15.2.0 and softdevice S140_v6_1_1.

Host communicate with 52840 via USB (CDC UART). Doing firmware update with proprietary message format.

Stored new image in flash (Bank_1) and change bootloader setting and reset device to update new image through bootloader code.

Problem is USB disable when we jump to bootloader code to update new image as I used only BLE supported bootloader but I want to keep USB active while in bootloader code.

I have added USB support in bootloader and but not able to keep USB enabled when bootloader copying new firmware from BANK_1 --> BANK_0.

Getting issue as host system disconnect power to nRF52840 when USB get disabled.

Just want to keep USB enabled in bootloader code.

 

Thanks,

Nirav Patel

Parents
  • Hi,

    The USB would need to re-enumerate when you reset or jump to from/to application/bootloader. If you are having issues with re-enumerating, then maybe you could try to call nrf_drv_usbd_disable() before you reset/jump.

  • Thanks Sigurd,

    Does not facing issue what you suggest to do. Let me explain in detail.

    I am using application with BLE+USB support and Bootloader with BLE only. So what happen when I update application via BLE bootloader (Jump to bootloader using NRF_BL_DFU_ENTER_METHOD_GPREGRET = 1), USB getting disabled when bootloader start running. To keep USB active I have added USB driver in BLE supported bootloader so I able to keep USB active while advertising in bootloader.

    Problem is after receiving image of new firmware, bootloader reset the device to copy new image from BANK1 --> Bank_0 at that time bootloader will not activate any transport layer just copying new image and reset device again to boot new image from BANK_0.

    I want to make USB enabled for whole the time like while in application and bootloader.

    Step_1: In application (USB is active)

    Step_2: Bootloader with BLE+USB (USB is active (As I added USB driver in BL)

    Step_3: After receiving image via BLE bootloader device reset to apply new image (USB is active till reset)

    Step_4: Bootloader copying image (USB is disabled)

    If I will mange to enabled USB in step_4 my issue will be resolved.

    Thanks,

    Nirav Patel

  • Since the bootloader resets the device, the USB will also be reset. I don't think it's possible to change this.

Reply Children
No Data
Related