Quality RTOS & Embedded Software

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


Loading

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?

Jokke


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.
Thanks

Jokke


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


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

Latest News

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

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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


Careers

FreeRTOS and other embedded software careers at AWS.



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

Renesas

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