Quality RTOS & Embedded Software

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


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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

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