nRF5340 beacon example with RPC

Beacon example (zephyr/samples/bluetooth/beacon)

Issuing the following:

west build -b nrf5340dk_nrf5340_cpuapp
west flash

I get images running on APP and NET core, beacon can be catched by nrfconnect.

But if I want the whole BT stack run on NET core with RPC interface:

west build -b nrf5340dk_nrf5340_cpuapp -- -DCONFIG_BT_RPC_STACK=y
west flash

Compile succeeds, but the console shows a lot of errors:

*** Booting Zephyr OS build v3.1.99-ncs1  ***ng system
Starting Beacon Demo
[00:00:00.265,350] <err> BT_RPC: Missmatched CONFIG_BT_PERIPHERAL: net=1, app=0
[00:00:00.265,411] <err> BT_RPC: Missmatched CONFIG_BT_SMP: net=1, app=0
[00:00:00.265,441] <err> BT_RPC: Missmatched CONFIG_BT_CONN: net=1, app=0
[00:00:00.265,472] <err> BT_RPC: Missmatched CONFIG_BT_ECC: net=1, app=0
[00:00:00.265,502] <err> BT_RPC: Missmatched CONFIG_BT_MAX_PAIRED: net=1, app=0
[00:00:00.265,502] <err> BT_RPC: Missmatched CONFIG_BT_SETTINGS_CCC_LAZY_LOADING: net=1, app=0
[00:00:00.265,533] <err> BT_RPC: Missmatched CONFIG_BT_SETTINGS: net=1, app=0
[00:00:00.265,563] <err> BT_RPC: Missmatched CONFIG_BT_MAX_CONN: net=1, app=255
[00:00:00.265,594] <err> BT_RPC: Missmatched CONFIG_BT_DEVICE_APPEARANCE: net=833, app=0
[00:00:00.265,594] <err> BT_RPC: Missmatched CONFIG_BT_DEVICE_NAME: net="Nordic_UART_S, app="Test beacon"
[00:00:00.265,625] <err> BT_RPC: Missmatched BT RPC config.
[00:00:00.265,655] <err> NRF_RPC: Error on receive reported -22, group bt_rpc, id 0x01, type 0x80
[00:00:00.265,716] <err> BT_RPC: nRF RPC error -22 ocurred. See nRF RPC logs for more details.
[00:00:00.265,716] <err> os: r0/a1:  0x00000003  r1/a2:  0x0000000d  r2/a3:  0x0000000c
[00:00:00.265,747] <err> os: r3/a4:  0x200006e8 r12/ip:  0x0000869c r14/lr:  0x00009187
[00:00:00.265,747] <err> os:  xpsr:  0x69000000
[00:00:00.265,747] <err> os: Faulting instruction address (r15/pc): 0x000048aa
[00:00:00.265,777] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:00.265,808] <err> os: Current thread: 0x20000d50 (unknown)

And not all of the above errors can be fixed by adding the appropriate config options to prj.conf.

What is the solution?

Parents
  • Hello,

    Can you try to follow the description for peripheral UART first to check that it works as expected, then next is the HIDS mouse, ref example build description:
    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/rpc_host/README.html#example-build 

    And not all of the above errors can be fixed by adding the appropriate config options to prj.conf.

    Which ones are left? To get more information about the assert I suggest to add the following:

    # Debugging configuration
    CONFIG_THREAD_NAME=y
    CONFIG_THREAD_ANALYZER=y
    CONFIG_THREAD_ANALYZER_AUTO=y
    CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y
    CONFIG_THREAD_ANALYZER_USE_PRINTK=y

    # Add asserts
    CONFIG_ASSERT=y
    CONFIG_ASSERT_VERBOSE=y
    CONFIG_ASSERT_NO_COND_INFO=n
    CONFIG_ASSERT_NO_MSG_INFO=n
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_THREAD_NAME=y

    You can also try to run something like this in your build folder (open command line from toolchain manager): 

    C:\ncs\toolchains\v2.1.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-addr2line.exe -e .\zephyr\zephyr.elf 0x000048aa (provided the fault is still at the same address as your original dump)

    Best regards,
    Kenneth

  • Which ones are left?

    [00:00:00.427,947] <err> BT_RPC: Missmatched CONFIG_BT_SETTINGS_CCC_LAZY_LOADING: net=1, app=0
    [00:00:00.427,978] <err> BT_RPC: Missmatched CONFIG_BT_SETTINGS: net=1, app=0

    My edited prj.conf looks like this (other dependencies could be resolved with it):

    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_DEVICE_NAME="Test beacon"
    
    CONFIG_BT_RPC=y
    CONFIG_BT_RPC_STACK=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_SMP=y
    CONFIG_BT_ECC=y
    CONFIG_BT_MAX_PAIRED=1
    CONFIG_BT_SETTINGS=y
    CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=y
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_DEVICE_NAME="Nordic_UART_Service"
    

    Tracing back the point of failure with addr2line: it points to bt_rpc_common.c::err_handler(...) function, which is used in nrf_rpc_init(err_handler).

  • <err> BT_RPC: Missmatched CONFIG_BT_SETTINGS_CCC_LAZY_LOADING: net=1, app=0
    <err> BT_RPC: Missmatched CONFIG_BT_SETTINGS: net=1, app=0

    The error indicate a mismatch between appcore and netcore, have you tried to setting them to the same value between the two cores? E.g. =y in both cores.

    Kenneth

  • I don't know how to set the APP and NET configuration separately. A few posts above I've shown my prj.conf. Please tell me how to edit APP and NET configs separately in case of a multi image build, like this!

Reply Children
Related