Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Interrupts driven UART in LPC2368

Posted by eduardo on August 14, 2009
I don't know what is really happening, but I'm just trying to insert serial.c (from LPC2000_GCC) in LPC2368_ECLIPSE example.

It seems to be working fine, except that after a defined number of interrupts (of PutChar in flash.c task) , the ARM freezes. It's the same number, always! In average, 596 putchars and the program stops. If I change optmization level from 0 to 1, this number changes to 1800 putchars. Anyway, I don't know where is the problem. Could somebody help me?

I'm using yagarto and FreeRTOS 5.4.2, last yagarto version (Binutils-2.19., Newlib-1.17.0, GCC-4.3.3, GDB-6.8.50-20080308, Insight-6.8.50-20080308) and Windows XP.

The code is in http://www.4shared.com/file/125067940/aaa9af1b/LPC2368_question.html .

Thanks in advance,
Eduardo Garcia

RE: Interrupts driven UART in LPC2368

Posted by eduardo on August 15, 2009
Now, I tried change the IRQ size to 0x400 (just like boot.s in LPC2106 example) but it is not the problem.

:-(

Any ideas?

RE: Interrupts driven UART in LPC2368

Posted by eduardo on August 17, 2009
Unfortunatelly, not yet.... I have tried the interrupts without queue functions and the result is the same. After exacts 2021 SendPutChars, or after receive 2021 characters, the firmware stop working.

I have tried with vApplicationStackOverflowHook but this function haven't been called.

This number changes regard to optimization level. By the way, I'm using -O1 now.

IMHO, it really seems to be a stack problem because the well defined number of interrupts that causes the error. But, increasing IRQ stack in boot.s there is no changes. And if a send chars over UART0 with no interrupts, this problem doesn't happen.

The source code now is a bit changed from the posted... but the error is the same. :-(

RE: Interrupts driven UART in LPC2368

Posted by eduardo on August 18, 2009
I've just discovered and fixed the problem.

There as a mistake in uart wrapper function prototype, so that, the real function was not a naked function. Each time that the uart_wrap function was called, the stack wasn't recovered.

Once I declared uart wrapper function correctly, everything starts working fine.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists