MOD5282 SmartTrap not working

Discussion to talk about software related topics only.
Post Reply
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

MOD5282 SmartTrap not working

Post by sulliwk06 »

When I enable smart traps and cause a trap, I'm only seeing the device reboot, I'm not seeing the smart trap output. I'm connected to UART0 which is set as the debug port, I'm not in debug mode. I don't actually see the trap like I normally do when smart traps are not enabled, so I think it's working but I'm not seeing the output. I tried the same experiment on my NANO54415 and the smart traps are working, so why not on my 5282?

P.S. I couldn't seem to cause a trap using the smart trap example in the NetburnerPCTools doc, so I just wrote a recursive function to blow the stack

Code: Select all

volatile int BlowStack(int depth)
{
	int stackVar = depth+1;
	iprintf("\r\ndepth = %d", stackVar);
	return BlowStack(stackVar);
}

Code: Select all

Blowing Stack
depth = 1
depth = 2
.
.
.
depth = 34
depth = 35
depth = 36
depthWaiting 2sec to start 'A' to abort
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD5282 SmartTrap not working

Post by dciliske »

Are you running a debug build?

[Edit: Never mind. Reading comprehension failure... Somehow I passed that in elementary school...]
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: MOD5282 SmartTrap not working

Post by pbreed »

Blowing the stack will not always cause a trap....


Try a divide by zero...


IE
void DoTrap()
{volatile int i;
i=1;
i--;
i=10000/i;
}
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Re: MOD5282 SmartTrap not working

Post by sulliwk06 »

pbreed wrote:Blowing the stack will not always cause a trap....

Try a divide by zero...
Wow, ok I guess the smart traps are working, I'm seeing them now. The problem is this all started when I was getting a trap on an OSSemPend which confused me, so I turned on smart traps and then the device would reboot instead of trapping. I guess I'll have to find another way to track this down.

Thanks for your help.
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD5282 SmartTrap not working

Post by dciliske »

I would bet that means your having a memory corruption issue. Trapping on a SemPend implies that someone's stack frame is corrupted and that restoring from that state caused a problem when resuming.
Dan Ciliske
Project Engineer
Netburner, Inc
Post Reply