DFU on custom board, memory problem

Hello,

Currently, I'm trying to flash my custom board that has nRF52832 with an uart application that I integrated buttonless DFU. I'm running into a problem where when I try to flash my hex file that has the following combination :

  • Softdevice
  • Bootloader
  • Application
  • Bootloader setting

I got the following error :

"ERROR: The file specified is not a valid hex file, has data outside valid areas"

"ERROR: or does not have data in valid areas."

From what I understand, it is an error on the memory side where my program might have passed its limit. But I don't know how to fix it. I'm not sure the type of model of my nRF52832, but on nRF Connect, it says that it is NRF52832_xxAB_REV1, Core RAM: 32KiB and Core ROM: 256KiB in pages of 4KiB. I'm using SES with SDK 16.0.0

Parents
  • Hello,

    I see. You have the small version of the nRF52832, and I suspect that both the bootloader and the bootloader settings page hex files are configured for the 512 variant (not the 256 variant).

    If you try to flash only the bootloader or only the bootloader settings file without merging them, does it give the same message?

    Go to your project settings for the bootloader, and change all the start addresses according to your flash size. The range of the flash is:

    512kB variant: 0x0000 0000 -> 0x0008 0000

    256kB variant: 0x0000 0000 -> 0x0004 0000

    So what you need to do is to change the bootloader start address to move all the flash placement settings to match your flash size. 

    Most important are the settings in Section Placement Macros:

    And you can also change the settings in Memory Segments:

    Then you may need to edit your section placement macros in the flash_placement.xml file, mainly the "bootloader_settings_page" and "mbr_params_page". You find this file by right clicking your project from the project explorer in SES, and select "Edit Section Placement".

    Then you need to set the correct size for your bootloader settings file. This is done when you generate them:

    >nrfutil settings generate --help
    Usage: nrfutil settings generate [OPTIONS] HEX_FILE
    
    Options:
      --family [NRF51|NRF52|NRF52QFAB|NRF52810|NRF52840]
                                      nRF IC family: NRF51 or NRF52 or NRF52QFAB
                                      or NRF52810 or NRF52840  [required]
      --application TEXT              The application firmware file. This can be
                                      omitted ifthe target IC does not contain an
                                      application in flash.Requires --application-
                                      version or --application-version-string.
      --application-version INTEGER   The application version.
      --application-version-string TEXT
                                      The application version string, e.g.
                                      "2.7.31". Will be converted to an integer,
                                      e.g. 207031.
      --bootloader-version INTEGER    The bootloader version.  [required]
      --bl-settings-version INTEGER   The Bootloader settings version.Defined in
                                      nrf_dfu_types.h, the following apply to
                                      released SDKs:
                                      |SDK12.0.0 - SDK15.2.0|1|
                                      |SDK15.3.0 -          |2|  [required]
      --start-address INTEGER         Custom start address for the settings page.
                                      If not specified, then the last page of the
                                      flash is used.
      --no-backup                     Do not overwrite DFU settings backup page.
                                      If not specified, than the resulting .hex
                                      file will contain a copy of DFU settings,
                                      that will overwrite contents of DFU settings
                                      backup page.
      --backup-address INTEGER        Address of the DFU settings backup page
                                      inside flash. By default, the backup page
                                      address is placed one page below DFU
                                      settings. The value is precalculated based
                                      on configured settings address
                                      (<DFU_settings_address> - 0x1000).
      --app-boot-validation [NO_VALIDATION|VALIDATE_GENERATED_CRC|VALIDATE_GENERATED_SHA256|VALIDATE_ECDSA_P256_SHA256]
                                      The method of boot validation for
                                      application.
      --sd-boot-validation [NO_VALIDATION|VALIDATE_GENERATED_CRC|VALIDATE_GENERATED_SHA256|VALIDATE_ECDSA_P256_SHA256]
                                      The method of boot validation for
                                      SoftDevice.
      --softdevice FILE               The SoftDevice firmware file. Must be given
                                      if SD Boot Validation is used.
      --key-file FILE                 The private (signing) key in PEM format.
                                      Needed for ECDSA Boot Validation.
      --help                          Show this message and exit.

    Try to use the --family NRF52QDAB option, and it will put the start address for this file to 0x0003F000 instead of 0x0007F000.

    Best regards,

    Edvin

  • Hello,

    I did some changes to my bootloader's Section Placement Macros as following :

    I only changed the FLASH_PH_SIZE and FLASH_START. I did not make any changes to Memory Segments and flash_placement.xml file as I'm not sure what and how exactly to modify it into. So I would like your recommendation on what these modifications should be, please. Then I tried to reflash the program with the new setting for the bootloader and there was no more error but our custom board does not seem to be working. Nothing was advertising.

    A weird remark I notice was, I flashed my custom board with the bootloader with the default setting as shown in the following image :

    nRF Connect managed to see the custom board advertising DFUTarg and I was able to DFU the custom board with my uart application that was integrated with buttonless DFU.

  • Try "build and debug" and see what happens

    Nothing much to be honest. It seems to be working. I verified it via nRF Connect mobile and I see my board advertising DFUTARG.

    This was the memory layout :

    So instinctively, I try to update it with my application and it worked. Here is the memory :

    Then I tried to save it as a hex file and try to reflash it via nrfjprog but it didn't work. Here what it looks like :

    It seems that the extracted code doesn't recognize which part represents what.

    Ideally, I would prefer to program my board in one go instead of programming the bootloader first, then generate my application zip file which then needs to be transferred to my phone, and only then I can update my board with the desired app.

  • Well, nevermind. I was mistaken. It worked as in, I managed to see it advertising after reflashing it but the DFU does not seem to be working. I managed to enter into boot mode but it failed to update it when. This was the log file :

    Log_2020-06-26_09_33_51[1].txt
    nRF Connect, 2020-06-26
    DfuTarg (CC:0F:60:FB:7D:AF)
    V	09:33:51.363	Connecting to CC:0F:60:FB:7D:AF...
    D	09:33:51.363	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	09:33:51.409	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    D	09:33:51.427	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	09:33:51.427	Connected to CC:0F:60:FB:7D:AF
    V	09:33:51.440	Discovering services...
    D	09:33:51.440	gatt.discoverServices()
    I	09:33:52.143	Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 6000ms)
    D	09:33:52.249	[Callback] Services discovered with status: 0
    I	09:33:52.249	Services discovered
    V	09:33:52.257	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    - Central Address Resolution [R] (0x2AA6)
    Generic Attribute (0x1801)
    Secure DFU Service (0xFE59)
    - DFU Packet [WNR] (8ec90002-f315-4f60-9fb8-838830daea50)
    - DFU Control Point [N W] (8ec90001-f315-4f60-9fb8-838830daea50)
       Client Characteristic Configuration (0x2902)
    I	09:33:52.280	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    I	09:33:52.336	Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 6000ms)
    V	09:33:55.503	[DFU] DFU service started
    V	09:33:55.503	[DFU] Opening file...
    I	09:33:55.503	[DFU] Firmware file opened successfully
    V	09:33:55.503	[DFU] Connecting to DFU target...
    D	09:33:55.504	[DFU] gatt = device.connectGatt(autoConnect = false)
    I	09:33:55.519	[DFU] Connected to CC:0F:60:FB:7D:AF
    V	09:33:55.519	[DFU] Discovering services...
    D	09:33:55.519	[DFU] gatt.discoverServices()
    I	09:33:55.519	[DFU] Services discovered
    D	09:33:55.519	[DFU] wait(1000)
    V	09:33:56.521	[DFU] Requesting new MTU...
    D	09:33:56.521	[DFU] gatt.requestMtu(517)
    I	09:33:56.552	[DFU] MTU changed to: 247
    V	09:33:56.552	[DFU] Enabling notifications for 8ec90001-f315-4f60-9fb8-838830daea50
    D	09:33:56.552	[DFU] gatt.setCharacteristicNotification(8ec90001-f315-4f60-9fb8-838830daea50, true)
    D	09:33:56.552	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
    I	09:33:56.596	[DFU] Data written to descr.8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-00
    V	09:33:56.597	[DFU] Notifications enabled for 8ec90001-f315-4f60-9fb8-838830daea50
    A	09:33:56.597	[DFU] Notifications enabled
    D	09:33:56.597	[DFU] wait(1000)
    V	09:33:57.597	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	09:33:57.597	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	09:33:57.634	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 06-01
    I	09:33:57.634	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-06-01-00-02-00-00-00-00-00-00-00-00-00-00
    A	09:33:57.635	[DFU] Command object info received (Max size = 512, Offset = 0, CRC = 00000000)
    V	09:33:57.635	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	09:33:57.635	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	09:33:57.661	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 02-00-00
    I	09:33:57.662	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-02-01
    A	09:33:57.662	[DFU] Packet Receipt Notif disabled (Op Code = 2, Value = 0)
    V	09:33:57.662	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	09:33:57.662	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	09:33:57.691	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-01-8D-00-00-00
    I	09:33:57.691	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	09:33:57.691	[DFU] Command object created
    V	09:33:57.691	[DFU] Writing to characteristic 8ec90002-f315-4f60-9fb8-838830daea50
    D	09:33:57.692	[DFU] gatt.writeCharacteristic(8ec90002-f315-4f60-9fb8-838830daea50)
    I	09:33:57.695	[DFU] Data written to 8ec90002-f315-4f60-9fb8-838830daea50, value (0x): 12-8A-01-0A-44-08-01-12-40-08-00-10-34-1A-02-CB-01-20-00-28-00-30-00-38-E8-A4-02-42-24-08-03-12-20-A1-A0-1E-6C-6E-4B-18-64-19-B2-A3-53-3F-C0-4C-84-0F-04-F1-15-A0-DD-21-2B-15-92-BB-11-6B-AB-DF-DB-48-00-52-04-08-01-12-00-10-00-1A-40-9C-28-D5-11-9E-88-0B-93-4F-54-0E-89-93-CD-3F-4B-E4-80-90-F9-3C-CA-50-21-73-F8-06-69-18-74-37-40-13-3B-40-B8-9E-84-A4-C8-FA-A1-5B-0C-15-96-20-04-83-44-A1-0A-30-6D-4D-CD-FC-91-C3-33-F4-A7-D3-9D
    A	09:33:57.695	[DFU] Command object sent (CRC = C0964F9C)
    V	09:33:57.695	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	09:33:57.695	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	09:33:57.721	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	09:33:57.721	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-8D-00-00-00-9C-4F-96-C0
    A	09:33:57.722	[DFU] Checksum received (Offset = 141, CRC = C0964F9C)
    V	09:33:57.722	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	09:33:57.722	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	09:33:57.751	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	09:33:57.886	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	09:33:57.886	[DFU] Command object executed
    V	09:33:57.886	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	09:33:57.887	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	09:33:57.917	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 06-02
    I	09:33:57.918	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-06-01-00-10-00-00-00-00-00-00-00-00-00-00
    A	09:33:57.918	[DFU] Data object info received (Max size = 4096, Offset = 0, CRC = 00000000)
    V	09:33:57.951	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	09:33:57.951	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    D	09:34:03.939	[Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
    E	09:34:03.939	[DFU] Error (0x85): GATT ERROR
    E	09:34:03.939	Error 8 (0x8): GATT CONN TIMEOUT
    I	09:34:03.939	Disconnected
    V	09:34:03.940	[DFU] Disconnecting...
    D	09:34:03.990	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	09:34:04.017	[DFU] gatt.disconnect()
    D	09:34:04.017	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    I	09:34:04.017	[DFU] Disconnected
    D	09:34:04.017	[DFU] gatt.refresh() (hidden)
    D	09:34:04.019	[DFU] gatt.close()
    D	09:34:04.025	[DFU] wait(600)
    D	09:34:04.629	gatt.close()
    D	09:34:04.638	wait(200)
    V	09:34:04.840	Connecting to CC:0F:60:FB:7D:AF...
    D	09:34:04.840	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	09:34:09.874	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E	09:34:09.874	Error 133 (0x85): GATT ERROR
    I	09:34:09.874	Disconnected
    D	09:34:13.714	gatt.close()
    D	09:34:13.725	wait(200)
    

Reply Children
  • Hello,

    Yes, you would have to modify the project settings. Look at the settings found in the project that I sent. 

     

    Fikri Saman said:
    I also have another weird remark. With the previous application, if I don't have RTT Viewer on, it will not update successfully. But when I have RTT Viewer to see the log, it succeeds in doing the DFU. Is that normal?

     Does this mean that you are doing a debug session in SES, or that you only close RTT viewer opened externally?

    The RTT viewer itself shouldn't matter, but if you run a debug session, that may affect the CLOCK. What is your clock configuration by the way? Do you have an external LFXTAL? I don't think I asked what kind of HW you are running this on.

    BR,

    Edvin

  • I modified the bootloader_debug with the settings that you sent me before and got the following errors :

    Does this mean that you are doing a debug session in SES, or that you only close RTT viewer opened externally?

    I actually don't know how to debug the bootloader via SES, that's why I used RTT viewer. It would be nice if you could point me in the right direction to debug with SES, please.

    What is your clock configuration by the way? Do you have an external LFXTAL? I don't think I asked what kind of HW you are running this on.

    I don't think I understand what you're demanding. Are you asking about my custom board or the equipment I used to program my custom board?

  • Fikri Saman said:
    I modified the bootloader_debug with the settings that you sent me before and got the following errors :

     What does your flash_placement.xml look like? And what does your project settings->Code->build->memory Segments setting look like? And what does your project settings->Code->linker->Section Placement Macros look like?

    And for the two last ones, remember to select "Common" before checking them:

     

    Fikri Saman said:
    I don't think I understand what you're demanding. Are you asking about my custom board or the equipment I used to program my custom board?

     I am asking about your custom board. Does it contain an LFXTAL? That would be the X2 in this figure:

    To run a debug session:

    If you set NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED to 0 in sdk_config, you will get the RTT output in Segger Embedded Studio.

    Best regards,

    Edvin

  • Here are my Section Placement Macros :

    My flash_placement.xml :

    0272.flash_placement.xml
    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="FLASH" start="$(FLASH_PH_START)" size="$(FLASH_PH_SIZE)">
        <ProgramSection load="no" name=".reserved_flash" start="$(FLASH_PH_START)" size="$(FLASH_START)-$(FLASH_PH_START)" />
        <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START)" />
        <ProgramSection alignment="4" load="Yes" name=".init" />
        <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
        <ProgramSection alignment="4" load="Yes" name=".text" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".crypto_data" inputsections="*(SORT(.crypto_data*))" address_symbol="__start_crypto_data" end_symbol="__stop_crypto_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_queue" inputsections="*(.nrf_queue*)" address_symbol="__start_nrf_queue" end_symbol="__stop_nrf_queue" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".dfu_trans" inputsections="*(SORT(.dfu_trans*))" address_symbol="__start_dfu_trans" end_symbol="__stop_dfu_trans" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".svc_data" inputsections="*(.svc_data*)" address_symbol="__start_svc_data" end_symbol="__stop_svc_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_const_data" inputsections="*(SORT(.log_const_data*))" address_symbol="__start_log_const_data" end_symbol="__stop_log_const_data" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_balloc" inputsections="*(.nrf_balloc*)" address_symbol="__start_nrf_balloc" end_symbol="__stop_nrf_balloc" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_backends" inputsections="*(SORT(.log_backends*))" address_symbol="__start_log_backends" end_symbol="__stop_log_backends" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_ble_observers" inputsections="*(SORT(.sdh_ble_observers*))" address_symbol="__start_sdh_ble_observers" end_symbol="__stop_sdh_ble_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_state_observers" inputsections="*(SORT(.sdh_state_observers*))" address_symbol="__start_sdh_state_observers" end_symbol="__stop_sdh_state_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_stack_observers" inputsections="*(SORT(.sdh_stack_observers*))" address_symbol="__start_sdh_stack_observers" end_symbol="__stop_sdh_stack_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_req_observers" inputsections="*(SORT(.sdh_req_observers*))" address_symbol="__start_sdh_req_observers" end_symbol="__stop_sdh_req_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_soc_observers" inputsections="*(SORT(.sdh_soc_observers*))" address_symbol="__start_sdh_soc_observers" end_symbol="__stop_sdh_soc_observers" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections" address_symbol="__start_nrf_sections" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_dynamic_data"  inputsections="*(SORT(.log_dynamic_data*))" runin=".log_dynamic_data_run"/>
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".log_filter_data"  inputsections="*(SORT(.log_filter_data*))" runin=".log_filter_data_run"/>
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".fs_data"  inputsections="*(.fs_data*)" runin=".fs_data_run"/>
        <ProgramSection alignment="4" load="Yes" name=".dtors" />
        <ProgramSection alignment="4" load="Yes" name=".ctors" />
        <ProgramSection alignment="4" load="Yes" name=".rodata" />
        <ProgramSection alignment="4" load="Yes" name=".ARM.exidx" address_symbol="__exidx_start" end_symbol="__exidx_end" />
        <ProgramSection alignment="4" load="Yes" runin=".fast_run" name=".fast" />
        <ProgramSection alignment="4" load="Yes" runin=".data_run" name=".data" />
        <ProgramSection alignment="4" load="Yes" runin=".tdata_run" name=".tdata" />
      </MemorySegment>
      <MemorySegment name="RAM" start="$(RAM_PH_START)" size="$(RAM_PH_SIZE)">
        <ProgramSection load="no" name=".reserved_ram" start="$(RAM_PH_START)" size="$(RAM_START)-$(RAM_PH_START)" />
        <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="$(RAM_START)" address_symbol="__app_ram_start__"/>
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run" address_symbol="__start_nrf_sections_run" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".log_dynamic_data_run" address_symbol="__start_log_dynamic_data" end_symbol="__stop_log_dynamic_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".log_filter_data_run" address_symbol="__start_log_filter_data" end_symbol="__stop_log_filter_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".fs_data_run" address_symbol="__start_fs_data" end_symbol="__stop_fs_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run_end" address_symbol="__end_nrf_sections_run" />
        <ProgramSection alignment="4" load="No" name=".fast_run" />
        <ProgramSection alignment="4" load="No" name=".data_run" />
        <ProgramSection alignment="4" load="No" name=".tdata_run" />
        <ProgramSection alignment="4" load="No" name=".bss" />
        <ProgramSection alignment="4" load="No" name=".tbss" />
        <ProgramSection alignment="4" load="No" name=".non_init" />
        <ProgramSection alignment="4" size="__HEAPSIZE__" load="No" name=".heap" />
        <ProgramSection alignment="8" size="__STACKSIZE__" load="No" place_from_segment_end="Yes" name=".stack"  address_symbol="__StackLimit" end_symbol="__StackTop"/>
        <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />
      </MemorySegment>
      <MemorySegment name="bootloader_settings_page" start="0x0003F000" size="0x1000">
        <ProgramSection alignment="4" keep="Yes" load="No" name=".bootloader_settings_page" address_symbol="__start_bootloader_settings_page" end_symbol="__stop_bootloader_settings_page" start = "0x0003F000" size="0x1000" />
      </MemorySegment>
      <MemorySegment name="mbr_params_page" start="0x0003E000" size="0x1000">
        <ProgramSection alignment="4" keep="Yes" load="No" name=".mbr_params_page" address_symbol="__start_mbr_params_page" end_symbol="__stop_mbr_params_page" start = "0x0003E000" size="0x1000" />
      </MemorySegment>
      <MemorySegment name="uicr_bootloader_start_address" start="0x10001014" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_bootloader_start_address" address_symbol="__start_uicr_bootloader_start_address" end_symbol="__stop_uicr_bootloader_start_address" start = "0x10001014" size="0x4" />
      </MemorySegment>
      <MemorySegment name="uicr_mbr_params_page" start="0x10001018" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_mbr_params_page" address_symbol="__start_uicr_mbr_params_page" end_symbol="__stop_uicr_mbr_params_page" start = "0x10001018" size="0x4" />
      </MemorySegment>
    </Root>
    

    My memory segments :

    FLASH RX 0x0 0x40000;RAM RWX 0x20000000 0x8000;uicr_bootloader_start_address RX 0x10001014 0x4;bootloader_settings_page RX 0x0003F000 0x1000;uicr_mbr_params_page RX 0x10001018 0x4;mbr_params_page RX 0x0003E000 0x1000

    They are all the same as the ones you sent me before and yet I still have these errors :

    Does it contain an LFXTAL?

    Yes, it does contain an LFXTAL.

    Concerning the debug session, if I run a debug session, wouldn't it erase the current program on my custom board? And which program do I have to run the debug session since there are the bootloader and the main application on my custom board


  • pca10040_s132_ble_debug_256k.zip

    Try this one. I did not change anything but the three things I mentioned in the previous reply. flash_placement.xml, build->memory segments, and linker->Section placement macros.

    In SES it is possible to attach the debugger if the .hex file is already flashed. Try to do this. To do so, try to use (toolbar->) Target -> Attach Debugger. If you do this, SES will not program anything.

    However, I suspect that you will run into some issues. Looking at the placement of the files, it looks like there is not enough RAM to run your application:

    The application uses 42.4kB RAM, and your nRF52 only has 32kB. This is the case for the previous (non _debug) project I sent as well. It uses 33.8kB (close, but still more than 32kB.

    It looks like the bootloader from SDK16 is too large for the 256/32 variant of the nRF52832.

    Perhaps you should consider moving to the 512/64 version?

    Alternatively, see if you can port the pca10040e bootloader project. It only uses 20kB of RAM, but you need to change it to using the S132 if that is what you are using.

    BR,

    Edvin

Related