cancel
Showing results for 
Search instead for 
Did you mean: 

Defining again ETH_RX_DESC_CNT and ETH_TX_DESC_CNT

imranhassan84
Associate II

I am working to send data continuously using TCP/IP, LWIP and free-RTOS. I created three tasks and using one task to send data. Each data packet is 1460 bytes and after sending around 300K packets the system halts and resets. I wanted to increase the size of descript ETH_RX_DESC_CNT and ETH_TX_DESC_CNT from 4 to 8 to check the performance. I do not want to change it in .ioc file as it will generate code again that will result in deletion of my code. I tried to redefine using every method, in compiler preprocess, main.h, stm32h7rsxx_hal_conf.h, stm32h7rsxx_hal_eth.h, ethernetif.c but nothing works. The value remains same 4U (default).

How I can do that?

Edit: I am using Nucleo-H7S3L8 board

5 REPLIES 5
Pavel A.
Super User

The number of descriptors is not defined in the project files. The default numbers are here:

https://github.com/STMicroelectronics/stm32h7rsxx-hal-driver/blob/181ba7a7e5f67cd0018dff060969b48cfb610831/Inc/stm32h7rsxx_hal_eth.h#L41

You can redefine in the compiler preprocessor settings or stm32h7rsxx_hal_conf.h. 

imranhassan84
Associate II

Thanks for the reply. 

I did in compiler preprocessor (as shown in figure attached) and to check the value I am printing on UART in ethernet.c (in low_level_init() function )but it is unchanged.

    printf("DMARxDscrTab=%p DMATxDscrTab=%p RX_POOL=%p\n", DMARxDscrTab, DMATxDscrTab, memp_memory_RX_POOL_base);
    printf("ETH_RX_DESC_CNT=%u  ETH_TX_DESC_CNT=%u  ETH_RX_BUFFER_CNT=%u\r\n",
           (unsigned)ETH_RX_DESC_CNT,
           (unsigned)ETH_TX_DESC_CNT,
           (unsigned)ETH_RX_BUFFER_CNT);


I also tried to change in stm32h7rsxx_hal_conf.h but i always give me makefile error. I tried define again (overwrite), undefine and define again but I am not able to.


imranhassan84_0-1760037567423.png

 

Thanks for the reply. 

I did in compiler preprocessor (as shown in figure attached) and to check the value I am printing on UART in ethernet.c (in low_level_init() function )but it is unchanged.

 

    printf("DMARxDscrTab=%p DMATxDscrTab=%p RX_POOL=%p\n", DMARxDscrTab, DMATxDscrTab, memp_memory_RX_POOL_base);
    printf("ETH_RX_DESC_CNT=%u  ETH_TX_DESC_CNT=%u  ETH_RX_BUFFER_CNT=%u\r\n",
           (unsigned)ETH_RX_DESC_CNT,
           (unsigned)ETH_TX_DESC_CNT,
           (unsigned)ETH_RX_BUFFER_CNT);

 


I also tried to change in stm32h7rsxx_hal_conf.h but i always give me makefile error. I tried define again (overwrite), undefine and define again but I am not able to.


imranhassan84_0-1760037567423.png

 

STackPointer64
ST Employee

Hello @imranhassan84,

The number of TX/RX descriptors is defined in stm32h7rsxx_hal_eth.h; that’s where they are referenced when descriptors are defined in ethernetif.c. I suggest you remove all the definitions you added and leave only the one in stm32h7rsxx_hal_eth.h. Then, do a clean build and search for DMARxDscrTab in the build analyzer under Memory details. The size of the descriptor should be 24 bytes multiplied by the number of descriptors (e.g., 96 bytes for 4 descriptors).

#ifndef ETH_TX_DESC_CNT
#define ETH_TX_DESC_CNT         8U
#endif /* ETH_TX_DESC_CNT */

#ifndef ETH_RX_DESC_CNT
#define ETH_RX_DESC_CNT         8U
#endif /* ETH_RX_DESC_CNT */

 

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.

Remove the D. ETH_RX_DESC_CNT, not DETH_RX_DESC_CNT.