Quality RTOS & Embedded Software

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


8 byte alignment

Posted by Jokke on November 13, 2006
Working with real view compiler for ARM (used by Keil) I ran into a need for 8 byte alignment of the stack. (sprintf with float values did not work otherwise.)

To achive this I had to add the following lines in heap_1.c:
#if portBYTE_ALIGNMENT == 8
#define heapBYTE_ALIGNMENT_MASK( ( size_t ) 0x0007 )

I also made some changes to my port of the OS.
In port.c, pxPortInitialiseStack, first lines:
/* Setup the initial stack of the task. The stack is set exactly as
expected by the portRESTORE_CONTEXT() macro.

8 byte alignment: */
pxTopOfStack = (portSTACK_TYPE *)((long)pxTopOfStack & 0xfffffff8);

In portmacro.h:
#define portBYTE_ALIGNMENT8

I'll send the changes to Richard.



RE: 8 byte alignment

Posted by Nobody/Anonymous on November 13, 2006
Thought that was in there already or was that just 4 byte alilgnmebt?

RE: 8 byte alignment

Posted by Jokke on November 14, 2006
Correct, there was 1, 2 and 4 byte alignment already. No big change!


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

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

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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