Skip to content

Commit 164944f

Browse files
moyamartinktaborowski
authored andcommitted
fix: crash on app_event_run_engine on scan with SID_LOCATION_METHOD_WIFI
By configuring `sid_location_config` with `.sid_location_type_mask = SID_LOCATION_METHOD_WIFI` the `mw_wifi_scan_service_on_update` crashes with the following stack trace: [00:00:02.012,512] <err> os: ***** BUS FAULT ***** [00:00:02.012,542] <err> os: Precise data bus error [00:00:02.012,542] <err> os: BFAR Address: 0xfab24321 [00:00:02.012,542] <err> os: Imprecise data bus error [00:00:02.012,573] <err> os: r0/a1: 0x00000000 r1/a2: 0xfab242cd r2/a3: 0x00000000 [00:00:02.012,603] <err> os: r3/a4: 0x0004f93d r12/ip: 0x00000002 r14/lr: 0x00034235 [00:00:02.012,603] <err> os: xpsr: 0x61000021 [00:00:02.012,634] <err> os: s[ 0]: 0x00000000 s[ 1]: 0x00000000 s[ 2]: 0x00000000 s[ 3]: 0x0004f93d [00:00:02.012,634] <err> os: s[ 4]: 0x20012808 s[ 5]: 0x200127f8 s[ 6]: 0x20022e88 s[ 7]: 0x00034235 [00:00:02.012,664] <err> os: s[ 8]: 0x00000000 s[ 9]: 0x20022e88 s[10]: 0x200024a0 s[11]: 0x00000000 [00:00:02.012,664] <err> os: s[12]: 0x00000000 s[13]: 0x00000000 s[14]: 0x00000000 s[15]: 0x00083d6f [00:00:02.012,695] <err> os: fpscr: 0x00000002 [00:00:02.012,695] <err> os: r4/v1: 0xfab24285 r5/v2: 0x00000000 r6/v3: 0x00000000 [00:00:02.012,725] <err> os: r7/v4: 0x20000bb4 r8/v5: 0x20012800 r9/v6: 0x00000000 [00:00:02.012,725] <err> os: r10/v7: 0x00000000 r11/v8: 0x00000003 psp: 0x2001d1d8 [00:00:02.012,725] <err> os: EXC_RETURN: 0xfffffff1 [00:00:02.012,756] <err> os: Faulting instruction address (r15/pc): 0x0004f94c [00:00:02.012,786] <err> os: >>> ZEPHYR FATAL ERROR 26: Unknown error on CPU 0 [00:00:02.012,786] <err> os: Fault during interrupt handling [00:00:02.012,817] <err> os: Current thread: 0x2000cb80 (logging) [00:00:02.187,377] <err> os: Halting system This PR addresses this issue by correctly handling the type of event in `app_event_run_engine` Signed-off-by: Martin Moya <moyamartin1@gmail.com>
1 parent 6438e91 commit 164944f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

subsys/semtech/lr1110_location/sid_pal_gnss_wifi_impl.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,13 @@ static sid_error_t schedule_lbm_timer(uint32_t delay_ms) {
8989
}
9090

9191
void app_event_run_engine() {
92-
location_state.wifi_cfg.on_wifi_event(location_state.gnss_cfg.ctx, EVENT_TYPE_LBM, 0);
92+
if(location_state.wifi_cfg.on_wifi_event) {
93+
location_state.wifi_cfg.on_wifi_event(location_state.wifi_cfg.ctx, EVENT_TYPE_LBM, 0);
94+
} else if(location_state.gnss_cfg.on_gnss_event) {
95+
location_state.gnss_cfg.on_gnss_event(location_state.gnss_cfg.ctx, EVENT_TYPE_LBM, 0);
96+
} else {
97+
SID_PAL_LOG_WARNING("Location event callback not set");
98+
}
9399
}
94100

95101
sid_error_t sid_pal_common_process_event() {

0 commit comments

Comments
 (0)