<?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>nRF52840 crashes when changing manufacturer data from SAADC handler callback</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59104/nrf52840-crashes-when-changing-manufacturer-data-from-saadc-handler-callback</link><description>Hi everyone, 
 I am using an nRF52840 dongle (MakerDiary) with SDK15.0 &amp;amp; SoftDevice S140 v6.0.0, and trying to change the BLE advertising manufacturer&amp;#39;s data with the information from the SAADC reading. I wrote a small function &amp;quot; set_mfg_data() &amp;quot; that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 15 Mar 2020 04:54:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59104/nrf52840-crashes-when-changing-manufacturer-data-from-saadc-handler-callback" /><item><title>RE: nRF52840 crashes when changing manufacturer data from SAADC handler callback</title><link>https://devzone.nordicsemi.com/thread/239839?ContentTypeID=1</link><pubDate>Sun, 15 Mar 2020 04:54:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8235ee58-42d7-4225-8b7e-90595e1f2342</guid><dc:creator>aeozyalcin</dc:creator><description>&lt;p&gt;I actually figured it out. I was calling a different function that changes advertising interval right after kicking off the SAADC conversion. So I think what was happenning was that there was a race condition, and the SAADC was finishing the conversion, and calling my &amp;quot;&lt;span&gt;set_mfg_data()&amp;quot; function at the same time as when the other function changing advertising interval was running, and this was most likely causing the crash. Both functions interact with the SoftDevice, and I am pretty sure this is what was causing the crash. I hope this helps others!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>