Skip to main content
THIHA KYAW
Associate III
Sep 28, 2017 6:00 AM UTC
Question

STM32F769I-Disco Ethernet

Posted on September 28, 2017 at 08:00

Hi,

Now I am creating a STM32CubeMX file for LWIP+FreeRTOS.

I didn't change anything and I just compile it.

But I didn't get IP address after dhcp_start(&gnetif);

I attached STM32CubeMX file.

Is there anything wrong in my settings?

Please advise me.

Regards,

Thiha Kyaw

#stm32f769i-disco
This topic has been closed for replies.

12 replies

AvaTar
Senior III
Sep 28, 2017 6:33 AM UTC
Posted on September 28, 2017 at 08:33

But I didn't get IP address after dhcp_start(&gnetif);

Check with your server.

DHCP servers give IP addresses only to machines that fulfill certain requirements, like the MAC address being in a specific range.

THIHA KYAW
Associate III
Sep 28, 2017 9:51 AM UTC
Posted on September 28, 2017 at 09:51

Thanks Avatar.

I may need to compare with example code. 

Example code is working.

Regards,

Thiha Kyaw

AvaTar
Senior III
Sep 28, 2017 9:55 AM UTC
Posted on September 28, 2017 at 09:55

I may need to compare with example code. 

Example code is working.

I hope you realize that two identical MAC addresses do not work.

Don't know your Cube code example, but I guess the MAC address comes as ♯ define from a header ...

THIHA KYAW
Associate III
Sep 28, 2017 8:53 AM UTC
Posted on September 28, 2017 at 10:53

Dear Avatar,

I think cube generated code has some problems. When I compare ethernet initialization, some pins are missing such RMII_MII_RXER pins.

I believe my STM32Cube file is not correct. 

0690X00000608QLQAY.png
AvaTar
Senior III
Sep 28, 2017 11:00 AM UTC
Posted on September 28, 2017 at 11:00

I don't use Cube, so I can't comment on on specific code.

But to recap:

But I didn't get IP address after dhcp_start(&gnetif);

Have you tried debugging, or an ethernet sniffer like Wireshark ?

If your see IP packets from/to your module, I would not start looking in the init code.

I still suspect you have a network/setup problem.

THIHA KYAW
Associate III
Sep 28, 2017 9:05 AM UTC
Posted on September 28, 2017 at 11:05

Dear Avatar,

Yes, I tried debugging.

When MX_LWIP_Init() funiction is called, netif_is_link_up(&gnetif) is always false.

That's means ethernet link doesn't up.

That's why I suspect it in hardware initialization.

Regards,

Thiha Kyaw

AvaTar
Senior III
Sep 28, 2017 11:22 AM UTC
Posted on September 28, 2017 at 11:22

When MX_LWIP_Init() funiction is called, netif_is_link_up(&gnetif) is always false.

That's means ethernet link doesn't up.

That's why I suspect it in hardware initialization.

That sounds correct.

Unfortunately I don't have a F769I Disco board, nor I am using Cube, so I can't help you with that.

But Cube is known not to be 100% bug-free, to state it cautiously.

If you have a working example, I would try to copy the init code from there.

THIHA KYAW
Associate III
Sep 28, 2017 9:29 AM UTC
Posted on September 28, 2017 at 11:29

Dear Avatar,

Thanks for your help.

Regards,

Thiha

ST Technical Moderator
Sep 28, 2017 11:22 AM UTC
Posted on September 28, 2017 at 13:22

Hello

thihakyaw.job

,

Could you please precise the version of CubeMx and firmware you are using ?

Have a look to the datasheet and check the pin assignment as the PG2 is used by FMC.

Also, refer to the errata sheet related to your device to check if you have the same conditions as described in the errata sheet.

Please, keep us informed about your progress.

Kind 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
THIHA KYAW
Associate III
Sep 29, 2017 3:41 AM UTC
Posted on September 29, 2017 at 03:41

Dear Imen,

Example Firmware is from \STM32Cube_FW_F7_V1.8.0\Projects\STM32F769I-Discovery\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS\

Line 166

/* Configure PG2, PG11, PG13 and PG14 */

GPIO_InitStructure.Pin = GPIO_PIN_2 | GPIO_PIN_11 | GPIO_PIN_13 | GPIO_PIN_14;

HAL_GPIO_Init(GPIOG, &GPIO_InitStructure);

STM32CubeMX Version is 4.22.1.

Please help to check my STM32CubeMX file and give me some suggestion.

Thanks.

Regards,

Thiha Kyaw

Joerg Wagner
Senior III
Sep 30, 2017 11:47 AM UTC
Posted on September 30, 2017 at 13:47

You probably have Chip Revision A of your STM32F769NIH.

It's labelled in the right bottom corner.

Take a look at page 18 of the errata data sheet. This problem

covered also the STM32F767 family and was solved by Rev. Z.

I don't know if 32F769I-DISCO boards with Rev. Z are available at the

distributors. But it's possible to write a software workaround to use

Ethernet properly.

john doe
Senior III
Sep 30, 2017 11:31 PM UTC
Posted on September 30, 2017 at 23:31

Going beyond that, I'm one that's willing to say the CubeMX application doesn't generate useful code in this context.  There isn't even working ethernet code in the BSP.  You need to rip out what you need from ~/STM32Cube/Repository/STM32Cube_FW_F7_V1.8.0/Projects/STM32F769I-Discovery/Applications/LwIP/LwIP_HTTP_Server_Netconn_RTOS/Src/ethernetif.c 

And if you're not going to use RTOS and interrupts, then you're going to have to constantly poll the interface