cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with DMA working with Ethernet

JonConesa
Associate II

Hi! I'm using a custom board with STM32H563 and recently, I've set up the Ethernet connection, but I'm encountering issues with GPDMA interrupts for controlling a PWM signal for one wire communication to control addressable LEDs.

In my project, I'm using FreeRTOS, where the Ethernet and the LEDs system threads are independent. After approximately four DMA interrupts, it jumps to the NMI_Handler. However, if I disable Ethernet (MX_ETH_Init()), the LEDs system functions properly. I've tried different priority configurations and switched to a more suitable DMA channel, but I still can't get it to work properly. Is there something important I should consider when using Ethernet and DMA simultaneously?

3 REPLIES 3
STea
ST Employee

Hello @JonConesa ,

you need to make sure that you tasks have sufficient stack and heap sizes and that the buffer descriptor allocation for the Ethernet are not conflicting with the GPDMA access addresses in the memory if you still have problems we need to have a more in depth look to see the origin of the NMI interrupt. another point try to run the application without the GPDMA part and see if you can reproduce this issue or it will disappear to know for sure if it is a conflict between Ethernet and DMA .

BR

In order 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.
SDu T
Associate III

Hi

 

How do you check the origin of the NMI Interrupt?

I am using the Nx_Iperf Demo and sometimes it jumps to NMI Interrupt quickly and sometimes immediately.

 

Hello @SDu T,

the origins of an NMI in the STM32H5xx are clock Erros Ram errors or Flash errors you can see about this more in depth and check the appropriate register to pinpoint the origin of the NMI to get more details about this see sections:

6.3.2 Error code correction (SRAM2, SRAM3, BKPSRAM)

7.3.9 OTP and RO memory access

11.4.10 Clock security system (CSS)

in the Reference Manuel.

in this case the error could be probably an OTP memory access in the Ethernet init function when trying to read the UID or mac address this can be solved by hardcoding the value of the MAC address in the Init function (see the example readme file) .this is an assumption and we need to have a look at the code to better understand the origins of the NMI but more Indepth debugging and reading of the associated flags can help us understand what is going on exactly .

BR

In order 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.