- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I have problem with changing IP address in the FPGA board. Here is my case, let say I have a FPGA board which is connected to PC. The PC sends a command to the FPGA that asks the FPGA to change its IP address to a new given IP address. Here is my idea to handle this task :- After receiving IP changes command from PC, both FPGA and PC terminate their TCP/IP connection by close their socket.
- The FPGA does the IP changes mechanism
- Both FPGA and PC initiate a new TCP/IP connection like usual
- The FPGA sends acknowledgement to the PC to tell that it already changes its IP address successfully.
- Terminate the previous TCP/IP connection (close the exist socket)
- Assign new IP address to the FPGA (I have made a new function called 'change_ip' which is basically same as get_ip_addr function provided by altera)
- Initiate new TCP/IP connection (create, bind, listen socket)
: See STDERR for expanded diagnosis translation.
: Bind failed
: ERRNO: :
: See STDERR (FAULT_LEVEL is SYSTEM).
: FAULT_LEVEL is SYSTEM.
: FATAL Error, Restart required.
: Locking scheduler - endless loop.
I also tried to kill the previous "inet main" and "clock tick" tasks, but in the end it also ends up with the same error message. Anybody know how is the correct procedure to change FPGA's IP address? :confused: :confused: Thanks for any comments or suggestions!
Link Copied
- « Previous
-
- 1
- 2
- Next »
27 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mcr42,
how did you made the changing of the ip address within the website? Or did you just changed it static in your application code? Thanks, Urmel- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did it just static.
But if you want to trigger actions through the webpage, you will find ProgFlashStub() in http.c. Here declare all the actions and which functions are called.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, thank you very much!
One last question: Where did you defined your change_ip() function? I tried it in Web_server.c but even when I enabled DHCP in Nichestacks Settings under System Library it couldn't find the dhc_state_init() function.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have no clue why it does work for me without include, but a quick grep for dhc_state_init() gave me <bsp>\iniche\src\h\dhcpclnt.h .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, thanks.
I got it running but with some workaround. I included the change_ip() function in network_utilities.c and made it "extern" so i can run it inside the webserver.c. Then I also added# include "dhcpclnt.h" to the network_utilities.c as well as defining the NetInfo struct. But there is still a warning, because "dhc_set_state" is not known. Curiously this function is defined in dhcpclnt.c and not in the header file. As I don't really need the dhcp at the moment I don't care. Just for the sake of interest. Which version of the NIOS-IDE do you use? I use the 9.1 SP2 of NIOS and i.e. the definition of IP4_ADDR is only in the network_utilities.c instead of webserver.h as it seems to be on your system.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using 9.1SP2 too.
But I moved the IP4_ADDR definition (among other edits), as there's no reason to keep it private to network_utilities.c.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Dear all, I have problem with changing IP address in the FPGA board. Here is my case, let say I have a FPGA board which is connected to PC. The PC sends a command to the FPGA that asks the FPGA to change its IP address to a new given IP address. Here is my idea to handle this task :
- After receiving IP changes command from PC, both FPGA and PC terminate their TCP/IP connection by close their socket.
- The FPGA does the IP changes mechanism
- Both FPGA and PC initiate a new TCP/IP connection like usual
- The FPGA sends acknowledgement to the PC to tell that it already changes its IP address successfully.
- Terminate the previous TCP/IP connection (close the exist socket)
- Assign new IP address to the FPGA (I have made a new function called 'change_ip' which is basically same as get_ip_addr function provided by altera)
- Initiate new TCP/IP connection (create, bind, listen socket)
: See STDERR for expanded diagnosis translation.
: Bind failed
: ERRNO: :
: See STDERR (FAULT_LEVEL is SYSTEM).
: FAULT_LEVEL is SYSTEM.
: FATAL Error, Restart required.
: Locking scheduler - endless loop.
I also tried to kill the previous "inet main" and "clock tick" tasks, but in the end it also ends up with the same error message. Anybody know how is the correct procedure to change FPGA's IP address? :confused: :confused: Thanks for any comments or suggestions! --- Quote End --- Hi, I am a new in altera. I want to create double socket servers in simple socket example. For that i have changed the SOPC builder and created one more ethernet port. I have also get the different IP addresses when the DHCP enabled. I can also access the ethernet port through telnet one by one as simple socket server.c has only one socket. Now I am trying to fix the socket address. suppose the socket address is 192.168.1.5 for et1 , i can access the et1 through telnet, but when i change the socket address from 192.168.1.6 for et1, i get the same above error. socket is failed to bind. code: addr.sin_family = AF_INET; addr.sin_port = htons(SSS_PORT); addr.sin_addr.s_addr = inet_addr("192.168.1.6"); err: [Network]: See STDERR for expanded diagnosis translation. [Network]: [sc_task] Bind failed [Network]: ERRNO: : [Network]: See STDERR (FAULT_LEVEL is SYSTEM). [Network]: FAULT_LEVEL is SYSTEM. [Network]: FATAL Error, Restart required. [Network]: Locking scheduler - endless loop. Thanks for any suggestions!
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »