Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/rtos/rtos-zephyr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export class RTOSZEPHYR extends RTOSCommon.RTOSBase {
resolve();
} catch (e) {
console.log('RTOSZEPHYR.getThreadInfo() error', e);
resolve(); // show the threads found so far instead of hanging the panel
}
},
(e) => {
Expand Down Expand Up @@ -410,7 +411,8 @@ export class RTOSZEPHYR extends RTOSCommon.RTOSBase {
return stackInfo;
}

const TopOfStack = callee_saved.psp.val; // FIXME This is not right for all arches => include\zephyr\arch\....\thread.h
// the saved stack pointer is 'psp' on Cortex-M and 'sp' on RISC-V (include/zephyr/arch/*/thread.h)
const TopOfStack = (callee_saved.psp ?? callee_saved.sp)?.val;
stackInfo.stackTop = parseInt(TopOfStack);

/* only available with CONFIG_THREAD_STACK_INFO (optional) */
Expand Down
Loading