Quality RTOS & Embedded Software

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


Keil arm7 crashes at startup with at91sam7s

Posted by Jokke on January 18, 2006
I am using the Keil arm7 port to run on atmels at91sam7s256.
When I come to the first portRESTORE_CONTEXT (vPortISRStartFirstTask) the following instructions:

__asm{ LDMFDLR, {R0-R14}^};
__asm{ NOP};
__asm{ LDRLR, [LR, #+60]};

will load 0xaaaaaaaa into LR(=R14), and then try to load LR from there.
I have also access to the IAR port, where the same instruction comes, but of some strange reason R13 and R14 are not loaded! Therefore it works with IAR.
I find this very strange. Does anyone have an explanation, and most important of course, how should it be for Keil? Shouldn't the correct content be on stack first? Where should that be put there the first time?


RE: Keil arm7 crashes at startup with at91sam7s

Posted by Nobody/Anonymous on January 18, 2006
The processor is in the wrong mode. It must be in Supervisor mode when vPortISRStartFirst is called.

My guess is that you are using the startup code from the FreeRTOS download when you are running using IAR, but not using something other than that included in the download when running using Keil.

Take a look at the startup code from the downloaded .zip file for the keil demo. This will show you what you need. (unless the mode is set using the IDE for Keil?)

This is a common mistake which is why the code is littered with comments saying that the processor must be in Supervisor mode when the scheduler is started ;-) [as is the WEB documentation].

RE: Keil arm7 crashes at startup with at91sam

Posted by Jokke on January 18, 2006
OK, I made an attempt to put it in the right mode, but apparently I failed.


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

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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

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