реклама на сайте
подробности

 
 
> Не могу скомпилить FREERTOS в IAR ARM 5.50
MALLOY2
сообщение Jun 6 2010, 09:44
Сообщение #1


Знающий
****

Группа: Validating
Сообщений: 838
Регистрация: 31-01-05
Пользователь №: 2 317



Не могу скомпилить FREERTOS в IAR ARM 5.50 если включаю "Multi-file Compilation", как только подключаю queue.h компилятор выдает кучу таких ошибок

Цитата
Error[Pe1061]: declaration of function "xQueueGenericSend" is incompatible with a declaration in another translation unit D:\Develop\xxxx\Firmware\Cortex\Source\FreeRTOS\Include\queue.h 472
the other declaration is at line 451 of "D:\Develop\xxxx\Firmware\Cortex\Source\FREERTOS\queue.c"


Уже второй день бьюсь не могу их подружить. Без "Multi-file Compilation" работает все нормально.

Как только пост создал и проблема частично решилась.

Вся беда в том что, в queue.h тип xQueueHandle обьявлен как void
Код
typedef void * xQueueHandle;


а в queue.c как структура
Код
typedef xQUEUE * xQueueHandle;


Вылечил так.

Подключил queue.h в queue.c
Определение структуры xQUEUE вынес в queue.h сюдаже и определение типа xQueueHandle. Все собралось, еще не осознал чем это грозит, да и не красиво как то, может есть еще варианты ?
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
zltigo
сообщение Jun 6 2010, 10:01
Сообщение #2


Гуру
******

Группа: Свой
Сообщений: 13 372
Регистрация: 27-11-04
Из: Riga, Latvia
Пользователь №: 1 244



Цитата(MALLOY2 @ Jun 6 2010, 12:15) *
Не могу скомпилить FREERTOS в IAR ARM 5.50 если включаю "Multi-file Compilation"

А оно Вам надо? Там проблем при такой компиляции хватает, я тут на прошлой неделе с дуру AVR-овсий исходник так компильнул (правда с discard unused public smile.gif smile.gif smile.gif )- так он молча повыбрасывал одиночные записи в периферию. Ну зачем типа они, если вcе равно никто потом записанное не читает. Да и без этого у него сильная тяга, ели нафиг не запретить, к генерации кроссвызовов. Полное спагетти.
Ну а вообще никаких препятствий нет. Только что собрал свой тестик:
Код
###############################################################################
#                                                                             #
# IAR ANSI C/C++ Compiler V5.50.0.51878/W32 for ARM     06/Jun/2010  13:48:57 #
# Copyright (C) 1999-2010 IAR Systems AB.                                     #
#                                                                             #
#    Cpu mode     =  thumb                                                    #
#    Endian       =  little                                                   #
#    Source file  =  D:\ARM_WORK\CM3Test\EMAC\emac.c                          #
#    Command line =  D:\ARM_WORK\CM3Test\EMAC\emac.c -D IAR_ARMCM3_LM -D      #
#                    PACK_STRUCT_END= -lcN D:\ARM_WORK\CM3Test\Works\List\    #
#                    --remarks --diag_suppress pa050,pe068 -o                 #
#                    D:\ARM_WORK\CM3Test\Works\Obj\ --debug --endian=little   #
#                    --cpu=Cortex-M3 -e --fpu=None --dlib_config              #
#                    "D:\IAR\Embedded Workbench 5\ARM\INC\DLib_Config_Normal. #
#                    h" -I D:\ARM_WORK\CM3Test\ -I                            #
#                    D:\ARM_WORK\CM3Test\INCLUDE\ -I                          #
#                    D:\ARM_WORK\CM3Test\LM3SLIB\ -I                          #
#                    D:\ARM_WORK\CM3Test\LM3SLIB\H\ -I                        #
#                    D:\ARM_WORK\CM3Test\..\COMMON\INCLUDE\ -I                #
#                    D:\ARM_WORK\CM3Test\..\COMMON\RTOS\INCLUDE\ -I           #
#                    "D:\IAR\Embedded Workbench 5\ARM\INC\" -Oh --mfc         #
#                    D:\ARM_WORK\CM3Test\LM3SLIB\G\lcd.c                      #
#                    D:\ARM_WORK\CM3Test\LM3SLIB\G\rit128x96x4.c              #
#                    D:\ARM_WORK\CM3Test\LM3SLIB\console.c                    #
#                    D:\ARM_WORK\CM3Test\LM3SLIB\cpu.c                        #
#                    D:\ARM_WORK\CM3Test\MAIN\command.c                       #
#                    D:\ARM_WORK\CM3Test\MAIN\main.c                          #
#                    D:\ARM_WORK\CM3Test\RESOURCE\cstartup.c                  #
#                    D:\ARM_WORK\CM3Test\RESOURCE\ll_init.c                   #
#                    D:\ARM_WORK\COMMON\RTOS\croutine.c                       #
#                    D:\ARM_WORK\COMMON\RTOS\list.c                           #
#                    D:\ARM_WORK\COMMON\RTOS\portable\ARM_CM3\IAR\port.c      #
#                    D:\ARM_WORK\COMMON\RTOS\portable\MEMMANG\HEAP_Z.C        #
#                    D:\ARM_WORK\COMMON\RTOS\queue.c                          #
#                    D:\ARM_WORK\COMMON\RTOS\tasks.c                          #
#    List file    =  D:\ARM_WORK\CM3Test\Works\List\emac.lst                  #
#    Object file  =  D:\ARM_WORK\CM3Test\Works\Obj\emac.o                     #
#                                                                             #
#                                                                             #
###############################################################################

Как и следовало ожидать без малейших замечаний. Не во FreeRTOS проблема.




Цитата(MALLOY2 @ Jun 6 2010, 12:44) *
Вся беда в том что, в queue.h тип xQueueHandle обьявлен как void
Код
typedef void * xQueueHandle;

Во! Забыл я, что всякую такую мишуру давно у себя в своей ветка FreeRTOS поубирал sad.gif.

Цитата(MALLOY2 @ Jun 6 2010, 12:44) *
Подключил queue.h в queue.c
Определение структуры xQUEUE вынес в queue.h сюдаже и определение типа xQueueHandle. Все собралось, еще не осознал чем это грозит, да и не красиво как то, может есть еще варианты ?

Да ничем, перестали быть скрытыми члены, ну и все.
Вот кусок совершенно аналогично, но по другим причинам, латанного мною:
Код
/*
    FreeRTOS.org V5.0.4 - Copyright (C) 2003-2008 Richard Barry.
.....
*/

#ifndef QUEUE_H
#define QUEUE_H

// zlt[
#include "RTOS.h"
#include "task.h"
#include "croutine.h"

#ifdef __cplusplus
extern "C" {
#endif

// Moved from queue.c
// Definition of the queue used by the scheduler.
// Items are queued by copy, not reference.
//
typedef struct QueueDefinition
{
    signed char *pcHead;                // < Points to the beginning of the queue storage area.
    signed char *pcTail;                // < Points to the byte at the end of the queue storage area.  Once more byte is allocated than necessary to store the queue items, this is used as a marker.

    signed char *pcWriteTo;                // < Points to the free next place in the storage area.
    signed char *pcReadFrom;            // < Points to the last place that a queued item was read from.

    xList xTasksWaitingToSend;                // < List of tasks that are blocked waiting to post onto this queue.  Stored in priority order.
    xList xTasksWaitingToReceive;            // < List of tasks that are blocked waiting to read from this queue.  Stored in priority order.

    unsigned portBASE_TYPE uxMessagesWaiting; // < The number of items currently in the queue.
    unsigned portBASE_TYPE uxLength;          // < The length of the queue defined as the number of items it will hold, not the number of bytes.
    unsigned portBASE_TYPE uxItemSize;          // < The size of each items that the queue will hold.

    signed portBASE_TYPE xRxLock;                // < Stores the number of items received from the queue (removed from the queue) while the queue was locked.  Set to queueUNLOCKED when the queue is not locked.
    signed portBASE_TYPE xTxLock;                // < Stores the number of items transmitted to the queue (added to the queue) while the queue was locked.  Set to queueUNLOCKED when the queue is not locked.
} xQUEUE;

// typedef void * xQueueHandle;
typedef xQUEUE *xQueueHandle;

//]zlt

......


--------------------
Feci, quod potui, faciant meliora potentes
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 29th July 2025 - 18:28
Рейтинг@Mail.ru


Страница сгенерированна за 0.01377 секунд с 7
ELECTRONIX ©2004-2016