SDK_ERROR observed

Hi Team,

I'm developing a custom app, based on the ble_app_uart.

I'm observing a error : SDK_ERROR (NRF_FAULT_ID_SDK_ERROR).

I'm unable to root cause it and also unable to get any information about this error.

I even though got the error details connecting the debugger.

Can you please share some insight about this crash/error. It will help to debug further the issue.

I understand the 

Below are error details (taken from function app_error_save_and_stop()):-

Parents
  • Hello,

    Please right click on the 'p_file_name' variable highlighted below and select 'string'. The value field will then display the file path to the file where the code assert was raised. The error occurred at line 1213 (0x4bd) in this file, and the error code was 0x11 (NRF_ERROR_BUSY).

    Best regards,

    Vidar

  • Thank You Vidar.

    I was able to see it by checking the memory address, but this approach is even better.

    Also, Vidar can you help me to generate disassembly file (*.dis) in Segger Embedded Studio which will help to to debug & view the complete code in disassembly.

    I know that the --disassemble, can be used to generate the disassembly but i didnt get the option/place to add this and i guess the Segger Embedded Studio must already have the feature to generate it.

  • No problem. The disassembly view shows that the program hangs in the MBR's hardfault handler. If you make the debugger continue execution, you should see that the program execution ends up in the hardfault handler declared in the application.

    Can you post a screenshot of the CPU registers when the CPU is halted at 0xa60? It may give us a clue as to why the exception was raised.

    sa.qw said:
    I'm using the Segger Embedded Studio v7.22, nRF5 SDK v17.0.2 and application ble_app_uart

    I recommend you use an older version to avoid issues with our example projects. The SDK 17.x was tested with Embedded studio version v5.42a (mentioned in the release notes), and there were some breaking changes introduced after v6.20

  • Hi Vidar,

    Below are the details with SES v5.42a :-

    If I continue execution, it go to the address 0x781b330a and on every continue be there.

    Also, in the release notes, SES v4.50 is mentioned. Hence, I even tried with v4.50 and below are the details on crash:-

    And continuing the execution, below are register values (same as that of SES v5.42a

    Also, using the project saadc_pca10040e, works fine (on all SES versions).

    The above logs are for project ble_app_uart_pca10040e_s112.

    I even tried to place a breakpoint at the first instruction in Reset_Handler() at instruction "b nRFInitialize", even then the execution didnt stop at this first instruction and instead directly shows the instruction at address 0xA60.

    From few posts it looks like it could be related to the Flash Placement (note - I didn't change it), hence attaching the 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=".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="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=".pwr_mgmt_data" inputsections="*(SORT(.pwr_mgmt_data*))" address_symbol="__start_pwr_mgmt_data" end_symbol="__stop_pwr_mgmt_data" />
        <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_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=".nrf_queue" inputsections="*(.nrf_queue*)" address_symbol="__start_nrf_queue" end_symbol="__stop_nrf_queue" />
        <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=".cli_command" inputsections="*(.cli_command*)" address_symbol="__start_cli_command" end_symbol="__stop_cli_command" />
        <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=".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=".log_backends" inputsections="*(SORT(.log_backends*))" address_symbol="__start_log_backends" end_symbol="__stop_log_backends" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections" address_symbol="__start_nrf_sections" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".cli_sorted_cmd_ptrs"  inputsections="*(.cli_sorted_cmd_ptrs*)" runin=".cli_sorted_cmd_ptrs_run"/>
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".fs_data"  inputsections="*(.fs_data*)" runin=".fs_data_run"/>
        <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" 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="RAM1" 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=".cli_sorted_cmd_ptrs_run" address_symbol="__start_cli_sorted_cmd_ptrs" end_symbol="__stop_cli_sorted_cmd_ptrs" />
        <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=".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=".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>
    </Root>
    

  • Hello,

    Please upload your project file too (*.emProject). From the images you posted I see that you have a corrupted/invalid stack pointer.

  • Hi Vidar,

    Uploading by project file.

    5153.ble_app_uart_pca10040e_s112.zip

    *Zipping it as it doesn't allow me to upload .emProject file

  • Sorry, I'm not seeing any errors in your project file or in flash_placement.xml. Are you able to upload the whole project so I can try to debug it here?

Reply Children
  • Do you have a bootloader present when you're debugging this? In other words, are you sure the crash is occuring in the application and not in the bootloader?

  • Hi Vidar,

    Sorry to say but I couldn't upload the complete code base.

    Can you help me with some pointer on how to debug it or how you will debug it.

    Also how you got to know that its a corrupted/invalid stack pointer, as I least expect it because i have a simple application and the execution never comes the Application, it crashes even before it.

    I have reasons to say that its not occurring in or due Application as execution never reaches there.

    Also, yes I have also added the bootloader.

    And FYI, am uploading the binaries (bootloader / soft device / application) though JLINK !

    I first use the project dfu\secure_bootloader to write the bootloader (+soft device), then use my project to write the application + soft device. I hope its not an issue.

  • Hi,

    sa.qw said:
    Can you help me with some pointer on how to debug it or how you will debug it.

    Are you able to run the application if you only program the Softdevice and application without the bootloader?

    sa.qw said:
    Also how you got to know that its a corrupted/invalid stack pointer, as I least expect it because i have a simple application and the execution never comes the Application, it crashes even before it.

    Because the stack pointer is well beyond the valid address range for RAM (which ranges from 0x20000000 to 0x20006000).

    sa.qw said:
    I have reasons to say that its not occurring in or due Application as execution never reaches there.

    It's not reaching main(), but is it reaching the application's reset handler?

    sa.qw said:
    I first use the project dfu\secure_bootloader to write the bootloader (+soft device), then use my project to write the application + soft device. I hope its not an issue.

    The bootloader will not be able to boot the application unless you also program a valid bootloader settings page along with it. See Combine application, bootloader and softdevice image - Bootloader setting.

  • Hi Vidar,

    Are you able to run the application if you only program the Softdevice and application without the bootloader?

    Yes.

    Because the stack pointer is well beyond the valid address range for RAM (which ranges from 0x20000000 to 0x20006000).

    ok

    It's not reaching main(), but is it reaching the application's reset handler?

    Its not even reaching the application's reset handler, i tried by keeping a breakpoint in reset handler.

    The bootloader will not be able to boot the application unless you also program a valid bootloader settings page along with it

    Thanks for the information but i was expecting the project dfu\secure_bootloader will have the valid bootloader settings and while flashing the nordic device via JLink, it also writes the bootloader settings as well. If this is not the case, then

    1. can bootloader setting be written via JLink ?
    2. Is DFU Secure Bootloader MANDATORY to perform DFU via BLE ?
      1. As, i was trying to add bootloader to enable the DFU via BLE

    I guess the issue is with the bootloader setting, as i erased the complete flash via JLink and only flashed the Application + Soft Device via JLink, and i have it working.

  • Hi,

    Then the problem isn't with the application, but with the bootloader. Please double check that the bootloader project you selected is configured to run on the nRF52810 and not some other nRF52 variant.

Related