Quality RTOS & Embedded Software

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




Loading

AVR323_WinAVR demo compilation with AVR Studi

Posted by Gerardo Rosiles on March 28, 2010
I used to be able to compile the FreeRTOS demo for the Atmega32 (using the Atmega323 demo) with AVR Studio. I downloaded the newer version of FreeRTOS and get the following errors:
C:\WinAVR\FreeRTOS\Demo\AVR_ATMega323_WinAVR\rtosdemo\default/../../main.c:269: undefined reference to `eeprom_read_block'

C:\WinAVR\FreeRTOS\Demo\AVR_ATMega323_WinAVR\rtosdemo\default/../../main.c:271: undefined reference to `eeprom_write_byte'

I know this looks more like an AVR studio or WinAVR question, but since it is related to the FreeRTOS demos I would like to see if someone has encountered this problem. It would seem that the compiler does not know were to locate the eeprom library, but if I make the program directly on a command window I don't get this problem.

Thanks.

RE: AVR323_WinAVR demo compilation with AVR Studi

Posted by Gerardo Rosiles on March 28, 2010
Ok, I found the culcript, which I do not know who to blame :). The main.c code for the demo has the following lines:

#ifdef GCC_MEGA_AVR
/* EEPROM routines used only with the WinAVR compiler. */
#include
#endif

It seems that GCC_MEGA_AVR is not defined. I assume FreeRTOS is expected this to be defined somewhere in the compiler, but it is not being detected at compilation time. As I said, if I "make" directly on a command line there is no problem. Hence, somehow AVR Studio is not providing this definition at compile time. I do not think I need to add the file into the project since this is suppose to be part of the compiler standard definitions (?).

In any case, this did not happen with the older versions on the WinAVR and AVRStudio tools.

Regards.


RE: AVR323_WinAVR demo compilation with AVR Studi

Posted by Gerardo Rosiles on March 28, 2010
Forgot to mention, commenting out the pre-processor lines fixes the problem.

RE: AVR323_WinAVR demo compilation with AVR Studi

Posted by Gerardo Rosiles on March 28, 2010
I meant to say:
// #ifdef GCC_MEGA_AVR
/* EEPROM routines used only with the WinAVR compiler. */
#include
// #endif

Sorry for so much blurb.

RE: AVR323_WinAVR demo compilation with AVR Studi

Posted by Richard on March 28, 2010
Its been a while since I updated my WinAVR, but have just tried the very latest WinAVR against the very latest FreeRTOS and found it compiled without any problems (I got the "../../Source/tasks.c:420: warning: cast from pointer to integer of different size" warning which has been discussed here before), although I have not tried actually running the code.

The GCC_MEGA_AVR definition should be set on the GCC command line, using the -D option. Take a look at the makefile that comes in the FreeRTOS WinAVR example project.

Regards

RE: AVR323_WinAVR demo compilation with AVR Studi

Posted by Gerardo Rosiles on April 28, 2010
Thanks, that fixed the problem.


[ 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