EmbeddedRelated.com
Forums
Memfault Beyond the Launch

FreeRTOS - UART Problem - LPC2114 suddenly stops

Started by elperegrinoranquel August 13, 2009
Hi,

i am working with a Development Board based on a LPC2114. We have made the port for FreeRTOS using the instructions available in FreeRTOS's web page, modifying the Demo for LPC2106 (because we use GCC compiler) and comparing with the Demo for LPC2129 (because there are only very little differences with this micro).

The Demo seemed to worked just fine, but the problem comes when we use the task for the serial comunication. The micro just stops working. All the other tasks stop running.

We tried modifying the Baudrate. Slower the Baudrate is, watching in a Hyperterminal port, more amount of Character we can receive. But after, a couple of sends (60 in most of the cases for a particular slow baudrate), it stops again. If we try to use a very fast baudrate, we don't receive anything trough the Hyperterminal before the micro stops.

We modified the send routine, and sent just one Character every time the micro receive something from the hyperterminal. It works, but after a couple of sends (independent of hoy many times we wait between the sends), it stops again.

Looks like a "buffer" problem, but don't know why or where. The modification to the example of LPC2106 with GCC are minimal, just the memory declaration and another ones needed to work with a different micro, but the source of the main and all the functions and routines are exactly the same. An oldest port with GCC was used without FreeRTOS in a Development Robot and until today serial communications work fine.

Spent hours looking, debugging and googling. No solution found... any ideas?

Thank you very much in advance,
Santiago

An Engineer's Guide to the LPC2100 Series

> -----Original Message-----
> From: l...
> [mailto:l...] On Behalf Of elperegrinoranquel
> Sent: 13 August 2009 20:50
> To: l...
> Subject: [lpc2000] FreeRTOS - UART Problem - LPC2114 suddenly stops
>
>
>
> Hi,
>
> i am working with a Development Board based on a LPC2114. We
> have made the port for FreeRTOS using the instructions
> available in FreeRTOS's web page, modifying the Demo for
> LPC2106 (because we use GCC compiler) and comparing with the
> Demo for LPC2129 (because there are only very little
> differences with this micro).



First thing to check is stack overflow:

http://www.freertos.org/Stacks-and-stack-overflow-checking.html
http://www.freertos.org/uxTaskGetStackHighWaterMark.html

For some other possible causes also look at:

http://www.freertos.org/FAQHelp.html

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.
--- In l..., "elperegrinoranquel" wrote:
>
> Hi,
>
> i am working with a Development Board based on a LPC2114. We have made the port for FreeRTOS using the instructions available in FreeRTOS's web page, modifying the Demo for LPC2106 (because we use GCC compiler) and comparing with the Demo for LPC2129 (because there are only very little differences with this micro).
>
> The Demo seemed to worked just fine, but the problem comes when we use the task for the serial comunication. The micro just stops working. All the other tasks stop running.
>
> We tried modifying the Baudrate. Slower the Baudrate is, watching in a Hyperterminal port, more amount of Character we can receive. But after, a couple of sends (60 in most of the cases for a particular slow baudrate), it stops again. If we try to use a very fast baudrate, we don't receive anything trough the Hyperterminal before the micro stops.
>
> We modified the send routine, and sent just one Character every time the micro receive something from the hyperterminal. It works, but after a couple of sends (independent of hoy many times we wait between the sends), it stops again.
>
> Looks like a "buffer" problem, but don't know why or where. The modification to the example of LPC2106 with GCC are minimal, just the memory declaration and another ones needed to work with a different micro, but the source of the main and all the functions and routines are exactly the same. An oldest port with GCC was used without FreeRTOS in a Development Robot and until today serial communications work fine.
>
> Spent hours looking, debugging and googling. No solution found... any ideas?
>

Debug it. Split up the problem to isolate it. You are receiving and sending stuff, so go back to just receiving stuff - comment out the line where your received char is queued to the send handler. Run in a long test file from hyperterminal, (or some other terminal app with creedence). Does the system survive? If not, throw away received data in the interrupt handler instead of attempting to queue it to a thread. Work now?

See what I mean - debug it by splitting it up!

Rgds,
Martin
Please,
Verify if UART_WRAPPER function is declared as "naked". That is important.

Keep me posted.

mjames_doveridge escreveu:
>
>
> --- In l... ,
> "elperegrinoranquel" wrote:
> >
> > Hi,
> >
> > i am working with a Development Board based on a LPC2114. We have
> made the port for FreeRTOS using the instructions available in
> FreeRTOS's web page, modifying the Demo for LPC2106 (because we use
> GCC compiler) and comparing with the Demo for LPC2129 (because there
> are only very little differences with this micro).
> >
> > The Demo seemed to worked just fine, but the problem comes when we
> use the task for the serial comunication. The micro just stops
> working. All the other tasks stop running.
> >
> > We tried modifying the Baudrate. Slower the Baudrate is, watching in
> a Hyperterminal port, more amount of Character we can receive. But
> after, a couple of sends (60 in most of the cases for a particular
> slow baudrate), it stops again. If we try to use a very fast baudrate,
> we don't receive anything trough the Hyperterminal before the micro
> stops.
> >
> > We modified the send routine, and sent just one Character every time
> the micro receive something from the hyperterminal. It works, but
> after a couple of sends (independent of hoy many times we wait between
> the sends), it stops again.
> >
> > Looks like a "buffer" problem, but don't know why or where. The
> modification to the example of LPC2106 with GCC are minimal, just the
> memory declaration and another ones needed to work with a different
> micro, but the source of the main and all the functions and routines
> are exactly the same. An oldest port with GCC was used without
> FreeRTOS in a Development Robot and until today serial communications
> work fine.
> >
> > Spent hours looking, debugging and googling. No solution found...
> any ideas?
> > Debug it. Split up the problem to isolate it. You are receiving and
> sending stuff, so go back to just receiving stuff - comment out the
> line where your received char is queued to the send handler. Run in a
> long test file from hyperterminal, (or some other terminal app with
> creedence). Does the system survive? If not, throw away received data
> in the interrupt handler instead of attempting to queue it to a
> thread. Work now?
>
> See what I mean - debug it by splitting it up!
>
> Rgds,
> Martin
__________________________________________________
Fa ligaes para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

Memfault Beyond the Launch