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

nRF52 DK - Peripheral UART example unmodified fails if CONFIG_BT_SERVICES is enabled.

I'm testing out the Peripheral Uart example on the nRF52 DK with zero modifications using visual studio code.  However, when I run it, it constantly reboots.  When using the debugger, it seems to be that something in the bt_enable() function causes it to SIGTRAP.

This is the output of the debug console

Thread 9 received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Remote target]
z_arm_is_synchronous_svc (esf=0x20006548 <z_main_stack+8>) at C:/ncs/v2.1.0-rc2/zephyr/arch/arm/core/aarch32/cortex_m/fault.c:649
649 uint16_t fault_insn = *(ret_addr - 1);

The RTT doesn't display anything.  And if I use the debugger, it dies in the z_arm_is_synchronous_svc() with a null pointer.

In doing some more digging, it seems the fault occurs with bt_settings_init().  If I turn CONFIG_BT_SERVICES off, the application seems to boot fine.  

This is a new DK and I've not paired it with anything in the past.  Not sure if this is exposing a bug associated with new hardware?

Parents
  • In digging further, it seems it fails when it tries to write to nvram in the function  z_impl_flash_write() which calls api->write().  Here are the arguments passed:

    digging further down into the stack, the actual fault occurs in flash_sync_mpsl.c:179 when it calls

        ret = mpsl_timeslot_request(_context.session_id, req); 
     Any thoughts?
Reply
  • In digging further, it seems it fails when it tries to write to nvram in the function  z_impl_flash_write() which calls api->write().  Here are the arguments passed:

    digging further down into the stack, the actual fault occurs in flash_sync_mpsl.c:179 when it calls

        ret = mpsl_timeslot_request(_context.session_id, req); 
     Any thoughts?
Children
  • full circle - definetly a bug.  I tried running the nvs app which ran fine - put some stuff on the nonvolatile system.  after that, i had no issues running the peripheral uart example.

    SO - - how do i report this as a bug?

  • Hi,

    So to try and reproduce I did the following:

    nRF Connect SDK v2.1.0

    Board: nRF52 DK (PCA10040) v1.1.1

    Example v2.1.0/nrf/samples/bluetooth/peripheral_uart

    Commands:

    west build -p -b nrf52dk_nrf52832
    west flash --erase

    With this setup, the sample boots fine, and does not enter a reset loop.

    Did I do this as you did?

    Regards,
    Sigurd Hellesvik

  •   I've lost track of which board is which, but when I click on the button you indicated, I indeed get the same reboot cycle happening again.

    I'm running the 2.1.0-rc2 SDK

    Here is my prj.conf (i left it unchanged):

    #
    # Copyright (c) 2018 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # Enable the UART driver
    CONFIG_UART_ASYNC_API=y
    CONFIG_NRFX_UARTE0=y
    CONFIG_SERIAL=y
    
    CONFIG_GPIO=y
    
    # Make sure printk is printing to the UART console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="Nordic_UART_Service"
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=1
    
    # Enable the NUS service
    CONFIG_BT_NUS=y
    
    # Enable bonding
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    # Enable DK LED and Buttons library
    CONFIG_DK_LIBRARY=y
    
    # This example requires more workqueue stack
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # Config logger
    CONFIG_LOG=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    
    CONFIG_ASSERT=y
    

Related