FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2010 Threads] Compilation warning on AVR GCCPosted by Bernardo on February 5, 2010 Hello,
I'm using FreeRTOS on a board I made with an AT90USB647 and the compiler issues a warning on line 422 of tasks.c:
FreeRTOS/tasks.c: In function 'xTaskGenericCreate': FreeRTOS/tasks.c:422: error: cast from pointer to integer of different size FreeRTOS/tasks.c:422: error: cast to pointer from integer of different size
in line 422 of tasks.c i can see: pxTopOfStack = ( portSTACK_TYPE * ) ( ( ( unsigned long ) pxTopOfStack ) & ( ( unsigned long ) ~portBYTE_ALIGNMENT_MASK ) );
in portmacro.h (based on portmacro.h in the ATMega323 example) i have: #define portSTACK_TYPEunsigned portCHAR
is this the correct portSTACK_TYPE for the AVR uController? What should i do? change portSTACK_TYPE or change line 422 of tasks.c? If i replace 'long' by 'int' in line 422 the warning disapears and FreeRTOS works but is this correct?
Regards, Bernardo Marques.
RE: Compilation warning on AVR GCCPosted by Richard on February 5, 2010 This warning has arrisen from a recent change and occurs on ports where the stack type is smaller than the pointer type. I think changing the unsigned long casts to portBASE_TYPE cases might be ok, but would have to check each port individually.
Regards.
RE: Compilation warning on AVR GCCPosted by Bernardo on February 9, 2010 Nope. It cannot be a cast to portBASE_TYPE, it will make it worse. I suppose that in AVR GCC a pointer has two bytes and the base type on the AVR is 8-bit. As pxTopOfStack must be casted to a 16-bit integer it must be to either int or portSHORT.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|