when i debug using the simulator i get this message
undefined opcode trap detected
is it bad ?
"debug your code" is kinda general
Well, so was your description of the problem. There was basically no usable information about the actual circumstances. So if you can't figure out what went wrong, with complete access to the source and everything, how can you expect people out here, without any of that information, to pull off such a trick?
Your program ended up jumping to an address where there was no (correct) code. You'll have to figure out for yourself how that happened. The "trace" feature of the simulator (if the 166 one has that... I've never used C166 myself) should help with that. It would allow you to go back in execution time, after the crash, to find out how you got there. Failing that, you'll have to retrace your steps through the program's development history, and find out when you broke it --- that usually makes it a lot easier to find out how you broke it.
Common problems:
- Call through uninitialized function pointers. - Write using uninitialized pointers. - Buffer overwrites. - Stack overflow. - Incorrectly initialized interrupt vectors.
i don't know exactly where to look to find more info... i would like some links about this or where to look for relevant info
This forum will make you a debugging guru
Sorry, typo. Of course, I meant will not.
Debug your code. This forum will make you a debugging guru. You are far more likely to get answers to specific questions.
how do i solve this?
Yes, looks like your program jumps to nowhere.
View all questions in Keil forum