v01d commented on pull request #2735: URL: https://github.com/apache/incubator-nuttx/pull/2735#issuecomment-768262291
Also, I'm supposed to avoid any concurrent calls to SDC/MPL functions. I added semaphores for mutual exclusion. But it seems that I should also not interrupt these calls so I added critical sections around them. I'm not entirely sure that is correct (I get confused with sched_lock, irqsave and critical section). For reference, this is what the SDC docs require: > Low priority is used for background tasks that are not directly tied to the radio or scheduling. These tasks are designed in such a way that they can be interrupted by high priority code. The tasks are however not designed to be interrupted by other low priority tasks. Therefore, make sure that only one MPSL API function is called from the application at any time. > > All protocol stacks using MPSL must be synchronized (i.e. not called concurrently) to avoid concurrent calls to MPSL functions. > > Application must only call MPSL APIs from non-preemptible threads, or with interrupts disabled (e.g. during initialization). > > The mpsl_low_priority_process() function should only be called from thread context, i.e. not directly from the software interrupt handler. > > Alternatively, you can use synchronization primitives to ensure that no MPSL functions are called at the same time. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org