<?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中的主题 LPCXpresso/LPC1114 Toolchain Problem / gcc/linker bug</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595631#M31458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by coolbrian on Tue Apr 02 05:09:01 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been hunting a rather strange problem and finally came up with a simple snippet to reproduce the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Platform: x86 Ubuntu 12.04&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IDE Version: LPCXpresso v5.1.2 [Build 2065]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the code (at the end of the post) is compiled with Debug configuration, and downloaded to a LPC1114 variant with LPC-Link, the values of all the variables are all messed up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I disassembled the AXF file and saw:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&amp;nbsp; _etext = 0x5c4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; val1&amp;nbsp;&amp;nbsp; = 0x10000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; val2&amp;nbsp;&amp;nbsp; = 0x10000001&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Therefore, I looked the data at offset 0x5c4 into the bin file and see unknown data at the place.&amp;nbsp; The expected 0x11223344 is shifted 4 bytes and located at 0x5c8.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it a linker script issue due to the usage of 64 bit data?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance. &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Brian&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;#include "driver_config.h"
#include "target_config.h"

volatile uint8_t val1 = 0x11;
volatile uint8_t val2 = 0x22;
volatile uint8_t val3 = 0x33;
volatile uint8_t val4 = 0x44;
volatile uint8_t val5 = 0x55;
volatile uint64_t val6 = 0x66554433221100;

int main(void)
{
while (1) {
val1++;
val2++;
val3++;
val4++;
val5++;
val6++;
}
return 0;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:00:47 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:00:47Z</dc:date>
    <item>
      <title>LPCXpresso/LPC1114 Toolchain Problem / gcc/linker bug</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595631#M31458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by coolbrian on Tue Apr 02 05:09:01 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been hunting a rather strange problem and finally came up with a simple snippet to reproduce the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Platform: x86 Ubuntu 12.04&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IDE Version: LPCXpresso v5.1.2 [Build 2065]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the code (at the end of the post) is compiled with Debug configuration, and downloaded to a LPC1114 variant with LPC-Link, the values of all the variables are all messed up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I disassembled the AXF file and saw:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&amp;nbsp; _etext = 0x5c4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; val1&amp;nbsp;&amp;nbsp; = 0x10000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; val2&amp;nbsp;&amp;nbsp; = 0x10000001&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Therefore, I looked the data at offset 0x5c4 into the bin file and see unknown data at the place.&amp;nbsp; The expected 0x11223344 is shifted 4 bytes and located at 0x5c8.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it a linker script issue due to the usage of 64 bit data?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance. &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Brian&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;#include "driver_config.h"
#include "target_config.h"

volatile uint8_t val1 = 0x11;
volatile uint8_t val2 = 0x22;
volatile uint8_t val3 = 0x33;
volatile uint8_t val4 = 0x44;
volatile uint8_t val5 = 0x55;
volatile uint64_t val6 = 0x66554433221100;

int main(void)
{
while (1) {
val1++;
val2++;
val3++;
val4++;
val5++;
val6++;
}
return 0;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:00:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595631#M31458</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: LPCXpresso/LPC1114 Toolchain Problem / gcc/linker bug</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595632#M31459</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 Tue Apr 02 05:51:07 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;No problem seen here with your test code. Variables placed in memory as expected, as seen in the map file. And all display and update as expected when debugging.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One thing to watch is that 64bit variables are padded to sit on a 64bit boundary in memory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What actually is the "strange problem" you are seeing that you produced this test case for??&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 23:00:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595632#M31459</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: LPCXpresso/LPC1114 Toolchain Problem / gcc/linker bug</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595633#M31460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by coolbrian on Tue Apr 02 07:27:55 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for testing.&amp;nbsp; I do not know why the code works with your toolchain while it doesn't with mine...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please see the attached files for the problem that I am after.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Within ResetISR() in the stock startup/cr_startup_lpc11.c, data is copied from Flash starting at &amp;amp;_etext to RAM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_etext=0x5c4 (blinky.map) while val[1-6] are stored from 0x5c8 and on in blinky.bin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, Line #279 in blinky.map says the .data section load address is 0x5c8, which is correct.&amp;nbsp; However, in ResetISR(), initializing data starting from &amp;amp;_etext (=0x5c4) does not seem right.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know if you need more information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Brian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:00:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595633#M31460</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: LPCXpresso/LPC1114 Toolchain Problem / gcc/linker bug</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595634#M31461</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 Tue Apr 02 08:54:36 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't tell for definite, as you didn't actually export your project - but I suspect that your project is based on some examples that NXP generated back during the lifetime of LPCXpresso 3. Unfortunately NXP have not updated these examples since - which means that odd problems can occasionally crop up due to their vintage.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would suggest that you try swapping the startup file you currently have within your project with the startup file generated by the LPCXpresso 5 project wizard. Then rebuild and see if this cures the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For some background information here, see:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/MigratingToNewVersion&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 23:00:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595634#M31461</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: LPCXpresso/LPC1114 Toolchain Problem / gcc/linker bug</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595635#M31462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by coolbrian on Tue Apr 02 21:39:11 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello CodeRedSupport,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes. You are correct that my project is based on the NXP examples included in the LPCXpresso 5.x, which contain faulty linker scripts + startup code combo.&amp;nbsp; I think that is the cause of the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Switching to the lone CMSISv1 library seems to solve the problem.&amp;nbsp; The linker script and the C environment setup code are massively different from the faulty ones.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the LPC11xx.h header file supplied by the LPCXpresso-shipped CMSISv1 library is wrong.&amp;nbsp; Some registers offsets are not correct.&amp;nbsp; I guess it is not being maintained anymore?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you a lot for the pointers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Brian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:00:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-LPC1114-Toolchain-Problem-gcc-linker-bug/m-p/595635#M31462</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:00:49Z</dc:date>
    </item>
  </channel>
</rss>

