Quality RTOS & Embedded Software

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




Loading

Separate interrupt stack Coldfire MCF52259

Posted by Per Klint on July 17, 2013
Hi!

We are using FreeRTOS Version 7.01 with a port very similar to the reference Coldfire 52259 demo.

Due to the problem that interrupts will use the interrupted task's stack to run, every task in the system needs to have extra stack allocated for this. We have up to 17 task running in ours system, so this extra stack eats a lot of valuable ram.

Is there a port handling interrupts in a separate stack for the Coldfire/68K family architecture?

I read on the forum that the PIC32 port has this and the stack is configured with configISR_STACK_SIZE parameter.

Best regards,

/// Per

RE: Separate interrupt stack Coldfire MCF52259

Posted by Richard on July 17, 2013
While all the newer ports maintain a separate interrupt stack, unfortunately being one of the older ports, the ColdFire port does not. Also, with Freescale spending many more dollars on Kinetis marketing over ColdFire marketing, it is unlikely the Coldfire port will get updated to do the same.

That said, I think it would be simple enough to implement the change (?). You would need to keep an interrupt nesting count. On interrupt entry (before interrupts are enabled), if the nest count is 0 then switch to a statically allocated system stack after the task context is saved. On exit, after decremented the count, if it is zero again, switch back to the task stack - which would probably happen anyway. Of course, it is always easier to say than do - I would have to refamiliarise myself with the Coldfire port to know for sure. You can re-use the stack that is already allocated by your linker for use by the main() function as the system stack.

The PIC32 does do this, but most is done in assembly so maybe not so easy to follow. The new A9 port goes a step further and only saves the task context if a context switch is actually needed.

Regards.

RE: Separate interrupt stack Coldfire MCF52259

Posted by Per Klint on July 19, 2013
Thanks for your answer!

I think I understand how it should be done, hopefully it will not be that difficult to implement.

Best regards,

/// Per


[ 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