<?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 Design Studio中的主题 KDS 3.0 linkage problem</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/KDS-3-0-linkage-problem/m-p/623193#M8010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am seeing a strange behavior.&amp;nbsp; I was using stdlib.h, and tried to use srand and rand functions.&amp;nbsp; At the end of the link, I got an error about an undefined reference to _sbrk.&amp;nbsp; After some searching, I found if I added:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GROUP (&lt;/P&gt;&lt;P&gt;libnosys.a&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;to the bottom of ProcessorExpert.ld, it works.&amp;nbsp; Now the strange thing is that my colleague is able to build the same project without having to do that, and we both have KDS 3.0.0.&amp;nbsp; Is there a setting somewhere that adds libnosys without having to modify the linker file, and perhaps the setting has changed?&amp;nbsp; We have been using stdlib.h for other functions with no trouble, it was just when we tried to use the random functions this showed up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Sep 2016 14:26:33 GMT</pubDate>
    <dc:creator>davidsherman</dc:creator>
    <dc:date>2016-09-15T14:26:33Z</dc:date>
    <item>
      <title>KDS 3.0 linkage problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/KDS-3-0-linkage-problem/m-p/623193#M8010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am seeing a strange behavior.&amp;nbsp; I was using stdlib.h, and tried to use srand and rand functions.&amp;nbsp; At the end of the link, I got an error about an undefined reference to _sbrk.&amp;nbsp; After some searching, I found if I added:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GROUP (&lt;/P&gt;&lt;P&gt;libnosys.a&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;to the bottom of ProcessorExpert.ld, it works.&amp;nbsp; Now the strange thing is that my colleague is able to build the same project without having to do that, and we both have KDS 3.0.0.&amp;nbsp; Is there a setting somewhere that adds libnosys without having to modify the linker file, and perhaps the setting has changed?&amp;nbsp; We have been using stdlib.h for other functions with no trouble, it was just when we tried to use the random functions this showed up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 14:26:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/KDS-3-0-linkage-problem/m-p/623193#M8010</guid>
      <dc:creator>davidsherman</dc:creator>
      <dc:date>2016-09-15T14:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: KDS 3.0 linkage problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/KDS-3-0-linkage-problem/m-p/623194#M8011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;Check out Erich &lt;SPAN&gt;Styger's&lt;/SPAN&gt; blog:&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuoneclipse.com/2015/12/13/linting-with-eclipse-and-the-gnu-arm-embedded-launchpad-compiler/"&gt;https://mcuoneclipse.com/2015/12/13/linting-with-eclipse-and-the-gnu-arm-embedded-launchpad-compiler/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look for:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica ,sans-serif; color: #373737; background: white; font-size: 11.5pt;"&gt;c&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica ,sans-serif; background: white; color: #373737;"&gt;:/freescale/kds_v3/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/&lt;SPAN class="GramE"&gt;..&lt;/SPAN&gt;/../../../arm-none-eabi/lib/armv7e-m/fpu\libg_&lt;SPAN class="GramE"&gt;s.a(&lt;/SPAN&gt;lib_a-sbrkr.o): In function `_&lt;SPAN&gt;sbrk_r&lt;/SPAN&gt;':&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica ,sans-serif; color: #373737;"&gt;&lt;BR /&gt;&lt;SPAN style="background: white;"&gt;sbrkr.c&lt;/SPAN&gt;&lt;SPAN style="background: white;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="background: white;"&gt;(.text._sbrk_r+0xc): undefined reference to `_&lt;SPAN&gt;sbrk&lt;/SPAN&gt;'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="background: white;"&gt;collect2.exe: error: &lt;SPAN&gt;&lt;SPAN class="GramE"&gt;ld&lt;/SPAN&gt;&lt;/SPAN&gt; returned 1 exit status&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="background: white;"&gt;makefile:&lt;/SPAN&gt;&lt;SPAN style="background: white;"&gt;72: recipe for target '&lt;SPAN&gt;EDWB.elf&lt;/SPAN&gt;' failed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="background: white;"&gt;make&lt;/SPAN&gt;&lt;SPAN style="background: white;"&gt;: *** [&lt;SPAN&gt;EDWB.elf&lt;/SPAN&gt;] Error 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="vertical-align: baseline;"&gt;&lt;SPAN style="font-family: inherit ,serif; mso-border-alt: none windowtext 0in; font-size: 9pt; border: windowtext 1pt; padding: 0in;"&gt;&lt;A href="https://mcuoneclipse.wordpress.com/"&gt;&lt;STRONG style="color: #1982d1; text-underline: none; text-decoration: none;"&gt;Erich &lt;SPAN&gt;Styger&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit ,serif; font-size: 9pt;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit ,serif; font-size: 9pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: inherit ,serif;"&gt;&lt;A href="https://mcuoneclipse.com/2015/12/13/linting-with-eclipse-and-the-gnu-arm-embedded-launchpad-compiler/#comment"&gt;&lt;STRONG style="border: windowtext 1pt; padding: 0in; color: #1982d1; mso-border-alt: none windowtext 0in; text-underline: none; text-decoration: none;"&gt;May 25, 2016 at 16:30&lt;/STRONG&gt;&lt;/A&gt;&lt;SPAN class="apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-border-alt: none windowtext 0in; border: windowtext 1pt; padding: 0in;"&gt;said:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 19.5pt; vertical-align: baseline; background: #dddddd; word-spacing: 0px; outline-width: 0px; outline-style: none; margin-left: 0in; orphans: 2; widows: 2; outline-color: invert; line-height: 18.3pt; margin-right: 0in; mso-margin-top-alt: 0in; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: Helvetica ,sans-serif; color: #373737;"&gt;Add&lt;BR /&gt;-specs=&lt;SPAN&gt;nosys.specs&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="GramE"&gt;to&lt;/SPAN&gt; the linker options. This will disable &lt;SPAN&gt;semihosting&lt;/SPAN&gt; which I think is causing your problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="" style="border: 0px; font-weight: inherit; font-size: 12px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 12px;"&gt;&lt;A class="" href="https://mcuoneclipse.wordpress.com/" rel="external nofollow" style="color: #1982d1; border: 0px; font-weight: bold; font-size: 12px;"&gt;Erich Styger&lt;/A&gt;&lt;/SPAN&gt;on &lt;A href="https://mcuoneclipse.com/2015/12/13/linting-with-eclipse-and-the-gnu-arm-embedded-launchpad-compiler/#comment-83091" style="color: #1982d1; border: 0px; font-weight: bold; font-size: 12px;"&gt;May 25, 2016 at 20:47&lt;/A&gt; &lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 12px;"&gt;said:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #373737; background-color: #dddddd; border: 0px; font-weight: 300; margin: 1.625em 0px 0px;"&gt;&lt;P style="border: 0px; font-weight: inherit; margin: 0px 0px 1.625em;"&gt;Hi Dale,&lt;BR /&gt;_sbrk() is a low level memory allocation routine, and this is needed depending on what kind of library you are using. I have seen this in other places too. You might use my implementation I have used in this article:&lt;BR /&gt;&lt;A href="https://mcuoneclipse.com/2015/10/28/tutorial-lwip-with-the-freertos-and-the-freescale-frdm-k64f-board/" rel="nofollow" style="color: #1982d1; border: 0px; font-weight: inherit;"&gt;https://mcuoneclipse.com/2015/10/28/tutorial-lwip-with-the-freertos-and-the-freescale-frdm-k64f-board/&lt;/A&gt;&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; margin: 0px 0px 1.625em;"&gt;I hope this helps,&lt;BR /&gt;Erich&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 19:59:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/KDS-3-0-linkage-problem/m-p/623194#M8011</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-09-15T19:59:03Z</dc:date>
    </item>
  </channel>
</rss>

