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
I think we could try to remove critical sections from rfmgmt code entirely. The only usage of rfmgmt outside LL task context seems to be the rfmgmt timer, at least this is the only I could find after a quick scan though the code. If we change that to either send an event to LL queue in order to serialize rfmgmt calls or replace the timer with a callout, critical sections should not be necessary.
Ah, I've just realized that sending an event from timer callback is not great idea as this would delay rfmgmt enable a bit which is not what we want there...
gmarull
added a commit
to teslabs/pebble-firmware
that referenced
this issue
Mar 7, 2025
So that we do not hit assertions when called from critical section
context.
See apache/mynewt-nimble#2004
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
gmarull
added a commit
to pebble-dev/pebble-firmware
that referenced
this issue
Mar 7, 2025
So that we do not hit assertions when called from critical section
context.
See apache/mynewt-nimble#2004
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
In the following controller code:
mynewt-nimble/nimble/controller/src/ble_ll_rfmgmt.c
Lines 285 to 300 in 7b14eab
ble_ll_event_add
is called while inside a critical section. This calls:mynewt-nimble/nimble/controller/src/ble_ll.c
Lines 1426 to 1430 in 7b14eab
In case of FreeRTOS,
mynewt-nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h
Lines 100 to 104 in 7b14eab
mynewt-nimble/porting/npl/freertos/src/npl_os_freertos.c
Lines 60 to 80 in 7b14eab
As you can see above,
xQueueSendToBack
is called withportMAX_DELAY
. I guess at the very least, we should add a zero delay if we're within a critical section. Also, see https://forums.freertos.org/t/critical-sections-freertos-api-calls/17352.The text was updated successfully, but these errors were encountered: