<?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: bss section in code space</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560017#M15674</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Mon Dec 10 03:02:08 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;According to the map file in your zip file, the 'junk' is correctly located in bss and not in flash. Why do you think it is in flash?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 02:10:16 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T02:10:16Z</dc:date>
    <item>
      <title>bss section in code space</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560011#M15668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by elecia on Wed Mar 02 11:34:10 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking at my .map file, I noticed that uninitialized globals are going into code space. Given a lack of initialization, global variables should default to zero so they shouldn't take up the flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've replicated this with the blinky example (blinky_main.c is attached, modifications are noted with BSS_TESTING #def). The buffer is going into the .bss section as it should but the bss section is taking up flash space. I compiled with space optimization (-Os) but it did not change the behavior.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the cr_startup_lpc13.c file, the start up code says&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[COLOR=DarkGreen][I]&amp;nbsp;&amp;nbsp;&amp;nbsp; // Zero fill the bss segment.&amp;nbsp; This is done with inline assembly since this&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // will clear the value of pulDest if it is not kept in a register.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/I][/COLOR]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Exactly what I would expect. So why is the linker putting the bss section in my image? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know I can fix this with my own linker scripts (though it is pretty complicated and uses linker varaibles. I tried just putting NOLOAD for the bss section of the linker script but that moves the bytes to the data section instead of the bss section). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, I'd like to know how to fix this with the managed scripts.&amp;nbsp; I'm using LPCXpresso 3.6.1. I'm compiling for LPC1343.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Elecia&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560011#M15668</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: bss section in code space</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560012#M15669</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 Mar 02 14:05:20 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You'll need to export the entire project, and post it.&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;CodeRedSupport&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560012#M15669</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: bss section in code space</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560013#M15670</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 Mar 02 15:43:35 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;If you not use the memory you have reserved, it will be discarded and so you may think the space has been allocated, when it has not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, if I just add&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;int junk[128] ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to blinky, it will apeear to have a size, but in fact the linker will have discared the memory and the symbol,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I then add &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;junk[0]=1 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to main() , then the linker will not discard the data, and you will see it is correctly added to bss.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you still think there is a problem, post the WHOLE project.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560013#M15670</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: bss section in code space</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560014#M15671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by elecia on Wed Mar 02 17:04:07 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the whole project. I took the standard blinky example and modified main&amp;nbsp; to add a global variable (bssJunkData) and a line that uses that variable. I also turned on space optimization (which didn't matter).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that the problem is not whether bssJunkData goes into bss (it does) but whether bss should be taking up flash space in my image when the section is filled with zeros by Reset_Handler.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Elecia&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560014#M15671</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: bss section in code space</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560015#M15672</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 Mar 02 19:07:35 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Elecia,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've imported the project as is. Can I ask why you think the .bss section is placed in flash? The enhanced Managed Linker Script mechanism does place data pointers to the .bss section boundaries in flash (e.g. __bss_section_table, __bss_section_table_end). These are used by an updated version of the ResetISR entry code to clear the .bss section. The updated entry code can be found in the LPC1343 examples which you can import. In your case, the IDE is using updated linker scripts, but does not have the startup code which uses the new mechanism. I see no evidence the .bss image itself is consuming flash space.&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;CodeRedSupport&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: elecia&lt;/STRONG&gt;&lt;BR /&gt;Here is the whole project. I took the standard blinky example and modified main&amp;nbsp; to add a global variable (bssJunkData) and a line that uses that variable. I also turned on space optimization (which didn't matter).&lt;BR /&gt;&lt;BR /&gt;Note that the problem is not whether bssJunkData goes into bss (it does) but whether bss should be taking up flash space in my image when the section is filled with zeros by Reset_Handler.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Elecia&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560015#M15672</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: bss section in code space</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560016#M15673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by efrasiyab_ on Mon Dec 10 02:22:49 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have faced with same issue. I created new project and defined a global variable like "volatile unsigned char junk[ 128 ]". it sits in bss segment but also in flas! it is uninitialised variable and it must not be stored in the code space. I am missing something but cant find. I also tried to edit linker script and changed optimisation options but nothing changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mcu: 11c12&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lpcxpresso version: v4.2.2 [Build 275] [03/04/2012]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560016#M15673</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: bss section in code space</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560017#M15674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Mon Dec 10 03:02:08 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;According to the map file in your zip file, the 'junk' is correctly located in bss and not in flash. Why do you think it is in flash?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560017#M15674</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: bss section in code space</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560018#M15675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by efrasiyab_ on Mon Dec 10 03:14:59 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for reply. it is my fault as lamer. i was looking erroneously&amp;nbsp; "dec" field as though it is code space consumption of project.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560018#M15675</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: bss section in code space</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560019#M15676</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 Dec 10 03:47:37 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You might want to read this FAQ then...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/FlashRamSize&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>Thu, 16 Jun 2016 02:10:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/bss-section-in-code-space/m-p/560019#M15676</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:18Z</dc:date>
    </item>
  </channel>
</rss>

