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


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 ]    [ 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