<?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>Static variables are reset after BLE sending</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17730/static-variables-are-reset-after-ble-sending</link><description>Hello !
I have a problem with my program (on a nRF52 board) : when I send a value to the board via BLE, it seems that my static variables are reset. 
 I noticed that, because in my main, I have a state machine (with a switch case), and when I send a</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Nov 2016 13:17:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17730/static-variables-are-reset-after-ble-sending" /><item><title>RE: Static variables are reset after BLE sending</title><link>https://devzone.nordicsemi.com/thread/68243?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2016 13:17:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a118d0d-1bbf-47ba-9605-cd58977bb947</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;In general you cannot do single stepping when using the SoftDevice, the exception is explain &lt;a href="https://devzone.nordicsemi.com/question/1489/can-i-debug-ble-program/"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It sounds to me like your device is reset, which will re-init your variables. See &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/"&gt;this&lt;/a&gt; for more information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static variables are reset after BLE sending</title><link>https://devzone.nordicsemi.com/thread/68242?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2016 12:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0083860f-910e-4b2b-830a-77cbc538fbfe</guid><dc:creator>butch</dc:creator><description>&lt;p&gt;Yes, I am pretty sure it is difficult to single step through a BT app.  From my own experience, it is hard to step through any app that uses interrupts.  You didn&amp;#39;t say whether the program seems to run correctly when not single-stepping?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static variables are reset after BLE sending</title><link>https://devzone.nordicsemi.com/thread/68241?ContentTypeID=1</link><pubDate>Mon, 14 Nov 2016 22:15:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b30aeb5-c59c-4bfc-945f-befcd77f48fd</guid><dc:creator>TheRaven</dc:creator><description>&lt;p&gt;Edit 2 : I am wondering if the using of the debugguer in &amp;quot;step by step mode&amp;quot; is correct for the Bluetooth, because of the timout intervals, etc. So maybe it is normal that the program restarts from scratch when I use the debugguer like this, no ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static variables are reset after BLE sending</title><link>https://devzone.nordicsemi.com/thread/68240?ContentTypeID=1</link><pubDate>Mon, 14 Nov 2016 21:53:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:769f5083-e849-406a-ade1-4120ff013975</guid><dc:creator>TheRaven</dc:creator><description>&lt;p&gt;Edit : In fact, it seems that the whole program is re-launched, because I tested mmy code with an other code, and after sending a value on the &amp;quot;static void led_write_handler&amp;quot; (8 bits), the program restarted from scratch, apparently (I saw it with the debugger).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>