Пример , идущий вместе с платой на основе TSE идёт нормально.
Изначально проект компилировался с ошибками на NIOS EDS 11.1 SP2, проект запускался на Quartus 11.1 SP2 WEB Edition:
При компиляции возникали следующие ошибки:
Цитата
echo_server.c:35: warning: implicit declaration of function 'close'
echo_server.c:56: warning: implicit declaration of function 'print_ipad'
echo_server.c:56: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
echo_server.c:56: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
echo_server.c:59: warning: implicit declaration of function 'read'
echo_server.c:61: warning: implicit declaration of function 'write'
echo_server.c:75:7: warning: no newline at end of file
ethernet.c: In function 'StatusCallback':
ethernet.c:44: error: too few arguments to function 'print_ipad'
ethernet.c:45: error: too few arguments to function 'print_ipad'
ethernet.c:46: error: too few arguments to function 'print_ipad'
ethernet.c: In function 'InitNetwork':
ethernet.c:65: error: too few arguments to function 'lwip_initialize'
ethernet.c: In function 'WaitOnPHY':
ethernet.c:83: error: 'TSE_MAC_BASE' undeclared (first use in this function)
ethernet.c:83: error: (Each undeclared identifier is reported only once
ethernet.c:83: error: for each function it appears in.)
ethernet.c:101: warning: implicit declaration of function 'usleep'
ethernet.c: In function 'xEthernetRun':
ethernet.c:143: error: 'TSE_MAC_BASE' undeclared (first use in this function)
ethernet.c:193: warning: 'return' with a value, in function returning void
ethernet.c:146: warning: unused variable 'nDisconnectCnt'
ethernet.c:143: warning: unused variable 'pmac'
ethernet.c: In function 'get_ip_addr':
ethernet.c:224: error: too few arguments to function 'print_ipad'
make: *** [obj/default/ethernet.o] Error 1
echo_server.c:56: warning: implicit declaration of function 'print_ipad'
echo_server.c:56: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
echo_server.c:56: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
echo_server.c:59: warning: implicit declaration of function 'read'
echo_server.c:61: warning: implicit declaration of function 'write'
echo_server.c:75:7: warning: no newline at end of file
ethernet.c: In function 'StatusCallback':
ethernet.c:44: error: too few arguments to function 'print_ipad'
ethernet.c:45: error: too few arguments to function 'print_ipad'
ethernet.c:46: error: too few arguments to function 'print_ipad'
ethernet.c: In function 'InitNetwork':
ethernet.c:65: error: too few arguments to function 'lwip_initialize'
ethernet.c: In function 'WaitOnPHY':
ethernet.c:83: error: 'TSE_MAC_BASE' undeclared (first use in this function)
ethernet.c:83: error: (Each undeclared identifier is reported only once
ethernet.c:83: error: for each function it appears in.)
ethernet.c:101: warning: implicit declaration of function 'usleep'
ethernet.c: In function 'xEthernetRun':
ethernet.c:143: error: 'TSE_MAC_BASE' undeclared (first use in this function)
ethernet.c:193: warning: 'return' with a value, in function returning void
ethernet.c:146: warning: unused variable 'nDisconnectCnt'
ethernet.c:143: warning: unused variable 'pmac'
ethernet.c: In function 'get_ip_addr':
ethernet.c:224: error: too few arguments to function 'print_ipad'
make: *** [obj/default/ethernet.o] Error 1
Отредактировав ethernet.c проект скомпилировался
Дополнительно добавил описание трансивера DP83640s в файлы
altera_avalon_tse.h
altera_avalon_tse.c
Однако при загрузке elf файла консоль выдаёт:
Цитата
[ethernet] PHY INFO: Interface: 0 Waiting for PHY
В отладчике консоль выдаёт следующие сообщения (DHCP = 0):
Цитата
[ethernet] PHY INFO: Interface: 0 Waiting for PHY
[ethernet] PHY INFO: [PHY ID] 0x0 2000 5ce1
[ethernet] PHY INFO: Issuing PHY Reset
[ethernet] Using Ethernet MAC address 00:07:ed:ff:68:b0 for interface: 0
[ethernet] Static IP Address for interface 0 192.168.0.218
INFO : TSE MAC 0 found at address 0x00a06000
INFO : PHY National DP83640s found at PHY address 0x01 of MAC Group[0]
INFO : PHY[0.0] - Automatically mapped to tse_mac_device[0]
INFO : PHY[0.0] - Restart Auto-Negotiation, checking PHY link...
WARNING : PHY[0.0] - Auto-Negotiation FAILED
INFO : PHY[0.0] - Checking link...
INFO : PHY[0.0] - Link not yet established, restart auto-negotiation...
INFO : PHY[0.0] - Restart Auto-Negotiation, checking PHY link...
INFO : PHY[0.0] - Auto-Negotiation PASSED
INFO : PHY[0.0] - Link established
INFO : PHY[0.0] - Speed = 100, Duplex = Full
[ethernet] PHY INFO: [PHY ID] 0x0 2000 5ce1
[ethernet] PHY INFO: Issuing PHY Reset
[ethernet] Using Ethernet MAC address 00:07:ed:ff:68:b0 for interface: 0
[ethernet] Static IP Address for interface 0 192.168.0.218
INFO : TSE MAC 0 found at address 0x00a06000
INFO : PHY National DP83640s found at PHY address 0x01 of MAC Group[0]
INFO : PHY[0.0] - Automatically mapped to tse_mac_device[0]
INFO : PHY[0.0] - Restart Auto-Negotiation, checking PHY link...
WARNING : PHY[0.0] - Auto-Negotiation FAILED
INFO : PHY[0.0] - Checking link...
INFO : PHY[0.0] - Link not yet established, restart auto-negotiation...
INFO : PHY[0.0] - Restart Auto-Negotiation, checking PHY link...
INFO : PHY[0.0] - Auto-Negotiation PASSED
INFO : PHY[0.0] - Link established
INFO : PHY[0.0] - Speed = 100, Duplex = Full
Проект
https://yadi.sk/d/lGUsipm7e62bU
Порт Ниоса брался отсюда
https://github.com/EngineeringSpirit/FreeLwIP-Nios-II