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 port changes?

Posted by Miles Gazic on July 24, 2009
I am using the version 5.0.0 port of FreeRTOS for the Cortex M3 with the Rowley toolchain (or at least, the comment block at the top of the files claims to be version 5.0.0). It was going fine for quite a while, but just recently I am having stack corruption problems (that may very well be my own fault), and I'm trying to determine if one of the Cortex M3's stack pointers is used, or both stack pointers. In my repository where I keep a copy of the FreeRTOS source code, I have a directory under demo named "CORTEX_STM32F103_Primer_Rowley". I downloaded a zip file of V5.4.0, and it doesn't have a directory by that name. I then re-downloaded V5.0.0, and it *also* doesn't have a directory by that name!

The thing in particular I am looking for is if there have been any updates to the linker script I am using. It was called FRTOS_1.ld in the copy of the code I have, and I do not see a file by that name anywhere in the fresh zipfile of V5.0.0, or V5.4.0. In fact, I don't find any linker scripts at all, for any of the STM32 demos.

If anyone could enlighten me, I would much appreciate it.

RE: Cortex M3 port changes?

Posted by Miles Gazic on July 25, 2009
I tried building Demo/CORTEX_STM32F107_GCC_Rowley from FreeRTOS V5.4.0 with the Rowley Crossworks IDE, and it said "no linker script or memory map file specified". That's without doing anything but double-clicking the .hzp file to launch crossworks, and then clicking build. So it looks like Crossworks is confused about the same thing I am: where's the linker script (.ld file)?

RE: Cortex M3 port changes?

Posted by Dave on July 25, 2009
I dont know where you got the demo from? Maybe the STM32 circle site?

Have you installed the STM32 package in Rowley? This is a separate step to installing the IDE.

RE: Cortex M3 port changes?

Posted by Miles Gazic on July 30, 2009
It appears that the old startup code that I had wasn't initializing the 2nd stack, and it was somehow getting set to an area of RAM that overlapped where BSS would go, if BSS was big enough. I modified the linker script (still don't know where that came from, probably auto-generated by some IDE I used in the past, perhaps Rowley CrossWorks) and startup code (Rowley's thumb_crt0.s) so that the 2nd stack would go in it's own block of RAM reserved for that purpose, and the problem has gone away.

Not quite sure on the terminology, but as I understand it the Cortex M3 has a main stack and a process stack. The normal stack pointer ("sp") is like a window that looks at the psp (process stack pointer) or the msp (main stack pointer), depending on a separate control bit. So you can flip the bit and modify sp to set each, or you can use a special msr instruction to modify msp or psp directly ("msr psp, r0" loads the psp from register r0).


[ 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