S12ZVM Byte Alignment Issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S12ZVM Byte Alignment Issue

762 Views
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 Kudos
Reply
1 Reply

747 Views
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 Kudos
Reply