Skip to main content
Graduate II
January 30, 2024
Solved

H723ZG Ethernet MPU: Should Rx_PoolSection still be included in the _FLASH.ld?

  • January 30, 2024
  • 2 replies
  • 2792 views

I have a NUCLEO-H723ZG.

From the STM32 examples, in the LwIP_UDP_Echo_Server/STM32CubeIDE/STM32H723ZGTX_FLASH.ld file, we have:

 

.lwip_sec (NOLOAD) : {
 . = ABSOLUTE(0x30000000);
 *(.RxDecripSection) 
 
 . = ABSOLUTE(0x30000200);
 *(.TxDecripSection)
 
 . = ABSOLUTE(0x30000400);
 *(.Rx_PoolSection) 
 } >RAM_D2 AT> ROM

 

 

 However, when creating a project with STM32CubeIDE 1.13.1, We don't get to set the Rx_PoolSection. Also, in the generated ethernetif.c file I got:

 

#if defined ( __ICCARM__ ) /*!< IAR Compiler */

#pragma location=0x30000000
ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */
#pragma location=0x30000100
ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */

#elif defined ( __CC_ARM ) /* MDK ARM Compiler */

__attribute__((at(0x30000000))) ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */
__attribute__((at(0x30000100))) ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */

#elif defined ( __GNUC__ ) /* GNU Compiler */

ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT] __attribute__((section(".RxDecripSection"))); /* Ethernet Rx DMA Descriptors */
ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT] __attribute__((section(".TxDecripSection"))); /* Ethernet Tx DMA Descriptors */

#endif

 

Should Rx_PoolSection be just ignored, hence not included in the _FLASH.ld file?

    This topic has been closed for replies.
    Best answer by KDJEM.1

    Hello @eduardo_reis ,

    To clarify my last reply: 

    -->H723ZG Ethernet MPU: Should Rx_PoolSection still be included in the _FLASH.ld?

    Yes.

    When you creating a new project with STM32CubeIDE, you need to add manually RX_POOL buffers in ethernetif.c and  to modify linkerscript. 

    KDJEM1_1-1707922206145.png

     

    KDJEM1_0-1707922145911.png

    I hope this answer your request :).

    Thank you.

    Kaouthar

     

    2 replies

    Technical Moderator
    February 7, 2024

    Hello @eduardo_reis ,

    It is mentioned in this FAQ: How to create project for STM32H7 with Ethernet an... - STMicroelectronics Community : After generate project with STM32CubeIDE, you need to modify the code by placement of the RX_POOL buffers in ethernetif.c* (example with STM32H750).

    /* USER CODE BEGIN 2 */
    #if defined ( __ICCARM__ ) /*!< IAR Compiler */
    #pragma location = 0x30040200
    extern u8_t memp_memory_RX_POOL_base[];
    
    #elif defined ( __CC_ARM ) /* MDK ARM Compiler */
    __attribute__((at(0x30040200)) extern u8_t memp_memory_RX_POOL_base[];
    
    #elif defined ( __GNUC__ ) /* GNU Compiler */
    __attribute__((section(".Rx_PoolSection"))) extern u8_t memp_memory_RX_POOL_base[];
    
    #endif
    /* USER CODE END 2 */

    Then, modify the linkerscript. This step should be skipped for Keil and IAR, since they support placing variables at specific address in C code. Modify the linkerscript (*.ld) that the ETH descriptors and buffers are located in D2 SRAM. 

    Note (*) these addresses and sizes depend on the device or core used.

    For more information I advise you to take a look at How do I create a project for STM32H7 with Ethernet and LwIP stack working?

    Thank you.

    Kaouthar

    Graduate II
    February 12, 2024

    Hello @KDJEM.1, thank you for your response.

    Would it be possible to be a bit more clear?

    As I said, I am using the H723ZG, which Memory layout points its address as AXI SRAM (32-byte aligned).

     

    Variable STM32H72x/H73x address Size Source file

    DMARxDscrTab0x3000000096 (256 max.)ethernetif.c
    DMATxDscrTab0x3000010096 (256 max.)ethernetif.c
    memp_memory_RX_POOL_baseAXI SRAM (32-byte aligned)12*(1536 + 24)ethernetif.c
    LwIP heap0x3000020032232 (32kB - 512 - 24)lwipopts.h

    -----


    @KDJEM.1 wrote:you need to modify the code by placement of the RX_POOL buffers in ethernetif.c* (example with STM32H750).

    What do you mean by modify since there is no description for memp_memory_RX_POOL_base in the ethernetif.c file, as I pasted it above?

    Should I include it?

    KDJEM.1Answer
    Technical Moderator
    February 14, 2024

    Hello @eduardo_reis ,

    To clarify my last reply: 

    -->H723ZG Ethernet MPU: Should Rx_PoolSection still be included in the _FLASH.ld?

    Yes.

    When you creating a new project with STM32CubeIDE, you need to add manually RX_POOL buffers in ethernetif.c and  to modify linkerscript. 

    KDJEM1_1-1707922206145.png

     

    KDJEM1_0-1707922145911.png

    I hope this answer your request :).

    Thank you.

    Kaouthar