CMSIS

23 Apr 2010 . Edited: 23 Apr 2010

Tried to find out whether the printf function uses the FIFO, but could arrive at a perfect conclusion. Then tried to use own printf function with enabling FIFO. The problem that i faced was irrespective of what is the level at which the write FIFO is filled it would only read 0x0 indicating that the FIFO is empty.

The bug is in the file http://mbed.org/projects/libraries/svn/mbed/trunk/LPC1768/LPC17xx.h

As per LPC1768 user manual the FIFO level register is 32 bit register with bits. Here in the LPC UART structure the FIFO level register is defined as   __I  uint8_t  FIFOLVL;

using #define rU0FIFOLVL    (*(volatile unsigned *)(0x4000C058)) instead of compilers LPC_UART0->FIFOLVL solved the problem. The FIFOLVL register needs to be defined as uint32.

I understand that the file LPC17xx.h is a standard file provided by CMSIS, so its not a mbed compiler's bug really, but the point is sometimes when we don't get the correct result its worthwhile to check the header files. Many amongst the MBED team have mentioned  this before.
Request the mbed team to make changes in the header file.
regards
rahul
p.s. i will publish the complete code soon (am not through with commenting and formatting yet)
07 Jun 2010

Thanks for raising this, I have filed it as a bug.

08 Jun 2010

Thank you Jon