Quality RTOS & Embedded Software

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


Coldfire V2 : parameter passing problem

Posted by pavel on July 6, 2012

I'm trying to get the FreeRTOS running on our custom board with MCF5232 using CodeWarrior 7.2. I came out from Demo project "ColdFire_MCF52221_CodeWarrior". After some debugging to find out why interrupts are not executed I run into function
in portasm.S which expects its argument on the stack but from the disasembly I could see that the paraemetr is passed in D0 register.

link A6,#-8
movem.l D6-D7,(SP)

move.w SR,D7 /* current sr */

move.l D7,D0 /* prepare return value */
andi.l #0x0700,D0 /* mask out IPL */
lsr.l #8,D0 /* IPL */

move.l 8(A6),D6 /* get argument +++++++++++++++++++++++ expected value on stack */
andi.l #0x07,D6 /* least significant three bits */
lsl.l #8,D6 /* move over to make mask */

andi.l #0x0000F8FF,D7 /* zero out current IPL */
or.l D6,D7 /* place new IPL in sr */
move.w D7,SR

movem.l (SP),D6-D7
lea 8(SP),SP
unlk A6

Code generated by compiler

moveq #4,d0 ; ulPortSetIPL( configMAX_SYSCALL_INTERRUPT_PRIORITY ) where argument is #4
jsr _@DummyFn1 ; I don't know why but ulPortSetIPL is also referenced as _@DummyFn1

Could anyone please help me how get over this problem and make the call properly? Maybe some settings in CodeWarrior are necessary but when I looked into the example project settings Code Generation -> Cold Fire Processor I could see that Parameter Passing is Register but the combobox is disabled. The same as in my project.

Thank you for any help


RE: Coldfire V2 : parameter passing problem

Posted by Erich Styger on July 6, 2012
The ColdFire compiler has changed the register passing. CodeWarrior 7.2 is rather old and it looks you mix up the old compiler with a newer port. So you probably better move up to the actual 10.2 version of the tools, or you need to backport or use an older FreeRTOS port. I believe there is a __registerABI or similar pragma you could use as well.

Hope this helps,

RE: Coldfire V2 : parameter passing problem

Posted by Richard on July 7, 2012
See the firs item here for a fix:


RE: Coldfire V2 : parameter passing problem

Posted by pavel on July 8, 2012
Hello guys
Thank you both for the help. I fixed the code according to the known issues.

As to the codewarrior, is version 10.2 also available for free as the version 7.2? (to 128KB) I downloaded cw for coldfire family from freescale site so I supposed it was the latest version.


RE: Coldfire V2 : parameter passing problem

Posted by Erich Styger on July 9, 2012
Yes, MCU10.2 comes as well with a free special edition with a code limitation. In case you consider using it with Processor Expert: http://mcuoneclipse.wordpress.com/2012/05/27/freertos-v7-1-1-released/ describes the latest embedded component port for it. Also available from the FreeRTOS community/interactive web site.

Hope this helps,

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

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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

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

Xilinx Microblaze and Zynq partner