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

 
 
 
Reply to this topicStart new topic
> AT91 USB CDC Driver
romez777
сообщение Dec 24 2007, 07:03
Сообщение #1


Местный
***

Группа: Свой
Сообщений: 292
Регистрация: 9-11-04
Пользователь №: 1 077



Приветствую,

взял пример драйвера с atmel.com, пример заточен под ARM. Теперь переношу под arm-gcc (toolchain из проекта YAGARTO), все подточил, кроме файла udp.c. Постоянно валится со следующими ошибками:

Код
udp.c: In function 'UDP_ConfigureEndpoint':
udp.c:579: error: dereferencing pointer to incomplete type
udp.c:580: error: dereferencing pointer to incomplete type
udp.c:582: error: dereferencing pointer to incomplete type
udp.c:602: error: dereferencing pointer to incomplete type


Код, на котором валится:

Код
bool UDP_ConfigureEndpoint(const S_usb                     *pUsb,
                           const S_usb_endpoint_descriptor *pEpDesc)
{
    unsigned char  bEndpoint;
    ...
    bEndpoint = (unsigned char) (pEpDesc->bEndpointAddress & 0x7);
    bType = (unsigned char) (pEpDesc->bmAttributes & 0x3);

    if (ISSET(pEpDesc->bEndpointAddress, 1 << 7)) {
        ....
    }
    .....

    pEndpoint->wMaxPacketSize = pEpDesc->wMaxPacketSize;

    .....
}


Файл, в котором определен S_usb_endpoint_descriptor подключается в самом начале udp.c.
В чем же проблема? Надеюсь кто-то уже поборол это?

Заранее благодарю!
Go to the top of the page
 
+Quote Post
romez777
сообщение Dec 24 2007, 09:36
Сообщение #2


Местный
***

Группа: Свой
Сообщений: 292
Регистрация: 9-11-04
Пользователь №: 1 077



Цитата(romez777 @ Dec 24 2007, 10:03) *
Приветствую,

взял пример драйвера с atmel.com, пример заточен под ARM. Теперь переношу под arm-gcc (toolchain из проекта YAGARTO), все подточил, кроме файла udp.c. Постоянно валится со следующими ошибками:

Код
udp.c: In function 'UDP_ConfigureEndpoint':
udp.c:579: error: dereferencing pointer to incomplete type
udp.c:580: error: dereferencing pointer to incomplete type
udp.c:582: error: dereferencing pointer to incomplete type
udp.c:602: error: dereferencing pointer to incomplete type


Код, на котором валится:

Код
bool UDP_ConfigureEndpoint(const S_usb                     *pUsb,
                           const S_usb_endpoint_descriptor *pEpDesc)
{
    unsigned char  bEndpoint;
    ...
    bEndpoint = (unsigned char) (pEpDesc->bEndpointAddress & 0x7);
    bType = (unsigned char) (pEpDesc->bmAttributes & 0x3);

    if (ISSET(pEpDesc->bEndpointAddress, 1 << 7)) {
        ....
    }
    .....

    pEndpoint->wMaxPacketSize = pEpDesc->wMaxPacketSize;

    .....
}


Файл, в котором определен S_usb_endpoint_descriptor подключается в самом начале udp.c.
В чем же проблема? Надеюсь кто-то уже поборол это?

Заранее благодарю!


Эту проблему победил, но теперь не работает линковка. Линкер вызывается с такими ключами:
Код
arm-elf-ld -r -o ..\obj\core.o -x -S udp.o device.o board.o at91stdio.o standard.o


Что приводит к ошибкам:
Код
device.o: In function `AT91F_AIC_ConfigureIt':
device.c:(.text+0x0): multiple definition of `AT91F_AIC_ConfigureIt'
udp.o:udp.c:(.text+0x0): first defined here
device.o: In function `AT91F_AIC_EnableIt':
device.c:(.text+0x38): multiple definition of `AT91F_AIC_EnableIt'
udp.o:udp.c:(.text+0x38): first defined here
device.o: In function `AT91F_AIC_DisableIt':
device.c:(.text+0x48): multiple definition of `AT91F_AIC_DisableIt'
udp.o:udp.c:(.text+0x48): first defined here
device.o: In function `AT91F_AIC_ClearIt':
device.c:(.text+0x5c): multiple definition of `AT91F_AIC_ClearIt'
...
at91stdio.o: In function `AT91F_AIC_ConfigureIt':
at91stdio.c:(.text+0x0): multiple definition of `AT91F_AIC_ConfigureIt'
udp.o:udp.c:(.text+0x0): first defined here
at91stdio.o: In function `AT91F_AIC_EnableIt':
at91stdio.c:(.text+0x38): multiple definition of `AT91F_AIC_EnableIt'
udp.o:udp.c:(.text+0x38): first defined here
....
standard.o: In function `AT91F_TC_IsInterruptMasked':
standard.c:(.text+0x1924): multiple definition of `AT91F_TC_IsInterruptMasked'
udp.o:udp.c:(.text+0x2908): first defined here
standard.o: In function `AT91F_PWMC_IsStatusSet':
standard.c:(.text+0x1930): multiple definition of `AT91F_PWMC_IsStatusSet'
udp.o:udp.c:(.text+0x2914): first defined here
standard.o: In function `AT91F_PWMC_IsInterruptMasked':
standard.c:(.text+0x193c): multiple definition of `AT91F_PWMC_IsInterruptMasked'
udp.o:udp.c:(.text+0x2938): first defined here
standard.o: In function `AT91F_UDP_IsInterruptMasked':
standard.c:(.text+0x1948): multiple definition of `AT91F_UDP_IsInterruptMasked'
udp.o:udp.c:(.text+0x2944): first defined here
standard.o: In function `AT91F_AIC_Open':
standard.c:(.text+0x1954): multiple definition of `AT91F_AIC_Open'
udp.o:udp.c:(.text+0x29e0): first defined here


Функции AT91F_AIC_* определены в хедере через inline. Возможно, кто уже сталкивался с этим и и может помочь справиться.

Спасибо!
Go to the top of the page
 
+Quote Post
xelax
сообщение Dec 24 2007, 09:51
Сообщение #3


Местный
***

Группа: Свой
Сообщений: 370
Регистрация: 7-11-06
Пользователь №: 22 035



У тебя видимо в standart.c подключается два (или более smile.gif ) хидерника, где подключаются определения инлайновых функций.

Сообщение отредактировал xelax - Dec 24 2007, 09:52
Go to the top of the page
 
+Quote Post
amw
сообщение Dec 24 2007, 10:25
Сообщение #4


Знающий
****

Группа: Свой
Сообщений: 601
Регистрация: 22-09-05
Из: Kharkov
Пользователь №: 8 847



Цитата(xelax @ Dec 24 2007, 11:51) *
У тебя видимо в standart.c подключается два (или более smile.gif ) хидерника, где подключаются определения инлайновых функций.

inline функция должна быть static.
Тогда делай что хочеш, включай сколько хочеш.
И самое ей место в .h файле, а не .c


--------------------
- А мораль отсюда такова: всякому овощу свое время. Или, хочешь, я это сформулирую попроще: никогда не думай, что ты иная, чем могла бы быть иначе, чем будучи иной в тех случаях, когда иначе нельзя не быть.
© Lewis Carroll. Alice's adventures in wonderland.
Go to the top of the page
 
+Quote Post

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

 


RSS Текстовая версия Сейчас: 21st July 2025 - 04:31
Рейтинг@Mail.ru


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