How do I troubleshoot traps without a line number?

Discussion to talk about software related topics only.
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: How do I troubleshoot traps without a line number?

Post by tod »

I understand not wanting to complicate things at this juncture. My paranoid nature makes me suggest you always check those error return values. If OSSemPend returns an error you're assuming it granted you access to the semaphore and deprecated the count (which it probably did not - at least if the NB implementation is anything like the uCOS-II implementation). At any rate it seems like a pretty simple thing to add.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: How do I troubleshoot traps without a line number?

Post by rnixon »

You code is using: OSSemPend(&MySemaphore, 0); which will block forever. If locking up is a problem, why not use a timeout and print out some diagnostics? And like Tod said, I always check return values for everything I can if I am having odd behavior.
User avatar
mx270a
Posts: 80
Joined: Tue Jan 19, 2010 6:55 pm

Re: How do I troubleshoot traps without a line number?

Post by mx270a »

Update: This project has taken a bizarre turn, the bug has apparently vanished. Last time I saw a lockup was 3 days ago. I even rolled back to the old code, and I cannot get it throw any traps or lockup now. I'm happy that it's working normally, but I'm also perplexed about what happened.
Post Reply