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.

TMS320F28379D: Strange processor behavior: wrong instruction execution ?

Part Number: TMS320F28379D


I have a local variable uint16_t* buf pointing to CPU1 to CPU2 Message RAM. The code is executed on CPU2 from RAM. I want to interpret first two elements of buf[ ] as uint32_t, so I wrote in C:

address = *((uint32_t*)buf);

But unfortunatelly I got unexpected result in the local variable "uint32_t address". I started debugging and stumbled over some unexpected behavior, that I can't understand.  The code above was compiled to the following sequence of assembler instructions:

        MOVL      ACC,*+XAR4[0]         ; [CPU_ALU] |204|
        MOVL      *-SP[4],ACC           ; [CPU_ALU] |204|

But running this code step by step I get strange results. It seems to me that first instruction is executed wrong. Here is a screenshot before execting first instruction:

Here is screenshot after "Assembly step into":

I expected that ACC register will contain 0x082000 after executing first assembly instruction, but it contains 0x20000081. How can it be possible ?

Regards,

Alex