Hello @Roberto C,
After thoroughly analyzing your project and debugging, I was able to isolate parts of it to test your issue. Here are my observations and recommendations:
The reason your application is not pingable is due to an overlap between the TouchGFX framebuffer and the Ethernet HEAP. In the ethernetif source file, the RX buffer count is set to 12, with each frame being 1536 bytes. This totals 18,432 bytes (approximately 18 KB). However, in your lwipopts.h file, the allocated heap size is only 16,360 bytes, which is insufficient. As a result, the compiler allocated the heap in AXISRAM at 0x2400xxxx. You resolved this by moving the framebuffer to 0x24040000.
To fix this properly, reduce the RX buffer count to 10 so the heap memory can remain at 0x30044000.
Additionally, the declaration for memp_memory_RX_POOL_base[] is missing in ethernetif.c. Although a section is declared, no variable is assigned, which may cause unpredictable behavior when integrating TouchGFX with LWIP.
#endif
#if defined ( __ICCARM__ ) /*!< IAR Compiler */
#pragma location = 0x30040200
extern u8_t memp_memory_RX_POOL_base[];
#elif defined ( __CC_ARM ) /* MDK ARM Compiler */
__attribute__((section(".Rx_PoolSection"))) extern u8_t memp_memory_RX_POOL_base[];
#elif defined ( __GNUC__ ) /* GNU */
__attribute__((section(".Rx_PoolSection"))) extern u8_t memp_memory_RX_POOL_base[];
#endif
/* USER CODE BEGIN 2 */
I also noticed that neither the Ethernet memory regions nor TouchGFX memory regions are configured in the MPU. Configuring these is recommended to prevent caching issues with Ethernet buffers and descriptors.
Lastly, you created a 256 KB memory sub-region in AXISRAM starting at 0x24000000 for the framebuffer, but this is larger than necessary. Using the formula:
Width * Height * Pixel Size = 480 * 128 * 2 = 122,880 bytes ≈ 120 KB
Dividing 122,880 by 4 gives the equivalent word size. You can declare the framebuffer as a uint32_t array and place it in the created region.
Finally, I suggest you to increase the minimum size of stack and heap in the loader file to