We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello to all!
Is possible to make a call to a SWI routine from a FIQ Handler when you are using the RTX Kernel?
I try this approach but a UNDEFINED exception occurs on exit of SWI function. See the code below:
void FIQCapture (void) __irq { static U32 ticksCounter = 0; ticksCounter++; if (ticksCounter > ((U32) 5)) { // Call freqMsrSignal in Fast Interrupt Mode freqMsrSignal(0x0001, &taskMeasureLoop); ticksCounter = 0; } // Match 0 asserted. Clear. T0IR = 1 << 0; } void __swi(8) freqMsrSignal(U16 event_flags, OS_TID *task); void __SWI_8 (U16 event_flags, OS_TID *task) { // Increment the SWI_Times in Supervisor Mode SWI_Times++; // Call a RTX function in Supervisor Mode os_evt_set(event_flags, *task); /// The context switch was: User->FIQ->Supervisor return; }
With this manner, I can call OS Functions from a FIQ Handler, my goal.
However, after run freqMsrSignal the system are switch to Undefined context
Undef_Handler B Undef_Handler
The code run the branch above (in a endless loop).
I use the uVision 3.50. Any suggestions?
Thanks a lot for replying.
I can't make the calls as regular functions. In the FIQ context, we can't make any OS calls (it's RL-ARM specific implementation).
I need to use the FIQ for priority reasons (the Vectored IRQ may be disable by RTOS in an unpredictable time).
In the FIQ I will make only very basic services. However they are deterministic services and need to be process with a very low jitter. Another task will be responsable to process the noncritical data. Is like a bottom/top half approach.
An easy way to make this is set a flag in FIQ context. Another task, in user context, can check the content of this flag by pooling. If is possible, I would like to use a more "polite" way: call OS functions from a FIQ Handler to wakeup a task (using a real IPC communication).
I try run this code in a MCB2300 board (with LPC2378).
Any suggestions?
Try using isr_evt_set() instead of os_evt_set()
I changed the code but the results are the same...
Maybe you have a problem with the stack size of the FIQ stack. Did you check this?
Thanks by your response.
Yes, I check the FIQ stack size. I set 200 bytes for this.
RTX function calls from FIQ handler are not allowed. You will always get problems if you are trying to use them from the FIQ interrupt handler.