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.

  • Has anyone seen any progress or resolution to this problem? I am trying to enable this on a nrf5340.

        

  • Hi Sam,

    I am not sure what happened to this case, but I haven't looked into this for about a year. Though I tried building the sidewalk end device sample for NCS 3 just now, with CONFIG_NANOPB enabled, for the nRF5340dk, and that seems to build ok. Are you seeing this issue on newer SDKs as well? What NCS version are you using?

    Regards,

    Elfving

  • I am working with NCS 2.9.0. I am using the sensor_monitoring variant of the sidewalk_end_device example and have enabled an adc channel as well.

  • Just to have the same baseline here, are you seeing it working with the default sample in 2.9?

    Regards,

    Elfving

  • This is the print out from my application - I am about to try migrating to a new version of NCS. Which version should I go to - 3.0.0 or 3.0.1?

    *** Booting Sidewalk v2.9.0-700b67f39073 ***
    *** Using nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 *----------------------------------------------------------------
    Sidewalk SDK        = 1.17.1.18
    APP_BUILD_VERSION   = 700b67f39073
    APP_NAME            = sidewalk
    build time          = May  6 2025 09:27:49
    board               = nrf5340dk/nrf5340/cpuapp
    ----------------------------------------------------------------
    [00:00:00.002,532] <inf> adc: Start ADC Init
    [00:00:00.002,624] <inf> adc: ADC Initialized Successfully
    [00:00:00.003,509] <inf> adc: Temp: 0 *C (0 *F)
    [00:00:00.003,540] <inf> adc: Send Temp Sidewalk message
    [00:00:00.004,211] <inf> sidewalk_events: sidewalk need to be started first.
    [00:00:00.020,996] <err> os: ***** USAGE FAULT *****
    [00:00:00.021,057] <err> os:   Stack overflow (context area not valid)
    [00:00:00.021,148] <err> os: r0/a1:  0xfffffffe  r1/a2:  0xffffffff  r2/a3:  0x00050000
    [00:00:00.021,209] <err> os: r3/a4:  0x00000000 r12/ip:  0xffffffff r14/lr:  0x000965fb
    [00:00:00.021,270] <err> os:  xpsr:  0xa1000000
    [00:00:00.021,362] <err> os: s[ 0]:  0xfffafffe  s[ 1]:  0xffffffff  s[ 2]:  0x20012378  s[ 3]:  0x00000000
    [00:00:00.021,484] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x000965fb  s[ 6]:  0x00050000  s[ 7]:  0x00000000
    [00:00:00.021,575] <err> os: s[ 8]:  0xffffffff  s[ 9]:  0x200123f0  s[10]:  0xffffffff  s[11]:  0x20004134
    [00:00:00.021,697] <err> os: s[12]:  0x00050000  s[13]:  0x00000000  s[14]:  0x0007aa31  s[15]:  0x00000000
    [00:00:00.021,728] <err> os: fpscr:  0x200123c8
    [00:00:00.021,820] <err> os: r4/v1:  0xfffafffe  r5/v2:  0xffffffff  r6/v3:  0x00000000
    [00:00:00.021,881] <err> os: r7/v4:  0x20012378  r8/v5:  0x00000000  r9/v6:  0x00000000
    [00:00:00.021,972] <err> os: r10/v7: 0x00000000  r11/v8: 0x00000000    psp:  0x20012340
    [00:00:00.022,003] <err> os: EXC_RETURN: 0xfffffffd
    [00:00:00.022,064] <err> os: Faulting instruction address (r15/pc): 0x00050030
    [00:00:00.022,155] <err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
    [00:00:00.022,186] <err> os: Current thread: 0x200042b8 (unknown)
    [00:00:00.215,148] <err> os: Halting system

Reply
  • This is the print out from my application - I am about to try migrating to a new version of NCS. Which version should I go to - 3.0.0 or 3.0.1?

    *** Booting Sidewalk v2.9.0-700b67f39073 ***
    *** Using nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 *----------------------------------------------------------------
    Sidewalk SDK        = 1.17.1.18
    APP_BUILD_VERSION   = 700b67f39073
    APP_NAME            = sidewalk
    build time          = May  6 2025 09:27:49
    board               = nrf5340dk/nrf5340/cpuapp
    ----------------------------------------------------------------
    [00:00:00.002,532] <inf> adc: Start ADC Init
    [00:00:00.002,624] <inf> adc: ADC Initialized Successfully
    [00:00:00.003,509] <inf> adc: Temp: 0 *C (0 *F)
    [00:00:00.003,540] <inf> adc: Send Temp Sidewalk message
    [00:00:00.004,211] <inf> sidewalk_events: sidewalk need to be started first.
    [00:00:00.020,996] <err> os: ***** USAGE FAULT *****
    [00:00:00.021,057] <err> os:   Stack overflow (context area not valid)
    [00:00:00.021,148] <err> os: r0/a1:  0xfffffffe  r1/a2:  0xffffffff  r2/a3:  0x00050000
    [00:00:00.021,209] <err> os: r3/a4:  0x00000000 r12/ip:  0xffffffff r14/lr:  0x000965fb
    [00:00:00.021,270] <err> os:  xpsr:  0xa1000000
    [00:00:00.021,362] <err> os: s[ 0]:  0xfffafffe  s[ 1]:  0xffffffff  s[ 2]:  0x20012378  s[ 3]:  0x00000000
    [00:00:00.021,484] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x000965fb  s[ 6]:  0x00050000  s[ 7]:  0x00000000
    [00:00:00.021,575] <err> os: s[ 8]:  0xffffffff  s[ 9]:  0x200123f0  s[10]:  0xffffffff  s[11]:  0x20004134
    [00:00:00.021,697] <err> os: s[12]:  0x00050000  s[13]:  0x00000000  s[14]:  0x0007aa31  s[15]:  0x00000000
    [00:00:00.021,728] <err> os: fpscr:  0x200123c8
    [00:00:00.021,820] <err> os: r4/v1:  0xfffafffe  r5/v2:  0xffffffff  r6/v3:  0x00000000
    [00:00:00.021,881] <err> os: r7/v4:  0x20012378  r8/v5:  0x00000000  r9/v6:  0x00000000
    [00:00:00.021,972] <err> os: r10/v7: 0x00000000  r11/v8: 0x00000000    psp:  0x20012340
    [00:00:00.022,003] <err> os: EXC_RETURN: 0xfffffffd
    [00:00:00.022,064] <err> os: Faulting instruction address (r15/pc): 0x00050030
    [00:00:00.022,155] <err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
    [00:00:00.022,186] <err> os: Current thread: 0x200042b8 (unknown)
    [00:00:00.215,148] <err> os: Halting system

Children
  • samtday said:
    Which version should I go to - 3.0.0 or 3.0.1?

    3.0.1. The last digit is just for bug-fixes, no API changes. 

    It is strange that you have issues with any version, though let's start focusing on v3, and see what the logs look like there.

    Regards,

    Elfving

  • Are there changes I should be aware of transitioning from 2.9.0 or am I good to just adjust the build configuration and run with it?

  • It seems the transition to v3.0.1 would require me to begin from an entirely different project (after downloading the 'Amazon Sidewalk Add-on') to be able to include the sidewalk SDK. Is this what you expect given I am currently working on v2.9.0. Is there a way to point my current project to the appropriate version instead of having to start from scratch in the new SDK?

  • I was able to migrate to the newest versions of the SDK and build a fresh example of sid_end_device with the only change being the addition of 'CONFIG_NANOPB=y' to prj.conf and it is still not running appropriately.

  • samtday said:
    It seems the transition to v3.0.1 would require me to begin from an entirely different project (after downloading the 'Amazon Sidewalk Add-on') to be able to include the sidewalk SDK. Is this what you expect given I am currently working on v2.9.0.

    Not at all, I am just trying to figure out what is wrong here by giving us the same baseline (given that I allready tested this on NCS 3 etc.). If you already have a large project set-up on NCS 2.9 we can continue with NCS 2.9 Slight smile Though I would suggest to start off by looking at the default sample instead of the project you have, as there could be other things that you've added that makes it run into this issue. Please try the default sample and let me know how it goes.

    samtday said:
    I was able to migrate to the newest versions of the SDK and build a fresh example of sid_end_device with the only change being the addition of 'CONFIG_NANOPB=y' to prj.conf and it is still not running appropriately.

    What do you mean by it not running appropriately? Do you get a build error?

    Regards,

    Elfving

Related