Hello,
I am using SysBios 6.37.02.27 on a dual-Cortex M4 in SMP mode (Jacinto6, i.e. DRA7xx). Occasionally, we see the following error message:
cat /d/remoteproc/remoteproc0/trace0
[t=0x00000001:3376844b] ti.sysbios.knl.Task: ERROR: line 1817: assertion failure: A_sleepTaskDisabled: Cannot call Task_sleep() while the Task scheduler is disabled.
ti.sysbios.knl.Task: line 1817: assertion failure: A_sleepTaskDisabled: Cannot call Task_sleep() while the Task scheduler is disabled.
xdc.runtime.Error.raise: terminating execution
The error varies slightly. Sometimes it complains about other blocking functions like Semaphore_pend(). However, we neither use Task_disable or Swi_disable in our code (which both disable the task scheduler). The only synchronization primitives that we use are Hwi_disable and sempahores.
This is a list of API functions that we call within a Hwi_disable section:
malloc
free
memset
vsnprintf
System_printf
Event_create
Event_post
Event_getPostedEvents
Event_pend with last parameter BIOS_NO_WAIT -> ok according to docu!
Event_delete
Error_check
Is there anything suspicious?
I already searched to forum, but did not find any satisfying answer. The example posted here () is trivial as it is documented behavior.
Thus, I have the following questions:
- Which SysBios API functions do actually disable the Task scheduler? So far I know of Task_disable() and Swi_disable(). Are there any other functions which might do this (maybe as a side-effect)?
- What is the meaning of "Disabling the Task Scheduler" when running in SMP mode? Does this only disable the scheduling on the core that called this function or does it disable the scheduling on all cores?
- If the answer is on all cores, how is a task that is running on the other core supposed to know that somebody else called to disable the scheduler? I think in this case, SysBios would be fundamentally broken as you could NEVER call any blocking API. You could never be sure that just in the moment some other code running on the other core disabled the scheduler.
(This is why I assume it only disables the scheduling on the core that called Task_disable() or Swi_disable()).
- If the answer is "only the task that called it", then if we get a stack trace (or set a breakpoint in the Error function), there must be a call to some task-disabling function in the call-chain of this particular task, correct? As far as I understand, it cannot be in any other task. Could you please confirm if this understanding is correct?
- Is there any SysBios configuration that needs to be changed when enabling SMP mode? Maybe the Task_disable() call resides in one of the SysBios modules (e.g. Logging module) because it is configured to use a certain Gate-Type that is not suitable for SMP? Would this be detected somehow?
Background: I spotted this here:
"Use these SMP-aware clone modules in place of their xdc.runtime equivalents:
• SysMin, SysStd, LoggerBuf (in ti.sybios.smp package)"
Found in http://processors.wiki.ti.com/images/1/14/Public_SmpBiosSlides.pdf
Is this mandatory or just optional?
Our SysBios configuration can be found here: http://pastebin.com/CsWsrBga
Thanks.
Best Regards,
Matthias