cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal bus error on STM32F407IGT6 + lwIP + DP83848 PHY with Cube V1.27.1

AYuzv.1
Associate

Hi ST Community,

Trying to get lwIP HTTP server working on STM32F407 with Cube V1.27.1. I am able to ping, however on the first HTTP request I get DMASR FBES (Fatal bus error) and after that, neither pings nor TCP packets get any response. Looking through the stm32f4xx_hal_eth.c, I see that FBES gets detected in HAL_ETH_Transmit and on the next HAL_ETH_Transmit call, the ETH_Prepare_Tx_Descriptors fails due to descriptor DESC0 showing that is owned (ETH_DMATXDESC_OWN) by DMA. 

I believe this issue is caused by DMA attempting to access HTTP buffer in memory, but I am not 100% sure. 

I am using Waveshare EVK407I dev board, which does come with a working example with old Cube V1.6.0. The example code can be found on their wiki. Therefore I am convinced that the hardware works, the issue has to be with the new stm32f4xx_hal_eth.c or lwIP. Worth to mention, I do not get any issues on Cube V1.27.1 on STM32F429 with LAN8742 (Nucleo).

Below is my code. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
AYuzv.1
Associate

The issue was resolved. For anybody with the same issue. The problem was that the HTML pages were placed in FLASH. For some reason, Ethernet DMA has trouble reading data from FLASH. So the fix was to remove `const static` from file definitions in your fsdata_custom.c. This causes the HTML page binary data to be placed in RAM. Ethernet DMA works perfectly with RAM.

View solution in original post

2 REPLIES 2
AYuzv.1
Associate

The issue was resolved. For anybody with the same issue. The problem was that the HTML pages were placed in FLASH. For some reason, Ethernet DMA has trouble reading data from FLASH. So the fix was to remove `const static` from file definitions in your fsdata_custom.c. This causes the HTML page binary data to be placed in RAM. Ethernet DMA works perfectly with RAM.

Piranha
Chief II