S12ZVM Byte Alignment Issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S12ZVM Byte Alignment Issue

779件の閲覧回数
FenomenoKim
Contributor I

Hello,

I hope this message finds you well. I am writing to seek assistance with an issue related to byte alignment in the S12ZVM environment.

The images on the left and right represent identical structs declared in different ".h" files. What I desire is for the alignment to occur on a per-byte basis, similar to the image on the right. However, I am encountering an issue where the alignment is altered, resembling the image on the left.

I have attempted various methods, including the use of "#pragma pack," but unfortunately, none of these approaches seem to provide a solution. Additionally, I have thoroughly reviewed and adjusted the settings in the properties section, believing that I have covered all relevant areas.

Could you kindly advise on what might be overlooked or provide guidance on resolving this alignment discrepancy? Your assistance in this matter would be greatly appreciated.

Thank you for your time and consideration.

Best regards,

1.png

2.png

3.png

4.png

5.png

   

0 件の賞賛
返信
1 返信

764件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @FenomenoKim,

Please have a look at this document, it covers data alignment:

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-constant-variable-code-allocation-in-C...

 

Regards,

Daniel

0 件の賞賛
返信