<?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>topic Re: Porting KL25Z from gcc-arm-embedded to codesourcery failed in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Porting-KL25Z-from-gcc-arm-embedded-to-codesourcery-failed/m-p/283944#M10752</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS a lot for sharing! This will help other Community members to increase their skills and build up interesting proposals like the one you came up with.&lt;/P&gt;&lt;P&gt;Looking forward to see you and your hard work around.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Monica.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jul 2013 17:33:18 GMT</pubDate>
    <dc:creator>Monica</dc:creator>
    <dc:date>2013-07-30T17:33:18Z</dc:date>
    <item>
      <title>Porting KL25Z from gcc-arm-embedded to codesourcery failed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Porting-KL25Z-from-gcc-arm-embedded-to-codesourcery-failed/m-p/283942#M10750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The original project comes from Andrew Payne. The code is built under gcc-arm-embedded under Linux. Now I am trying to port it to Codesourcery arm-none-eabi-gcc under Windows, because this toolchain is used by Arduino/Maple in open source projects.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After checking differences between two gccs, I made some changes on makefile and mkl25z4.ld, for CFLAGS.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;During porting project between two toolchains, I got following errors during linking:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -Wa,- adhlns=demo.lst -fmessage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -Os -I . -c demo.c D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -Wa,- adhlns=demo.lst -fmessage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -Os -I . -T mkl25z4.ld -o demo.out demo.o libbare.a libbare.a(_startup.o): In function `_reset_init': E:\labs_codesourcery_gcc_cortex_m\bare-metal-arm-master/_startup.c:307: undefined reference to `__cs3_start_c' d:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/armv 6-m\libc.a(lib_a-abort.o): In function `abort': abort.c:(.text+0xa): undefined reference to `_exit' d:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/armv 6-m\libc.a(lib_a-signalr.o): In function `_getpid_r': signalr.c:(.text+0x2): undefined reference to `_getpid' d:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/armv 6-m\libc.a(lib_a-lseekr.o): In function `_lseek_r': lseekr.c:(.text+0x10): undefined reference to `_lseek' collect2: ld returned 1 exit status make: *** [demo.out] Error 1 rm demo.o&lt;/PRE&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe gcc-arm-embedded and codesourcery have different approaches on startup code, interrupt and exit. For example, _start() calls main() in gcc-arm-embedded, while codesourcery uses __cs3_start_c() to call main(). But it complaints as undefined reference! And indeed this symbol is not included in any *.a file.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a complete Kinetis project for Codesourcery? Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337614" rel="nofollow noopener noreferrer" target="_blank"&gt;bare-metal-arm-master.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 12:22:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Porting-KL25Z-from-gcc-arm-embedded-to-codesourcery-failed/m-p/283942#M10750</guid>
      <dc:creator>kai_liu</dc:creator>
      <dc:date>2013-07-22T12:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Porting KL25Z from gcc-arm-embedded to codesourcery failed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Porting-KL25Z-from-gcc-arm-embedded-to-codesourcery-failed/m-p/283943#M10751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, it takes quite a long time to evaluate corresponding makefile/linker script.since invoking different gcc toolchains for ARM cortex-M0 are different in many ways, including:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;-mcpu (values, some uses cortex-m0, some uses cortex-m0plus)&lt;/LI&gt;&lt;LI&gt;newlib in CS, nano-newlib in gcc-arm-embedded)&lt;/LI&gt;&lt;LI&gt;c++ handling and overhead&lt;/LI&gt;&lt;LI&gt;interrupt and startup code&lt;/LI&gt;&lt;LI&gt;more&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;gcc-arm-embedded (Linux)&lt;/LI&gt;&lt;LI&gt;gcc-arm-embedded (Windows)&lt;/LI&gt;&lt;LI&gt;Codesourcery 2010q1 (Windows for Arduino and Maple)&lt;/LI&gt;&lt;LI&gt;Codesoucery 2013 (Windows)&lt;/LI&gt;&lt;LI&gt;Yagarto&lt;/LI&gt;&lt;LI&gt;WinARM&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally I found demos from CooCox (Eclipse based) is quite useful, it will generate code automatically. Then I check its building process and update my makefile/linker script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can download the attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PS, the code has not verified yet (an empty main.c) . I just make sure there are no building errors/warnings from gcc.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will update my post as soon as verification the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current status:&lt;/P&gt;&lt;P&gt;Codesoucery G++ Lite 2010q1&lt;/P&gt;&lt;P&gt;make / cs-make&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;F:\labs_codesourcery_gcc_cortex_m\KL25Z-Demo&amp;gt;make all
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c startup_coide.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c syscalls.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xadc.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xcore.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xdebug.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xgpio.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xsysctl.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xuart.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-ar -rv libbare.a startup_coide.o syscalls.o xadc.o
xcore.o xdebug.o xgpio.o xsysctl.o xuart.o
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-ar: creating libbare.a
a - startup_coide.o
a - syscalls.o
a - xadc.o
a - xcore.o
a - xdebug.o
a - xgpio.o
a - xsysctl.o
a - xuart.o
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c main.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -nostartfiles -Wl,-Map=KL25Z-Demo.map -O0
-Wl,--gc-sections -L. -Wl,-Tlink.ld -g -o KL25Z-Demo.elf main.o startup_coide.o syscalls.o xadc.o xcore.o xdebug.o xgpio
.o xsysctl.o xuart.o
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-size KL25Z-Demo.elf
&amp;nbsp;&amp;nbsp; text&amp;nbsp;&amp;nbsp;&amp;nbsp; data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bss&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dec&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hex filename
&amp;nbsp;&amp;nbsp; 1740&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp; 1104&amp;nbsp;&amp;nbsp;&amp;nbsp; 2844&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b1c KL25Z-Demo.elf
rm main.o
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Teensy demostrates that K20 can be used in Arduino IDE, if this demo goes well. (Teensy works great, but standalone project IDE seems better) I will design a simple IDE with Python/wxPython, (I preferred Python than Java) with wiring C++ API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking for your comments. I don't have enough motivation if it is not attractive to you guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 02:03:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Porting-KL25Z-from-gcc-arm-embedded-to-codesourcery-failed/m-p/283943#M10751</guid>
      <dc:creator>kai_liu</dc:creator>
      <dc:date>2013-07-26T02:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Porting KL25Z from gcc-arm-embedded to codesourcery failed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Porting-KL25Z-from-gcc-arm-embedded-to-codesourcery-failed/m-p/283944#M10752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS a lot for sharing! This will help other Community members to increase their skills and build up interesting proposals like the one you came up with.&lt;/P&gt;&lt;P&gt;Looking forward to see you and your hard work around.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Monica.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2013 17:33:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Porting-KL25Z-from-gcc-arm-embedded-to-codesourcery-failed/m-p/283944#M10752</guid>
      <dc:creator>Monica</dc:creator>
      <dc:date>2013-07-30T17:33:18Z</dc:date>
    </item>
  </channel>
</rss>

