<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis MicrocontrollersのトピックRe: Codewarrior Kinetis Compiler</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216855#M3786</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Luis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Calibri"&gt;You should use __atrribute__(align) as a workaround instead. This attribute is not properly documented in the Kinetis Compiler manual (&lt;STRONG&gt;&lt;FONT color="#000000"&gt;MTWX47648&lt;/FONT&gt;&lt;/STRONG&gt;).&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;typedef struct&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;unsigned long x __attribute__((aligned (1)));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;unsigned char y __attribute__((aligned (1)));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;} new_struct;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jun 2011 19:51:55 GMT</pubDate>
    <dc:creator>LuisCasado</dc:creator>
    <dc:date>2011-06-22T19:51:55Z</dc:date>
    <item>
      <title>Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216854#M3785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm doing some development with the CodeWarrior 10.1 and the TWR-K60N512 development kit.&lt;/P&gt;&lt;P&gt;I'm having some trouble figuring out how to byte align some structures in my code.&lt;/P&gt;&lt;P&gt;Since the compiler is gcc based I was wondering if it supports the #pragma pack() directive?&lt;/P&gt;&lt;P&gt;I couldn't find any information in the compiler documentation, and tried it in my code, but it returns a warning stating that it's an illegal pragma.&lt;/P&gt;&lt;P&gt;Are there any language extensions that need to be turned on for the pragma to work, or&amp;nbsp;is it&amp;nbsp;simply not supported by the compiler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luis Fresca&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 17:34:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216854#M3785</guid>
      <dc:creator>lfresca</dc:creator>
      <dc:date>2011-06-22T17:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216855#M3786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Luis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Calibri"&gt;You should use __atrribute__(align) as a workaround instead. This attribute is not properly documented in the Kinetis Compiler manual (&lt;STRONG&gt;&lt;FONT color="#000000"&gt;MTWX47648&lt;/FONT&gt;&lt;/STRONG&gt;).&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;typedef struct&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;unsigned long x __attribute__((aligned (1)));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;unsigned char y __attribute__((aligned (1)));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;} new_struct;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 19:51:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216855#M3786</guid>
      <dc:creator>LuisCasado</dc:creator>
      <dc:date>2011-06-22T19:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216856#M3787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I've tried that attribute, but it does not do what I want.&lt;/P&gt;&lt;P&gt;I want to force a struct to be byte aligned like #pragma pack(1) would do.&lt;/P&gt;&lt;P&gt;All __attribute__ (aligned(1)) does is tell the compiler to use &lt;EM&gt;at least&lt;/EM&gt; one byte alignment in the structure.&lt;/P&gt;&lt;P&gt;Since the compiler is aligning the data to&amp;nbsp;a 4 byte&amp;nbsp;boundary it is compiling with the statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the definition from gcc.org:&amp;nbsp;&lt;A href="http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Type-Attributes.html" rel="nofollow" target="_self"&gt;http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Type-Attributes.html﻿&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any compiler options to force struct alignment, like in Coldfire?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luis Fresca&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 20:47:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216856#M3787</guid>
      <dc:creator>lfresca</dc:creator>
      <dc:date>2011-06-22T20:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216857#M3788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Luis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We used pragma pack in Codewarrior 10.1 for Kinetis. We needed this to open bmp and wave files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;#pragma pack (push,2) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Align structure to 2 byte&lt;/P&gt;&lt;P&gt;typedef struct {&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long ChunkID; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//4 bytes = "RIFF" 0x52494646 big-endian form &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long ChunkSize; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//4 bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long Format; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //4 bytes = "WAVE" 0x57415645 big-endian&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long Subchunk1ID; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //4 bytes = "fmt" &amp;nbsp;0x666d7420 big-endian form&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long Subchunk1Size; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //4 bytes &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned short AudioFormat; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //2 bytes: 0 =???; &amp;nbsp;1 = Linear quantization; Others = compress&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsignedshort NumChannels; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//2 bytes: Mono = 1; Stereo = 2; etc. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long SampleRate; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//4 bytes: 8000, 44100, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long ByteRate; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //4 bytes: SampleRate * NumChannels * BitsPerSample/8 &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned short BlockAlign; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //2 bytes: NumChannels * BitsPerSample/8 &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned shor tBitsPerSamples; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//2 bytes: 8 = 8 bits; 16 = 16 bits; etc. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long Subchunk2ID; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //4 bytes = "data" 0x64617461 big-endian form &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long Subchunk2Size; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //4 bytes: NumSamples * NumChannels * BitsPerSample/8//&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long Data; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//(ChunkSize) bytes&amp;nbsp;&lt;/P&gt;&lt;P&gt;} WAVE_FILE;&lt;/P&gt;&lt;P&gt;#pragma pack (pop)﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you mark "Accept as Solution".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Gustavo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 21:18:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216857#M3788</guid>
      <dc:creator>gustavod</dc:creator>
      <dc:date>2011-06-22T21:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216858#M3789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for replying.&lt;/P&gt;&lt;P&gt;Like I said in the previous post, I've tried using #pragma pack() in my code, but the compiler keeps returning a illegal #pragma warning.&lt;/P&gt;&lt;P&gt;I'm also using Codewarrior 10.1, but it just doesn't seem to work in mine!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you have to use any compiler options to be able to use this #pragma?????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luis Fresca&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 21:36:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216858#M3789</guid>
      <dc:creator>lfresca</dc:creator>
      <dc:date>2011-06-22T21:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216859#M3790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been looking at the Kinetis Documentation more closely and found a reference to the #pragma pack directive in the Kinetis Build Tool Reference Manual, in the Pragmas for Optimization section, page 316.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still can't get it to work in my Codewarrior 10.1 project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no information on the aforementioned document about any precondition needed to use this pragma.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luis Fresca&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 22:31:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216859#M3790</guid>
      <dc:creator>lfresca</dc:creator>
      <dc:date>2011-06-22T22:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216860#M3791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Luis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can download my project. I used two pragma packs (in files SD_API.h and SD_API.c). This code is compiling in CodeWarrior 10.1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://brtos.googlecode.com/files/BRTOS%201.6x%20K40%20-%20SD%20%2B%20Wave.rar" rel="nofollow" target="_blank"&gt;http://brtos.googlecode.com/files/BRTOS%201.6x%20K40%20-%20SD%20%2B%20Wave.rar&lt;/A&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gustavo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 23:20:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216860#M3791</guid>
      <dc:creator>gustavod</dc:creator>
      <dc:date>2011-06-22T23:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216861#M3792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the FLASH version. The code is not compiling for RAM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 23:32:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216861#M3792</guid>
      <dc:creator>gustavod</dc:creator>
      <dc:date>2011-06-22T23:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216862#M3793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Gustavo, thanks for your help...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try this in your project to see if you have the same results...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Turn on the warnings for "Illegal Pragmas" &amp;amp; "Pad Bytes Added".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then re-compile your project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should see a warning regarding your #pragma pack() statements saying "illegal #pragma".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, from the results I see on my side, your WAVE_FILE struct is not being aligned to 2 bytes, but to 4 bytes, like in my project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try adding a unsigned char var to the end of your struct and rebuild your project.&lt;/P&gt;&lt;P&gt;If the compiler where aligning the struct to a 2 byte boundary you should get one pad byte added to the struct, but you should see that the compiler is adding 3 padding bytes, which means it's aligning your struct to a 4 byte boundary (which is the compiler default).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once again. Thank you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obrigado,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luis Fresca&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 23:48:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216862#M3793</guid>
      <dc:creator>lfresca</dc:creator>
      <dc:date>2011-06-22T23:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216863#M3794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forgive me Luis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the right manner to do it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;typedef struct __attribute__((packed, aligned(2)))﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gustavo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 02:38:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216863#M3794</guid>
      <dc:creator>gustavod</dc:creator>
      <dc:date>2011-06-23T02:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216864#M3795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gustavo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just tried it in your code, and It's still aligning on a 4 byte boundary.&lt;/P&gt;&lt;P&gt;As you can see bellow I added a unsigned char variable in order to make struct out of alignment,&lt;/P&gt;&lt;P&gt;I used the attribute you talked about and still got 3 bytes padding added to the structure, which means that regardless of the attribute declaration it is still aligning to a 4 byte boundary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;typedef struct &amp;nbsp;__attribute__ ((packed,aligned(2)))&lt;/P&gt;&lt;P&gt;{&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned long ChunkID;//4 bytes = "RIFF" 0x52494646 big-endian form &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned long ChunkSize;//4 bytes &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned long Format; //4 bytes = "WAVE" 0x57415645 big-endian form &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned long Subchunk1ID; //4 bytes = "fmt" &amp;nbsp;0x666d7420 big-endian form &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned long Subchunk1Size; //4 bytes &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned short AudioFormat;//2 bytes: 0 =???; &amp;nbsp;1 = Linear quantization; Others = compression &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned short NumChannels;//2 bytes: Mono = 1; Stereo = 2; etc. &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned long SampleRate;//4 bytes: 8000, 44100, etc. &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned long ByteRate;//4 bytes: SampleRate * NumChannels * BitsPerSample/8 &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned short BlockAlign;//2 bytes: NumChannels * BitsPerSample/8 &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned short BitsPerSamples;//2 bytes: 8 = 8 bits; 16 = 16 bits; etc. &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned long Subchunk2ID;//4 bytes = "data" 0x64617461 big-endian form &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned long Subchunk2Size;//4 bytes: NumSamples * NumChannels * BitsPerSample/8 &amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned char x; &amp;nbsp;&lt;/P&gt;&lt;P&gt;// unsigned long Data;//(ChunkSize) bytes&amp;nbsp;&lt;/P&gt;&lt;P&gt;} WAVE_FILE;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the compiler were&amp;nbsp;aligning&amp;nbsp;the data to a 2 byte boundary, you should only get one padding byte.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stil, thanks for all the time you're wasting on my problem!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 15:23:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216864#M3795</guid>
      <dc:creator>lfresca</dc:creator>
      <dc:date>2011-06-24T15:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216865#M3796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;This is a little bit strange, cause we use this attribute in other projects. You can download another project of us in the brtos google code. We have projects with bitmap files that uses strctures with 1, 2 and 4 bytes. Without this attribute the code do not work. This is all i can say. Best regards, Gustavo&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 21:34:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216865#M3796</guid>
      <dc:creator>gustavod</dc:creator>
      <dc:date>2011-06-24T21:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216866#M3797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Luis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you ever get this working? There was some good help and advice here, but it didn't seem to work for you. I can't provide anything further, but the fact that I didn't see a positive resolution concerns me. There is a possibility there's a defect in the compiler. It could be user error, a wrong setting - since it appears to work for others. But...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is not working for you, and it involves the CodeWarrior compiler, would you please open up a formal serivce request? At the moment there is a rather long queue, the support team has been working an internal global training event. But, they will get to it. &lt;A href="http://www.freescale.com/support" rel="nofollow" target="_blank"&gt;http://www.freescale.com/support&lt;/A&gt;. If you detail what you're doing and provide a project and code example, an apps engineer will get to it and perhaps be able to resolve the problem. If it turns out&amp;nbsp;there is a defect, we definitely want to know about it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 23:24:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216866#M3797</guid>
      <dc:creator>jimtrudeau</dc:creator>
      <dc:date>2011-06-30T23:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216867#M3798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Short answer... No, I haven't been able to get this to work.&lt;/P&gt;&lt;P&gt;I've been exchanging emails with my Freescale supplier, and he forwarded the issue to Freescale's support team, so I'm guessing a service request is already open!&lt;/P&gt;&lt;P&gt;But I don't think it's a project settings issue, since I downloaded Gustavo's project, and to my knowledge project settings were&amp;nbsp;imported along with the source, and still I could not get the same results he did.&lt;/P&gt;&lt;P&gt;There is the question of the compiler version. I'm using Codewarrior 10.1 on Windows XP, i'm not sure which one Gustavo has.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm going to wait a bit more time for some response from my supplier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I can't get the issue resolved, I'll post another message on this thread to keep you updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for interest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luis Fresca&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. - Once again, thanks for you help Gustavo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 23:58:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216867#M3798</guid>
      <dc:creator>lfresca</dc:creator>
      <dc:date>2011-06-30T23:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216868#M3799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Luis&lt;/P&gt;&lt;P&gt;I'm facing the same alignement problem using CW 10.2 trying to have a structure 1 byte aligned:&lt;/P&gt;&lt;P&gt;have you got any new from Freescale about your issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any option to be deactivate in compiler's options?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mauro Righetto&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 16:00:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216868#M3799</guid>
      <dc:creator>mra59</dc:creator>
      <dc:date>2012-05-16T16:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Kinetis Compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216869#M3800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma pack is now supported&amp;nbsp;by Kinetis compiler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2012 00:32:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Codewarrior-Kinetis-Compiler/m-p/216869#M3800</guid>
      <dc:creator>LuisCasado</dc:creator>
      <dc:date>2012-05-17T00:32:47Z</dc:date>
    </item>
  </channel>
</rss>

