Page 1 of 1

mod5234 failure debugging

Posted: Mon Jun 09, 2008 1:28 am
by cegelec
Hallo,
I wrote an application to resend ethernet packet to the serial ports. Now the applicaton from time to time restarts and I don't know why. Is there any instrument or documentation wich describes how to interpret Trap informations?

this is what it wrote to the serial port before the reset in "release" mode although that TrapEnable function is use only in debug mode. If the application runs in debug mode, the debugger stops in Idle process and it is not possible to run the application and I have to load the FactoryDemo through serial port.

Does anybody know, where can be the problem? Is there a limit of count of tasks? the faulted PC address is not possible to decode using WinAddr2Line. If somebody knows how to continue to solve the problem, please let me know.

Thank You,
Jan Mrazek


-------------------Trap information-----------------------------
Exception Frame/A7 =0205A254
Trap Vector =Access Error (2)
Format =01
Status register SR =2004
Fault Status =04
Faulted PC =B60E0000

-------------------Register information-------------------------
A0=B60E0000 A1=020C107E A2=020C1010 A3=02015DD6
A4=00000000 A5=020C1070 A6=0205A27C A7=0205A254
D0=00000044 D1=00000001 D2=00000044 D3=0205A274
D4=0000006F D5=0200FBE4 D6=02012C5E D7=0201DA3C
SR=2004 PC=B60E0000
-------------------RTOS information-----------------------------
The OSTCBCur current task control block = 020D5130
This looks like a valid TCB
The current running task is: IP ,#27
-------------------Task information-----------------------------
Task | State |Wait| Call Stack
Idle,#3F|Ready | |0200E428,0200DF6C,0
Main,#32|Timer |000F|0200E726,02000932,0200DF6C,0
TCP ,#28|Semaphore |0000|0200EDFE,0201A670,0200DF6C,0
IP ,#27|Running | |B60E0000,0
Esnd,#26|Fifo |0022|0200FD16,02020BF4,0200DF6C,0
User,#1E|Semaphore |0000|0200EDFE,02000618,0200DF6C,0
User,#2F|Fifo |0000|0200FD16,02016E34,02005B68,0200DF6C,0
User,#30|Fifo |0000|0200FD16,02016E34,02005194,0200DF6C,0
User,#23|Semaphore |0000|0200EDFE,02000A4E,0200DF6C,0
User,#20|Semaphore |0000|0200EDFE,0201D7E6,02009004,020091C2,02004696,
User,#21|Semaphore |0000|0200EDFE,0201D7E6,02009004,020091C2,02003154,
HTTP,#2D|Semaphore |0000|0200EDFE,02019B82,0201B80C,0200DF6C,0

-------------------End of Trap Diagnostics----------------------

Re: mod5234 failure debugging

Posted: Mon Jun 09, 2008 4:44 am
by rsg
First step - use winaddr2line to determine the faulting instruction in your source code. From your listing, the value you enter is B60E0000, which is listed on the line starting with "Faulted PC"...

HTH,
-Bob

Code: Select all

-------------------Trap information-----------------------------
Exception Frame/A7 =0205A254
Trap Vector =Access Error (2)
Format =01
Status register SR =2004
Fault Status =04
Faulted PC =B60E0000

Re: mod5234 failure debugging

Posted: Mon Jun 09, 2008 5:42 am
by cegelec
I tried to do that, but the address was not found in my *.elf file:(
The result was
??
??:0

Re: mod5234 failure debugging

Posted: Mon Jun 09, 2008 6:35 am
by Chris Ruff
Unfortunately, that is the usual experience when you invoke winaddr2line . winaddr2line is brilliant when you blow it in your code, but more often than not you corrupt the stack and it blows up in a non-documented spot.

Back out your recent code to prove it is OK again, and then look for the spot where you have the memory leak, or automatic variable array that steps over the index line

Chris

Re: mod5234 failure debugging

Posted: Mon Jun 09, 2008 11:18 pm
by cegelec
There must be a memory leak somewhere, but I don't know how to find out it. The debug report says, that there is a task #27 running (if I understand it well, that's a hex number) so that means IP task is in progress, when application corrupts. I can't put any breakpoint or so into this task. Is it possible to decode e.g. the Exception Frame/A7 somehow or what does mean Fault status = 04... It may be helpful... Or is there any tool how to decode what made an error by reading the IP packet?

Jan Mrazek

Re: mod5234 failure debugging

Posted: Tue Jun 10, 2008 5:11 am
by cegelec
It seems that the problem raises only if I listen to 12 UDP ports. I have listened for 10 UDP ports now for 2hrs and everything was OK, I made no other change in my application code. I have two FIFOs, on one I have 7 registered UDP ports on the other one there are 3 UDP ports registered. I use it as the interface switch (every interface has correspondet UDP port). May there be a limit of 10 UDP ports or should I resize some buffers? (I tried to resize all IP buffers in consts.h but without effect...)

Jan Mrazek

Re: mod5234 failure debugging

Posted: Mon Jun 16, 2008 12:25 am
by cegelec
The problem was, there is limit of 10 UDP ports as default. If You want to listen to more UDP, you have to rewrite the UDP_DISPATCH_SIZE constant in "constants.h" and rebuild the netburner system files. It seems it works.

Jan Mrazek