cancel
Showing results for 
Search instead for 
Did you mean: 

In STM32H743IITx with every 10min of interval DMA Error in DMACSR register RBU=1 ETI=1 AIS=1

lavanya
Associate III

 

 I am using the core STM32H743IITx with Dev board OpenH7XXI-C.

 PHY IC - DP83848,With RMII configuration.

 I am facing issue in Ethernet communication for every 10 min of interval, I am getting DMA Error with RBU,ETI,AIS   bit in DMACSR is set.

 but after few sec(30 to 40sec), It is reconnecting again.

DMA descriptors allocated in RAM_D2 section. 

LWIP_RAM_HEAP_POINTER @ 0x30020000

guidance on why this issue happens with regular interval will be helpful 
.lwip_sec (NOLOAD) :
{
. = ABSOLUTE(0x30040000);
*(.RxDecripSection)
. = ABSOLUTE(0x30040060);
*(.TxDecripSection)
. = ABSOLUTE(0x30040200);
*(.Rx_PoolSection)
} >RAM_D2

MPU Configuration

  MPU_InitStruct.Number = MPU_REGION_NUMBER5;
  MPU_InitStruct.BaseAddress = 0x30020000;
  MPU_InitStruct.Size = MPU_REGION_SIZE_128KB;
  MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;
  MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

  /** Initializes and configures the Region and the memory to be protected
  */
  MPU_InitStruct.Number = MPU_REGION_NUMBER6;
  MPU_InitStruct.BaseAddress = 0x30040000;
  MPU_InitStruct.Size = MPU_REGION_SIZE_512B;
  MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
  MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
  MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE;

@Piranha @STea @LCE 

20 REPLIES 20

I attached once again please check now

Guillaume K
ST Employee

@lavanya wrote:

 

 I am using the core STM32H743IITx with Dev board OpenH7XXI-C.

 PHY IC - DP83848,With RMII configuration.

It seems to be a development board from Waveshare company, with an ethernet PHY different from LAN8742 provided in STM32CubeH7 examples.

You must have used software provided by this company.

Did you ask them for support on their software and board ?

Hi @Guillaume K

I am using PHY driver from waveshare provided examples only.

I am attaching driver files here.

This is snip is jst before reconnecting 

lavanya_2-1758795763989.png

LCE
Principal II

RBU: Receive Buffer Unavailable

So it looks like you're receiving many many small packets.

It guess that these each "use up" an RX descriptor, and depending on your lwip settings also a complete packet buffer (pbuf).

I would largely increase the number of RX descriptors (that doesn't take too much memory), then also increase the numbers of pbufs.
As always, make sure where that memory is placed, check there's no overlap with RX / TX descriptors.

Also check how and how often your application handles RX packets, maybe you need to speed that up.
If you receive a high number of small packets in a short time, your application should handle that accordingly.

 

And finally: the HAL ETH driver and lwip are quite heavy things to handle, as soon as data rate goes up or some special features are required, you must dive into to that and understand more in detail what's going on there.

STackPointer64
ST Employee

Hello @lavanya,

After reviewing your project, I believe the memory corruption is likely due to the number of Rx buffers you are using. In the lwipopts.h file, you specified 16*1024 bytes for MEM_SIZE, which could handle up to 10 Rx buffers sized at 1,536 bytes each. However, your Rx buffer count is set to 12, exceeding the allocated memory by 2KB. This mismatch could explain the memory corruption issue. I suggest you adjust this either by setting the RxBuffers to 10 or increasing even more the MEM_SIZE and let me know if it resolves the problem. Meanwhile, I will continue checking for other misconfigurations that might be causing the issue.

Best regards,

 

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

Hi @STackPointer64  Any update on this?

 

@lavanya have you made the changes shown above?

Or checked what I recommended?

I was unable to open your rar file ... if you mind, try with file transfer to my address.

We choose to work only with ThreadX + all xxxX sw  - and we found that NetX examples crash with flood of syn test due to architectural errors in c code. 

Since then we dropped NetX (only) and moved to our own solution for network and we have great result as performances, time of processing and reliability + resilience to attacks, keeping full ThreadX, HAL, STM32CubeIde compatibility.

 

lavanya
Associate III

@LCE 

Yes I tried.

PBUF_POOL_SIZE = 16

PBUF_POOL_BUFSIZE =1536 

TCP_WND = 5840

TCP_MSS =1460

TCP_SND_BUF =5840

MEM_SIZE = 16K

Tx and Rx desc are in separate memory loc 

 
.lwip_sec (NOLOAD) :

{

. = ABSOLUTE(0x30040000);

*(.RxDecripSection)



. = ABSOLUTE(0x300400A0);

*(.TxDecripSection)



. = ABSOLUTE(0x30040200);

*(.Rx_PoolSection)

} >RAM_D2

 


LCE
Principal II

Too long ago when I wrote my H723 ETH driver that I remember all the details...

And you are absolutely sure that the RX pool is defined and placed correctly (I don't know the H743, the H723 only has 16k in that "area") ?

Just found in my notes that RX descriptor size must be lower than the number of buffers in lwip's RX pool.

So, how many TX and RX descriptors do you have? This number does not have to be the same.

These don't take much memory (4x u32 ?), and you probably need a few more on the TX side. I remember having seen lwIP using many small "packets", esp. with CGI or SSI, which I think each use up a descriptor. Not sure though...