Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 230912

Forum Post: RE: TMS320F280039C: struct data alignment

$
0
0
[quote userid="488507" url="~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1429546/tms320f280039c-struct-data-alignment/5495385#5495385"]Is there a compiler data alignment rule available to user ?[/quote] Yes. Please search the C28x compiler manual for the sub-chapter titled Field/Structure Alignment . One point it does not make clear: The alignment of a struct is the maximum of the alignment of any of its members. [quote userid="488507" url="~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1429546/tms320f280039c-struct-data-alignment/5495385#5495385"]Asking on why in project A, the len variable is not be filled with 0s following to the next struct ?[/quote] It must be the case that the structure type struct_GUI_STD_Co... contains no members that require 2-word alignment, and so it can start on an odd word address. By contrast, the structure type struct_DSP_Config must contain at least one member that requires 2-word alignment, and so it must start on an even word address. Thanks and regards, -George

Viewing all articles
Browse latest Browse all 230912

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>