This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Advertisement not working on custom NRF52810 board

I don't know if I'm dealing with a hardware or software problem at this point. I have a custom NRF52810 board with chip antenna and no LF clock, in SES. In SDK 16 I modified the ble_app_hids_keyboard_pca10040e_s112 in the following ways....

Build
    memory Segments
        FLASH RX 0x0 0x2ffff;RAM RWX 0x20000000 0x5fff

Code Generation    
    ARM FP ABI Type = Soft
    ARM FPU Type = None
    
Link
    Section Placement Macros
        FLASH_PH_START=0x0
        FLASH_PH_SIZE=0x2ffff
        RAM_PH_START=0x20000000
        RAM_PH_SIZE=0x5fff
        FLASH_START=0x19000
        FLASH_SIZE=0x0x2ffff
        RAM_START=0x20001a40
        RAM_SIZE=0x5fff

Preprocessor
    Preprocessor Definitions
        APP_TIMER_V2
        APP_TIMER_V2_RTC1_ENABLED
        BOARD_CUSTOM
        FLOAT_ABI_SOFT
        INITIALIZE_USER_SECTIONS
        NO_VTOR_CONFIG
        NRF52810_XXAA
        NRF52_PAN_74
        NRF_SD_BLE_API_VERSION=7
        S112
        SOFTDEVICE_PRESENT

Runtime Memory Area
    Heap Size
        2048
    Main Stack Size
        2048
Debug
    Target Device
        nrf25810_xxaa
Loader
    Additional Load File[0]
        ../../../../../../components/softdevice/s112/hex/s112_nrf52_7.0.1_softdevice.hex
        
-------------------

Created custom_board.h (from pca10040.h)


Replace project files:
    ses_startup_nrf52.s -> ses_startup_nrf52810.s
    system_nrf52.c-> system_nrf52810.c
    
Remove
    uart source files...
        nrf_drv_uart.c
    
Edit sdk_config.h
    disable UART, UARTE, LOG_BACKUP_UART
    set LF_SRC==0 in multiple places
    NRF_SDH_CLOCK_LF_RC_CTIV 16
    NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    NRF_LOG_BACKEND_RTT_ENABLED 1
    disable BSP (No buttons on my board)
    enable RTT logging backend

-----------------------

I will attach the project and sdk_config files. RTT logging only seems to work when selecting "Build and Run" rather than "Build and Debug". SES doesn't output any RTT logging in the built-in terminal. Here is the RTT output I'm getting...

00> <info> app_timer: RTC: initialized.
00>
00> <info> app: HID Keyboard example started.
00>
00> <info> app:   m_whitelist_peer_cnt 1, MAX_PEERS_WLIST 8
00>
00> <info> app: Fast advertising.
00>
00> <info> app: Slow advertising.
00>
00> <error> app: Fatal error
00>

The Fast advertising runs for a couple minutes, Slow advertising for several more minutes, and then finally the Fatal error. During this advertising process I am searching for new Bluetooth devices in Windows. I've tried the builtin Bluetooth adapter (4.0) and a USB Bluetooth adapter (4.2) and neither can find the adversiting signal. My laptop is within a half meter of the board. Can you help me diagnose this problem?

<!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_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=".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="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=".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>
sdk_config.h
<!DOCTYPE CrossStudio_Project_File>
<solution
  Name="ble_app_hids_keyboard_pca10040e_s112"
  target="8"
  version="2">
  <project Name="ble_app_hids_keyboard_pca10040e_s112">
    <configuration
      Name="Common"
      arm_architecture="v7EM"
      arm_core_type="Cortex-M4"
      arm_endian="Little"
      arm_fp_abi="Soft"
      arm_fpu_type="Soft"
      arm_linker_heap_size="2048"
      arm_linker_process_stack_size="0"
      arm_linker_stack_size="2048"
      arm_linker_treat_warnings_as_errors="No"
      arm_simulator_memory_simulation_parameter="RWX 00000000,00100000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
      arm_target_device_name="nRF52810_xxAA"
      arm_target_interface_type="SWD"
      c_preprocessor_definitions="APP_TIMER_V2;APP_TIMER_V2_RTC1_ENABLED;BOARD_CUSTOM;FLOAT_ABI_SOFT;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;NRF52810_XXAA;NRF52_PAN_74;NRF_SD_BLE_API_VERSION=7;S112;SOFTDEVICE_PRESENT"
      c_user_include_directories="../../../config;../../../../../../components;../../../../../../components/ble/ble_advertising;../../../../../../components/ble/ble_dtm;../../../../../../components/ble/ble_link_ctx_manager;../../../../../../components/ble/ble_racp;../../../../../../components/ble/ble_services/ble_ancs_c;../../../../../../components/ble/ble_services/ble_ans_c;../../../../../../components/ble/ble_services/ble_bas;../../../../../../components/ble/ble_services/ble_bas_c;../../../../../../components/ble/ble_services/ble_cscs;../../../../../../components/ble/ble_services/ble_cts_c;../../../../../../components/ble/ble_services/ble_dfu;../../../../../../components/ble/ble_services/ble_dis;../../../../../../components/ble/ble_services/ble_gls;../../../../../../components/ble/ble_services/ble_hids;../../../../../../components/ble/ble_services/ble_hrs;../../../../../../components/ble/ble_services/ble_hrs_c;../../../../../../components/ble/ble_services/ble_hts;../../../../../../components/ble/ble_services/ble_ias;../../../../../../components/ble/ble_services/ble_ias_c;../../../../../../components/ble/ble_services/ble_lbs;../../../../../../components/ble/ble_services/ble_lbs_c;../../../../../../components/ble/ble_services/ble_lls;../../../../../../components/ble/ble_services/ble_nus;../../../../../../components/ble/ble_services/ble_nus_c;../../../../../../components/ble/ble_services/ble_rscs;../../../../../../components/ble/ble_services/ble_rscs_c;../../../../../../components/ble/ble_services/ble_tps;../../../../../../components/ble/common;../../../../../../components/ble/nrf_ble_gatt;../../../../../../components/ble/nrf_ble_qwr;../../../../../../components/ble/peer_manager;../../../../../../components/boards;../../../../../../components/libraries/atomic;../../../../../../components/libraries/atomic_fifo;../../../../../../components/libraries/atomic_flags;../../../../../../components/libraries/balloc;../../../../../../components/libraries/bootloader/ble_dfu;../../../../../../components/libraries/bsp;../../../../../../components/libraries/button;../../../../../../components/libraries/cli;../../../../../../components/libraries/crc16;../../../../../../components/libraries/crc32;../../../../../../components/libraries/crypto;../../../../../../components/libraries/csense;../../../../../../components/libraries/csense_drv;../../../../../../components/libraries/delay;../../../../../../components/libraries/ecc;../../../../../../components/libraries/experimental_section_vars;../../../../../../components/libraries/experimental_task_manager;../../../../../../components/libraries/fds;../../../../../../components/libraries/fstorage;../../../../../../components/libraries/gfx;../../../../../../components/libraries/gpiote;../../../../../../components/libraries/hardfault;../../../../../../components/libraries/hci;../../../../../../components/libraries/led_softblink;../../../../../../components/libraries/log;../../../../../../components/libraries/log/src;../../../../../../components/libraries/low_power_pwm;../../../../../../components/libraries/mem_manager;../../../../../../components/libraries/memobj;../../../../../../components/libraries/mpu;../../../../../../components/libraries/mutex;../../../../../../components/libraries/pwm;../../../../../../components/libraries/pwr_mgmt;../../../../../../components/libraries/queue;../../../../../../components/libraries/ringbuf;../../../../../../components/libraries/scheduler;../../../../../../components/libraries/sdcard;../../../../../../components/libraries/sensorsim;../../../../../../components/libraries/slip;../../../../../../components/libraries/sortlist;../../../../../../components/libraries/spi_mngr;../../../../../../components/libraries/stack_guard;../../../../../../components/libraries/strerror;../../../../../../components/libraries/svc;../../../../../../components/libraries/timer;../../../../../../components/libraries/twi_mngr;../../../../../../components/libraries/twi_sensor;../../../../../../components/libraries/usbd;../../../../../../components/libraries/usbd/class/audio;../../../../../../components/libraries/usbd/class/cdc;../../../../../../components/libraries/usbd/class/cdc/acm;../../../../../../components/libraries/usbd/class/hid;../../../../../../components/libraries/usbd/class/hid/generic;../../../../../../components/libraries/usbd/class/hid/kbd;../../../../../../components/libraries/usbd/class/hid/mouse;../../../../../../components/libraries/usbd/class/msc;../../../../../../components/libraries/util;../../../../../../components/softdevice/common;../../../../../../components/softdevice/s112/headers;../../../../../../components/softdevice/s112/headers/nrf52;../../../../../../components/toolchain/cmsis/include;../../../../../../external/fprintf;../../../../../../external/segger_rtt;../../../../../../external/utf_converter;../../../../../../integration/nrfx;../../../../../../integration/nrfx/legacy;../../../../../../modules/nrfx;../../../../../../modules/nrfx/drivers/include;../../../../../../modules/nrfx/hal;../../../../../../modules/nrfx/mdk;../config;"
      debug_additional_load_file="../../../../../../components/softdevice/s112/hex/s112_nrf52_7.0.1_softdevice.hex"
      debug_register_definition_file="../../../../../../modules/nrfx/mdk/nrf52810.svd"
      debug_start_from_entry_point_symbol="No"
      debug_target_connection="J-Link"
      gcc_debugging_level="Level 3"
      gcc_entry_point="Reset_Handler"
      linker_output_format="hex"
      linker_printf_fmt_level="long"
      linker_printf_width_precision_supported="Yes"
      linker_scanf_fmt_level="long"
      linker_section_placement_file="flash_placement.xml"
      linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x2ffff;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x5fff;FLASH_START=0x19000;FLASH_SIZE=0x0x2ffff;RAM_START=0x20001a40;RAM_SIZE=0x5fff"
      linker_section_placements_segments="FLASH RX 0x0 0x2ffff;RAM RWX 0x20000000 0x5fff"
      macros="CMSIS_CONFIG_TOOL=../../../../../../external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar"
      project_directory=""
      project_type="Executable" />
    <folder Name="Segger Startup Files">
      <file file_name="$(StudioDir)/source/thumb_crt0.s" />
    </folder>
    <folder Name="nRF_Log">
      <file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_rtt.c" />
      <file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_serial.c" />
      <file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_uart.c" />
      <file file_name="../../../../../../components/libraries/log/src/nrf_log_default_backends.c" />
      <file file_name="../../../../../../components/libraries/log/src/nrf_log_frontend.c" />
      <file file_name="../../../../../../components/libraries/log/src/nrf_log_str_formatter.c" />
    </folder>
    <folder Name="nRF_Libraries">
      <file file_name="../../../../../../components/libraries/button/app_button.c" />
      <file file_name="../../../../../../components/libraries/util/app_error.c" />
      <file file_name="../../../../../../components/libraries/util/app_error_handler_gcc.c" />
      <file file_name="../../../../../../components/libraries/util/app_error_weak.c" />
      <file file_name="../../../../../../components/libraries/scheduler/app_scheduler.c" />
      <file file_name="../../../../../../components/libraries/timer/app_timer2.c" />
      <file file_name="../../../../../../components/libraries/util/app_util_platform.c" />
      <file file_name="../../../../../../components/libraries/crc16/crc16.c" />
      <file file_name="../../../../../../components/libraries/timer/drv_rtc.c" />
      <file file_name="../../../../../../components/libraries/fds/fds.c" />
      <file file_name="../../../../../../components/libraries/hardfault/hardfault_implementation.c" />
      <file file_name="../../../../../../components/libraries/util/nrf_assert.c" />
      <file file_name="../../../../../../components/libraries/atomic_fifo/nrf_atfifo.c" />
      <file file_name="../../../../../../components/libraries/atomic_flags/nrf_atflags.c" />
      <file file_name="../../../../../../components/libraries/atomic/nrf_atomic.c" />
      <file file_name="../../../../../../components/libraries/balloc/nrf_balloc.c" />
      <file file_name="../../../../../../external/fprintf/nrf_fprintf.c" />
      <file file_name="../../../../../../external/fprintf/nrf_fprintf_format.c" />
      <file file_name="../../../../../../components/libraries/fstorage/nrf_fstorage.c" />
      <file file_name="../../../../../../components/libraries/fstorage/nrf_fstorage_sd.c" />
      <file file_name="../../../../../../components/libraries/memobj/nrf_memobj.c" />
      <file file_name="../../../../../../components/libraries/pwr_mgmt/nrf_pwr_mgmt.c" />
      <file file_name="../../../../../../components/libraries/ringbuf/nrf_ringbuf.c" />
      <file file_name="../../../../../../components/libraries/experimental_section_vars/nrf_section_iter.c" />
      <file file_name="../../../../../../components/libraries/sortlist/nrf_sortlist.c" />
      <file file_name="../../../../../../components/libraries/strerror/nrf_strerror.c" />
      <file file_name="../../../../../../components/libraries/sensorsim/sensorsim.c" />
    </folder>
    <folder Name="None">
      <file file_name="../../../../../../modules/nrfx/mdk/ses_startup_nrf52810.s" />
      <file file_name="../../../../../../modules/nrfx/mdk/ses_startup_nrf_common.s" />
      <file file_name="../../../../../../modules/nrfx/mdk/system_nrf52810.c" />
    </folder>
    <folder Name="Board Definition">
      <file file_name="../../../../../../components/boards/boards.c" />
    </folder>
    <folder Name="nRF_Drivers">
      <file file_name="../../../../../../integration/nrfx/legacy/nrf_drv_clock.c" />
      <file file_name="../../../../../../modules/nrfx/soc/nrfx_atomic.c" />
      <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_clock.c" />
      <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_gpiote.c" />
      <file file_name="../../../../../../modules/nrfx/drivers/src/prs/nrfx_prs.c" />
    </folder>
    <folder Name="Board Support" />
    <folder Name="Application">
      <file file_name="../../../main.c" />
      <file file_name="../config/sdk_config.h" />
    </folder>
    <folder Name="nRF_Segger_RTT">
      <file file_name="../../../../../../external/segger_rtt/SEGGER_RTT.c" />
      <file file_name="../../../../../../external/segger_rtt/SEGGER_RTT_Syscalls_SES.c" />
      <file file_name="../../../../../../external/segger_rtt/SEGGER_RTT_printf.c" />
    </folder>
    <folder Name="nRF_BLE">
      <file file_name="../../../../../../components/ble/peer_manager/auth_status_tracker.c" />
      <file file_name="../../../../../../components/ble/common/ble_advdata.c" />
      <file file_name="../../../../../../components/ble/ble_advertising/ble_advertising.c" />
      <file file_name="../../../../../../components/ble/common/ble_conn_params.c" />
      <file file_name="../../../../../../components/ble/common/ble_conn_state.c" />
      <file file_name="../../../../../../components/ble/ble_link_ctx_manager/ble_link_ctx_manager.c" />
      <file file_name="../../../../../../components/ble/common/ble_srv_common.c" />
      <file file_name="../../../../../../components/ble/peer_manager/gatt_cache_manager.c" />
      <file file_name="../../../../../../components/ble/peer_manager/gatts_cache_manager.c" />
      <file file_name="../../../../../../components/ble/peer_manager/id_manager.c" />
      <file file_name="../../../../../../components/ble/nrf_ble_gatt/nrf_ble_gatt.c" />
      <file file_name="../../../../../../components/ble/nrf_ble_qwr/nrf_ble_qwr.c" />
      <file file_name="../../../../../../components/ble/peer_manager/peer_data_storage.c" />
      <file file_name="../../../../../../components/ble/peer_manager/peer_database.c" />
      <file file_name="../../../../../../components/ble/peer_manager/peer_id.c" />
      <file file_name="../../../../../../components/ble/peer_manager/peer_manager.c" />
      <file file_name="../../../../../../components/ble/peer_manager/peer_manager_handler.c" />
      <file file_name="../../../../../../components/ble/peer_manager/pm_buffer.c" />
      <file file_name="../../../../../../components/ble/peer_manager/security_dispatcher.c" />
      <file file_name="../../../../../../components/ble/peer_manager/security_manager.c" />
    </folder>
    <folder Name="UTF8/UTF16 converter">
      <file file_name="../../../../../../external/utf_converter/utf.c" />
    </folder>
    <folder Name="nRF_BLE_Services">
      <file file_name="../../../../../../components/ble/ble_services/ble_bas/ble_bas.c" />
      <file file_name="../../../../../../components/ble/ble_services/ble_dis/ble_dis.c" />
      <file file_name="../../../../../../components/ble/ble_services/ble_hids/ble_hids.c" />
    </folder>
    <folder Name="nRF_SoftDevice">
      <file file_name="../../../../../../components/softdevice/common/nrf_sdh.c" />
      <file file_name="../../../../../../components/softdevice/common/nrf_sdh_ble.c" />
      <file file_name="../../../../../../components/softdevice/common/nrf_sdh_soc.c" />
    </folder>
  </project>
  <configuration
    Name="Release"
    c_preprocessor_definitions="NDEBUG"
    gcc_optimization_level="Optimize For Size" />
</solution>
custom_board.h

Parents Reply
  • That is strange. The function ble_advertising_peer_addr_reply() can only return NRF_ERROR_INVALID_STATE (=0x8) and NRF_SUCCESS (=0x0):

    uint32_t ble_advertising_peer_addr_reply(ble_advertising_t * const p_advertising,
                                             ble_gap_addr_t          * p_peer_address)
    {
        if (!p_advertising->peer_addr_reply_expected)
        {
            return NRF_ERROR_INVALID_STATE;
        }
    
        p_advertising->peer_addr_reply_expected = false;
    
        memcpy(&p_advertising->peer_address, p_peer_address, sizeof(p_advertising->peer_address));
    
        return NRF_SUCCESS;
    }

    Can you try to set a debug point at return NRF_ERROR_INVALID_STATE inside ble_advertising_peer_reply()?

    Set the debug options as described here.

    Best regards,

    Simon

Children
  • My debug options were already set to Level 3 no optimization. The screen cap shows the program breaking at the app_error_fault_handler() function. When I double click on on_adv_avt() in the call stack it shows APP_ERROR_CHECK being called immediately after a breakpoint. That breakpoint never occurs for some reason. You can see the error code in the register as well.

  • Here's another note. This project has only a Release configuration, no Debug. When I change any options I do it on the Common configuration and I'm assuming that will apply to Release configuration. I just modified the Release configuration directly by disabling Optimazation for Space. After that, I'm getting a build error....

    .rodata is too large to fit in FLASH memory segment

    .data is too large to fit in FLASH memory segment

    Now I'm really confused. Shouldn't this project fit in the 52810 using the S112?

  • I just tried running another example using the proprietary radio protocol instead of BLE/Softdevice. I adapted esb_ptx_pca10040e to my 52810 board. When I debug I get caught in the clock_start() function (see screen cap). After searching on the forum I see that this could be a problem with my HF crystal (soldering or part spec). Here is the crystal model I'm using...

    https://www.digikey.com/product-detail/en/murata-electronics/XRCGB32M000F2P01R0/490-18340-1-ND/9959802

    If it is a problem with my crystal would that explain the strange BLE/Softdevice problem I was having with ble_advertising_peer_reply()?

    <!DOCTYPE CrossStudio_Project_File>
    <solution Name="esb_ptx_pca10040e" target="8" version="2">
      <project Name="esb_ptx_pca10040e">
        <configuration
          Name="Common"
          arm_architecture="v7EM"
          arm_core_type="Cortex-M4"
          arm_endian="Little"
          arm_fp_abi="Soft"
          arm_fpu_type="Soft"
          arm_linker_heap_size="2048"
          arm_linker_process_stack_size="0"
          arm_linker_stack_size="2048"
          arm_linker_treat_warnings_as_errors="No"
          arm_simulator_memory_simulation_parameter="RWX 00000000,00100000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
          arm_target_device_name="nRF52810_xxAA"
          arm_target_interface_type="SWD"
          c_preprocessor_definitions="BOARD_CUSTOM;BSP_DEFINES_ONLY;ESB_PRESENT;FLOAT_ABI_SOFT;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;NRF52810_XXAA;NRF52_PAN_74;NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED "
          c_user_include_directories="../../../config;../../../../../../components;../../../../../../components/boards;../../../../../../components/drivers_nrf/nrf_soc_nosd;../../../../../../components/libraries/atomic;../../../../../../components/libraries/balloc;../../../../../../components/libraries/bsp;../../../../../../components/libraries/delay;../../../../../../components/libraries/experimental_section_vars;../../../../../../components/libraries/log;../../../../../../components/libraries/log/src;../../../../../../components/libraries/memobj;../../../../../../components/libraries/ringbuf;../../../../../../components/libraries/strerror;../../../../../../components/libraries/util;../../../../../../components/proprietary_rf/esb;../../../../../../components/toolchain/cmsis/include;../../..;../../../../../../external/fprintf;../../../../../../external/segger_rtt;../../../../../../integration/nrfx;../../../../../../integration/nrfx/legacy;../../../../../../modules/nrfx;../../../../../../modules/nrfx/drivers/include;../../../../../../modules/nrfx/hal;../../../../../../modules/nrfx/mdk;../config;"
          debug_register_definition_file="../../../../../../modules/nrfx/mdk/nrf52810.svd"
          debug_start_from_entry_point_symbol="No"
          debug_target_connection="J-Link"
          gcc_debugging_level="Level 3"
          gcc_entry_point="Reset_Handler"
          linker_output_format="hex"
          linker_printf_fmt_level="long"
          linker_printf_width_precision_supported="Yes"
          linker_scanf_fmt_level="long"
          linker_section_placement_file="flash_placement.xml"
          linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x30000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x6000;FLASH_START=0x0;FLASH_SIZE=0x30000;RAM_START=0x20000000;RAM_SIZE=0x6000"
          linker_section_placements_segments="FLASH RX 0x0 0x30000;RAM RWX 0x20000000 0x6000"
          macros="CMSIS_CONFIG_TOOL=../../../../../../external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar"
          project_directory=""
          project_type="Executable" />
        <folder Name="Segger Startup Files">
          <file file_name="$(StudioDir)/source/thumb_crt0.s" />
        </folder>
        <folder Name="nRF_Log">
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_rtt.c" />
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_serial.c" />
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_uart.c" />
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_default_backends.c" />
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_frontend.c" />
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_str_formatter.c" />
        </folder>
        <folder Name="Board Definition">
          <file file_name="../../../../../../components/boards/boards.c" />
        </folder>
        <folder Name="nRF_Libraries">
          <file file_name="../../../../../../components/libraries/util/app_error.c" />
          <file file_name="../../../../../../components/libraries/util/app_error_handler_gcc.c" />
          <file file_name="../../../../../../components/libraries/util/app_error_weak.c" />
          <file file_name="../../../../../../components/libraries/util/app_util_platform.c" />
          <file file_name="../../../../../../components/libraries/util/nrf_assert.c" />
          <file file_name="../../../../../../components/libraries/atomic/nrf_atomic.c" />
          <file file_name="../../../../../../components/libraries/balloc/nrf_balloc.c" />
          <file file_name="../../../../../../external/fprintf/nrf_fprintf.c" />
          <file file_name="../../../../../../external/fprintf/nrf_fprintf_format.c" />
          <file file_name="../../../../../../components/libraries/memobj/nrf_memobj.c" />
          <file file_name="../../../../../../components/libraries/ringbuf/nrf_ringbuf.c" />
          <file file_name="../../../../../../components/libraries/strerror/nrf_strerror.c" />
        </folder>
        <folder Name="nRF_Drivers">
          <file file_name="../../../../../../integration/nrfx/legacy/nrf_drv_uart.c" />
          <file file_name="../../../../../../modules/nrfx/soc/nrfx_atomic.c" />
          <file file_name="../../../../../../modules/nrfx/drivers/src/prs/nrfx_prs.c" />
          <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_uart.c" />
          <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_uarte.c" />
        </folder>
        <folder Name="Application">
          <file file_name="../../../main.c" />
          <file file_name="../config/sdk_config.h" />
        </folder>
        <folder Name="nRF_Segger_RTT">
          <file file_name="../../../../../../external/segger_rtt/SEGGER_RTT.c" />
          <file file_name="../../../../../../external/segger_rtt/SEGGER_RTT_Syscalls_SES.c" />
          <file file_name="../../../../../../external/segger_rtt/SEGGER_RTT_printf.c" />
        </folder>
        <folder Name="None">
          <file file_name="../../../../../../modules/nrfx/mdk/ses_startup_nrf52810.s" />
          <file file_name="../../../../../../modules/nrfx/mdk/ses_startup_nrf_common.s" />
          <file file_name="../../../../../../modules/nrfx/mdk/system_nrf52810.c" />
        </folder>
        <folder Name="nRF_Properitary_RF">
          <file file_name="../../../../../../components/proprietary_rf/esb/nrf_esb.c" />
        </folder>
      </project>
      <configuration
        Name="Release"
        c_preprocessor_definitions="NDEBUG"
        gcc_optimization_level="Optimize For Size" />
      <configuration
        Name="Debug"
        c_preprocessor_definitions="DEBUG; DEBUG_NRF"
        gcc_optimization_level="None" />
    </solution>
    

    5076.sdk_config.h

  • cory123 said:
    If it is a problem with my crystal would that explain the strange BLE/Softdevice problem I was having with ble_advertising_peer_reply()?

    The problem with the crystal might cause problems with debugging. Here are some cases that might help out:

    However, I don't know too much about hardware. Could you open a new case regarding your crystal, and address your problems there. Then it will be assigned to someone with knowledge about this. I initially thought the problem was software related, my apologies for that.

    Best regards,

    Simon

  • I just found out yesterday that my footprint was wrong. I had the top left and bottom right pads connected to the NRF52810. It should be the bottom right and top left. This became clear when comparing my board layout with the reference design layout. Thanks for your help.

Related