<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to stop/disable/uninit CLI instance and USB CDC/ACM instance gracefully?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56861/how-to-stop-disable-uninit-cli-instance-and-usb-cdc-acm-instance-gracefully</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Apr 2020 14:50:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56861/how-to-stop-disable-uninit-cli-instance-and-usb-cdc-acm-instance-gracefully" /><item><title>RE: How to stop/disable/uninit CLI instance and USB CDC/ACM instance gracefully?</title><link>https://devzone.nordicsemi.com/thread/244779?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 14:50:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9591803-f6f2-4e7a-a3f8-ac6027d45a30</guid><dc:creator>jing</dc:creator><description>&lt;p&gt;how about&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nrf_cli_stop(&amp;amp;m_cli_cdc_acm);&lt;/p&gt;
&lt;p&gt;app_usbd_stop();&lt;/p&gt;
&lt;p&gt;while (nrfx_usbd_is_enabled()) ;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;jing&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to stop/disable/uninit CLI instance and USB CDC/ACM instance gracefully?</title><link>https://devzone.nordicsemi.com/thread/231361?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2020 10:52:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fd73e01-e1e1-418f-a7ac-8da68fd7ec10</guid><dc:creator>OceanS</dc:creator><description>&lt;p&gt;Hi Amanda,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;(1) Re how to close&lt;span&gt;&amp;nbsp;USB CDC/ACM instance gracefully,&amp;nbsp;&lt;/span&gt;Actually seemingly the code below isn&amp;#39;t enough if you have chance to run code in practical example&lt;/p&gt;
&lt;p&gt;app_usbd_stop();&amp;nbsp; // this would trigger an Assert,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;app_usbd_uninit();&lt;br /&gt; app_usbd_disable();&lt;/p&gt;
&lt;p&gt;Anyway, just comment out the Assert and let it go.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;(2) Re how to close CLI gracefully, also the code below isn&amp;#39;t enough if you build a quit command for CLI as,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nrf_cli_stop(&amp;amp;m_cli_cdc_acm);&lt;/p&gt;
&lt;p&gt;nrf_cli_uninit(&amp;amp;m_cli_cdc_acm);&lt;/p&gt;
&lt;p&gt;Via a Putty or Picocom to prove, you would find the instance isn&amp;#39;t stopped and disconnected.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you please help me clarify how to close CLI gracefully?&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;J.S.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to stop/disable/uninit CLI instance and USB CDC/ACM instance gracefully?</title><link>https://devzone.nordicsemi.com/thread/230537?ContentTypeID=1</link><pubDate>Thu, 23 Jan 2020 10:03:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a89f738-3b72-451e-9546-aa0e338cf6ec</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think you should call &lt;em&gt;app_usbd_disable()&lt;/em&gt;; before &lt;em&gt;app_usbd_uninit()&lt;/em&gt;;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to stop/disable/uninit CLI instance and USB CDC/ACM instance gracefully?</title><link>https://devzone.nordicsemi.com/thread/230442?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2020 20:26:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf70ca3d-15bd-48f8-ba07-58d43412109b</guid><dc:creator>OceanS</dc:creator><description>&lt;p&gt;Hi, Thanks for your response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You may have missed some of my details.&amp;nbsp; I am ok to init USBD.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nrfx_usbd.c:1708 is inside&amp;nbsp;nrfx_usbd_uninit().&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;void nrfx_usbd_uninit(void)&lt;br /&gt;{&lt;br /&gt; NRFX_ASSERT(m_drv_state == NRFX_DRV_STATE_INITIALIZED);&lt;/p&gt;
&lt;p&gt;m_event_handler = NULL;&lt;br /&gt; m_drv_state = NRFX_DRV_STATE_UNINITIALIZED;&lt;br /&gt; return;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;if possible, could you please give me any suggestion in how to&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;(1) close CLI instance gracefully&amp;nbsp; (2) close USB CDC/ACM instance gracefully&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;J.S.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to stop/disable/uninit CLI instance and USB CDC/ACM instance gracefully?</title><link>https://devzone.nordicsemi.com/thread/230358?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2020 13:14:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d00c374-3b7c-4879-a6a6-7f4180f4c113</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]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[/quote]
&lt;p&gt;&amp;nbsp;&lt;span&gt;nrfx_usbd.c:1708 is inside &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrfx__usbd.html#ga3bd25ccaba7a1eec76ba1b6877c1b358"&gt;nrfx_usbd_init&lt;/a&gt;().&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Please set up the Debugging environment as shown in this&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://www.youtube.com/watch?v=uP8RYgYGRvI&amp;amp;list=PLx_tBuQ_KSqGHmzdEL2GWEOeix-S5rgTV&amp;amp;index=7" rel="noopener noreferrer" target="_blank"&gt;Youtube tutorial.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So it looks like you have an issue enabling USBD. Please refer to the sdk_config.h in the&amp;nbsp;&lt;a title="USB Device Example" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/usbd_example.html?cp=7_1_4_6_52_4"&gt;USB Device Example&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>