paoloteti / ti-hercules-bsp

Bare Metal Board Support Package for Texas Instruments Cortex-R4F/R5F TMS570
Other
25 stars 4 forks source link

STC SelfTest may fail if WFI does not suspend the CPU. #8

Open paoloteti opened 6 years ago

paoloteti commented 6 years ago

STC Self test assumes that the WFI always causes the standby state. This isn't correct. WFI is a hint - the instruction can be retired without the CPU ever entering standby. It takes some cycles to enter standby due to the need to do things like flush the write buffer, and if during this time an interrupt or debug request occurs - the CPU won't enter standby

A part for the debug request case, We have to be sure STC SelfTest is always executed with interrupt disabled. It is also a good idea to add few NOPs or sequence of jumps before call WFI.