Starting Eth01 App

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
I am having trouble with the Eth1 app
So far I have set the main code with the functions
Eth_InitNetworkInterface() and Eth_OpenNetworkInterface()

To understand how this Eth App works, I would like to know what code should i use inside the loop

while(1){

}


I understand I have to use one of the Satellite modules.. What I can't understand is where should I connect the ethernet cable

I have seen that the port P0.0 could use an input signal of Eth0.CLK_RMMIB and the output signal could be the LEDTS0.COL2 as seen on table 2-1 of XMC4500 data-sheet

Could someone show me an example code and tell me how should I connect tha cable and signals in order to understand how it is configured and how this App works?

Kind Regards
0 Likes
4 Replies
lock attach
Attachments are accessible only for community members.
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Can you follow the quick start guide in the attachment?
0 Likes
Not applicable
Thank you Travis,

The guide was great for understanding the proceedure. Is there another one you could support me for any of the USB Apps?
There is not a way to work with this Eth App without the HMI board, right?

Thank you again for your support !
0 Likes
Not applicable
How can is set up the IP address on the XMC board?
What is the library containing all the functions to work with the Ethernet interface?

When i run the eth004 app this is the code that is generated, nowhere on it theres the setup for the ip address of the micro
Any help on this will be great!!


#include //SFR declarations of the selected device
#include //Declarations from DAVE3 Code Generation

/*Local port waiting for packets*/
#define LOCAL_PORT_RECEIVE (45555)
/*Local port used to echo back the packet*/
#define LOCAL_PORT_TRANSMIT (45174)
/*Destination port of echoed packet*/
#define TRANSMIT_PORT_DESTINATION (45175)


struct udp_pcb * udp_init_comm(unsigned int port) {
/* start the UDP server */
struct udp_pcb *pcb;
/* create new UDP PCB structure */
pcb = udp_new();
udp_bind(pcb, IP_ADDR_ANY, port);
return pcb;

}

void udp_receive_handler (void * arg, struct udp_pcb * upcb,
struct pbuf * p,
struct ip_addr * addr,
u16_t port){
struct pbuf * p_out;
/*As handler argument is expected the pcb that shall be used for
send back the data */
/* Allocate a buffer to store data to be transmitted*/
p_out = pbuf_alloc(PBUF_TRANSPORT,p->tot_len,PBUF_RAM);
/*Copy received data to transmit buffer*/
pbuf_copy(p_out,p);
/*Send back data to same ip that sent the data but on different port*/
udp_sendto((struct udp_pcb *)arg,p_out,addr,TRANSMIT_PORT_DESTINATION);
/*Free allocated buffer including the buffer of received data*/
pbuf_free(p_out);
pbuf_free(p);

}

int main(void)
{
struct udp_pcb *pcb_tr; //lwip pcb struct binded to transmit port
struct udp_pcb *pcb_rec; //lwip pcb struct binded to receive port

DAVE_Init(); // Initialization of DAVE Apps
lwIPStack_init(); //Start Lwip stack

//Create
pcb_tr=udp_init_comm(LOCAL_PORT_TRANSMIT);
pcb_rec=udp_init_comm(LOCAL_PORT_RECEIVE);

//Register an handler on receive packet event
udp_recv(pcb_rec,udp_receive_handler,pcb_tr);
while(1)
{

}
return 0;
}
0 Likes
Not applicable
Could someone explain me why is the ping not working? Should there be code inside the while (1) loop?
When i try to ping the board the message i get from the computer is ' the host is not accesible'

Kind regards
0 Likes