<?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>BLE startup with SD troubles</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126901/ble-startup-with-sd-troubles</link><description>I am modifying the Qorvo UWB SDK to add BLE operations. I have posted a couple other topics about different issues.. 
 
 I have ported my code to the latest Qorvo SDK, They use an interesting trick to include the SD binary in the linked file (elf/hex</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Feb 2026 17:15:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126901/ble-startup-with-sd-troubles" /><item><title>RE: BLE startup with SD troubles</title><link>https://devzone.nordicsemi.com/thread/560832?ContentTypeID=1</link><pubDate>Tue, 10 Feb 2026 17:15:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20c10ca1-8045-4b1c-82c7-cad2d7680a73</guid><dc:creator>rexxdad</dc:creator><description>&lt;p&gt;some additional code changes for different tasking model.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE startup with SD troubles</title><link>https://devzone.nordicsemi.com/thread/560592?ContentTypeID=1</link><pubDate>Sun, 08 Feb 2026 04:48:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91241d03-da04-4ddc-a5bd-c8ce6788dcc6</guid><dc:creator>rexxdad</dc:creator><description>&lt;p&gt;interestingly, if for Ozone I use the same setupTarget&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;void _SetupTarget(void) {
  unsigned int SP;
  unsigned int PC;
  unsigned int VectorTableAddr;

  VectorTableAddr = 0; //Elf.GetBaseAddr(); //0 ; // 0x27000;

  if (VectorTableAddr == 0xFFFFFFFF) {
    Util.Log(&amp;quot;Project file error: failed to get program base&amp;quot;);
  } else {
    SP = Target.ReadU32(VectorTableAddr);
    Target.SetReg(&amp;quot;SP&amp;quot;, SP);

    PC = Target.ReadU32(VectorTableAddr + 4);
    Target.SetReg(&amp;quot;PC&amp;quot;, PC);
  }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;my ble init code runs fine..&lt;/p&gt;
&lt;p&gt;the elf entrypoint is not in the SD code&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ENTRY(Reset_Handler)&lt;br /&gt;&lt;br /&gt;Qorvo provides another package with SD 113, which uses the same c sourcefile/ld/entrypoint for loading the sd hex code.&lt;/p&gt;
&lt;p&gt;and it runs ok.. (but I haven&amp;#39;t tried it with Ozone)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE startup with SD troubles</title><link>https://devzone.nordicsemi.com/thread/560591?ContentTypeID=1</link><pubDate>Sun, 08 Feb 2026 04:19:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da5f5121-966d-4055-862c-55093702afce</guid><dc:creator>rexxdad</dc:creator><description>&lt;p&gt;no, line 42 of the .ld is in a comment.. mergehex may be useful, but cannot be used with the elf, which I want to use for source debugging..&amp;nbsp; i had an Ozone script that load the elf (with free space for SD) and then loaded the SD hex over it..&amp;nbsp;&lt;br /&gt;this worked great...&lt;/p&gt;
&lt;p&gt;this is the Ozone function I had been using, but don&amp;#39;t need it now.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void TargetDownload (void) {
   Util.Log(&amp;quot;Downloading Program.&amp;quot;);
   Exec.Download(&amp;quot;/home/sam/Downloads/DW3_QM33_SDK_1.0.2.new/SDK/Firmware/BuildOutput/DW3_QM33_SDK_UCI/FreeRTOS/Type2AB_EVB/Type2AB_EVB-DW3_QM33_SDK_UCI-FreeRTOS.elf&amp;quot;);
   Target.LoadMemory(&amp;quot;/home/sam/Downloads/DW3_QM33_SDK_1.0.2.new/SDK/Firmware/SDK_BSP/Nordic/NORDIC_SDK_17_1_0/components/softdevice/s14hex/s140_nrf52_7.2.0_softdevice.hex&amp;quot;,0x0);
}

void _SetupTarget(void) {
  unsigned int SP;
  unsigned int PC;
  unsigned int VectorTableAddr;

  VectorTableAddr = 0; //Elf.GetBaseAddr(); //0 ; // 0x27000;

  if (VectorTableAddr == 0xFFFFFFFF) {
    Util.Log(&amp;quot;Project file error: failed to get program base&amp;quot;);
  } else {
    SP = Target.ReadU32(VectorTableAddr);
    Target.SetReg(&amp;quot;SP&amp;quot;, SP);

    PC = Target.ReadU32(VectorTableAddr + 4);
    Target.SetReg(&amp;quot;PC&amp;quot;, PC);
  }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the ld file, c source and map file sections to show it works properly&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; /*   __HeapBase
 *   __HeapLimit  ---- line 42
 *   __StackLimit
 *   __StackTop
 *   __stack
 */
ENTRY(Reset_Handler)

flash_page_min_align = 4096;

MEMORY
{
    RAM (rwx)      : ORIGIN = 0x20013000, LENGTH = 0x2D000  /* 0x20000000 to 0x200026FF RAM section is dedicated to SoftDevice */
    FLASH (rx)     : ORIGIN = 0x00000000, LENGTH = 1M - 4K - 4K /* 1M minus calib_sha/calib sections. */
    CALIB_SHA (rw) : ORIGIN = 0x000FE000, LENGTH = 4K
    CALIB (rw)     : ORIGIN = 0x000FF000, LENGTH = 4K
}

SECTIONS
{
    .soft_device (0x00000000) :
    {
        KEEP(*(.soft_device_prog))
    } &amp;gt; FLASH

    /* start with interrupt vectors - s140 softdevice is ~154KB, so start application at 0x27000 */
    .isr_vectors (0x27000) :
    
and the map output  shows it in the right place. 

Memory Configuration

Name             Origin             Length             Attributes
RAM              0x20013000         0x0002d000         xrw
FLASH            0x00000000         0x000fe000         xr
CALIB_SHA        0x000fe000         0x00001000         rw
CALIB            0x000ff000         0x00001000         rw
*default*        0x00000000         0xffffffff

Linker script and memory map

LOAD /Applications/ArmGNUToolchain/15.2.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/15.2.1/thumb/v7e-m+fp/hard/crti.o
LOAD /Applications/ArmGNUToolchain/15.2.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/15.2.1/thumb/v7e-m+fp/hard/crtbegin.o
LOAD /Applications/ArmGNUToolchain/15.2.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/15.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o
                0x00001000                        flash_page_min_align = 0x1000

.soft_device    0x00000000    0x26634
 *(.soft_device_prog)
 .soft_device_prog
                0x00000000    0x26634 SoftDeviceNrfx/libSoftDeviceNrfx.a(s140_nrf52_7.2.0_softdevice.c.obj)
                0x00000000                soft_device_prog

.isr_vectors    0x00027000    0x4b9ec
                0x00027000                        . = ALIGN (0x4)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The Qorvo sdk is in the old Nordic SDK 17.1 format.. nothing I can do about that&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE startup with SD troubles</title><link>https://devzone.nordicsemi.com/thread/560590?ContentTypeID=1</link><pubDate>Sun, 08 Feb 2026 04:10:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e2534fb-44d5-467b-9399-8589415d775c</guid><dc:creator>rexxdad</dc:creator><description>&lt;p&gt;the ble_stack_init() function from the examples&amp;nbsp;SDK_17_1_0/examples/ble_central_and_peripheral/experimental/ble_app_interactive/ble_m fail same rc=8,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;these are the first calls to SD&lt;/p&gt;
&lt;p&gt;from the example&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_stack_init(void)
{
    ret_code_t err_code;

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    // Configure the BLE stack using the default settings.
    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

    // Register a handler for BLE events.
    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE startup with SD troubles</title><link>https://devzone.nordicsemi.com/thread/560588?ContentTypeID=1</link><pubDate>Sat, 07 Feb 2026 17:33:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca8f805d-929f-457e-be62-b277465dadc8</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Error is in line 42 of your linker script.&lt;/p&gt;
&lt;p&gt;On a more serious note: The SD only works when flashed into its intended position and nowhere else. VERY difficult to do in a normal LD linker script. Mergehex is a lot simpler to use.&lt;/p&gt;
&lt;p&gt;Note that the old SDKs should not be used for new development. Look at the NCS SDK, which already uses the linker for the nordic BTLE stuff.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>