Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

dfu\secure_bootloader\pca10040_s132_ble does not fit in FLASH SDK 17.10 Segger Embedded Studio v5.42a

I compiling the example as it is, I have just added the  micro-ecc library and updated the dfu_public_key, but I get this error

1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.42a/gcc/arm-none-eabi/bin/ld: error: section .tdata overlaps absolute placed section .mbr_params_page
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.42a/gcc/arm-none-eabi/bin/ld: section .mbr_params_page VMA [000000000007e000,000000000007efff] overlaps section .rodata VMA [000000000007de98,000000000007e393]

SEGGER Embedded Studio for ARM 5.42a is the version recommended in the SDK release note, I have tried more recent versions but I get the same error

  • Hello,

    It is surprising that you ran out of flash with this project, especially considering you are using the same toolchain as mentioned in the release notes. I was not able to reproduce this here either. 

    Could you upload your SDK with the uECC libraries here or in a private ticket to see if it allows me to reproduce the problem?

    Thanks,

    Vidar

  • I see you have made some modifications to the BLE transport (nrf_dfu_ble.c), which increases the flash footprint of the bootloader. 

    --- /Rocco_nrF5_SDK/components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c
    +++ /nRF5_SDK_17.0.2_d674dde/components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c
    @@ -40,7 +40,6 @@
     #include "nrf_dfu_ble.h"
     
     #include <stddef.h>
    -#include <stdlib.h>
     #include "sdk_common.h"
     #include "nrf_dfu_transport.h"
     #include "nrf_dfu_types.h"
    @@ -914,46 +913,6 @@
     }
     #endif
     
    -/**@brief get the serial number from the flash.
    - *
    - * @details serial number is added to the advertising packet 
    - * 
    - */
    -
    - char* my_itoa(int i, char b[]){
    -    char const digit[] = "0123456789";
    -    char* p = b;
    -    if(i<0){
    -        *p++ = '-';
    -        i *= -1;
    -    }
    -    int shifter = i;
    -    do{ //Move to where representation ends
    -        ++p;
    -        shifter = shifter/10;
    -    }while(shifter);
    -    *p = '\0';
    -    do{ //Move back, inserting digits as u go
    -        *--p = digit[i%10];
    -        i = i/10;
    -    }while(i);
    -    return b;
    -}
    -char bn_name[] = "DFU_CC24800000";
    -
    -void array_of_char(int number, char *numberArray)
    -{
    -   int count = 0;    
    -   int n = number;
    -
    -   while (n != 0){
    -       numberArray[count] = n % 10 + '0';
    -       n /= 10;
    -       count++;
    -   }
    -    numberArray[count] = '\0';
    -}
    -
     
     /**@brief     Function for initializing GAP.
      *
    @@ -964,7 +923,7 @@
     {
         uint32_t                err_code;
         ble_gap_conn_sec_mode_t sec_mode;
    -    uint8_t const *       device_name;
    +    uint8_t const *         device_name;
         uint32_t                name_len;
     
         BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
    @@ -973,29 +932,6 @@
     
         err_code = gap_address_change();
         VERIFY_SUCCESS(err_code);
    -
    -    
    -
    -       uint32_t serial;
    -       char name_buffer[4];
    -        int no_chars=0, indx;
    -      memcpy(&serial, (uint32_t*)0x10001080, 4);
    -
    -
    -    serial &= 0xFFFF;
    -    //serial = 0xb;
    -   
    -    
    -    //array_of_char(serial, name_buffer);
    -    
    -    no_chars = sprintf(name_buffer, "%d", serial);
    -    //my_itoa(serial, name_buffer);
    -     indx = no_chars-1;
    -     strcpy(&bn_name[14-indx-1], name_buffer);
    -
    -
    -     
    -    NRF_LOG_DEBUG("ROCCO name: %s",bn_name);
     
         if ((m_flags & DFU_BLE_FLAG_USE_ADV_NAME) != 0)
         {
    @@ -1007,13 +943,11 @@
     #endif
         {
             NRF_LOG_DEBUG("Using default advertising name");
    -        //device_name = (uint8_t const *)(NRF_DFU_BLE_ADV_NAME);
    -        //name_len    = strlen(NRF_DFU_BLE_ADV_NAME);
    -        device_name = (uint8_t const *)(bn_name);
    -        name_len    = strlen(bn_name);
    -    }
    -
    -    err_code = sd_ble_gap_device_name_set(&sec_mode, device_name, name_len); 
    +        device_name = (uint8_t const *)(NRF_DFU_BLE_ADV_NAME);
    +        name_len    = strlen(NRF_DFU_BLE_ADV_NAME);
    +    }
    +
    +    err_code = sd_ble_gap_device_name_set(&sec_mode, device_name, name_len);
         VERIFY_SUCCESS(err_code);
     
         err_code = sd_ble_gap_ppcp_set(&m_gap_conn_params);
    

    To fix this, you can either revert the change, or lower the Bootloader start address by 0x1000 to increase the size of the bootloader section in flash.

  • thank you very much Vidar, I was absolutely convinced that I did revert that file, but I was definitely wrong! 

Related