<?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>SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123381/safertos-ble</link><description>I have been trying to make SAFERTOS based BLE example working on nRF52832 (PCA10040) similar to the one provided by Nordic SDK 17.1.0 at `examples\ble_peripheral\ble_app_hrs_freertos` 
 I had taken the SAFERTOS evaluation example as base and tried to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Aug 2025 07:26:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123381/safertos-ble" /><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/547011?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2025 07:26:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9143c3c-ed24-4352-a2da-5759bc5c715d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Of course. The sd_* API functions trigger a&amp;nbsp;SVC exception by executing the SVC instruction shown in the disassembly view (please&amp;nbsp;refer to&amp;nbsp;&amp;quot;&lt;a href="https://docs.nordicsemi.com/bundle/sds_s132/page/SDS/s1xx/overview/api_overview.html"&gt;Application programming interface&lt;/a&gt;&amp;quot;&amp;nbsp;for more details). This&amp;nbsp;is supposed to invoke the Supervisor Call handler inside the SoftDevice. But my current suspicion is that&amp;nbsp;safertos is&amp;nbsp;changing the interrupt forwarding and causing the SVC interrupt to be&amp;nbsp;forwarded directly to the application instead. Hope this helps.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1756365955082v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/547009?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2025 07:05:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08690c35-0162-4931-ad32-c102424544f3</guid><dc:creator>virendraVT</dc:creator><description>&lt;p&gt;Thanks Vidar, Sorry to ask but could you elaborate more, what do you mean here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/547008?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2025 07:02:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c37d36e-29ee-41db-a597-1b3e05415ffd</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Sorry, I misread your previous reply and thought you were seeing the same issue with the SDK example. Please try single stepping from the SVC instruction to confirm whether program execution reaches the corresponding SVCall in the SoftDevice. There is no debug info for the softdevice image, so you would need to rely on the PC to see if it&amp;#39;s in the SD&amp;#39;s memory range.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/547007?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2025 06:54:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3e493dd-4553-4817-923a-63d603299670</guid><dc:creator>virendraVT</dc:creator><description>&lt;p&gt;I did not face any issue with running freertos sample example from sdk, but when I ported the application to SAFERTOS I was facing error as seen in attached snapshot.&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1756364020120v1.png" /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1756364157966v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also in the IAR, I have .intvec start @ 0x26000, ROM start @ 0x26000 end 0x7fffff and RAM start 0x2000986c and end as 0x2000ffff&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/546995?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2025 04:38:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9afe2b06-3c59-4e18-a4ab-44d7b205d844</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;No worries. But are you not able to run or debug any of the BLE examples with your IAR setup? The&amp;nbsp;softdevice function itself will not return a RAM address. Maybe you can post some screenshots showing the disassembly and CPU register view when stepping into and exiting the sd_softdevice_enable() function so I can try to look for clues for this behavior.&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/546987?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2025 00:55:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33e05180-48e6-4d41-bf8d-3897308f1b0e</guid><dc:creator>virendraVT</dc:creator><description>&lt;p&gt;Apologies for my delayed response. Currently the project I am using does not have a bootloader at the moment, as this is a POC to validate whether/how SAFERTOS+BLE works. I am able to debug the example `app_hrs_freertos` with or without this setting. In debugger mode, I can see that `ret_code = sd_softdevice_enable(&amp;amp;clock_lf_cfg, app_error_fault_handler);` in nrf_sdh.c returns some invalid address value and hence the application is unable to initialise.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/545858?ContentTypeID=1</link><pubDate>Mon, 18 Aug 2025 06:41:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38bab2f9-81cc-49a9-b305-28df7708ef7e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The purpose of setting --drv_vector_table_base to 0 is to ensure that the debugger does not start execution directly from the application&amp;#39;s start address&amp;nbsp;and skip the Softdevice initialization on boot. All IAR BLE projects in the SDK have this setting. Are you able to run and debug those?&lt;/p&gt;
[quote user="virendraVT"]The&amp;nbsp;&lt;span&gt;--drv_vector_table_base did not help as the debugger was not even triggering to main with this setting.&lt;/span&gt;[/quote]
&lt;p&gt;Do you have a bootloader present on this device? Can you pause the debugger and check the program counter to see where it hangs?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/545256?ContentTypeID=1</link><pubDate>Mon, 11 Aug 2025 15:43:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e9312b7-f28f-4e8a-8a24-427ee238671f</guid><dc:creator>virendraVT</dc:creator><description>&lt;p&gt;Hey Vidar&lt;br /&gt;&lt;br /&gt;The&amp;nbsp;&lt;span&gt;--drv_vector_table_base did not help as the debugger was not even triggering to main with this setting. I was able to debug code further without this setting. However I am still facing error, 536901812 (0x200078B4)&amp;nbsp; (earlier it was 536899764 (0x200070B4) )instead of success (0x0) from sd_softdevice_enable(&amp;amp;clock_lf_cfg, app_error_fault_handler)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/544732?ContentTypeID=1</link><pubDate>Wed, 06 Aug 2025 08:52:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0d43434-495f-4aa4-b045-317007bd432a</guid><dc:creator>virendraVT</dc:creator><description>&lt;p&gt;Thanks Vidar, I am using IAR 7 as of now but will keep this in mind. And will update&amp;nbsp;&lt;span&gt;--drv_vector_table_base once I&amp;nbsp;fix another issue.&lt;br /&gt;Thanks again.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/544593?ContentTypeID=1</link><pubDate>Tue, 05 Aug 2025 10:41:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:414d4ffa-48a3-40f3-a92a-956053bcd86b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Please also make sure you have&amp;nbsp;&lt;span&gt;--drv_vector_table_base set to 0 in the IAR debugger settings as mentioned in this post&lt;/span&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/21317/warning-stack-pointer-is-setup-to-incorrect-alignment-stack-addr-0xffffffff/83509"&gt;RE: Warning: Stack pointer is setup to incorrect alignment. Stack addr = 0xFFFFFFFF&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Same as in the SDK examples.&lt;/p&gt;
&lt;p&gt;The SDK is also configured for IAR 7 and release notes mentions changes which may be neccessary&amp;nbsp;if you&amp;#39;re using IAR 8&amp;nbsp;or&amp;nbsp;newer:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ote for IAR 8 users:

When using IAR 8, you must apply the following workaround in the MDK:

- Apply a patch to modules/nrfx/mdk/compiler_abstraction.h at line 140
 (fix the &amp;#39;__ALIGN()&amp;#39; macro definition): use the argument &amp;#39;n&amp;#39; in the macro expansion instead of &amp;#39;x&amp;#39;.

-------------------

Libraries for IAR 8 require wchar_t to be of size 32 bits while IAR 7 requires 16 bits.
  
To run a project using IAR 8, follow these instructions:
 1. Open the IAR project in IAR 8. The IAR workbench will automatically generate an IAR 8 compatible project file.
 2. If the project contains one of the precompiled libraries listed below, replace it
    with the IAR 8 compatible alternative (there are no projects targeting nRF51 in this SDK).
 3. Save the project.
 4. When building the project, you might get the warning: &amp;quot;The header file &amp;#39;cmsis_iar.h&amp;#39; is obsolete and should not be used. [...]&amp;quot;.
    - The problem is described in DevZone post: https://devzone.nordicsemi.com/f/nordic-q-a/31123/iar-ewarm-8-22-1-complains-about-cmsis_iar-h
      The solution is to remove all occurrences of #include &amp;lt;cmsis_iar.h&amp;gt;.
     
The affected libraries are:
 - micro-ecc crypto:
    - IAR7: Includes library located in the folder named “…_iar\…”.
    - IAR8: Switch to using the library from the folder named “…_armgcc\…”.
 - nrf_cc310, nrf_cc310_bl, and nrf_oberon:
    - IAR7: Link to a library where “short_wchar” is part of the folder name.
    - IAR8: Link to a library without “short_wchar” in the folder name.
 - Gazell, NFC Tag, and 802.15.4:
    - IAR7: Includes the library where the file name ends with “_iar”.
    - IAR8: Switch to using the library with similar file name that ends with “_gcc”.&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/544544?ContentTypeID=1</link><pubDate>Tue, 05 Aug 2025 04:29:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82573691-30b8-4c4b-b34c-8fc16c6be75e</guid><dc:creator>virendraVT</dc:creator><description>&lt;p&gt;Thanks Vidar,&lt;br /&gt;This did help to recover the board.&lt;br /&gt;I am still debugging the hardfault part.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/544268?ContentTypeID=1</link><pubDate>Fri, 01 Aug 2025 06:24:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f50f10a7-4761-4e9d-9f66-e73b8ab0419d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The errors could indicate an unreliable connection between the debugger and the nRF52832. This can happen if the nRF is not properly powered. However, it is unusual to&amp;nbsp;experience this on a development kit, and it doesn&amp;#39;t make sense to me that you&amp;#39;re able to both recover and load the firmware before the errors occur as the log shows.&lt;/p&gt;
&lt;p&gt;Please try programming the hex file from the command line using &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nRF-Util"&gt;nrfutil device &lt;/a&gt;&amp;nbsp;(make sure it is up to date) to see if it makes any difference.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfutil device recover
nrfutil device program --firmware HEXFILE --options chip_erase_mode=ERASE_ALL,verify=VERIFY_READ,reset=RESET_SOFT&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/544259?ContentTypeID=1</link><pubDate>Fri, 01 Aug 2025 02:33:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0776d4cc-2a7a-4def-89e2-9c9f6435cd99</guid><dc:creator>virendraVT</dc:creator><description>&lt;p&gt;Hi Vidar&lt;br /&gt;&lt;br /&gt;Yes, I have the preprocessor `SOFTDEVICE_PRESENT` defined, also now I can&amp;#39;t recover the development board even by using Programmer v4.6.2&lt;br /&gt;&lt;br /&gt;The board is now continuously printing&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;em&gt;&amp;lt;error&amp;gt; hardfault: HARD FAULT at 0x00031722&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;lt;error&amp;gt; hardfault: R0: 0x00004001 R1: 0x00000000 R2: 0x200078A8 R3: 0x00000000&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;lt;error&amp;gt; hardfault: R12: 0x00000000 LR: 0x0002E05D PSR: 0x21000000&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And when I try to program another example from sdk nRF5 v17.1.0, I am getting below error log,&amp;nbsp;and it seems I cannot recover this board.&lt;/p&gt;
&lt;div class="core19-log-entry core19-log-level-info"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:13.816&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;Recovering Application core&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="core19-log-entry core19-log-level-info"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:13.816&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;Recovering Application core 0%&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="core19-log-entry core19-log-level-info"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:15.569&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;Recovering Application core 100%&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="core19-log-entry core19-log-level-info"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:15.570&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;Recovering Application core completed&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="core19-log-entry core19-log-level-info"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:15.570&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;Loading core information for Application core&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="core19-log-entry core19-log-level-info"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:15.571&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;Loading core information for Application core 0%&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="core19-log-entry core19-log-level-info"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:15.572&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;Update files regions according to Application core&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="core19-log-entry core19-log-level-info"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:15.572&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;Parse memory regions for file&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="core19-log-entry core19-log-level-info"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:15.572&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;SoftDevice detected, id 0x101 (S132 v7.2.0)&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="core19-log-entry core19-log-level-error"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:15.609&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;Failed &amp;quot;loading core information for application core&amp;quot;. Error: code: 1, description: Generic, message: Batch task core-info failed, Device error: Failed to read from memory address 0x10000130: Failed to write DebugPort register 0x08: Unknown Error in J-Link DLL (error code =-1)&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="core19-log-entry core19-log-level-error"&gt;
&lt;div class="core19-log-cell core19-log-time"&gt;&lt;em&gt;10:30:15.619&lt;/em&gt;&lt;/div&gt;
&lt;div class="core19-log-cell"&gt;&lt;em&gt;Error: Failed with exit code 1. One or more batch tasks failed: * 1050373515: Device error: Failed to read from memory address 0x10000130: Failed to write DebugPort register 0x08: Unknown Error in J-Link DLL (error code =-1) (Generic) Message: Batch task core-info failed, Device error: Failed to read from memory address 0x10000130: Failed to write DebugPort register 0x08: Unknown Error in J-Link DLL (error code =-1).&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;I would appreciate any help.&lt;br /&gt;Thanks.&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAFERTOS+BLE</title><link>https://devzone.nordicsemi.com/thread/544196?ContentTypeID=1</link><pubDate>Thu, 31 Jul 2025 11:03:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acfa79bc-2330-4d3c-a478-2988398f94af</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Are you able to pinpoint exactly where the fault exception is raised? I&amp;nbsp;just&amp;nbsp;had another ticket&amp;nbsp;where the SVC instruction for sd_softdevice_enable() triggered a fault exception. The&amp;nbsp;reason for this&amp;nbsp;was that the CRITICAL_REGION_ENTER()/CRITICAL_REGION_EXIT() macros&amp;nbsp;enclosing the call were compiled without the SOFTDEVICE_PRESENT symbol defined. Do you have this symbol included in your preprocessor definitions like in the &lt;span&gt;ble_app_hrs_freertos example&lt;/span&gt;?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>