Skip to main content
MANISH
Associate III
March 13, 2018
Question

STM32H7 Ehernet issue

  • March 13, 2018
  • 5 replies
  • 1019 views
Posted on March 13, 2018 at 08:31

Hai , Now we are using the STM32H7 MCU in our board instead of the STM32F7 MCU .For ethernet in the STM32F7 phy drivers are given by  the stm during the generation (by cubemx) only but for the STM32H7 phy drivers are not  available . how to select the phy address in STM32H7 .

Best reards

Maheshwar.

#stm #h743-208 #ethernet
This topic has been closed for replies.

5 replies

ST Technical Moderator
March 13, 2018
Posted on March 13, 2018 at 13:43

Hello

maheshwarreddy681

,

For STM32H7, theLAN8742 PHY driver is configured from the LwIP >

Platform Settings

tab, then CubeMx copies lan

8742

.c/.hfiles from the CubeH7 firmware package toyour project directory and you canmanage thePHY setting.

0690X0000060A6SQAU.png

Best Regards

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
MANISH
MANISHAuthor
Associate III
March 23, 2018
Posted on March 23, 2018 at 10:12

Hello   Lmen  D ,

                           Thank you for the valuable reply , I had changed the Phy settings as mentioned above still the Ethernet is not working i.e i'am unable to send the Packet out . Is their any special clock settings are needed for the Ethernet.

Best regards 

Maheshwar

Joerg Wagner
Senior III
March 28, 2018
Posted on March 28, 2018 at 18:38

https://community.st.com/0D50X00009XkWXJSA3

You cannot set the PHY address.

In lan87c is a for loop which starts at address 0 and tries to find a device until addr=

Take care of the RAM settings, do not use DTCMRAM.

I had some articles about that in this forum.

MANISH
MANISHAuthor
Associate III
May 23, 2018
Posted on May 23, 2018 at 08:06

Hello Joerg Wagner,

       Which function we need to use for the receiving the UDP packet .For sending the UDP packet we are using the following function.UDP_packet_send(uint8_t *Tx_buf,uint16_t length).

Thank you.

Joerg Wagner
Senior III
May 23, 2018
Posted on May 23, 2018 at 10:17

 ,

 ,

♯ define UDP_PORT 7

char rx_buf[1500],

char got_udp=0,

/**

 ,

 , * @brief This function is called when an UDP datagrm has been received on the port UDP_PORT.

 ,

 , * @param arg user supplied argument (udp_pcb.recv_arg)

 ,

 , * @param pcb the udp_pcb which received data

 ,

 , * @param p the packet buffer that was received

 ,

 , * @param addr the remote IP address from which the packet was received

 ,

 , * @param port the remote port from which the packet was received

 ,

 , * @retval None

 ,

 , */

 ,

void udp_echoserver_receive_callback(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port)

 ,

{ , , ,

 , , // my own receive buffer

 , , , memcpy(rx_buf, p->,payload, p->,len),

 , ,  ,/* free the UDP connection, so we can accept new clients */

 ,

 , ,  ,udp_disconnect(upcb),

 , ,  ,/* Free the p buffer */

 ,

 , ,  ,pbuf_free(p),

 , , // set a flag we received new data

 , ,  ,got_udp=1,

 ,

}

/* Private functions ---------------------------------------------------------*/

/**

 ,

 , * @brief , Initialize the server application.

 ,

 , * @param , None

 ,

 , * @retval None

 ,

 , */

 ,

void udp_echoserver_init(void)

 ,

{

 ,

 , , struct udp_pcb *upcb,

 ,

 , , err_t err,

 ,

 , , /* Create a new UDP control block , */

 ,

 , , upcb = udp_new(),

 , , if (upcb)

 ,

 , , {

 ,

 , , , , /* Bind the upcb to the UDP_PORT port */

 ,

 , , , , /* Using IP_ADDR_ANY allow the upcb to be used by any local interface */

 ,

 , ,  , , err = udp_bind(upcb, IP_ADDR_ANY, , UDP_PORT),

 ,

 ,

 , , , , , if(err == ERR_OK)

 ,

 , , , , , {

 ,

 , , , , , , , /* Set a receive callback for the upcb */

 ,

 , , , , , , , udp_recv(upcb, udp_echoserver_receive_callback, NULL),

 ,

 , , , , , }

 ,

 , , , , , else

 ,

 , , , , , {

 ,

 , , , , , , , udp_remove(upcb),

 ,

 , , , , , }

 ,

 , , }

 ,

 , , else

 ,

 , ,  , , , _Error_Handler(__FILE__, __LINE__),

 ,

}