Quality RTOS & Embedded Software

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




Loading

Stack-Problem on LPC2290

Posted by Joe on March 14, 2007
Hi @all,

i have the FreeRTOS running on a LPC2290-Board and up to now it works fine. Additionally i have added the newlib-lpc-port from Aeolus and it also runs fine. For developing I'm using the WinARM-distribution.

Now i have tried to extend the system with an proprietary CAN-driver and the i get abort-errors and some strange behaviour. I'm still debugging with a GBD-Insight with segger-JLink and my gdg told me, the may be stack is corrupted or I got the message "cannot access the memory address 0x11111111" which is the regvalue of r11.

I think, that stacksizes are big enough, 0x2000 for IRQ and SVC !

At the moment I don't have any idea how to catch this problem, does anyone have an idea how to find this error ?

regards

Joe

RE: Stack-Problem on LPC2290

Posted by Joe on March 14, 2007
additional information:

the error occurrs only after a CAN-Interrupt and only when I call function ins the CAN-isr.

RE: Stack-Problem on LPC2290

Posted by Nobody/Anonymous on March 14, 2007
Does the CAN ISR use a lot of stack?
Has the CAN ISR been written using the required syntax (naked attributes, portENTER_SWITCHING_ISR(), only declaring variables ater the call to portENTER_SWITCHING_ISR(), etc)?

In the Data Abort handler, inspect the value of pxCurrentTCB to find out the location of the stack being used. If there are no 0xA5's left in the stack then it has overflowed.

RE: Stack-Problem on LPC2290

Posted by Joe on March 14, 2007
I don't want to switch in the CAN-Isr only proceed my CAN-driver

the ISR ist attributed with the follwoing statement:

void __attribute__((interrupt("IRQ"))) v_lpc22xx_CanIsrRxBus1 (void)

I think it seems to be OK !

I also tried to use the Macros : portSAVE_CONTEXT & portRESTORE_CONTEXT but that crashed immediately :-(

Joe

RE: Stack-Problem on LPC2290

Posted by Nobody/Anonymous on March 14, 2007
> I don't want to switch in the CAN-Isr only proceed my CAN-driver

Not sure what this is meaning.


portSAVE_CONTEXT & portRESTORE_CONTEXT should not be used in an IRQ.

portENTER_SWITCHING_ISR() portEXIT_SWITCHING_ISR() can only be used in naked functions.

Does not help with your problem. Just clarification.

RE: Stack-Problem on LPC2290

Posted by Joe on March 14, 2007
the problem is solved :-) after adding the macros to the isr the system is running and I also understand why
the macros are so neccessary


thank you for helping

regards
Joe


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




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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

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

OpenRTOS and SafeRTOS