Quality RTOS & Embedded Software

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


Loading

dabort irq on 1st call to portSAVE_CONTEXT

Posted by Nick Ward on July 3, 2009
Hello All,

I'm using the V4.2.0 ARM7_LPC2000 port of the FreeRTOS and am now getting the dabort irq on the first call to portSAVE_CONTEXT. Previously I did not have this problem but I think I have changed something. I am using source code control but reverting to a previous commit doesn't seem to help. I have been trying to work this out for a while now and have been browsing the forums for similar problems but have had no luck. Does anyone have any ideas to what I have done? Thanks in advance.

Nick

RE: dabort irq on 1st call to portSAVE_CONTEX

Posted by Richard on July 3, 2009
I presume to get that far the kernel was started correctly. Which mode is the CPU in when portSAVE_CONTEXT is called.

Regards.

RE: dabort irq on 1st call to portSAVE_CONTEXT

Posted by Nick Ward on July 5, 2009
Yes the kernel seems to have started correctly. The tick interrupt is working, memory seems to be successfully allocated to the tasks and the program runs into the last defined task. I'll check the CPU mode asap.

RE: dabort irq on 1st call to portSAVE_CONTEXT

Posted by Nick Ward on July 6, 2009
In the current task the CPSR register shows that it is in System mode and just before portSAVE_CONTEXT is called it is in Supervisor mode. I have to break it on the line 'asm volatile ( "ADD LR, LR, #4");' else it will not break and the board needs to be disconnected from the PC to get it to work again.

Cheers

RE: dabort irq on 1st call to portSAVE_CONTEXT

Posted by Nick Ward on July 6, 2009
In the current task the CPSR register shows that it is in System mode and just before portSAVE_CONTEXT is called it is in Supervisor mode. I have to break it on the line 'asm volatile ( "ADD LR, LR, #4");' else it will not break and the board needs to be disconnected from the PC to get it to work again.

Cheers

RE: dabort irq on 1st call to portSAVE_CONTEXT

Posted by Nick Ward on July 6, 2009
I discovered that for some reason the CPU mode had changed to FIQ after power up and before vTaskStartScheduler was being called. This made me look at the start up files 'Philips_LPC230X_Startup.s' and 'crt0.s' and discovered that crt0.s had been changed (particularly the supervisor set up for some unknown reason) from the original project (unfortunately not currently under revision control). Using the old version of the file from a backup fixed this problem. Thanks heaps for your help Richard. I wasn't very familiar with the CPU modes and their use in OS design till you prompted me to look into it. Cheers.


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


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

Careers

FreeRTOS and other embedded software careers at AWS.


Latest News

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


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner