Quality RTOS & Embedded Software

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


Zynq Cortex-A9 Failure at Low Temperature

Posted by razed11 on November 11, 2015


In version 7.0.2 portRESTORE_CONTEXT tries to set the SPSR:


/* Get the SPSR from the stack. */									\
"LDMFD	LR!, {R0}											\n\t"	\


We are seeing a very strange failure at low temperature where the endian bit gets set when this function returns. We added a line after the one above to read back the value and it is different from the value in R0 (but the same as the corrupt value it takes when the function returns with SUBS:

~~~~ /* And return - correcting the offset in the LR to obtain the / / correct address. */ "SUBS PC, LR, #4 nt" `` ~~~~

In 8.x this code was changed and returns in the following way:

~~~~ /* Return to the task code, loading CPSR on the way. */ RFEIA sp! ~~~~

I'm not pointing the finger at the RTOS but I'm curious if you can give us some history on this change and why it was written differently? Can you tell me if there are any restrictions on adding our line "MSR RO, SPSR" to read back the value?


Zynq Cortex-A9 Failure at Low Temperature

Posted by heinbali01 on November 11, 2015


What port and what part (MCU) are you using ?

Sorry, you wrote that already in the title: Zynq Cortex-A9

Zynq Cortex-A9 Failure at Low Temperature

Posted by heinbali01 on November 11, 2015

Ok, I see it in the title: "Zynq Cortex-A9".

What you are describing, does that happen during xPortStartScheduler() -> vPortRestoreTaskContext() ?

Coincidentally I recently went through this V8.2.3 port code (for another reason), and I can confirm that every bit falls into the right register at start-up.

Can you tell me which files you used for version V7.0.2 ?


Zynq Cortex-A9 Failure at Low Temperature

Posted by razed11 on November 13, 2015

Hi Hein,

It happens at portRESTORE_CONTEXT. We're using 7.0.2 so it's in portmacro.h.

After doing some reading I can understand why the implementation changed for at least one reason: Not all Cortex-A9s have virtualization extension which means the MSR, MRS instructions used in our 7.0.2 port could be used for all Cortex-A9s (though in practice maybe all are Cortex-A9VE).

I've also been told that the SPSR is not guaranteed to be in a well-defined state though I'm waiting to see a citation from ARM. If this is true I still do not believe that this is a FreeRTOS issue as that initialization would have to happen just after reset.

Zynq Cortex-A9 Failure at Low Temperature

Posted by rtel on November 13, 2015

There was no official FreeRTOS port for the Cortex-A9 in FreeRTOS V7.0.2. I suspect the V7.0.2 code you have was created by Xilinx themselves (Xilinx maintained an unofficial port for some time prior to ourselves creating an official one), so the change you refer to is not in fact a change - just a different code base. The first official port appeared in V8.0.0.

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

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

Latest News

FreeRTOS kernel V10 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