RAKWireless / RAK4630-Amazon-Sidewalk-Example

Example code for Sidewalk application on the RAK4630/RAK4631
MIT License
3 stars 1 forks source link

Fault during interrupt handling in unmodified demo code #1

Closed ryanfeist2 closed 8 months ago

ryanfeist2 commented 8 months ago

Compiling unmodified code and running it on RAK4631 produces the following error over the RTT interface. Patch has been applied prior to building. Please help me understand what is happening.

Booting Zephyr OS build v3.3.99-ncs1

nrf v2.4.0 sidewalk v1.14.3-88-g81357f9 zephyr v3.3.99-ncs1

sidewalk_fork_point = 0000000000000000000000000000000000000000 build time = 2024-03-06 15:19:21.795361+00:00

[00:00:00.004,302] sm_main: Main regulator status: High voltage mode. Voltage supplied on VDDH. [00:00:00.011,322] fs_nvs: 2 Sectors of 4096 bytes [00:00:00.011,352] fs_nvs: alloc wra: 0, fd0 [00:00:00.011,352] fs_nvs: data wra: 0, 64 [00:00:00.011,383] sm_main: Sidewalk demo started! [00:00:00.013,793] sm_task: Initializing sidewalk with BLE & LoRa link mask. [00:00:00.412,017] sid_ble: Enable BT [00:00:00.412,628] bt_sdc_hci_driver: SoftDevice Controller build revision: e0 7e 2e c1 5e 05 85 23 46 15 dc fa 8e 29 7d 70 |.~..^..# F....)}p 10 93 a5 fc |....
[00:00:00.412,811] sm_task: Starting sidewalk_receive_task ... [00:00:00.416,656] bt_hci_core: HW Platform: Nordic Semiconductor (0x0002) [00:00:00.416,687] bt_hci_core: HW Variant: nRF52x (0x0002) [00:00:00.416,717] bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 224.11902 Build 2231721665 [00:00:00.418,304] bt_hci_core: Identity: C8:7E:34:57:AB:DF (random) [00:00:00.418,334] bt_hci_core: HCI: version 5.4 (0x0d) revision 0x1077, manufacturer 0x0059 [00:00:00.418,365] bt_hci_core: LMP: version 5.4 (0x0d) subver 0x1077 [00:00:00.418,395] sid_ble: BT initialized [00:00:00.472,869] sm_callbacks: Status changed: not ready [00:00:00.472,930] sm_callbacks: Device Unregistered, Time Sync Fail, Link Status Mask = 0 [00:00:00.472,961] sm_task: Starting sidewalk_main_task ... [00:01:00.094,268] my_tasks: temp: 27.082855 [00:01:00.094,268] my_tasks: hum: 31.493095 [00:01:00.094,299] my_tasks: Sidewalk link is not ready!!! [00:01:00.094,329] my_tasks: State: 0, Ready: 0 ASSERTION FAIL [!arch_is_in_isr()] @ WEST_TOPDIR/zephyr/kernel/mutex.c:101 mutexes cannot be used inside ISRs [00:01:21.411,407] os: r0/a1: 0x00000004 r1/a2: 0x00000065 r2/a3: 0x00000002 [00:01:21.411,437] os: r3/a4: 0x20003c10 r12/ip: 0x00000000 r14/lr: 0x00039373 [00:01:21.411,437] os: xpsr: 0x41000021

[00:01:21.411,529] os: fpscr: 0x00000000 [00:01:21.411,560] os: Faulting instruction address (r15/pc): 0x0006537c [00:01:21.411,621] os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0 [00:01:21.411,621] os: Fault during interrupt handling

[00:01:21.411,682] os: Current thread: 0x20004a88 (swi_thread) [00:01:21.864,959] os: Halting system

hallard commented 8 months ago

Just cloned following readme instruction worked like a charm for sample dut,

west init -m https://github.com/RAKWireless/RAK4630-Amazon-Sidewalk-Example rak-sid-workspace
cd rak-sid-workspace/
west update
cd rak-sid/
west patch
west build -p -b rak4631_nrf52840 app/rak4631_sid_dut/

notice sidewalk is not on same version vs yours

*** Booting Zephyr OS build v3.3.99-ncs1 ***
----------------------------------------------------------------
nrf                  v2.4.0
sidewalk             v1.14.3-89-g8c6c218
zephyr               v3.3.99-ncs1
----------------------------------------------------------------
sidewalk_fork_point = 0000000000000000000000000000000000000000
build time          = 2024-03-09 12:54:08.866033+00:00
----------------------------------------------------------------
uart:~$ 

not sure what's going on on your side

ryanfeist2 commented 8 months ago

Hi @hallard, thanks for your feedback. It turns out that I wasn't running a completely unmodified rak4631-rak1901-demo code and had some faulty lines of code inserted that were halting the thread at runtime. It works now. Thanks for your support!