Software hang/anamolies

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Software hang/anamolies

1,188 Views
denny_george
Contributor I
Hello,
 
Can anyone tell me about Software hang/anamolies,its causes- that forces the watchdog to interfere and reset the system.If possible, would you analyse from the MCU point of view (MCU internals,registers,memory etc) rather than from any high level language point of view.
 
 
I have one more request/question.Its regarding illegal opcode.How does illegal opcode occur in an MCU.Is it only by Program Memory corruption?Any other possibilities.I'm aware most controllers support illegal opcode resets.But how is illegal opcode generated in the MCU after flashing compiled code into it.
 
Patiently waiting for your feedback.
Labels (1)
0 Kudos
2 Replies

296 Views
blood
Contributor III
An illegal opcode can happen when the program starts running code from RAM. Your program could do this if your stack has been corrupted or if you have overrun it. If the stack gets corrupted this means when a function returns it can return to somewhere unknown.
If you are writing code in assembler then you may have mis-alligned push and pull statements.
You can also get the same problem if you are using paging and have changed the code page, then when a function returns it will return to the correct address but on a different page.
0 Kudos

296 Views
bigmac
Specialist III
Hello Nexus,
 
You seem to have posted similar questions in the 8-bit forum.  Please do not cross-post in more than one forum.
 
Regards,
Mac
 
0 Kudos