cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 RMII and lwIP memory allocation problem

mmercan
Associate

Hello members of the ST community,

I want to access LAN8742 PHY with RMII via ethernet protocol with STM32H743VIT6 microcontroller. I want to run the system using the default address settings generated by CubeMX. I created 10kB space for MEM_SIZE. I wanted to access the callback function of the system over ethernet by creating a UDP server. The system does not enter the callback function determined by the data coming over UDP. The addressing I used in this microcontroller is shown below;


LWIP_RAM_HEAP_POINTER : 0x30004000
First Tx Identifier Address : 0x30000080
First Rx Identifier Address : 0x30000000
Rx Buffers Address : 0x30000100


I found an application for lwIP application in the forum using MII connections. I tried the configurations there but no results. When I run the system in debug mode, mem_malloc: could not allocate in mem.c is returned;

 

MEM_STATS_INC(err);
LWIP_MEM_ALLOC_UNPROTECT();
sys_mutex_unlock(&mem_mutex);
LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SERIOUS, (“mem_malloc: could not allocate %”S16_F“ bytes\n”, (s16_t)size));
return NULL;

 

Can you help how to fix this problem. Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

You can also refer to this github link (especially for flash.ld file modification for placement of DMA descriptors and RX buffers).

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
SofLit
ST Employee

Hello @mmercan and welcome to the community,

Could you please refer to this article on how to create a project for STM32H7 with Ethernet and LwIP stack 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
SofLit
ST Employee

You can also refer to this github link (especially for flash.ld file modification for placement of DMA descriptors and RX buffers).

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.