Tool/software: Code Composer Studio
Hello
I porting an RTOS to AM3354, after the program execute assembler :
LDMIA SP!, {R0} ; Pickup saved CPSR value MSR SPSR_cxsf, R0 ; Setup new context SPSR value LDMIA SP!, {R0-R12,LR,PC} ; Pop new tasks context
the program jump into the entry point in the task, and the PC Register value is 0x40302B1C,
then I press the button 'step into', the program execute one sentence code and the
PC value become 0x40302B22( the value is not 4 byte align ). Then the program jump into
the following code in document memset32.asm .
_word_aligned: AND R1, R1, #255 ; be safe since prototype has value as ; as an int rather than unsigned char ORR R1, R1, R1, LSL #8 ; replicate byte in 2nd byte of ; register CMP R2,#4 ; are at least 4 bytes being set BCC _memset3
Then the hard fault happened.
But, if I change the code:
LDMIA SP!, {R0-R12,LR,PC}^
into
LDMIA SP!, {R0-R12,LR,PC}
everything is fun, why this happen?
Best Regards
Jack