<?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: LPCOPEN compilation error</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCOPEN-compilation-error/m-p/673983#M32918</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The IDE"s built in libraries provide the _sbrk() function. You generally should not need to provide your own.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aside : you may find this FAQ useful :&amp;nbsp;&lt;A href="https://community.nxp.com/message/630622"&gt;https://community.nxp.com/message/630622&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;LPCXpresso Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jul 2017 10:25:14 GMT</pubDate>
    <dc:creator>lpcxpresso_supp</dc:creator>
    <dc:date>2017-07-19T10:25:14Z</dc:date>
    <item>
      <title>LPCOPEN compilation error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCOPEN-compilation-error/m-p/673982#M32917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am migrating my project from CMSIS to &lt;SPAN&gt;LPCOPEN&amp;nbsp;&lt;/SPAN&gt;and I am having compilation problems with function "caddr_t _sbrk(int incr)". I am using LPC1768FBD100 chip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Follow function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include &amp;lt;errno.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdarg.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include &amp;lt;string.h&amp;gt;&lt;BR /&gt;#include &amp;lt;fcntl.h&amp;gt;&lt;BR /&gt;#include &amp;lt;sys/stat.h&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;caddr_t _sbrk(int incr)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;extern char _pvHeapStart; /* Defined by the linker */&lt;BR /&gt; static char *heap_end;&lt;BR /&gt; char *prev_heap_end;&lt;BR /&gt; register char *stack_ptr __asm ("sp");&lt;/P&gt;&lt;P&gt;if (heap_end == 0)&lt;BR /&gt; {&lt;BR /&gt; heap_end = &amp;amp;_pvHeapStart;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;prev_heap_end = heap_end;&lt;/P&gt;&lt;P&gt;if (heap_end + incr &amp;gt; stack_ptr)&lt;BR /&gt; {&lt;BR /&gt; errno = ENOMEM;&lt;/P&gt;&lt;P&gt;return (caddr_t)-1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;heap_end += incr;&lt;/P&gt;&lt;P&gt;return (caddr_t)prev_heap_end;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;When I compile the project using CMSIS everything is ok,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invoking: MCU C Compiler&lt;BR /&gt;arm-none-eabi-gcc -D__USE_CMSIS -D__CODE_RED -D__NEWLIB__ -I"../inc" -I"C:\Alvaro\thyssen\Workspace_alopes_MFG040029\depot\Drivers\LPC17xx\CMSIS_LPC17xx\inc" -I"C:\Alvaro\thyssen\Workspace_alopes_MFG040029\depot\Drivers\LPC17xx\Drivers_LPC17xx\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -MMD -MP -MF"src/system.d" -MT"src/system.o" -MT"src/system.d" -o"src/system.o" "../src/system.c"&lt;BR /&gt;Finished building: ../src/system.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;but when I compile using lpcopen I have the follow compilation error:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invoking: MCU C Compiler&lt;BR /&gt;arm-none-eabi-gcc -std=gnu99 -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_LPCOPEN -D__LPC175X_6X__ -DUSB_HOST_ONLY -DCORE_M3 -I"C:\Alvaro\thyssen\Workspace_alopes_MFG040029\depot\Modulos\lpc_chip_175x_6x\inc" -I"C:\nxp\LPCXpresso_8.0.0_526\lpcxpresso\tools\lib\gcc\arm-none-eabi\4.9.3\include-fixed" -I"C:\nxp\LPCXpresso_8.0.0_526\lpcxpresso\tools\arm-none-eabi\include" -I"C:\nxp\LPCXpresso_8.0.0_526\lpcxpresso\tools\lib\gcc\arm-none-eabi\4.9.3\include" -I"C:\Alvaro\thyssen\Workspace_alopes_MFG040029\depot\Modulos\lpc_board_nxp_lpcxpresso_1769\inc" -I"C:\Alvaro\thyssen\Workspace_alopes_MFG040029\depot\Modulos\VOX5\VOX5\code\inc" -I"C:\Alvaro\thyssen\Workspace_alopes_MFG040029\depot\Modulos\VOX5\VOX5\lpcusblib\Drivers\USB" -I"C:\Alvaro\thyssen\Workspace_alopes_MFG040029\depot\Modulos\VOX5\VOX5\fatfs\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m3 -mthumb -specs=redlib.specs -MMD -MP -MF"code/src/main.d" -MT"code/src/main.o" -MT"code/src/main.d" -o "code/src/main.o" "../code/src/main.c"&lt;BR /&gt;../code/src/main.c:154:1: error: function '__errno' is initialized like a variable&lt;BR /&gt; int errno=0;&lt;BR /&gt; ^&lt;BR /&gt;../code/src/main.c: In function '_sbrk':&lt;BR /&gt;../code/src/main.c:1080:8: error: 'errno' undeclared (first use in this function)&lt;BR /&gt; errno = ENOMEM;&lt;BR /&gt; &lt;BR /&gt;&lt;EM&gt;In my file .c there is other functions that are using errno and not generate compilation erros. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2017 11:46:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCOPEN-compilation-error/m-p/673982#M32917</guid>
      <dc:creator>alvarolopes</dc:creator>
      <dc:date>2017-07-18T11:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: LPCOPEN compilation error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCOPEN-compilation-error/m-p/673983#M32918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The IDE"s built in libraries provide the _sbrk() function. You generally should not need to provide your own.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aside : you may find this FAQ useful :&amp;nbsp;&lt;A href="https://community.nxp.com/message/630622"&gt;https://community.nxp.com/message/630622&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;LPCXpresso Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 10:25:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCOPEN-compilation-error/m-p/673983#M32918</guid>
      <dc:creator>lpcxpresso_supp</dc:creator>
      <dc:date>2017-07-19T10:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: LPCOPEN compilation error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCOPEN-compilation-error/m-p/673984#M32919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where can I find the prototype of this function (_sbrk)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I search in my workspace project for this function, there is 0&amp;nbsp;results for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying migrating other funcions (system calls) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int _close(int file)&lt;BR /&gt;void _exit(int status)&lt;BR /&gt;int _fstat(int file, struct stat *st)&lt;BR /&gt;int _getpid(void)&lt;BR /&gt;int _isatty(int file)&lt;BR /&gt;int _kill(int pid, int sig)&lt;BR /&gt;int _lseek(int file, int ptr, int dir)&lt;BR /&gt;int _open(char *name, int flags, int mode)&lt;BR /&gt;int _read(int file, char *ptr, int len)&lt;BR /&gt;int _stat(char *file, struct stat *st)&lt;BR /&gt;int _unlink(char *name)&lt;BR /&gt;int _write(int file, char *ptr, int len)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing this because, for example, when I use fopen, I need that this function, open a file from External Flash(using SPI) that have your own functions like write, read, status, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I direct all these file handling functions to the SPI interface?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For make this happen I create a function _open that provide this action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 12:06:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCOPEN-compilation-error/m-p/673984#M32919</guid>
      <dc:creator>alvarolopes</dc:creator>
      <dc:date>2017-07-19T12:06:41Z</dc:date>
    </item>
  </channel>
</rss>

