Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,326 Views

BSP Content Linking while upgrading Niche UDP Offload Ethernet Example to 10.1

Hi Guys, 

 

I'm trying to upgrade the UDP offload example to 10.1 both to give to the community and to use as part of my Uni project (this is a very tiny part). 

I need to get the UDP offload example going in 10.1 and also for the DE2-115. 

http://www.alterawiki.com/wiki/nios_ii_udp_offload_example 

 

I'm having errors that are "undefined reference", but the definition is in the BSP. So is it a BSP linking problem?  

Basically i'm after advice on the problem. I've added extra detail below for your reference if needed. 

 

problem summary 

I've got compiler errors for undefined objects that actually are defined in the BSP. See the attached image for errors and read on for details. 

 

error details 

 

What i've got is the errors shown in the attached pic. They refer to "undefined" calls. Thing is, these definitions exist in code in the BSP. One refers to menus from the niche stack and the others to an Altera timer. 

 

The timer related ones are in the bsp/drivers/src/ . These appear to me to be included via the include call #include<sys/alt_timestamp.h> 

 

The menu one is in menus.c in bsp/hal/iniche/src/miclib/ . The only link i see is #include"menu.h" . Note that the .c has "menus" with an s; where the .h doesn't. So does the .c get included.....? 

 

Any help will be greatly appreciated. When i get this going i plan to upload it back up as I've noticed some other people would like a 10.1 version of it. 

THANKS IN ADVANCE  

 

extra details 

 

 

how i developed the example to 10.1
  1. Used v9.0sp2 to run the UDP off load example src scripts from the Nios console. This constructs the quartus project and application. 

  2. Took my successful Simple Socket Server 10.1 Example and added the needed UDP offload objects to the SOPC design. 

  3. Created a Nios project using the MicroC OS and Interniche options enabled for the BSP creation. 

  4. Took the raw .c and .h files from the v9.0 Nios program. Adapted them to the new system.h. 

This has led me to the errors. 

 

 

what i've tried to do to fix
  1. I've played around trying different includes and even copying the "menus.c" file out of the BSP and into the project itself. 

  2. Tried to make direct includes using a header called "menus.h" 

    1 and 2 still couldn't get past those errors (or the extra ones these attempts created). 

  3. Looked at the 9.0 BSP summary html for any differences in settings. None seen. 

0 Kudos
10 Replies
Altera_Forum
Honored Contributor I
76 Views

open the file that is generating the errors and try using the shortcut Control+Shift+N. Eclipse will try and find the correct include files that you might be missing. Also the F3 key can take you to the point of definition for variables and functions. This can be useful for tracking down where things are and why they might not be included.

Altera_Forum
Honored Contributor I
76 Views

Thanks for the reply R.Tennil. 

 

I have tried Control+Shift+N and it just makes a "ding" sound. I did it while in the code and on the error. 

 

it may have something to do with them being 'externs'. i do not know exactly what that does. can someone please enlighten me? 

 

When i use F3 it actually takes me to the the headers where the definition is. Bellow i'll copy in the defintions. 

 

I'm also getting warnings regarding the BSP directories saying the incluse paths are not found. But they are correct and the files exist. How can i refresh this so it works? 

 

 

--- Quote Start ---  

Description Resource Path Location Type 

Invalid project path: Include path not found (D:\University\AlteraWorkspace\UDPOffload_EnetCam\NiosSoftware\UdpOffload_vA_bsp). UdpOffload_vA pathentry Path Entry Problem 

--- Quote End ---  

 

 

 

 

 

--- Quote Start ---  

 

undefined reference to `install_menu' demo_control.c /UdpOffload_vA line 69 C/C++ Problem 

Pressing F3 takes me to menu.h with the defintion 

 

externint install_menu(struct menu_op * newmenu); /* add new menu */ 

 

--- Quote End ---  

 

 

 

--- Quote Start ---  

 

undefined reference to `alt_timestamp_freq' and `alt_timestamp_start' and `alt_timestamp' 

Pressing F3 takes me to alt_timestamp.h with the defintion 

 

 

 

extern 

int alt_timestamp_start (void); 

 

extern 

 

alt_timestamp_type alt_timestamp (void); 

 

externalt_u32 alt_timestamp_freq (void); 

 

--- Quote End ---  

 

 

Altera_Forum
Honored Contributor I
76 Views

I've Done a rebuild with a new project and it is coming down to linkers. 

As in, the files with the functions i need are there is the BSP, but they don't appear in the BSP editor tab 'Target BSP Directory'. 

How do I add custom components .h and .c files to that?
Altera_Forum
Honored Contributor I
76 Views

I have the same problem as yours.  

for the timer error, you only need edit bsp to enable the timer, but the menu.h, I cannot find how to solve it.
Altera_Forum
Honored Contributor I
76 Views

I gave up on getting this example working. I'm now attempting to get my own code doing it using the UDP payload inserter only

Altera_Forum
Honored Contributor I
76 Views

Did you ever test the anything about payload using UDP method? I am going to use it to transfer mass data from my nios II board to the PC. I need 300Mbps payload.

Altera_Forum
Honored Contributor I
76 Views

I need exactly the same thing. Unfortunately I haven't got anything at all going so far. 

I could never get the example to compile. At this moment, i'm trying to get the UDP packet inserter (UPI) part and the alignment pad inserter going. 

 

I've tried to write my own C code to intialise the UPI but i'm still trying to get it to function.
Altera_Forum
Honored Contributor I
76 Views

I*s anyone working on this or something similar atm? 

 

I think i'm almost there but i can't get it to work. 

I can elaborate more if people are willing to assist, when we get it figured we can post for all. 

 

My problem seems to be with legth control. Although the UDP payload inserter says it can take up to 1472 (ish) UDP bytes. Its length field is only determined by a two byte address (15:0) so that doesn't make sense. 

 

To show how close i am, i actually do get packets out, but they are wrong size and and i only get about 20 before the UPI faults. 

 

As i said, i'm more than happy to elaborate, i just don't wasnt to take the time to post a clear concise post if no-one cares.
Altera_Forum
Honored Contributor I
76 Views

Could you point me to where you're seeing the 2-byte length field? I dug through the verilog files a bit looking for some extra information but didn't see anything for length in the payload_inserter.v.

Altera_Forum
Honored Contributor I
76 Views

Hey Tennill, 

 

The payload length is  

  • LINE 60: shown on the comments diagram with comment underneath. 

  • LINE 293: Taken combinationally from sink data with 8 added. This is to define the UDP header. (shown on LINE 50) 

    note: THis is where its only reading 2 bytes in, which would be limiting the size of your packets yeah? 

  • LINE 295: Then added with 20 to become the length of of the total IP packet. (shown on LINE 17). 

I'm doing testing sending 22 byte packets to avoid this sizing problem in my concept testing. For some reason, its sending garbage packets of total length of 136 before it craps itself. 

It should be just packets of 22 + 8 + 20 = 50 bytes, since incorporating the IP and UDP headers. 

I've got signal tap going and i can't figure it out.
Reply