<?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>Flashing nRF52840 results in &amp;quot;Device Busy&amp;quot; after SoftDevice is flashed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79532/flashing-nrf52840-results-in-device-busy-after-softdevice-is-flashed</link><description>Hello, 
 I have a nRF52840 and am unable to flash an application to it. I am trying to flash the &amp;quot;examples/ble_peripheral/ble_app_blinky/hex/ble_app_blinky_pca10059_s140.hex&amp;quot; file of the nRF5 SDK 17.0.2, after trying to flash various other applications</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 30 Oct 2021 19:16:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79532/flashing-nrf52840-results-in-device-busy-after-softdevice-is-flashed" /><item><title>RE: Flashing nRF52840 results in "Device Busy" after SoftDevice is flashed</title><link>https://devzone.nordicsemi.com/thread/336754?ContentTypeID=1</link><pubDate>Sat, 30 Oct 2021 19:16:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbbbea04-6e6c-44c3-ba2b-0184d1ef7474</guid><dc:creator>msebas</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;please excuse the long response time. I was quite busy with something else and the problem was much more complicated than expected.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/amanda"&gt;Amanda Hsieh&lt;/a&gt;&amp;nbsp;Thank you very much for the answer, it gave me the necessary hint: The device resets itself 2 time, once after the softdevice flash and once after the flash of the application.&lt;/p&gt;
&lt;p&gt;For anyone who has a similar error:&lt;/p&gt;
&lt;p&gt;The error was that the reset of the device after the flush of the softdevice triggered a third application (in my case ModemManager) to open the serial device-file /dev/ttyACM0 and block it for a few seconds. During that time the device was busy, so nRF Connect was unable to open it to flash the application to the device, resulting in the error message given above.&lt;/p&gt;
&lt;p&gt;How to check for this and how to find out which application is blocking nRF Connect from opening the serial device:&lt;/p&gt;
&lt;p&gt;Run in your bash the following code (you need inotify-tools installed and working, I did run it as root):&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;while true
do 
until inotifywait -q -e access -e modify -e open -e close /dev | grep ttyACM; do true; done
lsof /dev/ttyACM* 2&amp;gt;/dev/null
done&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It outputs something like (after you tried to flash an application with softdevice)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/dev/ ACCESS ttyACM1
COMMAND     PID      USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
nrfconnec 24114 Sebastian   57uW  CHR  166,1      0t0 20117517 /dev/ttyACM1
/dev/ ACCESS ttyACM1
COMMAND     PID      USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
nrfconnec 24114 Sebastian   57uW  CHR  166,1      0t0 20117517 /dev/ttyACM1
/dev/ ACCESS ttyACM1
.......................
/dev/ ACCESS ttyACM1
COMMAND     PID      USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
nrfconnec 24114 Sebastian   57uW  CHR  166,1      0t0 20117517 /dev/ttyACM1
/dev/ ACCESS ttyACM1
/dev/ OPEN ttyACM1
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
ModemMana 2668 root    9u   CHR  166,1      0t0 20118427 /dev/ttyACM1
/dev/ MODIFY ttyACM1
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
ModemMana 2668 root    9u   CHR  166,1      0t0 20118427 /dev/ttyACM1
/dev/ MODIFY ttyACM1
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
ModemMana 2668 root    9u   CHR  166,1      0t0 20118427 /dev/ttyACM1
/dev/ CLOSE_WRITE,CLOSE ttyACM1
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
ModemMana 2668 root    9u   CHR  166,1      0t0 20118427 /dev/ttyACM1
/dev/ MODIFY ttyACM1
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
ModemMana 2668 root    9u   CHR  166,1      0t0 20118427 /dev/ttyACM1
/dev/ CLOSE_WRITE,CLOSE ttyACM1
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;telling you which process is bulling the poor nRF Connect by stealing the serial device. After that it was simple. Stop the corresponding service and anything is fine...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps someone, it took me quite some time to figure out what exactly was happening.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing nRF52840 results in "Device Busy" after SoftDevice is flashed</title><link>https://devzone.nordicsemi.com/thread/329198?ContentTypeID=1</link><pubDate>Mon, 13 Sep 2021 11:25:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc669f18-d631-473c-a46c-a9f4546b3a2d</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The examples/ble_peripheral/ble_app_blinky/hex/ble_app_blinky_pca10059_s140.hex combines with Softdevice as the log indicates &lt;em&gt;SoftDevice detected, id 0x103 (S112 v7.2.0)&lt;/em&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The device will reset when the upgrade completes and the dongle will no longer show up in nRF Connect unless the application used DFU Trigger Library is used, as it is no longer in DFU mode. You will get an error stating &amp;quot;Reopen device failed&amp;quot; in this case,&amp;nbsp;and have to push the RESET button in order to make it show up in nRF Connect Programmer again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can use&amp;nbsp;nRF Connect mobile app to check the device advertise &amp;quot;Nordic_Blinky&amp;quot; or not.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>