<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>Segmentation Fault While using Open and Close Adapter API&amp;#39;s In PC-BLE Driver</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/87365/segmentation-fault-while-using-open-and-close-adapter-api-s-in-pc-ble-driver</link><description>Hello, 
 
 Aim : Our application uses the PC-BLE driver for serialization purpose as well as the nrfutil for DFU purpose in the same script, we switch between the two by opening and closing the adapters regularly. We use the &amp;quot;adapter.driver.open()&amp;quot; and</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Fri, 13 May 2022 13:45:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/87365/segmentation-fault-while-using-open-and-close-adapter-api-s-in-pc-ble-driver" /><item><title>RE: Segmentation Fault While using Open and Close Adapter API's In PC-BLE Driver</title><link>https://test-devzone.nordicsemi.com/thread/367864?ContentTypeID=1</link><pubDate>Fri, 13 May 2022 13:45:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6448ac0-4089-4ac7-a12c-18e634834d2f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sakib,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have further comment as I&amp;#39;m not very familiar with running Python on ARM core processor. But I have forwarded your question to our R&amp;amp;D team. I will let you know if I get any update.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation Fault While using Open and Close Adapter API's In PC-BLE Driver</title><link>https://test-devzone.nordicsemi.com/thread/367746?ContentTypeID=1</link><pubDate>Fri, 13 May 2022 05:01:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:beebe0dd-fe64-4498-a603-864f47e33860</guid><dc:creator>user89683</dc:creator><description>[quote userid="2121" url="~/f/nordic-q-a/87365/segmentation-fault-while-using-open-and-close-adapter-api-s-in-pc-ble-driver/365787#365787"]If you are open and close the adapter, I would suggest to find a way to trigger a soft reset on the firmware running on the nRF52 so that when you open the adapter it will start fresh.&amp;nbsp;[/quote]
&lt;p&gt;We tried this with no success.&lt;/p&gt;
&lt;p&gt;Next we tried using the garbage collector python library while switching the adapter, we observed that the segmentation error rate decreases.&lt;/p&gt;
&lt;p&gt;Please note that we are not observing this issue on the windows setup, however we are getting this issue when we are using the same script on our ARM7 32bit Quectel based SC20 processor.&lt;/p&gt;
&lt;p&gt;Please let us know what else we can try to resolve this issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Sakib&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation Fault While using Open and Close Adapter API's In PC-BLE Driver</title><link>https://test-devzone.nordicsemi.com/thread/365787?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 12:58:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b080108-bf1d-45dc-a486-ad6ecae24278</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sakib,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I wouldn&amp;#39;t say that the pc-ble-driver-py must not be used for production software. What I meant was that the library was created as an example of what you can do. It&amp;#39;s more of a reference that you can develop your&amp;nbsp;software&amp;nbsp;on. But we haven&amp;#39;t done thorough test and&amp;nbsp;may not be very stable.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;If you are open and close the adapter, I would suggest to find a way to trigger a soft reset on the firmware running on the nRF52 so that when you open the adapter it will start fresh.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation Fault While using Open and Close Adapter API's In PC-BLE Driver</title><link>https://test-devzone.nordicsemi.com/thread/365654?ContentTypeID=1</link><pubDate>Sat, 30 Apr 2022 07:35:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c325a5c6-8a23-4f27-ab83-ba8f1d050619</guid><dc:creator>user89683</dc:creator><description>&lt;p&gt;Hello Hung Bui,&lt;/p&gt;
&lt;p&gt;Following is the screen shot of the error&lt;br /&gt;&lt;img src="https://test-devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1651303282163v1.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Following log shows the origin of the segmentation fault that we got after placing the trace function.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Fatal Python error: Segmentation fault

Thread 0xac8ff460 (most recent call first):
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 299 in wait
  File &amp;quot;/usr/lib/python3.6/queue.py&amp;quot;, line 173 in get
  File &amp;quot;/usr/lib/python3.6/site-packages/pc_ble_driver_py-0.15.0-py3.6-linux-armv7l.egg/pc_ble_driver_py/ble_driver.py&amp;quot;, line 2336 in ble_event_handler_thread
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 864 in run
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 916 in _bootstrap_inner
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 884 in _bootstrap

Thread 0xad2ff460 (most recent call first):
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 299 in wait
  File &amp;quot;/usr/lib/python3.6/queue.py&amp;quot;, line 173 in get
  File &amp;quot;/usr/lib/python3.6/site-packages/pc_ble_driver_py-0.15.0-py3.6-linux-armv7l.egg/pc_ble_driver_py/ble_driver.py&amp;quot;, line 2287 in status_handler_thread
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 864 in run
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 916 in _bootstrap_inner
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 884 in _bootstrap

Thread 0xadc2e460 (most recent call first):
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 299 in wait
  File &amp;quot;/usr/lib/python3.6/queue.py&amp;quot;, line 173 in get
  File &amp;quot;/usr/lib/python3.6/site-packages/pc_ble_driver_py-0.15.0-py3.6-linux-armv7l.egg/pc_ble_driver_py/ble_driver.py&amp;quot;, line 2326 in log_message_handler_thread
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 864 in run
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 916 in _bootstrap_inner
  File &amp;quot;/usr/lib/python3.6/threading.py&amp;quot;, line 884 in _bootstrap

Current thread 0xaea8e010 (most recent call first):
  File &amp;quot;/usr/lib/python3.6/site-packages/pc_ble_driver_py-0.15.0-py3.6-linux-armv7l.egg/pc_ble_driver_py/ble_driver.py&amp;quot;, line 1788 in close
  File &amp;quot;/usr/lib/python3.6/site-packages/wrapt-1.13.0rc2-py3.6-linux-armv7l.egg/wrapt/decorators.py&amp;quot;, line 469 in _synchronized
  File &amp;quot;/usr/lib/python3.6/site-packages/pc_ble_driver_py-0.15.0-py3.6-linux-armv7l.egg/pc_ble_driver_py/ble_driver.py&amp;quot;, line 101 in wrapper
  File &amp;quot;/home/root/smartmeshsdk/app/Simple/BleCommLib.py&amp;quot;, line 159 in close
  File &amp;quot;Ble_Mote_Scheduler.py&amp;quot;, line 1100 in disconnect_manager
  File &amp;quot;Ble_Mote_Scheduler.py&amp;quot;, line 918 in start_dfu
  File &amp;quot;Ble_Mote_Scheduler.py&amp;quot;, line 1168 in &amp;lt;module&amp;gt;
Segmentation fault (core dumped)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you mean that the pc-ble-driver(python) must not be used for production software, we have referred the &amp;quot;heart-rate-monitoring.py&amp;quot; example as a starting point for our development and&amp;nbsp;have already developed a python script that uses the pc-ble-driver with the nrf52840 chip having connectivity firmware that enables serialization process. Also we have used the BLE custom services and characteristics.&lt;/p&gt;
&lt;p&gt;Please let us know if we are missing anything.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards,&lt;br /&gt;Sakib&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation Fault While using Open and Close Adapter API's In PC-BLE Driver</title><link>https://test-devzone.nordicsemi.com/thread/365532?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2022 08:20:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96b6fbcd-a314-4bab-8256-22b1eac953dd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sakib,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m checking internally to see if there is any API that can check the state of the adapter. Could you show the exact&amp;nbsp;log of the error when it happens ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;But please be aware that the pc-ble-driver was provided as an example library showcasing what you can do to interface with the connectivity firmware on the nRF52.&amp;nbsp;Care must be taken if you plan to use it as an end product.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>