<?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>LPCXpresso IDE中的主题 Re: How to create a list file?</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563780#M17271</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by RA1981 on Wed Aug 24 09:43:13 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: CodeRedSupport&lt;/STRONG&gt;&lt;BR /&gt;Sorry, you read a little too much into my statement here. This is a personal "wish list area" for me, but it is not an area where you are likely to see new functionality within LPCXpresso in the near future.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't worry, I didn't read to much into it (that's why I wrote it with a smilie).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;I just did a compare and contrast of the entries for the structures in the map file.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mmmmmh.... For me the map isn't very detailful, that's the reason for this thread, but maybe I read the map file wrong...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt; You want to be slightly careful of using 8 bit variables. Remember that we are talking about a 32-bit processor here, and 32-bit variables are the most efficiently handled from the generated code viewpoint. With 8-bit variables, you will often end up with additional code (for example, shifts). Thus your saving in RAM space may get offset by the increase in your code size in flash. &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know about the disadvantages using non-32-bit variables on a 32-bit MCU, but... if I understand it right this means: if I need a buffer with 1k entries, where each entry is only a byte value it would cost me half the RAM of a LPC1114 if I use 32-bit width variable type. Okay, this example is maybe a bit oversized, but in fact I'm right, right? :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Or could such a case be solved better?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;[ There is a paper which includes some information on this here:&lt;BR /&gt;&lt;A href="http://"&gt;http://www.eetimes.com/design/embedded/4210470/Efficient-C-Code-for-ARM-Devices?pageNumber=1&lt;/A&gt;&lt;BR /&gt;Although this is focussed on ARM's RealView compiler, much of it equally applies to gcc.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you, I'll read it :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;But what is best for your application is really down to your own experimentation and system resources.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The best for my application is to get experience with the NXP devices and the LPCxpresso environment ;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ralf&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:21:09 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:21:09Z</dc:date>
    <item>
      <title>How to create a list file?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563776#M17267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by RA1981 on Sun Aug 21 00:21:49 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wonder if it's possible to create a list file with more details than the map file. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Especially I'm interested in how much memory a function needs and how the memory footprints of structs look like (e.g. checking if there are gaps between struct members, etc.).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to get a detailed list file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ralf&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:21:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563776#M17267</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list file?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563777#M17268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CodeRedSupport on Mon Aug 22 01:20:49 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm afraid that there is no currently of extending the map information generated in these ways with the LPCXpresso IDE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With regards to stack space, then the "simple" way to check this is to use "memory painting" - which basically involves initialising memory to a known value then looking at how much of this has been overwritten after running your code for a period of time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NXP also have a stack usage monitor example in their code samples that you might want to check out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With regards to checking for how much padding your structures are using, one possible way to doing this would be to do a build as normal, and record the size of your structures. Then rebuild with the "[FONT=Courier New][SIZE=1]-fpack-struct[/SIZE][/FONT]" compiler option and compare the size of the structures.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that I would not recommend the use of the "[FONT=Courier New][SIZE=1]-fpack-struct[/SIZE][/FONT]" for general usage due to the code size and performance overheads this can cause. However there are some&amp;nbsp; circumstances where you may need to make use of it - for example for&amp;nbsp; accessing data coming in from peripherals. If you want to pack your structures, then you would also be better off using "[FONT=Courier New][SIZE=1]__attribute__((packed))[/SIZE][/FONT]" to more finally control what you are actually packing....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/PackedStructs&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CodeRedSupport&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:21:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563777#M17268</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list file?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563778#M17269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by RA1981 on Tue Aug 23 09:33:14 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: CodeRedSupport&lt;/STRONG&gt;&lt;BR /&gt;I'm afraid that there is no [B]currently[/B] of extending the map information generated in these ways with the LPCXpresso IDE.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'Currently' means that this might be the case in the (near) future? ;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;With regards to stack space, then the "simple" way to check this is to use "memory painting" - which basically involves initialising memory to a known value then looking at how much of this has been overwritten after running your code for a period of time.&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;Okay, my question doesn't target the stack space initially because I thought the linker would give me a warning if there's not enough stack space. If this is not the case I'll use your suggested approach.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;NXP also have a stack usage monitor example in their code samples that you might want to check out.&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;I'll search for it, thank you for the hint :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;With regards to checking for how much padding your structures are using, one possible way to doing this would be to do a build as normal, and record the size of your structures. Then rebuild with the "[FONT=Courier New][SIZE=1]-fpack-struct[/SIZE][/FONT]" compiler option and compare the size of the structures.&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;How to get the size? Use the C sizeof-Operator?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;Note that I would not recommend the use of the "[FONT=Courier New][SIZE=1]-fpack-struct[/SIZE][/FONT]" for general usage due to the code size and performance overheads this can cause. However there are some&amp;nbsp; circumstances where you may need to make use of it - for example for&amp;nbsp; accessing data coming in from peripherals. If you want to pack your structures, then you would also be better off using "[FONT=Courier New][SIZE=1]__attribute__((packed))[/SIZE][/FONT]" to more finally control what you are actually packing....&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;Okay, I understand why it's not a good idea to pack it, but most of my projects data are mostly 8-Bit variables, so it would be wasting memory without packing (especially when large arrays are used and in this case with caution to the stack).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ralf&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:21:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563778#M17269</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list file?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563779#M17270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CodeRedSupport on Wed Aug 24 00:12:50 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: RA1981&lt;/STRONG&gt;&lt;BR /&gt;'Currently' means that this might be the case in the (near) future? ;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry, you read a little too much into my statement here. This is a personal "wish list area" for me, but it is not an area where you are likely to see new functionality within LPCXpresso in the near future.&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;How to get the size? Use the C sizeof-Operator?&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;I just did a compare and contrast of the entries for the structures in the map file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Okay, I understand why it's not a good idea to pack it, but most of my projects data are mostly 8-Bit variables, so it would be wasting memory without packing (especially when large arrays are used and in this case with caution to the stack).&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;You want to be slightly careful of using 8 bit variables. Remember that we are talking about a 32-bit processor here, and 32-bit variables are the most efficiently handled from the generated code viewpoint. With 8-bit variables, you will often end up with additional code (for example, shifts). Thus your saving in RAM space may get offset by the increase in your code size in flash. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ There is a paper which includes some information on this here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://www.eetimes.com/design/embedded/4210470/Efficient-C-Code-for-ARM-Devices?pageNumber=1&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Although this is focussed on ARM's RealView compiler, much of it equally applies to gcc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But what is best for your application is really down to your own experimentation and system resources.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CodeRedSupport&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:21:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563779#M17270</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list file?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563780#M17271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by RA1981 on Wed Aug 24 09:43:13 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: CodeRedSupport&lt;/STRONG&gt;&lt;BR /&gt;Sorry, you read a little too much into my statement here. This is a personal "wish list area" for me, but it is not an area where you are likely to see new functionality within LPCXpresso in the near future.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't worry, I didn't read to much into it (that's why I wrote it with a smilie).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;I just did a compare and contrast of the entries for the structures in the map file.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mmmmmh.... For me the map isn't very detailful, that's the reason for this thread, but maybe I read the map file wrong...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt; You want to be slightly careful of using 8 bit variables. Remember that we are talking about a 32-bit processor here, and 32-bit variables are the most efficiently handled from the generated code viewpoint. With 8-bit variables, you will often end up with additional code (for example, shifts). Thus your saving in RAM space may get offset by the increase in your code size in flash. &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know about the disadvantages using non-32-bit variables on a 32-bit MCU, but... if I understand it right this means: if I need a buffer with 1k entries, where each entry is only a byte value it would cost me half the RAM of a LPC1114 if I use 32-bit width variable type. Okay, this example is maybe a bit oversized, but in fact I'm right, right? :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Or could such a case be solved better?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;[ There is a paper which includes some information on this here:&lt;BR /&gt;&lt;A href="http://"&gt;http://www.eetimes.com/design/embedded/4210470/Efficient-C-Code-for-ARM-Devices?pageNumber=1&lt;/A&gt;&lt;BR /&gt;Although this is focussed on ARM's RealView compiler, much of it equally applies to gcc.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you, I'll read it :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;But what is best for your application is really down to your own experimentation and system resources.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The best for my application is to get experience with the NXP devices and the LPCxpresso environment ;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ralf&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:21:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-create-a-list-file/m-p/563780#M17271</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:21:09Z</dc:date>
    </item>
  </channel>
</rss>

