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 Amanda, 

    (1) Re how to close USB CDC/ACM instance gracefully, Actually seemingly the code below isn't enough if you have chance to run code in practical example

    app_usbd_stop();  // this would trigger an Assert, 

    app_usbd_uninit();
    app_usbd_disable();

    Anyway, just comment out the Assert and let it go. 

    (2) Re how to close CLI gracefully, also the code below isn't enough if you build a quit command for CLI as, 

    nrf_cli_stop(&m_cli_cdc_acm);

    nrf_cli_uninit(&m_cli_cdc_acm);

    Via a Putty or Picocom to prove, you would find the instance isn't stopped and disconnected.  

    Could you please help me clarify how to close CLI gracefully?  

    Thanks.

    Regards

    J.S.

Children
Related