cancel
Showing results for 
Search instead for 
Did you mean: 

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

eduardo_reis
Senior

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?

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

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

 

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

3 REPLIES 3
KDJEM.1
ST Employee

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

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.

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.1
ST Employee

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

 

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.