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

How to stop/disable/uninit CLI instance and USB CDC/ACM instance gracefully?

Hi, 

environment as below, 

(1) upon SDK (nRF5_SDK_15.3.0_59ac345)

(2) Nordic Open_Bootloader (example project: Open_bootloader_usb_mbr_pca10056_debug) 

(3) Nordic 52840 DK (PCA10056)

I am trying to do (1) close CLI instance gracefully  (2) close USB CDC/ACM instance gracefully, however I get error as below, 

app: ERROR 3735928559 [Unknown error code] at C:\nRFSrcRoot\nRF5_SDK_15.3.0_59ac345\modules\nrfx\drivers\src\nrfx_usbd.c:1708 PC at: 0x0003D4E7

My source code like below (order also as below). Could you please let me how I could get it done properly? Thanks 

void mygraceful_close(){

       nrf_cli_stop(&m_cli_cdc_acm);

       nrf_cli_uninit(&m_cli_cdc_acm);

       app_usbd_stop();

       app_usbd_uninit();
       app_usbd_disable();

}



Regards

J.S.

Parents Reply
  • Hi, Thanks for your response. 

    You may have missed some of my details.  I am ok to init USBD. 

    nrfx_usbd.c:1708 is inside nrfx_usbd_uninit(). 

    void nrfx_usbd_uninit(void)
    {
    NRFX_ASSERT(m_drv_state == NRFX_DRV_STATE_INITIALIZED);

    m_event_handler = NULL;
    m_drv_state = NRFX_DRV_STATE_UNINITIALIZED;
    return;
    }

    if possible, could you please give me any suggestion in how to 

     (1) close CLI instance gracefully  (2) close USB CDC/ACM instance gracefully

    Thanks. 

    Regards

    J.S.

Children
Related