Content originally posted in LPCWare by riscy00 on Sat Jan 05 11:53:33 MST 2013
Now that fixed....one more experiment is to change from Semihost to None.
Was is worth going into RedLib(None)...no host, any difference in size?
Set this via Properties > Setting > Tool Setting > MCU Linker
then check Manage Linker Script and select Use C Library to RedLib (none).
I tried this and it give lot of error as snippet shown below, what I done wrong?.
I have retarget code below:
int __sys_write(int iFileHandle, char *pcBuffer, int iLength)
{
UARTSend((uint8_t *)pcBuffer,iLength); //send data buffer to UART
return iLength;
}
and
void UART_Process_Recieved_Message(void)
{
LPC_UART->IER = IER_THRE | IER_RLS;// Disable RBR
UARTSend( (uint8_t *)UARTBuffer, UARTCount );
//printf("Received data: %s\n",(uint8_t *)UARTBuffer);
UARTCount = 0;
LPC_UART->IER = IER_THRE | IER_RLS | IER_RBR;// Re-enable RBR
}
....
<Snip>
....
Building target: LEDTest2.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -Xlinker -Map=LEDTest2.map -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "LEDTest2_Debug.ld" -o "LEDTest2.axf" ./startup/cr_startup_lpc11.o ./driver/gpio.o ./driver/uart.o ./cmsis/core_cm0.o ./cmsis/system_LPC11xx.o ./9_SysTick/Systick.o ./9_Main/Main.o ./9_Global/Global.o ./7_UART/UART_Utils.o
c:/nxp/lpcxpresso_5.0.14_1109/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv6-m\libcr_c.a(_deferredlazyseek.o): In function `__flsbuf':
_deferredlazyseek.c:(.text.(float, long, short, bool, float __restrict)+0x8a): undefined reference to `__sys_istty'
c:/nxp/lpcxpresso_5.0.14_1109/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv6-m\libcr_c.a(_writebuf.o): In function `_Cwritebuf':
_writebuf.c:(.text._Cwritebuf+0x16): undefined reference to `__sys_flen'
_writebuf.c:(.text._Cwritebuf+0x26): undefined reference to `__sys_seek'
c:/nxp/lpcxpresso_5.0.14_1109/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv6-m\libcr_c.a(alloc.o): In function `malloc':
alloc.c:(.text.malloc+0x70): undefined reference to `_sbrk'
alloc.c:(.text.malloc+0x90): undefined reference to `_sbrk'
c:/nxp/lpcxpresso_5.0.14_1109/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv6-m\libcr_c.a(alloc.o): In function `_Csys_alloc':
alloc.c:(.text._Csys_alloc+0x14): undefined reference to `__sys_appexit'
c:/nxp/lpcxpresso_5.0.14_1109/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv6-m\libcr_c.a(fseek.o): In function `fseek':
fseek.c:(.text.fseek+0x18): undefined reference to `__sys_istty'
fseek.c:(.text.fseek+0x3c): undefined reference to `__sys_flen'
collect2: ld returned 1 exit status
make: *** [LEDTest2.axf] Error 1
20:41:20 Build Finished (took 4s.808ms)