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:

  • samtday said:
    Let me know if there is anything I can do on my side to assist in the process.

    We were wondering about how to prioritize this issue. Your RSM have sent you an email about this, if you could answer him that would be great.

    Regards,

    Elfving

  • Hi,

    We've gotten a bit further with this. 

    The issue stems from that Amazon is using nanopb in version 0.3.9.3. As Sidewalk has linked the implementation of the used nanopb in the delivered library, when we enable the nanopb config, there is a second implementation, that is not compatible. The linker does not have a way to sort what implementation to use, and therefore it breaks when the incorrect implementation is used. Unfortunately, this version of nanopb is not supported in zephyr. 

    We are working with Amazon to upgrade the nanopb to a newer version that is supported by Zephyr, and maybe exclude it from the libraries. 

    To in the meantime, what you can do is to is to download the nanopb in the same version (0.3.9.3) and use that instead, though not from Kconfig, but as an external library. Keep in mind that the compiled version of the nanopb is already part of the sidewalk library, so you should only need the headers for the application. One of the guys in the relevant R&D team created a PR with the headers compatible with the nanopb used in the sidewalk libs here.

    Regards,

    Elfving

  • Elfving:

    Thank you for the update. This is great information. I plan to try that PR and the 0.3.9.3 version of nanopb within my project. Please, keep me updated of any progress made on yours and/or Amazon's side as I will want to migrate to the updated libraries as soon as they are available.

    Sam

Related