by aolofsson » Thu Jun 19, 2014 2:01 am
If the program you ran ended with a normal "exit" then, you would end up with a trap instruction, the way the crt0 is currently implemeted. This does put the core in a halted state (DEBUGSTATUS register) but not in an idle STAT( STATUS[0] bit). If you want to specifically put the core in an idle state, then you would need to execute an "idle" instruction in your program. There are some examples where we do this instead of exiting from main. With respect to the disclaimer about reading the GP registers..this is fine to do in an IDLE state as well as in a HALTED state.
Andreas