STM32F7 Bus Fault with address in nowhere-land
Heyho,
after having found the PHY problem I can stream some audio via TCP.
But when I don't get the data out fast enough (e.g. TCP ACK takes too long so that there would be a buffer overflow), I stop the transfer and send some UART messages.
Without having changed anything signifcant, suddenly I get a Hard Fault in the midst of these UART messages.
I started the CubeIDE debugger and found that it is a Bus Fault at address 0x43817a3b, error PRECISERR:
CFSR = 0x8200 -> PRECISERR, BFAR valid
BFAR = 0x43817a3b
ARM:
A data bus error has occurred, and the PC value stacked for the exception return points to the instruction that caused the fault.
When the processor sets this bit to 1, it writes the faulting address to the BFAR.STM32F767, custom board and Nucleo-144 same behavior
bare metal SAI DMAs -> ETH-DMA via lwIP TCP
streaming works with e.g. 25.6 Mbit/s
BIG DMA SAI buffers are used: 240 x 1440 B = 337.5 kB
The Hard Fault occurs somewhere after line 13 of the following code in main():
if( u8a2ipActive == 1 &&
((u32a2ipTxErrCnt > 100) || (u32ErrCntPktSkipped > 0)) )
{
uart_printf("# ERR: TCP Streaming\n\r");
uart_printf("u32a2ipBnWrErrCnt = %ld\n\r", u32a2ipBnWrErrCnt);
uart_printf("u32a2ipBnFreeErrCnt = %ld\n\r", u32a2ipBnFreeErrCnt);
uart_printf("u32ErrCntPktSkipped = %ld\n\r", u32ErrCntPktSkipped);
if( psGlobTcpStreamState->pPcb != NULL )
{
uart_printf("pPcb->snd_queuelen = %d\n\r", (uint16_t)psGlobTcpStreamState->pPcb->snd_queuelen);
uart_printf("pPcb->snd_buf = %d\n\r", (uint16_t)psGlobTcpStreamState->pPcb->snd_buf);
uart_printf("pPcb->dupacks = %d\n\r", (uint16_t)psGlobTcpStreamState->pPcb->dupacks);
uart_printf("pPcb->unsent->p->ref = %d\n\r", (uint16_t)psGlobTcpStreamState->pPcb->unsent->p->ref);
uart_printf("pPcb->unacked->p->ref = %d\n\r", (uint16_t)psGlobTcpStreamState->pPcb->unacked->p->ref);
}
uart_printf("SAI/DMA stop\n\r");
if( HAL_OK != SAI_RX_stop_DMA() ) uart_printf("# ERR: SAI_RX_stop_DMA()\n\r");
...So, I actually do not understand ARM's error description,
and I don't know where that address is: according to the STM32F767 memory map, the addr 0x43817a3b is somewhere in "Reserved" between AHB1 and AHB2.
Maybe there are some SRAM borders crossed due to the big DMA buffers? That shouldn't be the cause I guess, then the hard fault would occur sooner and not after having used is thousands of times.
Anybody any ideas, please?
