This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541: CC2540 8051 CPU Action in response to an invalid Instruction/OpCode ..

Part Number: CC2541

Hi Team CC25xx,

What will the CC2541 8051 do in response to receiving an invalid OpCode?  For example if there is a memory corruption or ESD event causing the 8051 to receive an invalid instruction/OpCode into its instruction queue.. how does the system respond?  An interrupt trap or a reset or..?

Thanks, Merril

  • Hi Merril,

    Usually if there is a memory corruption the consequence is that the CPU jumps to the wrong adress and tries to run from there. As you understand it's extremely unpredictable since what happens will depend entirely on what address it jumps to. 

  • As Marie states, it is unpredictable.

    The 8051 core will simply run on and fail in an unknown way. If for example the mapped code space has an ending portion with 0xFF and the code randomly jumps there, it will simply run the corresponding command (MOV R7,A) which is a single cycle command where the program counter (PC) step to the next command until it wraps and restart at 0. The state of the core and peripherals are unknown at this state and a clean boot might not occur. I believe there might only be one undefined command (0xA5), but I believe this does noting. I believe reading from undefined/illegal memory only returns 0, but I have not tested it.

    https://www.win.tue.nl/~aeb/comp/8051/set8051.html#51undef