<?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>Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5026/porting-hrs-example-to-iar---crash-at-svc-0x10</link><description>I&amp;#39;m trying to port the HRS example using S110 Softdevice and SDK 7.1.0 to IAR 7.10 on the pca10028 board. 
 I&amp;#39;ve created an IAR project which uses the same files as the Keil version, using the Keil limited demo IDE to determine the paths of each file</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Jan 2015 17:39:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5026/porting-hrs-example-to-iar---crash-at-svc-0x10" /><item><title>RE: Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/thread/17726?ContentTypeID=1</link><pubDate>Thu, 15 Jan 2015 17:39:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6bc3c0a-c744-44b0-843b-69cafacf5c91</guid><dc:creator>Jeff Wormsley</dc:creator><description>&lt;p&gt;Merged all the other little compiler setting and project setting differences, but keeping my file paths.  Readings are still a bit erratic.  Unload IAR version, load Keil version, and much steadier graph appears.  Not a perfect sawtooth, but far fewer glitches.  But, the important part is that it does work.&lt;/p&gt;
&lt;p&gt;Thanks for all of the help.&lt;/p&gt;
&lt;p&gt;Jeff.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/thread/17725?ContentTypeID=1</link><pubDate>Thu, 15 Jan 2015 17:25:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83a3971a-ed25-4092-a061-c5c65b43b99c</guid><dc:creator>Jeff Wormsley</dc:creator><description>&lt;p&gt;Afraid I can&amp;#39;t seem to reproduce your directory structure.  I don&amp;#39;t have a nRF51_SDK_7.1.0 directory, and thus can&amp;#39;t find these paths.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;      &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\toolchain&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\libraries\button&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\libraries\sensorsim&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\ble\ble_services\ble_hrs&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\ble\ble_services\ble_dis&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\ble\ble_services\ble_bas&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\softdevice\s110\headers&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\ble\common&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\bsp&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\libraries\timer&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\libraries\gpiote&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\drivers_nrf\hal&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\ble\device_manager&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\ble\device_manager\config&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\softdevice\common\softdevice_handler&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\libraries\scheduler&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\drivers_nrf\pstorage&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\drivers_nrf\pstorage\config&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\libraries\util&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\libraries\trace&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\drivers_nrf\uart&amp;lt;/state&amp;gt;
  &amp;lt;state&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\components\libraries\fifo&amp;lt;/state&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;All I have is this:  C:\Keil_v5\ARM\Pack\NordicSemiconductor&lt;/p&gt;
&lt;p&gt;That has these subfolders:&lt;/p&gt;
&lt;p&gt;nRF_BLE
nRF_DeviceFamilyPack
nRF_Drivers
nRF_Drivers_External
nRF_Examples
nRF_Libraries
nRF_Properitary_RF
nRF_RTX
nRF_Serialization
nRF_SoftDevice_Common
nRF_SoftDevice_S110
nRF_SoftDevice_S120
nRF_SoftDevice_S130
nRF_SoftDevice_S210
nRF_SoftDevice_S310&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll just try to diff your code against mine and make all the remaining adjustments.&lt;/p&gt;
&lt;p&gt;Jeff.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/thread/17724?ContentTypeID=1</link><pubDate>Thu, 15 Jan 2015 17:07:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb4e7476-8438-4c1c-afb1-e1c079dd6088</guid><dc:creator>Jeff Wormsley</dc:creator><description>&lt;p&gt;Thanks for the files.  I diff&amp;#39;ed them with mine, and I think the main difference was that I had fat fingered the RAM start in my linker file.  I had &amp;quot;define symbol &lt;strong&gt;ICFEDIT_region_RAM_start&lt;/strong&gt; = 0x20000200;&amp;quot; when I needed 0x20002000;  After that, the project seems to run, although there are still some oddities.  With the Keil demo project, when I look at the toolbox HRM app, the climb and fall of the rate was rock steady, but with the IAR compiled version, it misses a beat now and then.  I&amp;#39;ll try to reproduce your directory structure exactly so I can run your complete project and see if that continues to happen.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/thread/17723?ContentTypeID=1</link><pubDate>Thu, 15 Jan 2015 14:32:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d76acc51-7b57-4cd3-a462-40f9a6f82407</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure of what&amp;#39;s causing the error you see, but I was able to port the hrs example by using the  hrs IAR example in SDK 6.1.0 as reference.&lt;/p&gt;
&lt;p&gt;Extract the &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4861.IAR.zip"&gt;IAR.zip&lt;/a&gt; in ..\nRF51_SDK_7.1.0\examples\ble_peripheral\ble_app_hrs\pca10028\s110 to ensure the correct paths. Also had to make some small changes to the retarget.c for it to be compatible with IAR. You can replace the defalt on with this one:
&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/retarget.c"&gt;retarget.c&lt;/a&gt;. Then choose the debugger you&amp;#39;re using in the debugger options.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/thread/17722?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2015 20:56:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1169dc7b-3202-4db0-954d-0e52cc338675</guid><dc:creator>Jeff Wormsley</dc:creator><description>&lt;p&gt;Tracing through the code in IAR&amp;#39;s disassembler, eventually I end up in softdevice_assertion_handler, with the values:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PC = 0x000026B0
line_num = 959
file_name = &amp;quot;src\ll_ctrl.s0.c&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I don&amp;#39;t know if that will help figure out what is wrong or not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/thread/17721?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2015 19:24:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aaad0193-6b31-439e-b5fa-3bc1e98b0540</guid><dc:creator>Jeff Wormsley</dc:creator><description>&lt;p&gt;This one also.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/6257/nrf51822-softdevice-cant-work-properly-with-iar/#reply-6276"&gt;Link&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve added this command line option, and now get farther into the application.  However, now I am getting a reset later on.&lt;/p&gt;
&lt;p&gt;In ble_advdata_set, when the last line is executed, according to the disassembly, SVC 0x72 is executed.  Stepping over that line resets the processor.&lt;/p&gt;
&lt;p&gt;So I&amp;#39;ve found at least part of the solution.  Not sure if I should close this and open a new question or not.
return sd_ble_gap_adv_data_set(p_encoded_advdata, len_advdata, p_encoded_srdata, len_srdata);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/thread/17720?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2015 18:45:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d28a44cd-7712-4680-95cd-639b6aef7912</guid><dc:creator>Jeff Wormsley</dc:creator><description>&lt;p&gt;I think maybe this topic is related, but alas no solution there...&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/7546/s120-hard-fault-in-softdevice_handler_init-iar/"&gt;link text&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/thread/17719?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2015 18:06:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb147cf1-4b97-4008-92b2-95268eec1193</guid><dc:creator>Jeff Wormsley</dc:creator><description>&lt;p&gt;A little progress.  If I increase my applications stack size, then it will complete the SVC 10 call.  However, it crashes again a little later after calling sd_nvic_EnableIRQ.  I assume this is related to the IRQ table mixup noted above, where the hard fault handler being called is from my application, when nothing I can see should have mapped the vectors to that location.  I expect if I find where that is happening I may find the source of this problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/thread/17718?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2015 17:41:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14c3a275-86f5-4ff8-a091-abd4c978369d</guid><dc:creator>Jeff Wormsley</dc:creator><description>&lt;p&gt;It&amp;#39;s very confusing.  Working through this in the Keil debugger, I&amp;#39;m not sure how this even works.  The vector table at 0x1600 has no service handler for SVC 10, so I have to assume that the vectors aren&amp;#39;t remapped at this point and the SD handler must be handling this.  There is a vector for this pointing to 0x0751 at the appropriate location, so this must be what is executing under Keil.  If I stop Keil, and load IAR, I can examine the SD vector table as well, and see the same handler there as I do for Keil, so I would assume the SVC 10 IRQ would be handled the same there as well.  But instead, I get a hard fault that is handled at my applications HardFault handler at 0x1943A.  I don&amp;#39;t see how that can be, as I haven&amp;#39;t remapped the interrupt vectors from their default.  The .icf file does set the .intvecstart to 0x16000, but this should only control where the interrupts are placed in the memory map.  I&amp;#39;ve built bootloaders with applications on STM32, and had to explicitly set the CPU registers to move the interrupt vector.  I would assume the same is needed here.  Is it possible some of the startup code is doing this behind my back?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Porting HRS Example to IAR - Crash at SVC 0x10</title><link>https://devzone.nordicsemi.com/thread/17717?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2015 01:04:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ed2229d-ae65-4eec-be71-543ad8257189</guid><dc:creator>Peter</dc:creator><description>&lt;p&gt;I&amp;#39;m running into the same problem making an HRS example project for Eclipse with a managed build--I&amp;#39;ll be very interested in the answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>