You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nanostack-hal: add alternative critical section implementation
The nanostack hal's critical section uses a mutex for mutual exclusion,
which is nice for many use cases. But when one needs to use the critical
section from interrupts, the RTX will have a assertion failure and panic.
Add a configurable for mbed_lib, which can be used to enable a alternative
version of critical section, which uses the underlying OS primitives, which
disables the interrupts.
Note: the default behavior is not changed, one needs to override the
"nanostack-hal.critical-section-usable-from-interrupt" to have "true".
Reason for this change is that there is a need for sending events using
nanostack event queue from interrupt context, eg. from a socket callback.
Copy file name to clipboardExpand all lines: features/FEATURE_COMMON_PAL/nanostack-hal-mbed-cmsis-rtos/mbed_lib.json
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,10 @@
8
8
"event_loop_thread_stack_size": {
9
9
"help": "Define event-loop thread stack size.",
10
10
"value": 6144
11
+
},
12
+
"critical-section-usable-from-interrupt": {
13
+
"help": "Make critical section API usable from interrupt context. Else a mutex is used as locking primitive. Consult arm_hal_interrupt.c for possible side effects on interrupt latency.",
0 commit comments