Page 1 of 1

NetBurner MOD5270 restarts by itself

Posted: Sat Jun 23, 2012 1:32 pm
by dkoste01
Hello,
I have been working on an application for my internship, which allows connections via TCP and updates via FTP. I am almost done with my application, but I have encountered a weird problem which I cannot seem to solve. I have used the TCPMultiSocket example as a base, and went from there on. During a few of my tests, everything worked as expected, but with my latest version, which incorporated FTP client capabilities and access to the SD card, for some reason after entering 2-3 commands, the controller restarts itself as I see on the Mttty Terminal, as seen below.

Code: Select all

Waiting 2sec to start 'A' to abort
Configured IP = 0.0.0.0
Configured Mask = 0.0.0.0
MAC Address= 00:03:f4:02:63:a9
Trying DHCP
DHCP assigned the IP address of :192.168.1.128
FAT mount to SD/MMC successful
SD/MMC drive change successful
Listening for incoming connections on port 23
Added connection on fd[0] = 35, 192.168.1.137:45978
Report Client command was received.
Waiting 2sec to start 'A' to abort
Configured IP = 0.0.0.0
Configured Mask = 0.0.0.0
MAC Address= 00:03:f4:02:63:a9
Trying DHCP
DHCP assigned the IP address of :0.0.0.0
FAT mount to SD/MMC successful
SD/MMC drive change successful
Listening for incoming connections on port 23
I tried using the debugger to see what happens, but when using the debugger, the program works as intended. Any help would be greatly appreciated. Also, if anything else is needed from my code, I will provide that.

Re: NetBurner MOD5270 restarts by itself

Posted: Sat Jun 23, 2012 10:37 pm
by tod
Do you have a call to EnableSmartTraps(); somewhere in your main startup code?
I'm thinking you've made some change that is causing the NetBurner to trap but typically I always see trap diagnostic info but since I always EnableSmartTraps() I'm not sure what it looks like if you don't have it on. Turning it on "may" help you narrow down the problem. Often though a trap occurs at some point after the actual error, every now and then though it can lead you right to it.

The only time I've ever seen a NetBurner restart without trap information was when the power supply was on the edge of providing enough power and something would cause enough of a power drain to make it dip below the threshold and the processor would just restart.

Do you use version control software? If so run a diff between the working build and the current build. One easy way to make the processor trap is to change the type of a variable (say from int to float) but then not change a printf command that prints that value out. There are of course many other ways, mostly involving bad pointer usage.

You can also update your working folder back to the changeset that was working correctly, start a new branch and then add the changes one at a time until you see the problem.

Alternately try commenting out all the FTP changes, if that doesn't work comment out all the SD Card changes. Divide and conquer.

Re: NetBurner MOD5270 restarts by itself

Posted: Mon Jun 25, 2012 12:26 pm
by dkoste01
I commented out one of my functions and the SmartTraps was able to output a report to Mttty this time.

Code: Select all

-------------------Trap information-----------------------------
Exception Frame/A7 =20002788
Trap Vector        =Access Error (2)
Format             =04
Status register SR =2000
Fault Status       =08
Faulted PC         =2000278C

-------------------Register information-------------------------
A0=200027CB A1=20006A00 A2=0204084C A3=0204069A
A4=02018770 A5=020187B0 A6=20002790 A7=20002788
D0=0000000E D1=00002000 D2=00000001 D3=200027E0
D4=200027E8 D5=00000024 D6=200027CB D7=0202B86E
SR=2000 PC=2000278C
-------------------RTOS information-----------------------------
The OSTCBCur current task control block = 20000664
This looks like a valid TCB
The current running task is: Main#32
-------------------Task information-----------------------------
Task    | State    |Wait| Call Stack
Idle#3F|Ready     |    |0200AE0C,02009204,0
Main#32|Running   |    |2000278C,0
TCPD#28|Semaphore |0002|0200AA5E,0201764E,02009204,0
IP#27|Fifo      |000E|02009F3C,0200D678,02009204,0
Enet#26|Fifo      |0026|02009F3C,020060E4,02009204,0

-------------------End of Trap Diagnostics----------------------
I am assuming something happens with one of my containers, is that correct?

Re: NetBurner MOD5270 restarts by itself

Posted: Mon Jun 25, 2012 2:31 pm
by dkoste01
I was able to solve the problem. :D