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




Loading

Cortex-M3 Stack problem using a bootloader

Posted by ravaz on April 1, 2008
I found a problem on the Cortex-M3 port. In the port.c file the MSP (main stack pointer) is initialized assuiming that the vector table is strored at the adress 0x00000000, using a bootloader this is not hte case. For that reason I modified the code as follow:


Line 160: prvSetMSP( *((unsigned portLONG *) portNVIC_VTABLE ) );

The portNVIC_VTABLE must be defined using:

#define portNVIC_VTABLE 0xE000ED08


Hope can help....

RE: Cortex-M3 Stack problem using a bootloader

Posted by Dave on April 3, 2008
Very good point. Can we add this to the standard download?

RE: Cortex-M3 Stack problem using a bootloade

Posted by ravaz on April 3, 2008
Another correction should be done is the systick timer reload value. To be correct the value should be loaded using:

*(portNVIC_SYSTICK_LOAD) = (configCPU_CLOCK_HZ / configTICK_RATE_HZ)-1;

regards

Ravaz

RE: Cortex-M3 Stack problem using a bootloade

Posted by Richard on April 3, 2008
I like to make sure I make that mistake over and over again :o) It will be right (for this port at least) in the next version.

Regards.

RE: Cortex-M3 Stack problem using a bootloade

Posted by ravaz on April 3, 2008
I would take the chance to thank you for the great job and for the perseverance you have to continously improve it....

RE: Cortex-M3 Stack problem using a bootloade

Posted by ravaz on April 8, 2008
I did the modification for the version 4.8.0 as follow

void vPortStartFirstTask(void)
{
asm volatile(
" ldr r0, =0xE000ED08 \n" /* Load the NVIC_TABLE offset address. */
" ldr r0, [r0] \n" /* Get the vector table offset. */
" ldr r0, [r0] \n" /* Get the stack pointer. */
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
" svc 0 \n" /* System call to start first task. */
);
}


Regards


Ravaz


[ 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