Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

Nios II IDE Linker "Unable to reach ..."

Altera_Forum
Honored Contributor II
2,428 Views

Hi, 

I'm using Nios II IDE 8.1. This particular Project is based on the uC-OS simple socket server. I'm not new to using the IDE I've got some pretty cool embedded code running on a Custom CPU board (1Mbyte SSRam) with a Cyclone III. 

 

I added a variable to the main program (iniche_init.c) and then declared it "extern unsigned char mslType" in the enet_server.c file because it's getting updated via enet task. I have other variables declared as "extern" and have had no problem until now. 

 

I did read that I'm out of the 64K and I need to use the -G option (in 6. Developing Programs Using the Hardware Abstraction Layer). But cleaned and tried that and still have the error below. So, reading more I see that I need to change the Board Support Package to match ? I've just used the defaults "altera_components" which I don't want to mess up because I have other projects that are working with that. 

 

i'd sure like to understand this better and know what to do with a little better 'guidance' than going back and forth reading and trying things. 

 

could someone please educate me to save me a little time or "narrow down the reading"  

 

thanks !! 

 

 

Linking April15_EnetTgtGen_CPU.elf... 

obj/enet_server.o(.text+0x664): In function `sss_handle_receive': 

../enet_server.c:643: undefined reference to `mslType' 

obj/enet_server.o(.text+0x664):../enet_server.c:643: Unable to reach mslType (at 0x00000000) from the global pointer (at 0x0123ff30) because the offset (-19136304) is out of the allowed range, -32678 to 32767. 

 

collect2: ld returned 1 exit status 

make: *** [April15_EnetTgtGen_CPU.elf] Error 1 

Build completed in 50.937 seconds 

--- Quote End ---  

0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
1,410 Views

Is mslType really located at 0x0 or are you just seeing some sort of uninitialized (NULL) pointer issue? 

 

Cheers, 

 

-Ura
0 Kudos
Altera_Forum
Honored Contributor II
1,410 Views

Where is mslType actually declared? 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,410 Views

you haven't declared the variable anywhere. 

one object file (.c file) needs to drop the 'extern' label.
0 Kudos
Altera_Forum
Honored Contributor II
1,410 Views

O.K. - solved. I had them both "extern" (it's been a long week) but still the issue of changing the BSP is something that interest me to learn about for other project. However, I guess there now Eclipse is the new environment and I need to eventually migrate to that.

0 Kudos
Reply