TimeTick and SNMP

Discussion to talk about software related topics only.
SeeCwriter
Posts: 630
Joined: Mon May 12, 2008 10:55 am

TimeTick and SNMP

Post by SeeCwriter »

At the risk of stepping in it again, I have another issue with SNMP. I've implemented SNMP in the Nano,
and all the SNMP commands are working. But occasionally when I send a command the TimeTick quits updating.
I know this because I put a printf() in the main loop and monitor it with MTTY. The output streams along showing
TimeTick incrementing. But after entering a few SNMP commands it stops.

Code: Select all

		printf("TT: %lu\r\n", TimeTick );
My guess it that an interrupt has been disabled. The program is still running. I can continue to send commands
and they are processed. But without the TimeTick running some of my program doesn't run.

Note that this only happens with SNMP. I can send the same commands via UDP all day long without any issues.
But with SNMP it will typically happen in less than 10 commands.

Not sure where to go with this.
IDE v2.7.3
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: TimeTick and SNMP

Post by rnixon »

I would check to see if where ever your printf is located could be the problem. If the system timer is not running, I do not think any part of your program would run either. Maybe your printf is is a task that never runs when this situation occurs?
SeeCwriter
Posts: 630
Joined: Mon May 12, 2008 10:55 am

Re: TimeTick and SNMP

Post by SeeCwriter »

I was incorrect about TimeTick not updating. What is happening is that the program is getting stuck in some task and usermain() never runs again.
I tried to find where the program was getting stuck by putting printf() statements everywhere. But then it wouldn't fail. I take out the printf()'s and it fails right away. It appears to get stuck in the SNMP task, as it will still communicate SNMP when its in the stuck scenario. Nothing in usermain() runs, no TCP or UDP comm, no other tasks run as far as I can tell, just SNMP.
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: TimeTick and SNMP

Post by pbreed »

To find where it get stuck run the Task scan....


Basically...

#include <taskmon.h>
Then in UserMain add...

EnableTaskMonitor();



Then when your program is running run the utility taskmon

This will tell you exactly what tasks are running, and what each of them is doing...
SeeCwriter
Posts: 630
Joined: Mon May 12, 2008 10:55 am

Re: TimeTick and SNMP

Post by SeeCwriter »

Thanks for that info. I've never used TaskScan before. It confirmed my theory. The SNMP command causes
data to be written to a SPI bus periperal. Following the SPI driver example from the NB manual, I wait on
a semiphore for the operation to complete. For reasons I don't understand, an SNMP command will cause that
semiphore to not be cleared, and since the timeout value is 0 usermain task comes to a halt.

The same command received via a UDP datagram doesn't cause this issue. When I put a timeout value in OSSemPend(),
no more hanging. When I tried using DSPIDone() instead of a semiphore, the Nano wouldn't even boot. On power-up
it spits out the "Waiting 2sec to start 'A' to abort" message and that's it. It can't even be reprogrammed.
I have abort into the monitor and load an example program via the serial port to recover.

Doesn't make sense. I only have 2-tasks I wrote, usermain() and a UDP Reader task based on an example UDP reader
in the manual. And the UDP task doesn't use the SPI bus. It simply stuffs received datagrams into a fifo
where they are read out and processed in usermain().
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: TimeTick and SNMP

Post by pbreed »

What NNDK version and are you doing any Multicast stuff?

A few versions ago we had a really nasty bug in the multicast part of the ethernet driver for the 54415 parts that clobbered RTOS and interrupts...


Paul
SeeCwriter
Posts: 630
Joined: Mon May 12, 2008 10:55 am

Re: TimeTick and SNMP

Post by SeeCwriter »

We are using v2.7.3.

We use broadcast UDP datagrams, if that's what you mean. Nothing with TCP.
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: TimeTick and SNMP

Post by pbreed »

I believe 2.7.3 has the fix, but I must be in the office to be 100% sure. (I'll check on Friday)...
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: TimeTick and SNMP

Post by pbreed »

2.7.3 Should have the fix in it.
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: TimeTick and SNMP

Post by pbreed »

just to be 100% sure can you submit a support ticket and include your source file...
nburn\mod5441x\system\emulticast.cpp


Paul
Post Reply