STM32L4R5ZI is hitting "HardFault_Handler" after
- September 18, 2018
- 5 replies
- 4236 views
Hello,
I am using the stm32L4R5ZI Nucleo board with a MT9V024 camera sensor and a USB drive.
I am using the HAL/STM32cubeMX library for the DCMI functionality using 10-bit parallel data with HSync and VSync as well (13 wires with 10-bit+Vsync+Hsync+DCMIclock).
MT9V024 is a 752x480 monochrome sensor.
The MT9V024 sensor is outputting 8-bit parallel images at 66 fps (frames per second), but I just want to capture a single frame and the DCMI is set to "DCMI_MODE_SNAPSHOT".
The issue I am having is once I call "HAL_DCMI_Start_DMA()" in main.c, the interrupt "DMA1_Channel1_IRQHandler()" is called and causes "HardFault_Handler".
I have tried to pull Hsync and Vsync to see if the interrupt is the issue.
When the Vsync and Hsync wires are removed, the DMA1_Channel1_IRQHandler() interrupt is no longer called (I assume DCMI is looking for Vsync start of image).
This also verified that the camera data is making it to the stm32L4 controller.
I checked the "uint8_t cameraBuffer[]" of size 360960 pixels and is filled with NULL values.
I attached my code to this point, but I am not sure how to debug the "HardFault_Handler".
Google searches yield accessing error registers, but I am sure that I am doing something VERY BAD and I am not sure how to approach this issue.
I also included a picture of the test setup with the camera and microcontroller boards.
Could someone please convey what I am doing wrong with DCMI/DMA/USB or how to debug the "HardFault_Handler"?
Thank you,
Keith
