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.

MSP430G2744: IAR not supporting packed bitfield?

Part Number: MSP430G2744

MSP430G2744, IAR 7.10.2

I am testing a program in IAR, but I found that the bitfield in a packed struct is not correct.

The code is something like this:

#define RF_MSG_HEADER_DOWNLINK \
  uint8 Length;  /*Length of the message excluding me*/   \
  uint8 RecvAddr;   \
  uint8 SendAddr;   \
  uint8 Content_SenderType:1;  \
  uint8 Content_MessageId:7;

typedef struct __attribute__((packed))
{
  RF_MSG_HEADER_DOWNLINK
} RfMsgHeaderDownlinkT;

typedef struct
{
  RF_MSG_HEADER_DOWNLINK
} RfMsgHeaderDownlink2T;

During debugging, I could see the address and the value of "Content_SenderType" and "Content_MessageId" of the unpacked struct is correct, but they are not correct for the packed struct. The address is the start of the struct.
Does IAR not support bitfield in packed structure? There seems no description on what will happen when packed is mixed with bitfield in the compiler user guide.
Does anybody have any idea?

**Attention** This is a public forum