Files
micropython/ports/stm32/lwip_inc/lwipopts.h
Damien George 6c4b05d832 stm32/lwip_inc: Further increase N6 lwIP memory.
This MCU has a lot of memory and gigabit ethernet, so it benefits from
improved lwIP performance.

Signed-off-by: Damien George <damien@micropython.org>
2025-11-20 13:01:35 +11:00

31 lines
871 B
C

#ifndef MICROPY_INCLUDED_STM32_LWIP_LWIPOPTS_H
#define MICROPY_INCLUDED_STM32_LWIP_LWIPOPTS_H
#include STM32_HAL_H
#define LWIP_NETIF_EXT_STATUS_CALLBACK 1
#define LWIP_LOOPIF_MULTICAST 1
#define LWIP_LOOPBACK_MAX_PBUFS 8
#define LWIP_IPV6 0
#define LWIP_RAND() rng_get()
// Increase memory for lwIP to get better performance.
#if defined(STM32N6)
#define MEM_SIZE (64 * 1024)
#define PBUF_POOL_SIZE (32)
#define TCP_MSS (1460)
#define TCP_WND (16 * TCP_MSS)
#define TCP_SND_BUF (16 * TCP_MSS)
#define MEMP_NUM_TCP_SEG (64)
#endif
// Include common lwIP configuration.
#include "extmod/lwip-include/lwipopts_common.h"
extern uint32_t rng_get(void);
#endif // MICROPY_INCLUDED_STM32_LWIP_LWIPOPTS_H