Skip to main content
M3R
Associate II
January 8, 2021
Solved

Ethernet Hard Fault When MACAddr get Value

  • January 8, 2021
  • 5 replies
  • 4072 views

hi

i Use stm32f107RC and lan8720.

when MX_ETH_Init(); function run i got Hard Fault in This line:0693W000006I4XdQAK.pngHow can I solve this problem?

This topic has been closed for replies.
Best answer by Vangelis Fortounas

Hello

heth.Init.MACAddr is not defined as array but just as pointer

In same function, define

uint8_t mcdr[]={0x00,0x80,0xE1,0x00,0x52,0x00};//def and initialize

heth.Init.MACAddr = &mcdr[0];

5 replies

TDK
Super User
January 8, 2021

It's an imprecise error, which means the error is probably not on the line that triggered it. Most likely the issue is elsewhere.

But you should verify that heth.Init.MACAddr points to a valid location in RAM.

"If you feel a post has answered your question, please click ""Accept as Solution""."
M3R
M3RAuthor
Associate II
January 9, 2021

yes

i checked the address of the variable, it is in RAM (0x200013B0)

I Changed the microcontroller IC, which is the same problem again.

M3R
M3RAuthor
Associate II
January 12, 2021

Does anyone have an opinion?

Vangelis Fortounas
Associate II
January 12, 2021

Hello

heth.Init.MACAddr is not defined as array but just as pointer

In same function, define

uint8_t mcdr[]={0x00,0x80,0xE1,0x00,0x52,0x00};//def and initialize

heth.Init.MACAddr = &mcdr[0];

M3R
M3RAuthor
Associate II
January 13, 2021

Thanks @Vangelis Fortounas​ 

This Problem has Solved.

When I want to ping, it receives data but does not send data.

What is the problem?

�?Status 0x00D00000 is Not Defined... in Header

0693W000007B1r6QAC.jpg

Vangelis Fortounas
Associate II
January 13, 2021

Hello

Ping uses ICMP protocol that belongs to Internet Protocol layer.

MAC layer can't unterstand what is ping. It just receives and transmits data

There are examples here and here. Not for f107 but you can take an idea what to do.

STM32CubeMX can produce working code by using ethernet interface and LWIP stack.

M3R
M3RAuthor
Associate II
January 13, 2021

HI.

I have used the lwip functions and already got pings in the stm32f429 and lan8720.

But I can't get a ping in f1 Series .

Is there a software problem?

Vangelis Fortounas
Associate II
January 15, 2021

LWIP has some ICMP settings not to respond to broadcast and multicast pings. Send a unicast ping to LWIP.

Update F1 HAL to the latest version.

Compare the LWIP working settins of F429 with those of f107

Activate debuging for UDP, ICMP, and redirect the messages to a console. It will help a lot.

At last put a break inside the icmp_input(...) function and step by step find the cause of this behaviour.