# Using printf/DEBUTOUT() with DEBUG_UART not SemiHosting

Discussion created by lpcware on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by gwlindberg on Thu Feb 04 12:06:46 MST 2016
I'm trying to use uart0 in our LPC1517 for debug output.

I've enabled the defines for DEBUG_ENABLE AND DEBUG_UART in board.h and if I use the DEBUGOUT() macro everything compiles correctly. If I try to use the DEBUGOUT() macro or printf() I get the following errors:

 `c:/nxp/lpcxpresso_8.0.0_526/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m\libcr_c.a(alloc.o): In function `_Csys_alloc':alloc.c:(.text._Csys_alloc+0x12): undefined reference to `__sys_appexit'c:/nxp/lpcxpresso_8.0.0_526/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m\libcr_c.a(_deferredlazyseek.o): In function `__flsbuf':_deferredlazyseek.c:(.text.__flsbuf+0x84): undefined reference to `__sys_istty'c:/nxp/lpcxpresso_8.0.0_526/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m\libcr_c.a(_writebuf.o): In function `_Cwritebuf':_writebuf.c:(.text._Cwritebuf+0x14): undefined reference to `__sys_flen'_writebuf.c:(.text._Cwritebuf+0x28): undefined reference to `__sys_seek'c:/nxp/lpcxpresso_8.0.0_526/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m\libcr_c.a(fseek.o): In function `fseek':fseek.c:(.text.fseek+0x1a): undefined reference to `__sys_istty'fseek.c:(.text.fseek+0x44): undefined reference to `__sys_flen'collect2.exe: error: ld returned 1 exit status`

Where are these symbols defined? board_api.h redefines the DEBUGOUT() macro to printf for non-SemiHosting debugging, so I would assume that it is expected to work. Am I expected to provide stubs for these functions, I've searched and I can't find any sample code for these functions, what is supposed to be in them?