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?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!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" />
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sdk_config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!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"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
custom_board.h