Hi folks,
I am debugging a very hard to reproduce issue and after a very long analisys I am thinking it is tied to a SWI that is not being executed on time, please see the below description:
- DSP/BIOS version 5.33.04
- DSP 64P (on OMAP3430)
- mySWI (dynamically created) with priority of 8 and initial mailbox value of 0x1 is posted from a HWI as follows:
SWI_andn(mySWI, 0x1);
- sleep_SWI (dynamically created) with priority of 8 is posted from the idle task (TSK object of priority 0) as follows:
SWI_or(sleep_SWI,sleepCode);
sleep_SWI is intended to put the DSP to Sleep via a call to: PWRM_sleepDSP(sleepCode, sleepArgs, 0); we return only when an OMAP mailbox interrupt pulls us out of sleep state.
When the application hangs I connected the JATG and CCS and I could see that the SWI running is sleep_SWI I guess the DSP is sleeping, waiting for the OMAP mailbox interruption, also the CCS shows the Program Counter nearby to the __PWR_doIdle assembly symbol.
I am thinking that the first SWI to be posted (I mean put in the scheduler ) is the sleep_SWI; then the HWI occurs and mySWI is also scheduled and the HWI ends; then the DSP/BIOS scheduler takes the control and sleep_SWI is executed (because it was posted first), this means that the DSP will be put in sleep; and mySWI will never be executed since the sleep_SWI is running and nothing can preempt it (only a OMAP mailbox interrupt can). With this situation the application will hang.
Is the above scenario posible?
If yes, if I am able to send the OMAP mailbox INTr the DSP will wake up and the scheduler will execute the peding SWI mySWI?
Is it posible to know if there are other SWIs already in the sheduler before put the DSP to Sleep?
I will appreciate your inputs, any idea can help.
Regards,
Armando.