STM32H723ZG DHCP memory allocation problem in LwIP
Hello,
I implemented the How to use SNTP over LwIP and RTC with an STM32 - STMicroelectronics Community example (not using FreeTOS) in the suggested STM32H723ZG NUCLEO-144 board. The app runs, but when it tries to allocate memory for DHCP with the mem_memalloc() function in dhcp:start (dhc.c lib file) it always returns null pointer. I t can't allocate memory for DHCP structure, the dhcp pointer is always 0 and dhcp_start() always returns with ERR_MEM error.
dhcp_start(struct netif *netif)
{
struct dhcp *dhcp;
...
/* no DHCP client attached yet? */
if (dhcp == NULL) {
dhcp = (struct dhcp *)mem_malloc(sizeof(struct dhcp));
if (dhcp == NULL) {
return ERR_MEM;
}
...
}In STM32H723ZGTX_FLASH.ld I have:
MEMORY
{
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 320K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K
}
...
/* ETH_CODE: add placement of DMA descriptors, rest is used by RX_POOL */
.lwip_sec (NOLOAD) : {
. = ABSOLUTE(0x30000000);
*(.RxDecripSection)
. = ABSOLUTE(0x30000080);
*(.TxDecripSection)
. = ABSOLUTE(0x30000100);
*(.Rx_PoolSection)
} >RAM_D2 AT> FLASHCan sombody help, what is wrong in the code?
Thanks,
Louis
