Hi,
I am running a simple which uses Shell and another task which uses printf to print out some debug info.
Occasionlly, I got this on the Hyperterminal:
Terminating shell.
Shell exited, restarting.....
Does anyone know the cause of the shell restarting or point me the direction to look at it?
Thanks
Jeff
Solved! Go to Solution.
PetrM,
Thanks for your reply.
I found the cause of my problem:
I use direct interrupt in my code. I use Event to signal other task that an interrupt has occured. This causes a lot of problems--- sometime Shell restarts, sometime unexpected exceptions........
So I changes the code to use a global variable to signal the interrupt event. below is the code snip.
In the MQXUG, on page154 it reads:
"It must not call any MQX functions" when user uses replacement ISR.
So without using MQX Event, what is the best method to communcate between ISR and other task?
Regards,
Jeff
---------------------------------------------------------------------------------------------------------
__declspec(interrupt:0) void new_irq7_isr ( pointer user_isr_ptr )
{
VMCF5225_STRUCT_PTR reg_ptr = (VMCF5225_STRUCT_PTR)BSP_IPSBAR;
//switch caused IRQ
reg_ptr->EPORT->EPFR |= MCF522XX_EPORT_EPFR_EPF7; //DES Clear IRQ7 interrupt flag
intcnt++;
if ( intcnt > MAX_INT_CNT )
intcnt =0;
// _lwevent_set(&ISR7_Event,ISR7_EVENT);
}
---------------------------------------------------------------------------------------------------------------------------------
I had this problem when there was not enough memory left.
There can be also problem with stack size of the shell task.
PetrM
PetrM,
Thanks for your reply.
I found the cause of my problem:
I use direct interrupt in my code. I use Event to signal other task that an interrupt has occured. This causes a lot of problems--- sometime Shell restarts, sometime unexpected exceptions........
So I changes the code to use a global variable to signal the interrupt event. below is the code snip.
In the MQXUG, on page154 it reads:
"It must not call any MQX functions" when user uses replacement ISR.
So without using MQX Event, what is the best method to communcate between ISR and other task?
Regards,
Jeff
---------------------------------------------------------------------------------------------------------
__declspec(interrupt:0) void new_irq7_isr ( pointer user_isr_ptr )
{
VMCF5225_STRUCT_PTR reg_ptr = (VMCF5225_STRUCT_PTR)BSP_IPSBAR;
//switch caused IRQ
reg_ptr->EPORT->EPFR |= MCF522XX_EPORT_EPFR_EPF7; //DES Clear IRQ7 interrupt flag
intcnt++;
if ( intcnt > MAX_INT_CNT )
intcnt =0;
// _lwevent_set(&ISR7_Event,ISR7_EVENT);
}
---------------------------------------------------------------------------------------------------------------------------------
Hello,
there is no trivial way to communicate between ISR and task without synchronization in more complicated data-access schematics.
You can for example set a flag in global variable.
If there is only one task waiting for that flag, the task can scan periodically for the "data ready" flag.
If there are more tasks waiting for data, on ColdFire you have to use TAS instruction.
Note that in any case, your waiting-for-signal-tasks cannot be blocked by operating system.