I am trying to resurrect an old olimex lpc2124 board with some code
written using the WinARM and newlib lpc library. It is 5 year old code
and I am running into a problem with the interrupts and UART serial
reading. The main loop will run, but it gets stuck at read until I enter
a character into the serial interface using putty. How can I make read
non-blocking? I thought I set it up to do that using the newlib-lpc
ioctl function. Does this not work?
I know that there used to be some race condition with the UART in the
old newlib-lpc, but I have the newest version of WinARM so I thought
that was taken car of. Could there be some other race condition I am
getting? Or is it just read that is messing things up?
All of the code is below. If something isn't clear let me know and I'll
My main function has a loop the runs every so often using a regular
returns -1 with the errno 88 which is defined as "File opening Error:
Function not implemented"
ioctl is implemented in Winarm using the newlib-lpc library right? Does
that mean that I am having a problem with Winarm?
return 0 however, which means that those ioctl functions work...
Could anyone give me some direction or suggestions with this? I have
googled everything I can think of and cannot find anyone with the same
Newlib is open source. Use the source, Luke!
Note: You may have to implement non-blocking UART read and write
yourself. Newlib is a minimal LibC implementaion which lacks many
features in favor of size and speed.
I was finally able to find the source code. The aeoulus development
website has a broken link for the source code (although I called the
phone number on the website, and the owner said he was gonna fix that
soon). But after some diffing I found a link to a forum that has the
file Beitrag "printf bei armgcc"
But in case that goes down, I'll attach it here for any other poor soul
who cannot find it.
Anyway, the problem was that BLOCKING_IO_NO was only implemented for spi
and not UART. I am gonna try to implement the BLOCKING_SETUP for UART
myself and see if I can get it to work. If I can figure it out, i'll
post my results back here.