Unable to use NanoPB with Sidewalk

Hello, I am trying to use the subghz template in ncs 2.5.2 but I am running into an issue when enabling NanoPB. When enabling NanoPB with CONFIG_NANOPB=y the application faults when connecting to BLE to register on the network. If I am already registered on the network the application runs fine but it seems there is something in the BLE registration that is causing a fault with NanoPB.

00> [00:00:02.054,931] <inf> sid_ble_conn: BT Connected
00> [00:00:03.348,114] <err> os: ***** BUS FAULT *****
00> [00:00:03.348,114] <err> os:   Precise data bus error
00> [00:00:03.348,144] <err> os:   BFAR Address: 0x110001
00> [00:00:03.348,175] <err> os: r0/a1:  0x20010150  r1/a2:  0x00110001  r2/a3:  0x00000000
00> [00:00:03.348,175] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000003 r14/lr:  0x0003b44b
00> [00:00:03.348,205] <err> os:  xpsr:  0x41000200
00> [00:00:03.348,236] <err> os: s[ 0]:  0x200087d0  s[ 1]:  0x20016bc6  s[ 2]:  0x00000000  s[ 3]:  0x0002fefb
00> [00:00:03.348,236] <err> os: s[ 4]:  0x2001acf4  s[ 5]:  0x0003cacd  s[ 6]:  0x2001ad60  s[ 7]:  0x2001ad60
00> [00:00:03.348,266] <err> os: s[ 8]:  0x20016ec0  s[ 9]:  0x2001acf4  s[10]:  0x2001ad60  s[11]:  0x20010168
00> [00:00:03.348,266] <err> os: s[12]:  0x00000014  s[13]:  0x20016bc6  s[14]:  0x00000000  s[15]:  0x00067ef7
00> [00:00:03.348,327] <err> os: fpscr:  0x00000000
00> [00:00:03.348,327] <err> os: r4/v1:  0x200101c8  r5/v2:  0x2000a838  r6/v3:  0x0008129e[0m
00> [00:00:03.348,358] <err> os: r7/v4:  0x20016af4  r8/v5:  0x00000004  r9/v6:  0x00000000
00> [00:00:03.348,358] <err> os: r10/v7: 0x00000000  r11/v8: 0x00000000    psp:  0x200100b0
00> [00:00:03.348,388] <err> os: EXC_RETURN: 0xffffffed
00> [00:00:03.348,388] <err> os: Faulting instruction address (r15/pc): 0x00069d7a
00> [00:00:03.348,419] <err> os: >>> ZEPHYR FATAL ERROR 25: Unknown error on CPU 0
00> [00:00:03.348,480] <err> os: Current thread: 0x200033a0 (unknown)
00> [00:00:04.049,621] <err> os: Halting system


Call Stack:

Parents
  • Hello Timothy,

    Sorry about the wait. The Easter period is a public holiday in Norway.

    I don't think the combination of NanoPB and Sidewalk has been tested. Have you tried debugging to find where the bus fault was raised?

    Regards,

    Elfving

  • No worries. At the moment the call stack and fault info above are all I have. It is pretty easier to reproduce by just adding CONFIG_NANOPB=y if you need more info immediately. I will see if I can get some more debug information later.

  • Hi again Sam, and thank you for your patience,

    You are not seeing this issue with NANOPB not enabled right? If so I would assume that the mfg.hex is fine. Could you try running addr2line on that faulting instruction set?

    Here are some steps on how to use addr2line:

    1. Check if you have arm-none-eabi-addr2line set up by running "where arm-none-eabi-addr2line" in a cmd window.
      1. This should return something like "C:\Program Files (x86)\GNU Tools ARM Embedded\4.9 2015q3\bin\arm-none-eabi-addr2line.exe"
      2. If it does not return this, then there might be some issues with the gnuarmemb path configuration
    2. Next step is to investigate what is in the R15/pc and R14/lr addresses
      1. arm-none-eabi-addr2line -e <path to _build\zephyr\zephyr.elf> <0x000211a8> for r15/pc
      2. arm-none-eabi-addr2line -e <path to _build\zephyr\zephyr.elf> <0x00018b3d> for r14/lr

    2. Should give you what function call that causes the kernel panic deep down in the stack. Remember to replace "<path to _build\zephyr\zephyr.elf>" with your actual path

    Regards,

    Elfving

  • Elfving, thanks for the guidance.

    I ran into issues with the "arm-none-eabi-addr2line" command.

    1. There is no zephyr.elf at that location.
    2. I did find a few zephyr.elf files at other locations, but when I attempt to run the addr2line command, the output is: "The system cannot find the file specified"

    All this to say, I did go look a the zephyr.map file and found where the address should be:

    .text.load_descriptor_values
    0x0000000000050af4 0xf4 modules/nanopb/libmodules__nanopb.a(pb_common.c.obj)

  • Since the error seems to be related to stack size and the crash I received is coming from the Sidewalk Thread, I tried increasing the following config variables within prj.conf

    CONFIG_SIDEWALK_THREAD_STACK_SIZE=24576 (from 16384 & 8192)

    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192 (from 4096)

    CONFIG_SIDEWALK_HEAP_SIZE=10240 (from 5120)

    But none of these changes affected the outcome.

  • We are seeing this on our side as well now, and the relevant R&D team is looking into it. There might be some sort of conflict since nanobp is already in use by the protocol library for sidewalk.

    Could you expand a bit on your use-case for nanopb? 

    Regards,

    Elfving

  • Elfving: we are building a device with the goal of collecting various sensor values and publishing this data to AWS via Sidewalk. Due to the bandwidth limitations of sidewalk we wanted to utilize protobuf to balance the throughput of data.

    Sam

Reply Children
No Data
Related