cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet Hard Fault When MACAddr get Value

M3R
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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];

View solution in original post

9 REPLIES 9
TDK
Guru

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
Associate II

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
Associate II

Does anyone have an opinion?

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];

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

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.

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?

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.

M3R
Associate II

My problem was Solved when i use CMSIS_V2 RTOS.

Thanks for the tips @Vangelis Fortounas​ :rose: