<?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 do multiple text segments?</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-do-multiple-text-segments/m-p/584756#M26422</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 Fri Nov 19 02:27:04 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The generated makefiles convert .c to .o without any intermediate step. If you want to see what the compiler has output, use the "-save-temps" option, which will leave the intermediate files in the build directory (Debug or Release). An alternative would be to output an assembler listing file, by adding "-Xassembler -aln=${InputFileBaseName}.s" to the compiler options.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you really want to do it all yourself, using makefiles, writing your own makefile and linker scripts etc, you need to create a Makefile project by doing the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File-&amp;gt;New-&amp;gt;Project...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Expand C/C++ and select "C Project", Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Expand Makefile project and select "Empty Project"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ensure "Code Red MCU Toolchain" is selected under toolchain&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Choose a project name, and Next, or Finish&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By default, the code is placed in the .text section. You can put the code for any function into your own section by prefixing the function definition with&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__attribute__((section(".my-text-section")))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You then need to change the linker script to place this wherever you want. See the FAQ for more information:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/CodeRedFAQ&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;and specifically&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/OwnLinkScripts&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use arm-none-eabi-strip to strip your binaries. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd be surprised if you really can save much space by compressing your code and expanding it at run time (given the size of the expansion routine).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 01:19:52 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T01:19:52Z</dc:date>
    <item>
      <title>How to do multiple text segments?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-do-multiple-text-segments/m-p/584755#M26421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by chrisz on Thu Nov 18 23:59:10 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Just started using LPCXpresso and the Eclipse environment, so forgive me if this is somewhere in the documentation and I can't find it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to do things:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First, whenever developing embedded systems, I always arrange Makefiles so they compile in 2 parts:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;.c -&amp;gt; .s&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.s -&amp;gt; .o&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That way, the assembly code is always left around so I can look at it and gain an understanding of what was actually done and how to interface to it. I have found a place where I can modify the command line to gss to specify -S to get the assembly files (Tool Settings, MCU C Compiler), but I have not been successful in then making it go on to compile these generated .s files into .o files. It simply stops after the .c -&amp;gt; .s step and fails.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone tell me how I should accomplish this? Can I use an external Makefile with the eclipse environment, and if so, can someone offer an example? The makefile in the source directory appears to be regenerated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Second, I want to set up 2 text code segments. The first segment will go into flash. The second segment will contain init code that can be thrown away once it has run. I want to compress this segment and then load it into SRAM at startup. (I may eventually add more temporary segments using this same concept if the space saving proves substantial.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously I will need to create a custom .ld file to pass to the linker, but it is unclear how I should do this. The ones used in the example (e.g. lpcxpresso1114_blinky_Debug.ld) say that they are auto generated from nxp_lpc11_c.ld and not to modify them, but I can not find the parent file on my system.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also need to add a step in the Makefile that strips the binary code and compresses it to a data block. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have an example application that shows how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm sure I can figure all this out myself in time, but if anyone from the group can offer some assistance and an example or 2 it will save me alot of time, and having spent 2 weeks just trying to get the development system to work I'm already way behind on this project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any assistance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:19:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-do-multiple-text-segments/m-p/584755#M26421</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to do multiple text segments?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-do-multiple-text-segments/m-p/584756#M26422</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 Fri Nov 19 02:27:04 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The generated makefiles convert .c to .o without any intermediate step. If you want to see what the compiler has output, use the "-save-temps" option, which will leave the intermediate files in the build directory (Debug or Release). An alternative would be to output an assembler listing file, by adding "-Xassembler -aln=${InputFileBaseName}.s" to the compiler options.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you really want to do it all yourself, using makefiles, writing your own makefile and linker scripts etc, you need to create a Makefile project by doing the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File-&amp;gt;New-&amp;gt;Project...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Expand C/C++ and select "C Project", Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Expand Makefile project and select "Empty Project"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ensure "Code Red MCU Toolchain" is selected under toolchain&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Choose a project name, and Next, or Finish&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By default, the code is placed in the .text section. You can put the code for any function into your own section by prefixing the function definition with&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__attribute__((section(".my-text-section")))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You then need to change the linker script to place this wherever you want. See the FAQ for more information:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/CodeRedFAQ&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;and specifically&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/OwnLinkScripts&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use arm-none-eabi-strip to strip your binaries. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd be surprised if you really can save much space by compressing your code and expanding it at run time (given the size of the expansion routine).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:19:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-do-multiple-text-segments/m-p/584756#M26422</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to do multiple text segments?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-do-multiple-text-segments/m-p/584757#M26423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Dig Kleppe on Tue Dec 20 14:00:39 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;For using segments do I need a makefileproject? I placed a var in one of standard RAM segments ( RamAHB8_B0B LPC1788), using attribute.. , but this does not work. Is was placed as a usual var. Making it a global intitialized var did not help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to add a segment for external SDram. I expected I could add this in the MCU settings!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dig Kleppe&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;a few minutes later:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Found the solution using cr_section_macros.h , works with a adapted linkerscript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dig Kleppe&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:19:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-to-do-multiple-text-segments/m-p/584757#M26423</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:19:53Z</dc:date>
    </item>
  </channel>
</rss>

