LPC1114 LPCXpresso

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1114 LPCXpresso

1,427 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by riscy00 on Sat Jan 05 09:10:30 MST 2013
I have eval board and LPCXpresso IDE installed few week ago.

I was experimenting the printf function (no float needed) with LPC1114 in C.

I use retarget where UART is streamed out to terminal (ie Putty). I use CodeRed library and make use of interrupt.

RedLib is selected with auto enabled (Debug Configuration>Project debug>Debugging). I assumed host not enable.

It is working fine under 19200 Baud Rate, sending "test" message every 1 second (via systick).

However....

Within the project properties....Properties>Setting>Tool Setting>Symbols. I was experimenting the printf with CR_PRINTF_CHAR and CR_INTEGER_PRINTF symbol, for which it may reduce the codes further (no need for float).....the printf("test"); does not works (both and either). When I remove this symbol it work fine.

Have I missed something here?
0 Kudos
Reply
5 Replies

1,342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by riscy00 on Sat Jan 05 13:06:59 MST 2013
Okay thank for that I selected to RedLib(nohost) rather than RebLib(none).

I do not understand why the CodeRed IDE has grey out the RebLib/NewLib listing within quick setting method.

Zero..thank again. I can now do some serious stuff!
0 Kudos
Reply

1,342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Jan 05 12:14:34 MST 2013

Quote: riscy00
I tried this and it give lot of error as snippet shown below, what I done wrong?.



You're neither using forum Search nor CodeRed Wiki :rolleyes:

http://www.support.code-red-tech.com/CodeRedWiki/UndefinedReference?

http://knowledgebase.nxp.com/showthread.php?t=3167
0 Kudos
Reply

1,342 Views
lpcware
NXP Employee
NXP Employee
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)
0 Kudos
Reply

1,342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by riscy00 on Sat Jan 05 11:35:56 MST 2013
Hmmm that funny when I tried it again, it work fine now!

Last week it did not work and that rack me up a bit

Now very happy :)

Work on TX and RX
0 Kudos
Reply

1,342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Jan 05 09:20:17 MST 2013

Quote:

...does not works (both and either)...

What 'does not works': transmitting or receiving?

Adding 'CR_INTEGER_PRINTF' is working fine here (and also reducing code size) since years (with TeraTerm) :eek:
0 Kudos
Reply