XMC4500 byte alignment

Sysprogs forums Forums VisualGDB XMC4500 byte alignment

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12448
    lkormos
    Participant

    Hi,

    I have a XMC4500 custom board and a working code witch was created under DAVE eclipse softver.

    I build my project under VisualGDB, but it is not working perfectly becouse of packed structures. I tried adding “-fpack-struct” to flags, but i got hard fault when the program trying to access hardware registers (-fpack-struct=4 is working fine, but i need byte alignment).

    Is there any solution?

    Regards,

    Kormos L.

     

    #12458
    support
    Keymaster

    Hi,

    Yes, please try setting __attribute__((packed(number)) on the specific structures that need to be packed.

    You can also try this build [http://sysprogs.com/files/tmp/VisualGDB-5.3.8.1797.msi]. Once you click ‘details’ in the embedded memory explorer, it will show struct sizes and field offsets directly in the code.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.