S12ZVM Byte Alignment Issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S12ZVM Byte Alignment Issue

761 次查看
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 回复

746 次查看
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 项奖励
回复