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

USB disconnect causing system reset

Software : C / GCC - SDK 15.0.0 - SD140 6.0.0 - building on multiple platforms. 
Hardware : nRF52840-DK (Q1AAC0) - and secondary testing on custom board using the Fanstel BT840 Module 

Whenever the chip is in low-power, and the USB is disconnected there is a system reset.

We're using POWERMANAGE_... for sysoff, wakeup
And in the case of including an event handler it's the 


1) No USB device, no USB handlers or events included. Enter low power via button push, plug in USB, unplug results in full system reset. 
2) USB Event Handler included : nrf_drv_power_usbevt_init() --> linked to custom power_usb_event_handler(nrf_drv_power_evt_t event)
-- but no other service (no ACM, MSD, etc...) 
-- Plug in USB (reaches NRF_DRV_POWER_EVT_DETECTED) puts device into sleep
-- Unplug never hits USB event handler NRF_DRV_POWER_USB_EVT_REMOVED

So no USB handler set up, reset, USB handler set up - reset. Happens on both boards.

Is there some flag deep in the sdk we need to unset in order to tell the chip not to reset on unplug or are we looking at something in hardware? 



Related