<?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>Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13240/timer-handler-mess-up-application-flow</link><description>I have a working application with TIMER1 setup to fire handler every 10us. I would like to add a 560us periodic event to enable/disable a PWM, so I add a little more code to my timer handler: 
 static uint16_t m_10us_cntr2= 0;
void timer_event_handler</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 23 Apr 2016 18:22:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13240/timer-handler-mess-up-application-flow" /><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50508?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 18:22:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60ee91de-5444-4fee-a4d9-2f42c918570b</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;So, as I mentioned, I did get a new idea. It is to simply halt the normal operation when I am running this new feature. The normal operation only require &lt;strong&gt;5 minute&lt;/strong&gt; precision, and the new feature&amp;#39;s operation finishes within a second.&lt;/p&gt;
&lt;p&gt;I will now have the compare value at whatever exact interval I need PWM toggling, says 560 or 935. Upon timer interrupt, I update the compare value and let the timer run again. Once the process is completed, I will simply reinitialize the timer to have the normal operation runs again.&lt;/p&gt;
&lt;p&gt;I think this sounds way better than my previous approach. I feel like an idiot now that I looked at the big picture. Proper sleeps are really necessary for quality work after all.&lt;/p&gt;
&lt;p&gt;Please feel free to give your evaluation of my new idea and any recommendation you have.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50507?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 18:18:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4fe95f9-9c6f-4224-9b14-f104ea7b769e</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;@rols: Thanks for the offer. I will try my best to explain my feature while staying conformed to my NDA. So please forgive me if things become cryptic because details are withdrawn. To be honest, I simply am not sure how much I can share in public forums. I think one would be able to guess what I am doing based on this much info anyway.&lt;/p&gt;
&lt;p&gt;What I am trying to do is precisely turning on/off PWM and/or trigger GPIO event at &lt;strong&gt;varying&lt;/strong&gt; intervals, usually 300-20,000us, with precision about 10us. The exact intervals varies by the situation. Also, this feature is not used all the time.&lt;/p&gt;
&lt;p&gt;Because I also need my existing application work properly in the background, I decided to use a constant compare value that I could couple with a few counters to get both PWM toggling and my normal application working normally. As we have found out, that does not work so well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50506?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 16:54:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cf631d3-88ce-4d1f-a686-7873f3bee0ed</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Vo, the ARM6V reference manual gives you the basic interrupt latency, or just google for &amp;#39;Cortex M0 Interrupt Latency&amp;#39; and it will point you to a reference. The softdevice spec tells you how many extra cycles are added for the trampoline, it&amp;#39;s 49 cycles which is really just the softdevice working out what the interrupt is, working out it&amp;#39;s external, loading up the interrupt table and jumping.&lt;/p&gt;
&lt;p&gt;At this point however a better question is what are you trying to do? Interrupt timers on a 16MHz processor for a 10us event is pretty aggressive. Doing it while a higher priority softdevice is running, using generic timer code which is great but not really designed for 100kHz operation is going to break down, once you&amp;#39;re in connection, it&amp;#39;s going to really break down as the softdevice interrupts you. If you can say what you&amp;#39;re trying to accomplish here it may be possible to suggest a better way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50505?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 13:49:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d15a6ae-41da-4ddc-8d91-369c5ea63099</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Vo,&lt;/p&gt;
&lt;p&gt;I have done little bit of digging in cortex M0 book and gone through this thread again. RK, You are right, It is not likely to have a stack overflow in this case because of the interrupt nesting. The AVI file Vo Thanh attached prroves that the printing thread is almost starving for CPU just after the timer interrupt is enabled. The rest of the two prints were printed normally.
I have now deleted the confusing update i made ... This is most most likely that main thread is starving of CPU time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50504?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 13:14:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bdc1ae2-a932-41b3-9139-1d0069c21db5</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;@rols: I see now. Could you advise me where I could learn in-depth details like the number of cycles SoftDevice and Interrupt handling takes?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50503?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 13:06:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b1ef76c-3cf2-4ba0-aace-5040c8624732</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;For exactly the reason Aryan mentioned above, it&amp;#39;s 160 cycles. The M0 interrupt latency is 16, the softdevice adds 49, so basically you have 100 cycles left. If you look at the app timer code it&amp;#39;s going to work its way down a linked list, work out which timers to fire, fire them by calling your service routine, remove them, reschedule the next one, shuffle them back into the list. And it does the servicing by raising another interrupt, so that&amp;#39;s another 60 cycles. And that&amp;#39;s before you actually do any work in your handler. I&amp;#39;m fairly impressed that it even managed to call your timer handler every 10us, back when it was basically a do-nothing handler, add any code and all you do is service the timer.&lt;/p&gt;
&lt;p&gt;And even if it did work it wouldn&amp;#39;t work really because the softdevice is going to interrupt and put huge big random 20-500us gaps in the timing, so you will miss many ticks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50502?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 12:49:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c07ccf40-65df-4c59-8d3a-1d4a3bb9f602</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;@rols @aryan: Thanks for being so enthusiast about this case.  I will get the application pointer for you when I get back to my office on Monday.
@rols: You mentioned that a 10us interval is unfeasible. Could you please explain why you could tell that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50493?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 12:40:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4291b7b-7777-4d0d-9a26-8f360025ff1d</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Aryan - if an interrupt is raised when one is already in progress, only if it&amp;#39;s higher priority will it be taken, then, yes that interrupt handler stacks, runs and returns to the original running one. If the interrupt is the same or lower priority (which it would be if it&amp;#39;s the same interrupt), then only the pending flag in the NVIC is set for it.&lt;/p&gt;
&lt;p&gt;When the current interrupt returns, the highest priority pended interrupt is taken and stacked at that point (actually it just tail calls it but same effect)&lt;/p&gt;
&lt;p&gt;So on the M0 you can theoretically only get 4 on the stack at the same time and only if you had a priority 3, then a 2 then a 1 and then a 0 interrupt in that order, each one interrupting the last before completion.&lt;/p&gt;
&lt;p&gt;I expect in this case the timers are so short the code just ping pongs between the TIMER interrupt and the timer handler interrupt and never goes to do anything else.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50501?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 11:36:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78b22c38-5213-4fca-aa46-f99a0a2d1eeb</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Vo Thanh Hieu,
Could you please check if there is a stack overflow.  It is easy to check by looking at the SP register after running your code for some time.&lt;/p&gt;
&lt;p&gt;I am not 100% sure of how the stack is handled when the interrupt is pended while being serviced. I think what RK says makes sense but I would like to get the value of Stack Pointer just to be sure.
&lt;strong&gt;RK, Congrats for being on the TOP of the devzone ranking. You are now most reputated user in this forum.&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50500?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 09:00:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d00b407-6526-4ff7-88ab-c9207262046a</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I don&amp;#39;t see how the timer handler here is called recursively. The timer handler is called from inside the timer interrupt so by definition, even if another timer interrupt arrives, the first one is finished and returns completely before it&amp;#39;s taken again.&lt;/p&gt;
&lt;p&gt;I can see (and thought originally when I saw the 10us in the original post which was clearly infeasible) that the timer would be getting constantly called, ie as soon as it returns from one call, it&amp;#39;s called instantly. I can therefore also see how the CPU ends up doing nothing but servicing the timer, stopping anything else useful from happening, but not recursively and thus not overflowing the stack.&lt;/p&gt;
&lt;p&gt;Is there actual evidence here the stack overflowed as opposed to the CPU just being unable to keep up with the rate of timeouts it needs to handle and never really getting out of the TIMER interrupt code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50499?ContentTypeID=1</link><pubDate>Sat, 23 Apr 2016 08:30:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:047b391c-a3d7-4749-9518-709a201c68be</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,
Sorry for late replies, I really think 10us is not feasible. If you want such timing you should design something that do not need interrupt handlers using PPI and GPIOTE.  Else use nRF52 where you have dedicated PWM modules which will be able to give any kind of complex PWM patterns.
I will update my answer that the stack overflow happened and you could accept the answer. Think about using nRF52 instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50498?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 17:07:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:761213fa-dcda-4d77-9a67-5b07fd8a8a61</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;By the way, should we update one of the answer with the conclusion that stack overflow happened?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50497?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 16:35:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8134222-1dd8-400c-9590-801dc584d94c</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;That is indeed unfortunate. With TIMER0 occupied by SoftDevice, TIMER2 used for PWM, I am left with only TIMER1 to handle both PWM toggling and periodic app task timing. On the other hand my feature really need that 10us if not 5us, because PWM will need to be toggle at irregular interval.&lt;/p&gt;
&lt;p&gt;I guess we won&amp;#39;t be able to add that feature for now. Perhaps if I got more time later I will try to think of another solution, just got an idea actually but I ran out of time for this feature for now. Thanks for the help, Aryan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50494?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 10:16:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c1938ce-60dd-4214-b62d-9bab4f7890c8</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Yes, it could happen with the amount of code you have. More importantly, the chances are more if the timer interrupt latency is increased by having other interrupts. I think 10us is too short for reliable interrupt handling especially if this has to work with rest of the interrupts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50491?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 08:52:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f28179fa-2bd4-4dfc-a7f1-b733bc72ab6d</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Aryan, that is all I could think of at the moment. Back when I failed with 1us and 5us interval, I also thought that the interrupt are fired too rapidly to be handled correctly. I was hoping that with 10us interval it would be different, and had also tried to make the handler work as light as I could make it of. What you see is literally everything in my timer handler, some conditional counter increments, some conditional flag sets. Do you think even with only so little code, stack overflow still happens?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50492?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 08:22:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1fe526a-6c91-4cb0-8db6-14a2e66e81c9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;10us is too short time interval to have an interrupt handler, with 10µs interval you only have 160 cycles per interrupt. With callbacks you easily exceeds this. You will then call the same function a multiple number of times until the stack is overflown and this is when the UART stops working. It has worked for me because i do not have any other interrupts and most probably my testing was very close with this border. When you have many other peripherals with interrupts enabled then most probably your stack has overflowed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50495?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2016 02:12:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fbfac9b-87b2-4ab1-829b-35379c4d5554</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Unfortunately that idea of mine didn&amp;#39;t work. I didn&amp;#39;t realize the two channel will be sharing the same counter. If I have the 1ms channel reset the counter, it will ruin the precision needed for the 10us channel. If I have the 10us channel reset the counter, the 1ms channel will never get to the compare value at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50496?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2016 08:19:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92eb8432-890b-457d-b9df-cf79cdc82edd</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Aryan, first of all, the &lt;code&gt;56&lt;/code&gt; problem is fixed in my code after I discussed it over with Dan, but I forgot to change it in the post. Sorry about that. I will get it edited.&lt;/p&gt;
&lt;p&gt;As for the double &lt;code&gt;nrf_drv_timer_enable()&lt;/code&gt;calls, that is probably an error while I edited the post. Sorry about that as well. I will see that it get fixed.&lt;/p&gt;
&lt;p&gt;I believe the problem should not lies in my I2C and PWM. They both worked before I added the &amp;quot;TROUBLESOME_CODE` into my timer handler. As I explained in the questions, I have a working application, and I am now just trying to toggle PWM on and off every 560us as a proof of concept for a new feature.&lt;/p&gt;
&lt;p&gt;On other note, as I typed this comment, it occurs to me that I could use a second capture compare channel and thus have two timer handler cases, decreasing the amount of code need to run each interrupt. I will take a look at that option now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50490?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2016 06:52:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a4fed7e-9559-4691-a5de-aa9112785abf</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You are enabling the timer before configuring it and then after configuring it. This might result in false triggers before the timer is configured.&lt;/p&gt;
&lt;p&gt;If you want 560 us then you should not use 560 as condition but 56 (56*10us = 560us)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void timer_event_handler(nrf_timer_event_t event_type, void* p_context)
{
    m_10us_cntr2++;
    if (m_10us_cntr2&amp;gt;= 56)
    {
         //        NOT EVEN DOING ANYTHING HERE YET
        m_10us_cntr2= 0;
    } 
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start="3"&gt;
&lt;li&gt;
&lt;p&gt;I do not know what the last two if statements in the timer_event_handler are doing and i do not know that value of PERIODIC_TASKS_PERIOD so i removed the last if statement.&lt;/p&gt;
&lt;p&gt;void timer_event_handler(nrf_timer_event_t event_type, void* p_context)
{
m_10us_cntr2++;
if (m_10us_cntr2&amp;gt;= 56)
{
m_10us_cntr2= 0;
nrf_gpio_pin_toggle(26);
}&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;m_10us_cntr++;
if (m_10us_cntr &amp;gt;= 100000)
{
    m_second_counter++;
    m_10us_cntr= 0;
}
nrf_gpio_pin_toggle(25);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And i get the timer handler with good accuracy (the small error shown is interrupt latency)
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5482.Capture1.PNG" alt="image description" /&gt;&lt;br /&gt;
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3286.Capture2.PNG" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;And the debug log which is printed instantly (not half a minute)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;timer_init&lt;br /&gt;
time_ticks = 160&lt;br /&gt;
end of timer_init()&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The conclusion is there is something with your I2C or PWM handling. I am pretty sure you can exclude timer handling from the problem you have.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50489?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2016 04:00:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:204a864b-e225-4422-84ab-3a7c18c4b625</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Dan, I was able to get more details on the issue. Please check my updated question for them&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50488?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2016 04:34:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3397f361-27d5-4da6-9698-55de3230a5a1</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Dan,
I am currently out of office so I could not get more stack trace information at the moment. I just want to drop a comment about the &amp;quot;factor of 10&amp;quot; issue here:&lt;/p&gt;
&lt;p&gt;Thanks for pointing that out. Initially I wrote the handler to run with a 1us capture compare period. However that didn&amp;#39;t end well. For both 1us and 5us, the app encounter some problem running. It looks like I was able to notice and correct the counter target value for the 1s flag but still forgot to correct the 560us flag.&lt;/p&gt;
&lt;p&gt;Once again, thanks for pointing that out. I will get that corrected once I got back to my office and more importantly I will get more crash details to update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50487?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2016 04:16:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:879863be-9853-43dd-902e-e3701f8e7c9d</guid><dc:creator>Dan Danknick</dc:creator><description>&lt;p&gt;To start with, all of your compares are off by a factor of 10 in timer_event_handler().&lt;/p&gt;
&lt;p&gt;Can you give us more information on how your app crashes? For example, a stack trace from Keil and the type of &amp;quot;crash&amp;quot; - are you hitting a fault in error handler array?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50486?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2016 02:50:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87055e55-aa2c-4599-addd-f79e28a1a11c</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Aryan, I have updated my question with the information you requested. I am using SoftDevice S110 along with my application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer handler mess up application flow</title><link>https://devzone.nordicsemi.com/thread/50485?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 08:52:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99e86965-e5e4-4111-81b0-096760dee6c6</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Vo Thanh Hieu,
The code you gave does not give any good information. Can you please post the timer initialization code here. Also what is the exact place where the app fails? I could not see any debug_logs int he code you showed. You said you are using timer setup for 10us, then it is safe to assume that you are not using softdevice?
Put more of your timer code so that I can look at it and try to analyse what happened.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>