2020-08-27 08:27 AM
hello,
i'm debugging this code suddenly i got a hard fault as shown in the figure:
how can I solve this
2020-08-27 08:38 AM
Looks like it’s in the watchdog IRQ handler. Unlikely that HAL_Delay caused the issue.
2020-08-27 09:17 AM
The watchdog raises the hard fault because it catched an infinite loop in the HAL_Delay my friend, so the HAL_delay causes the hard fault
2020-08-27 03:42 PM
Is HAL Tick advancing? Or the delay you're attempting spaning the watchdog?
Bringing up the camera before the SysTick/TIM driving the tick has been initialized?
2020-08-27 11:19 PM
i changed the timebase to use TIM6 instead of SysTick. now I get a hard fault in DMA2D. the green line
2020-08-28 07:35 AM
Suggests one of the structures/instances is not properly initialized.
Got to double check the processor registers, and disassembled code at the fault to completely understand which element failed.
2020-08-28 09:17 AM
I generated this with cubeMX, naturally it's compatible with my board.
this is the disassembly with the @ of the error
2020-08-28 09:26 AM
Inspect the value in R3, likely bogus
Would likely be hdma2d->Instance pointing at some random location, CHECK IT
2020-08-28 09:28 AM
the value is: 0x7f800, it's ok because cubeMX generated that value too
2020-08-28 10:17 AM
This is an uphill slog.
DMA2D_BASE is 0x4002B000 as I recall. The structure (hdma2d) is either not properly initialized, or is subsequently corrupted.