<?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>Major IAR Embedded Issues</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35580/major-iar-embedded-issues</link><description>So literally, I cannot trust what IAR is doing. Running version 8.22.1, it crashes every time I attempt to debug an nRF52832 device (SparkFun board). 
 I&amp;#39;ve already programmed in the S132 softdevice as part of the nRF5 SDK and then while attempting to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Jun 2018 08:58:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35580/major-iar-embedded-issues" /><item><title>RE: Major IAR Embedded Issues</title><link>https://devzone.nordicsemi.com/thread/137220?ContentTypeID=1</link><pubDate>Fri, 22 Jun 2018 08:58:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d46b46fa-0587-4869-99ac-d0945ca17dd4</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I am not sure exactly why IAR is crashing all the time. Do you see this behavior only on one computer, or have you tested on several different?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On the clock part.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The HFXtal has to be turned on in the application. The chip uses the RC oscillator until this is done. This can either be done manually, or by activating the SoftDevice.&lt;/p&gt;
&lt;p&gt;If you use bsp_board_led_invert(), this will not toggle the pin on every clock cycle, so what you are seeing is not unexpected. If you want accurate toggling on that frequency, I would suggest that you use the PPI together with GPIOTE.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Attached is a project that does this. It starts the hfclk, and initializes a PPI channel to&amp;nbsp;toggle a pin on a timer compare event. The project is not much to debug, as the main loop does nothing, but you can use this to check that the HFXTAL is running.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that the attached project only has the Keil IDE (I&amp;#39;m sorry). But the main.c file is the important file here. If you replace the main.c file in any of the peripheral examples with the main.c file from this one, it should compile. It only uses a handful of included .h-files. (no .c files)&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-c1cfe929ebc14f188a94b72afca8a9c2/pastedimage1529657842782v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-c1cfe929ebc14f188a94b72afca8a9c2/pastedimage1529657908986v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-c1cfe929ebc14f188a94b72afca8a9c2/ppi_2D00_simple_2D00_toggle.zip"&gt;devzone.nordicsemi.com/.../ppi_2D00_simple_2D00_toggle.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(written in SDK14.0.0, but It uses only nrf specific macros, so I think you should be able to run it on any SDK for the nRF52)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This project results in the pin toggling like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-c1cfe929ebc14f188a94b72afca8a9c2/pastedimage1529656933234v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Major IAR Embedded Issues</title><link>https://devzone.nordicsemi.com/thread/137055?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 10:32:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bb5e898-e7e2-4bdd-99ab-a1e6ca27ca9f</guid><dc:creator>webzoid</dc:creator><description>&lt;p&gt;Hi jev, exactly - I&amp;#39;ve used older versions of IAR before without issue but the more recent ones crash left, right and centre.&lt;/p&gt;
&lt;p&gt;So I have made some progress - I&amp;#39;ve taken the BLE Blinky example and stripped back the code to remove all bluetooth functions, just some simple LED toggling. This works and I no longer get the same type of IAR crashes which I used to with the Bluetooth enabled.&lt;/p&gt;
&lt;p&gt;However, it does still crash.&lt;/p&gt;
&lt;p&gt;As for interrupts being switched off, I&amp;#39;m using the SDK examples as they are (apart from minor tinkering as above) - I&amp;#39;m new to the SDK to I&amp;#39;m still figuring my way around and working out what is enabled and how things are actually enabled. Some times are still a mystery!&lt;/p&gt;
&lt;p&gt;One thing I am a little puzzled about is the lack of external clock usage by the SDK. I have both a 32MHz crystal and a 32.768kHz crystal but neither of them generate any clock signals. My guess is that the internal RC is being used. If I do nothing more than toggle an LED in the main loop (using&amp;nbsp;bsp_board_led_invert), I can see the frequency of the toggle is 400kHz - I would expect this to be up in the MHz range.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Major IAR Embedded Issues</title><link>https://devzone.nordicsemi.com/thread/137051?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 10:21:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8b42d5d-8ed8-48f4-8ec1-fdb01230e51e</guid><dc:creator>jev</dc:creator><description>&lt;p&gt;We use a slightly older version (8.11.2 to be exact) and whilst the IAR debugger isn&amp;#39;t the most advanced in the world it certainly allows you to step through your code.&lt;/p&gt;
&lt;p&gt;Did you switch off interrupts during stepping? If not, try that first. Assuming you use a segger J-Link, go to the J-Link menu in the IDE and make sure &amp;quot;Disable interrupts when stepping&amp;quot; is ticked.&lt;/p&gt;
&lt;p&gt;On-chip debugging code in any system that uses a live environment and requires hard realtime behavior is&amp;nbsp;tricky. The environment doesn&amp;#39;t stop producing data for example when the CPU hits a breakpoint or when you step through your code.&lt;/p&gt;
&lt;p&gt;Other toolchains will suffer from the same issues. We use a mix from IAR&amp;#39;s build-in debugger and SEGGER&amp;#39;s oZone. Sometimes IAR performs better, in other situations oZone is the tool for the job. Again, provided you use a J-Link, give oZone a try (however, be aware that oZone requires some tinkering with scripts to make sure it initializes the softdevice correctly).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Major IAR Embedded Issues</title><link>https://devzone.nordicsemi.com/thread/137017?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 07:47:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4471dbb3-41cb-4de4-9b57-07c947f288bd</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;That being said, it is not certain that this is the problem. Again, I haven&amp;#39;t experimented too much with IAR, but stepping through a project that is using the SoftDevice is not that easy, as the SoftDevice will miss some time critical events after starting advertising, or while in a connection, which will cause some asserts. However, it shouldn&amp;#39;t crash the IDE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But feel free to try out SES if you are not satisfied with IAR.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Major IAR Embedded Issues</title><link>https://devzone.nordicsemi.com/thread/137015?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 07:43:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c94d09e-bf63-4935-ab66-72a41951a174</guid><dc:creator>webzoid</dc:creator><description>&lt;p&gt;Hi, thanks for your response. The most important thing for me at the moment is a working, reliable debugging mechanism so I can single step however, IAR just isn&amp;#39;t allowing this. If I knew that my code-base was working then I&amp;#39;d definitely turn to a makefile-based platform.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Major IAR Embedded Issues</title><link>https://devzone.nordicsemi.com/thread/137012?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 07:40:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b682ed9-a63c-4f6b-8900-2513dc6ff2a4</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t tested IAR too much, so I can&amp;#39;t say I am familiar with any known issues. But if you are asking for alternatives, there are the obvious ones that you see in the SDK. We have Keil, Segger Embedded Studio (SES) and using a standalone gcc compiler and a makefile.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;SES is free for Nordic Semiconductor users, as you can see &lt;a href="https://www.segger.com/news/segger-embedded-studio-ide-now-free-for-nordic-sdk-users/"&gt;here&lt;/a&gt;, so if you are interrested, you can try it out (no fees, and no limitations in code size or time limit). See &lt;a href="https://www.youtube.com/watch?v=YZouRE_Ol8g"&gt;this video&lt;/a&gt; on how to set it up.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Major IAR Embedded Issues</title><link>https://devzone.nordicsemi.com/thread/137005?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 06:48:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e05ecada-393a-4cb6-a313-91c6c6474fee</guid><dc:creator>webzoid</dc:creator><description>&lt;p&gt;I&amp;rsquo;ve since attempted to flash the Blinky App (S132) onto a SparkFun nRF52832 breakout board. After single-stepping successful, approximately 4 seconds after allowing the application to run, I then get a &amp;ldquo;Failed to read CPU status after 4 attempts&amp;rdquo; error yet the application is still running on the board.&lt;/p&gt;
&lt;p&gt;Going backwards to SDK 14 has the same issues.&lt;/p&gt;
&lt;p&gt;As much as it pains me to say, the Arduino code runs perfectly on the board!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>