<?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>DEADBEEF in my Code but from where?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1007/deadbeef-in-my-code-but-from-where</link><description>Hi, 
 i have a big Problem, if i debug my code i get in some cases in register 3 the value 0xDEADBEEF and after that the device doesn&amp;#39;t work any longer in a correct way. No i had debugged a long time but can not discover where this error is from. I check</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Nov 2013 17:32:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1007/deadbeef-in-my-code-but-from-where" /><item><title>RE: DEADBEEF in my Code but from where?</title><link>https://devzone.nordicsemi.com/thread/4762?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2013 17:32:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c47c210-9c2f-444c-bc52-b399306f2442</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;thank you for your reply. I will look for, if i do this but i can not imagine where i should do something like this.&lt;/p&gt;
&lt;p&gt;How is it possible to write to a protected peripharal. I don&amp;#39;t write to the flash or something like that.&lt;/p&gt;
&lt;p&gt;Could it be possible that i have to configure the RAM at the beginning, becouse i don&amp;#39;t do something like that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DEADBEEF in my Code but from where?</title><link>https://devzone.nordicsemi.com/thread/4761?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2013 17:05:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:126e719d-2b06-4005-be58-8d30ba7d304a</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;This clearly shows that the CPU is in the HardFault Handler, and will occur if you either&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;try to use to a protected peripheral (for instance writing to its registers, see the SoftDevice Specification for this list), or&lt;/li&gt;
&lt;li&gt;call a softdevice API function from an interrupt with priority 0 (see the appendix of the Reference Manual for an explanation)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Edit: A few additional things that might cause a HardFault:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Accessing illegal addresses as RAM (for instance writing to address 0 or dereferencing a NULL pointer).&lt;/li&gt;
&lt;li&gt;Doing unaligned access (i.e. trying to set a value in RAM on a variable that is not located at a word-aligned address).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using the latest softdevice, you will get a backtrace in Keil when you hit a HardFault, allowing you to see where the HardFault occured, so that is often a good way to find it. Remember to also upgrade the header files when replacing a softdevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DEADBEEF in my Code but from where?</title><link>https://devzone.nordicsemi.com/thread/4760?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2013 16:58:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:047ecdbb-7c81-4a97-8b38-a4866952bdd2</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;so i still have trouble with getting the DEADBEEF Error from the Softdice and don&amp;#39;t know how i should going on. Sometimes when i stop debugging one libary open and close in a few seconds. i have made a picture, what does this mean?&lt;/p&gt;
&lt;p&gt;best regards Nils&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/error.png" alt="error.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DEADBEEF in my Code but from where?</title><link>https://devzone.nordicsemi.com/thread/4755?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2013 12:13:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d8e6813-b583-4cad-abaa-299ba48595f7</guid><dc:creator>Bastiaan</dc:creator><description>&lt;p&gt;If you look at the implementation of app_timer, you can see that all operations are queued and then handled from a software interrupt. If you do multiple calls to app_timer_* functions from a higher level interrupt, operations will need to be queued, and APP_TIMER_OP_QUEUE_SIZE sets the size of this queue. Take a look at this question for a better explanation of this parameter:
&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/how-big-should-app_timer_op_queue_size-be" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/how-big-should-app_timer_op_queue_size-be&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You will therefore either have to reduce the number of timer operations you do from higher-order interrupts, or move to using the scheduler, so that all operations happen from main context.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DEADBEEF in my Code but from where?</title><link>https://devzone.nordicsemi.com/thread/4756?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2013 12:13:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da1c45a1-9797-44ad-9a57-f74f31711a30</guid><dc:creator>Guest</dc:creator><description>&lt;p&gt;If you look at the implementation of app_timer, you can see that all operations are queued and then handled from a software interrupt. If you do multiple calls to app_timer_* functions from a higher level interrupt, operations will need to be queued, and APP_TIMER_OP_QUEUE_SIZE sets the size of this queue. Take a look at this question for a better explanation of this parameter:
&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/how-big-should-app_timer_op_queue_size-be" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/how-big-should-app_timer_op_queue_size-be&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You will therefore either have to reduce the number of timer operations you do from higher-order interrupts, or move to using the scheduler, so that all operations happen from main context.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DEADBEEF in my Code but from where?</title><link>https://devzone.nordicsemi.com/thread/4754?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2013 10:56:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d754f65-15e2-4fc8-bb19-e9072a817c4d</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;sorry for that silly answer, yes i did not understand your answer in a correct way, but no i got it. I have done what you told me and found that an error come when using app_timer.&lt;/p&gt;
&lt;p&gt;I use app timer for my button detection and start and stop the Timer by detecting rising or falling pins with gpiote. And it works but no i found that sometimes (not every time) an error occured by starting or stopping one timer. It is the error NRF_NRF_ERROR_NO_MEM    ///&amp;lt; No Memory for operation. How is that possible?&lt;/p&gt;
&lt;p&gt;I use nearly 18 Timer (not at same Time) but i also set
#define APP_TIMER_MAX_TIMERS		                23&lt;br /&gt;
#define APP_TIMER_OP_QUEUE_SIZE			23&lt;/p&gt;
&lt;p&gt;Could that be a reason for my error?&lt;/p&gt;
&lt;p&gt;Thank you, Nils&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DEADBEEF in my Code but from where?</title><link>https://devzone.nordicsemi.com/thread/4759?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2013 16:52:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f1e440c-90cf-4249-bc78-7687876bc831</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Did you actually read my reply?
&amp;quot;Make sure [app_error_handler] contains an infinite loop of some kind. Doing so should show you where the error occurred, which again should help you find the actual problem.&amp;quot;
If you have an empty app_error_handler, you will for sure see strange behavior, since the program will keep on running when an error has occurred, and things are in an inconsistent state.&lt;/p&gt;
&lt;p&gt;The file name and line number failing will be passed in the arguments of app_error_handler. If you have UART printout enabled, you can for example print them out over UART. If you use ble_debug_assert_handler, you should be able to inspect the variables from the debugger. Keil tend to optimize away regular arguments, but not the static variables.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DEADBEEF in my Code but from where?</title><link>https://devzone.nordicsemi.com/thread/4758?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2013 16:47:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:881ad8c0-654f-4dea-a7c1-5898e1d34f02</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;Thanks for helping me. I also thought that i can detect function which writes deadbeef in register 3 but it does not work or i do something wrong. From where is it possible to get thes deadbeef i can not find the word in my code, does it come from the softdevice? My app error handler is empty. If i do a breakpoint in the error handler an it wil be called how can i detect from where in the code the error handler is called ?&lt;/p&gt;
&lt;p&gt;Thank you ole, best regards nils&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DEADBEEF in my Code but from where?</title><link>https://devzone.nordicsemi.com/thread/4757?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2013 16:35:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d29d18e2-e3dc-42da-a368-5aa66592b42d</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;If you run your project with the debugger, it should be possible to see where it hangs when you stop it.&lt;/p&gt;
&lt;p&gt;To be certain that you catch all errors, you should also remove the reset from app_error_handler, and make sure it contains an infinite loop of some kind. Doing so should show you where the error occurred, which again should help you find the actual problem.&lt;/p&gt;
&lt;p&gt;If you still have trouble, can you please share your complete code, either here or in a support case, so that we can take a look?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>