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


LPC2106 and Rowley

Posted by Nobody/Anonymous on August 15, 2006
we are trying to compile the Project FreeRTOS 4.0.4 (we picked out the uP
Rowley Demo, originally it was for LCP2124, but we've changed everything to
run it on the LPC2106) on a Philips LPC2106-Evalutation Board from Olimex
with the CrossStudio 1.6 from Rowley and I have some trouble with it:
(almost) everytime i use an interruptrequest not given in the demo (e.g. a
button on EINT2-Pin or a additional Timer-Interrupt) my program crash by
beeing hold in one of the default abort handlers (time data-, prefetch-, or
undef abort).

Do you've got any suggestions?

Thank you very much & wish you a good day.

RE: LPC2106 and Rowley

Posted by Richard on August 15, 2006
Which startup code are you using? The startup code must setup stacks for the IRQ and System modes. Could it be that you are running out of stack in the IRQ?

How are your interrupts being called. Do you vector directly to the interrupt with interrupts remaining disabled, or do you have some intermediary code? You should be vectoring directly.

Is the interrupt that is causing the problem attempting to perform a context switch, or is it just a plain interrupt that always returns to the task that it interrupted?

From your question it sounds like the examples interrupt routines given in the FreeRTOS download are working correctly (i.e. the sample UART ISR for the LPC2106 GCC port). Is this correct?


RE: LPC2106 and Rowley

Posted by Nobody/Anonymous on August 15, 2006
First of all many thanks for your fast reply!

Yes it is correct, that the sample ISRs are working fine! But if i extend one of the examples with another ISR, it crashes.

I've used both the FreeRTOS-uP-Rowley-demo and Rowleys-sample startup skript for Philips LPC210X (both are called "Philips_LPC210X_Startup.s"), but it always results in the same error.
I've compared the two scripts and found out that only the bootloader's got a different checksumm (if Preprocessiordefinition VECTORED_IRQ_INTERRUPTS is set like in my IDE, Checkum is 0xB9205F88 (Rowley-startup) or 0xB9205F84 (FreeRTOS-startup))?!

The Interrupts are called vector directly like it is given on the FreeRTOS-Homepage and I tried it with or without a context-switch.

<my context switching-Timer1ISR>
void __attribute__ ((interrupt(naked))) timer1ISR(void);
void timer1ISR(void)
portLONG lSwitchRequired = 1;//0L;
/*Reset Timer 1-IR by clearing IR-Flag and setting Counter to Zero*/
T1_IR = ( ( unsigned portCHAR ) 0x01 );
T1_TC = 0;
VICVectAddr = ( ( unsigned portLONG ) 0 );
</my context switching-Timer1ISR>

What now happens is:
the FreeRTOS-Systemticker (Timer0) works fine and all Threads are started normally. When my timer1-IRQ occurs (like described above) I could debug that the uC jumps correct into the ISR (can watch it by debugging and setting a breakpoint on it) and let the LED toggle. But this happens only about 2..5 times, then an error handler occurs (mostly undef-handler).
This also happens if the program jumps in to the ISR by pressing the Button on EINT2.

I could imagine that it has something to do with nested interrupts, but I've tried everything that comes in my mind (disable all IRQs when entering ISR, context switching etc.) and nothing worked.

Best Regards,

RE: LPC2106 and Rowley

Posted by Nobody/Anonymous on August 15, 2006
Have you altered portENTER_SWITCHING_ISR() at all? The macro must end with a bracket {. This ensures the correct stack frame is setup before your variable lSwitchRequired is defined.

Try making lSwitchRequired stack, then setting it to 1 on each interrupt. This might highlight where the problem is.

Can you show the code for prvToggleLED also.

Is the function being compiled into ARM mode?

RE: LPC2106 and Rowley

Posted by Nobody/Anonymous on August 15, 2006
No, the portENTER_SWITCHING_ISR()-Macro was not altered (and I controlled that it ends with a bracket).

Sorry, what do you mean with "Try making lSwitchRequired stack"? I've tried to make the lSwitchRequired variable static, but it has no effect.

Here's my code for the led-toggle, but even if you disable the callup for prvToggleLED() in the ISR the ISR although crashes.

void prvToggleLED(unsigned portLONG led_number);
void prvToggleLED(unsigned portLONG led_number)
static unsigned portLONG ulState= 0;

//ulState = GPIO0_IOPIN;
if( ulState & led_number )
GPIO_IOCLR = led_number;
GPIO_IOSET = led_number;
ulState ^= led_number;

When I disable the interrupt generation for Timer 1 all the rest of my code works fine.

RE: LPC2106 and Rowley

Posted by Nobody/Anonymous on August 15, 2006
>Sorry, what do you mean with "Try making lSwitchRequired stack"? I've tried to make the lSwitchRequired variable static, but it has no effect.

I meant static :-$

[ 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