Hi everybody
I use SAM7x512 and RL-ARM OS. here, OS has 7 tasks and one of them is for CAN receiver. OS_TICK is 1000 and OS_STKSIZE is 1024. and 500000 is my CAN baudrate(my board is just receiver and transmitter is a KVASER PCI CAN Interface).
speed of data transmission is my problem.
when for example transmitter side of CAN bus send a packet per 10ms or more there is know any problem but when I try to increase the speed after some packet (about 200 messages or more) I will get OS_ERR_FIFO_OVF in os_error function. but when I disable the CAN task all other task are working as well.
note: When the system is getting crash and doesn't do any tasks but it's not in os_error function in debug mode with ulink2 sometimes task of CAN in "RTX task and system" -> "stack load" shows "under flow" and after that it calls os_error (in usual states it's about 3% of stack usage)
I tried such works:
1. increase OS_STKSIZE 2. increase OS_FIFOSZ 3. increase CAN_No_ReceiveObjects 4. chaning the OS_TICK
but nothing happened
Does anyone know what I should do?
Hi there is nobody to help me!!! such a good forum!!!
I found somethings else but the problem still exist.
in my project I used Ethernet TCP too.
sometimes before the system get crashed, OS is alive but doesn't do any tasks and when I paused ulink2 to debug, I found it the program involved between CAN IRQ and Ethernet IRQ service routine and never get out of there until WDT restart the system.
I thought I have to use nesting interrupt method. but I don't know how because I found two method to cop such a thing
1. using the method which is mentioned here: http://www.keil.com/support/docs/2910.htm (IENABLE and IDESABLE)
2. using the method which is mentioned in RL-ARM_gs.pdf something like this (page 30):
void Task3 (void) { while (1) { os_evt_wait_or (0x0001, 0xffff); // Wait until ISR triggers an event … // Handle the interrupt } // Loop and go back to sleep }
void IRQ_Handler (void) __irq { isr_evt_set (0x0001, tsk3); // Signal Task 3 with an event EXTINT = 0x00000002; // Clear the peripheral interrupt flag VICVectAddr = 0x00000000; // Signal end of interrupt to the VIC }
I've used both but the problem is still exist.
please help me
thanks
* Try increasing the priority of the CAN task. Too many signals are piling up without being handled which causes the failure. * Try to limit the time the scheduler is disabled. * Don't use nested interrupt. Unlikely to help and introduced a risk of stack overflow. * Try to speed up general interrupt handling.
Is your CAN interrupt "efficient"? Are you storing messages in a buffer, to later be handled by a task or are you blocking the interrupt system while handling the message?
Are you sure there is no interrupt left handing leading to this problem...? Are you acknowledging all interrupts under all circumstances?
View all questions in Keil forum