Mod5213 Reset during running, any bug?

Discussion to talk about software related topics only.
Post Reply
Haiyang
Posts: 11
Joined: Wed Mar 09, 2011 8:45 am

Mod5213 Reset during running, any bug?

Post by Haiyang »

Hi, all. I am using Mod5213 to collect data from spi and transmit to UART in 50Hz. My code is working OK. But yesterday I got reset when my code was still running. I can't tell where is the problem. Anybody can tell me what the error msg says? Or is there a place I can check what the error means? One thing not good in my code is that I am printing some variables in 50Hz to UART using printf directly. I was using mtty to receive the file.

Thanks in advance.

-------------------Trap information-----------------------------
Exception Frame/A7 =20001CC4
Trap Vector =Access Error (2)
Format =03
Status register SR =2704
Fault Status =0C
Faulted PC =FFC06966

-------------------Register information-------------------------
A0=20001822 A1=00000000 A2=000000A2 A3=000000A3
A4=000000A4 A5=000000A5 A6=20001CC4 A7=20001CC4
D0=20001D28 D1=00000000 D2=000000D2 D3=000000D3
D4=000000D4 D5=000000D5 D6=000000D6 D7=000000D7
SR=2704 PC=FFC06966
-------------------RTOS information-----------------------------
SR indicates trap from within ISR or CRITICAL RTOS section
The OSTCBCur current task control block = 00000000
This is not a valid TCB the RTOS has been corrupted
-------------------Task information-----------------------------
Task | State |Wait| Call Stack
Idle,#3
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: Mod5213 Reset during running, any bug?

Post by tod »

See http://wiki.embeddedethernet.com/Suppor ... _fix_traps

In my experience the easiest way to cause a trap involves using printf and mismatching the format string with the variable, that is you specify something like %d but then you send a float. Often happens after you change the type of a variable.

Which is why <mount platform='soapbox'> if you use printf/sprintf you should read: The printf is dead, long live cout in the wiki. </mount>
Haiyang
Posts: 11
Joined: Wed Mar 09, 2011 8:45 am

Re: Mod5213 Reset during running, any bug?

Post by Haiyang »

Thanks, tod. That is a good point. I will check it out.
I guess it is time to start programming in C++ for Nburner.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Mod5213 Reset during running, any bug?

Post by rnixon »

Could also be a stack overflow, array indexed out of range, or wild pointer. Be careful with C++, the stack overflow problem can be worse when instances are instantiated as autovars.
Post Reply