This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UART I/O on LPC4357 using Keil uVision

Hi,

I am trying to setup UART1 communication on the LPC4357 device. This is the first time I am using an ARM device, I usually use AVR ATmega devices. Now, to setup an I/O stream, I used

(line 12) FILE *UART_STR = FDEV_SETUP_STREAM(UartPutChar, UartGetChar, _FDEV_SETUP_RW);

and then later on,

(line 24) stdout = stdin = UART_STR;

But this is not working as the IDE gives me the following errors

Driver.c(12): error: #20: identifier "FDEV_SETUP_STREAM" is undefined
Driver.c(12): error: #59: function call is not allowed in a constant expression
Driver.c(12): error: #20: identifier "_FDEV_SETUP_RW" is undefined
Driver.c(24): error: #137: expression must be a modifiable lvalue
Driver.c(24): error: #137: expression must be a modifiable lvalue

Apparently, the stdio.h library in Keil does not have this macro defined unlike the AVR library. I do not know of anything else to make my code for the UART setup work, as I need to setup an I/O stream.

So, I'm wondering if someone knows how I might fix this issue in Keil and get my code to work. Please help me with this matter!

Thank you.
-Jameel