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.

CCS/TMS320F28377S: pointer address changes during initialization

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

Hi,

I got an issue during manipulating a self-defined structure. When I was trying to initialize the value, once I tried to write to the data union, all the location will be corrupt and set to start from 0x0. And then it will entering into illegal isr trap. Anyone can help with that? The structure definition are attached.

  •  

    Looks like the pointer address is kind of overlapped with the data section in the structure, which cause corrupt of msg object when writing to the data. The accual correct address to this msg shall be 0x412 instead of 0x416. But seems like the compiler create a pointer which pointed to 0x412 memmory while the pointer's location with 0x412 object range. Does anyone know why the compiler behaves like this? 

  • The function CAN_messageClear is called from the function pack_PT_OBC_state.  The argument that is passed should be the address of a CAN_message_S.  Inspect that call.  What is being passed?  Is the address of that CAN_message_S variable 0x412?  Does that address make sense?

    Thanks and regards,

    -George

  • Please reply to the questions in my last post.

    Thanks and regards,

    -George

  • Hi George,

    Thanks for replying my question. Your reply helps me find the issue. The issue turns out to be that a CAN_message_S* is passed to function instead of the CAN_message_S type variable.

    Regards,

    Li