Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12618 Discussions

Errors Building Redboot for EP2C35 Dev Board

Altera_Forum
Honored Contributor II
1,182 Views

Hello: 

 

I am currently trying to build Redboot for the Cyclone II 2C35 Development Board. Two errors are being reported during the link phase: 

 

1. undefined reference to perror in altera_avalone_lan91c111.inl.  

 

The code is shown below. Does ALTERA_NIOS_DEV_BOARD_CYCLONE_2C35 need to be added to the# if defined list or can I just comment out the reference to perror? 

 

/cygdrive/c/Projects/GenOne/Software/eCos/redboot_install/lib/extras.o(.text.altera_avalon_lan91c111_get_esa_wrapper+0x88): In function `altera_avalon_lan91c111_get_esa_wrapper': 

/cygdrive/c/Projects/GenOne/Software/eCos/redboot_install/include/cyg/sopc/altera_avalon_lan91c111.inl:112: undefined reference to `perror' 

/cygdrive/c/Projects/GenOne/Software/eCos/redboot_install/lib/extras.o(.text.altera_avalon_lan91c111_get_esa_wrapper+0x94):/cygdrive/c/Projects/GenOne/Software/eCos/redboot_install/include/cyg/sopc/altera_avalon_lan91c111.inl:113: undefined reference to `perror' 

/cygdrive/c/Projects/GenOne/Software/eCos/redboot_install/lib/extras.o(.text.altera_avalon_lan91c111_get_esa_wrapper+0xa0):/cygdrive/c/Projects/GenOne/Software/eCos/redboot_install/include/cyg/sopc/altera_avalon_lan91c111.inl:114: undefined reference to `perror' 

 

From ../altera_avalon_lan91c111\current\include\altera_avalon_lan91c111.inl: 

# if defined(ALTERA_NIOS_DEV_BOARD_CYCLONE_1C20) ||  

defined(ALTERA_NIOS_DEV_BOARD_STRATIX_1S10) ||  

defined(ALTERA_NIOS_DEV_BOARD_STRATIX_1S10_ES) ||  

defined(ALTERA_NIOS_DEV_BOARD_STRATIX_1S40) 

 

HAL_READ_UINT32 ((void*) (LAST_FLASH_SECTOR), signature); 

 

if (signature != 0x00005afe) 

diag_printf("This Flash does not contain a valid MAC Address\n"); 

memcpy(enaddr, static_esa, 6); 

diag_printf("Using the default of 0x%x:%x:%x:%x:%x:%x\n", enaddr[0], enaddr[1], enaddr[2], 

enaddr[3], enaddr[4], enaddr[5]); 

else 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 4), enaddr[0]); 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 5), enaddr[1]); 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 6), enaddr[2]); 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 7), enaddr[3]); 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 8), enaddr[4]); 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 9), enaddr[5]); 

}# else 

diag_printf("This is not an Altera development board\n"); 

memcpy(enaddr, static_esa, 6); 

diag_printf("Using the default of 0x%x:%x:%x:%x:%x:%x\n", enaddr[0], enaddr[1], enaddr[2], 

enaddr[3], enaddr[4], enaddr[5]); 

 

perror( "Not an Altera board.\n"); 

perror( "You need to modify the function altera_avalon_lan91c111_get_esa() \n"); 

perror( "to set a MAC address for your board");# endif /* (Altera Nios Dev board definition) */ 

 

 

2. Global Pointer out of range 

 

/cygdrive/c/Projects/GenOne/Software/eCos/redboot_install/lib/libtarget.a(redboot_main.o)(.text.do_idle+0x14): In function `valid_address': 

/cygdrive/c/altera/kits/nios2/components/ecos/ecos-current/packages/redboot/current/src/main.c:756: Unable to reach __RedBoot_IDLE_TAB_END__ (at 0x04000dd0) from the global pointer (at 0x04008e2c) because the offset (-32860) is out of the allowed range, -32678 to 32767. 

 

collect2: ld returned 1 exit status 

make[1]: Leaving directory `/cygdrive/c/Projects/GenOne/Software/eCos/redboot_build/redboot/current' 

make[1]: *** [/cygdrive/c/Projects/GenOne/Software/eCos/redboot_install/bin/redboot.elf] Error 1 

make: Leaving directory `/cygdrive/c/Projects/GenOne/Software/eCos/redboot_build' 

make: *** [build] Error 2 

 

From ../altera_avalon_lan91c111\current\include\altera_avalon_lan91c111.inl: 

# if defined(ALTERA_NIOS_DEV_BOARD_CYCLONE_1C20) ||  

defined(ALTERA_NIOS_DEV_BOARD_STRATIX_1S10) ||  

defined(ALTERA_NIOS_DEV_BOARD_STRATIX_1S10_ES) ||  

defined(ALTERA_NIOS_DEV_BOARD_STRATIX_1S40) 

 

HAL_READ_UINT32 ((void*) (LAST_FLASH_SECTOR), signature); 

 

if (signature != 0x00005afe) 

diag_printf("This Flash does not contain a valid MAC Address\n"); 

memcpy(enaddr, static_esa, 6); 

diag_printf("Using the default of 0x%x:%x:%x:%x:%x:%x\n", enaddr[0], enaddr[1], enaddr[2], 

enaddr[3], enaddr[4], enaddr[5]); 

else 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 4), enaddr[0]); 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 5), enaddr[1]); 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 6), enaddr[2]); 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 7), enaddr[3]); 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 8), enaddr[4]); 

HAL_READ_UINT8 ((void*) (LAST_FLASH_SECTOR + 9), enaddr[5]); 

}# else 

diag_printf("This is not an Altera development board\n"); 

memcpy(enaddr, static_esa, 6); 

diag_printf("Using the default of 0x%x:%x:%x:%x:%x:%x\n", enaddr[0], enaddr[1], enaddr[2], 

enaddr[3], enaddr[4], enaddr[5]); 

 

perror( "Not an Altera board.\n"); 

perror( "You need to modify the function altera_avalon_lan91c111_get_esa() \n"); 

perror( "to set a MAC address for your board");# endif /* (Altera Nios Dev board definition) */ 

 

 

Any thoughts? 

 

TIA
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
415 Views

About first problem, 

I have a same problem , It looks likes this eCos configurator supported only few models about below. 

My case was ALTERA_NIOS_DEV_BOARD_STRATIX_2S60_ES board. so I simply add "defined(ALTERA_NIOS_DEV_BOARD_STRATIX_2S60_ES) || \" 

 

#if defined(ALTERA_NIOS_DEV_BOARD_CYCLONE_1C20) ||  

defined(ALTERA_NIOS_DEV_BOARD_STRATIX_1S10) ||  

defined(ALTERA_NIOS_DEV_BOARD_STRATIX_1S10_ES) || \ 

#defined(ALTERA_NIOS_DEV_BOARD_STRATIX_2S60_ES) || \ 

#defined(ALTERA_NIOS_DEV_BOARD_STRATIX_1S40) 

 

aqura http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
0 Kudos
Altera_Forum
Honored Contributor II
415 Views

aqura: 

 

Thank you for your reply. That is what I thought. However I was reluctant to add the test for the 2C35 board since it was included elsewhere in the code. I will add and rebuild. 

 

As for my second error, from this forum (and others) I have added "[]" to the following statements in main.c to modify the addressing from relative to absolute. 

 

From: extern struct init_tab_entry __RedBoot_INIT_TAB__[], __RedBoot_INIT_TAB_END__; 

 

To: extern struct init_tab_entry __RedBoot_INIT_TAB__[], __RedBoot_INIT_TAB_END__[]; 

 

Thanks again........... 

 

Graham.....
0 Kudos
Altera_Forum
Honored Contributor II
415 Views

I am also trying to build RedBoot for a Cyclone-II 2C35. 

 

I have had many of the same problems like yours and I have been using the suggested fixes but I just keep getting to some other error. 

 

Did you or anyone else get Redboot to build for the Cyclone-II 2C35? 

 

Thanks.
0 Kudos
Altera_Forum
Honored Contributor II
415 Views

Hello, 

 

We are in the process of getting the ecos update for Nios II 5.1 ready to go -- this will be addressed in that release.
0 Kudos
Reply