;****************************************************************************** THUMB REQUIRE8 PRESERVE8 AREA |.text|, CODE, READONLY, ALIGN=2 ; Reference to the FailSafe routine to be executed in case of non-recoverable ; failure IMPORT FailSafePOR ;; C variables for control flow monitoring IMPORT CtrlFlowCnt IMPORT CtrlFlowCntInv ;******************************************************************************* ; Function Name : STL_StartUpCPUTest ; Description : Full Cortex-M3 CPU test at start-up ; Note: when possible, BRANCH are 16-bit only (depending on ; relative offset to final BL instruction) ; Input : None. ; Output : Branch directly to a Fail Safe routine in case of failure ; Return : CPUTEST_SUCCESS (=1) ; WARNING : all registers destroyed when exiting this function (including ; preserved registers R4 to R11) and excluding stack point R13) ;*******************************************************************************/ STU_CPURegsAddressing PROC ;64.7us EXPORT STU_CPURegsAddressing PUSH {R0-R12} MOVS R0, #0x00 MOVS R1, #0x00 MOVS R2, #0x00 MOVS R3, #0x00 MOVS R4, #0x00 MOVS R5, #0x00 MOVS R6, #0x00 MOVS R7, #0x00 MOVS R8, #0x00 MOVS R9, #0x00 MOVS R10, #0x00 MOVS R11, #0x00 MOVS R12, #0x00 MOVS R0, #0x00 MOVS R1, #0x01 MOVS R2, #0x02 MOVS R3, #0x03 MOVS R4, #0x04 MOVS R5, #0x05 MOVS R6, #0x06 MOVS R7, #0x07 MOVS R8, #0x08 MOVS R9, #0x09 MOVS R10, #0x0A MOVS R11, #0x0B MOVS R12, #0x0C CMP R0, #0x00 BNE __REGS_ADDRESSING_ERR CMP R1, #0x01 BNE __REGS_ADDRESSING_ERR CMP R2, #0x02 BNE __REGS_ADDRESSING_ERR CMP R3, #0x03 BNE __REGS_ADDRESSING_ERR CMP R4, #0x04 BNE __REGS_ADDRESSING_ERR CMP R5, #0x05 BNE __REGS_ADDRESSING_ERR CMP R6, #0x06 BNE __REGS_ADDRESSING_ERR CMP R7, #0x07 BNE __REGS_ADDRESSING_ERR CMP R8, #0x08 BNE __REGS_ADDRESSING_ERR CMP R9, #0x09 BNE __REGS_ADDRESSING_ERR CMP R10, #0x0A BNE __REGS_ADDRESSING_ERR CMP R11, #0x0B BNE __REGS_ADDRESSING_ERR CMP R12, #0x0C BNE __REGS_ADDRESSING_ERR B __REGS_ADDRESSING_RET __REGS_ADDRESSING_ERR B FailSafePOR __REGS_ADDRESSING_RET POP {R0-R12} BX LR ; return to the caller ENDP END