• AVR Freaks

How to setup an UDP communication between PIC32 ESK 2 and PC ?

Author
Fullgor
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2020/04/21 01:04:50
  • Location: 0
  • Status: offline
2020/05/22 07:15:16 (permalink)
0

How to setup an UDP communication between PIC32 ESK 2 and PC ?

Hardware : PIC32MX795F512L - PIC32 Ethernet Starter Kit 2
Software : MPLAB X IDE v5.35 - Plugin Harmony v3.50
 
Hello,
 
I am trying to setup an UDP server on PIC32 via Ethernet to receive communication from a PC through a local network. I started by searching for example codes, and I chose to begin with the project "udp_server" included in the Net driver of Harmony. I configured in the "configuration.h" file the IP, Mask, Gateway, and DNS that my Network admin gave to me :

/* Network Configuration Index 0 */
#define TCPIP_NETWORK_DEFAULT_INTERFACE_NAME_IDX0       "ETHMAC"
#define TCPIP_IF_ETHMAC

#define TCPIP_NETWORK_DEFAULT_HOST_NAME_IDX0            "MCHP_PIC32"
#define TCPIP_NETWORK_DEFAULT_MAC_ADDR_IDX0             0

#define TCPIP_NETWORK_DEFAULT_IP_ADDRESS_IDX0           "XXX.XXX.XXX.XXX"
#define TCPIP_NETWORK_DEFAULT_IP_MASK_IDX0              "XXX.XXX.XXX.XXX"
#define TCPIP_NETWORK_DEFAULT_GATEWAY_IDX0              "XXX.XXX.XXX.XXX"
#define TCPIP_NETWORK_DEFAULT_DNS_IDX0                  "XXX.XXX.XXX.XXX"
#define TCPIP_NETWORK_DEFAULT_SECOND_DNS_IDX0           "XXX.XXX.XXX.XXX"

When I run the program, the setup seems to work as expected. But the board can't detect when a socket is opened. I can't manage to communicate with the PIC, it doesn't even answer to a ping.
I tried looking at the available configurations in Harmony, but as I don't know much about network, I barely understand what is already done in this project.
By searching on internet, I found some tutorials to setup a UDP server with Harmony v2, but from what I saw, Harmony v2 and v3 are quite different, so I can't figure out what to do with that. I also found something with Harmony v3 and a PIC32MZ, but it uses DRAM and other hardwares I don't have, and an older version of the Net driver with different option layouts. (And I don't have the patience to dig in the 1000+ pages of the Net driver documentation, which primarily describes functions)
I find weird that a starter kit, as its name implies, doesn't come with some workings programs, and doesn't work with the provided example codes from drivers...
So I am looking for leads to get a simple working UDP server on PIC32 ESK 2.
#1
Jump to:
© 2020 APG vNext Commercial Version 4.5