2022-11-01 05:45 PM
Hi,
I use STM32CubeMX to configure a STM32H743 device. I enabled global DCMI interrupts.
But I see no HAL functions to start the DCMI and enable specific interrupts.
I hoped to find suitable functions in stm32h7xx_hal_dcmi.c. But there aren't.
There is a HAL_DCMI_Stop() but not a start equivalent.
There is a HAL_DCMI_Start_DMA() which is strange because I did not enable DMA in STM32CubeMX. (Well, I did first, but then I disabled it)
I see the interrupt functions like HAL_DCMI_VsyncEventCallback() which I can overload, but I see no functions to enable each specific interrupt.
What am I doing wrong?
Solved! Go to Solution.
2022-11-03 01:55 AM
Hello @CJans.1,
Besides to the proposal from @Pavel A., I recommend you to take a look at the AN5020.
The DCMI is connected to the AHB bus matrix through the AHB2 peripheral bus. It is accessed by the DMA to transfer the received image data. The destination of the received data depends on the application. For that, the HAL_DCMI_Start_DMA() function is used to enable the capture.
To be able to use the DCMI interrupts, the user must enable the DCMI global interrupts on the NVIC side. Each interrupt is then enabled separately by enabling its corresponding enable bit in the DCMI_IER register.
The DCMI examples based on STM32CubeMX shared in the AN5020 may help you in your configuration.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Kaouthar
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.
2022-11-02 02:54 PM
> What am I doing wrong?
Relying on the HAL library too much. Not looking for code examples (these may explain intended use of the library)
2022-11-03 01:55 AM
Hello @CJans.1,
Besides to the proposal from @Pavel A., I recommend you to take a look at the AN5020.
The DCMI is connected to the AHB bus matrix through the AHB2 peripheral bus. It is accessed by the DMA to transfer the received image data. The destination of the received data depends on the application. For that, the HAL_DCMI_Start_DMA() function is used to enable the capture.
To be able to use the DCMI interrupts, the user must enable the DCMI global interrupts on the NVIC side. Each interrupt is then enabled separately by enabling its corresponding enable bit in the DCMI_IER register.
The DCMI examples based on STM32CubeMX shared in the AN5020 may help you in your configuration.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Kaouthar
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.
2022-11-03 03:06 PM
Thx for pointing me to doc AN5020. Very usefull.
I imported some DMCI examples. But they all seem quite complex. Using DMA2D and LCD etc.
I only want to know how to write DCMI information into RAM using DMA.
I used the HAL_DCMI_Start_DMA() to start a DCMI and DMA. The DCMI seems to be starting. It generates interrups. But DMA still does not operate.
I probably missing some little step.
2022-11-04 12:57 AM
Hello @CJans.1,
Maybe the problem is related to memory layout and internal data cache (D-Cache) of the Cortex-M7 core. So, Try disable D-Cache and I advise you to follow this FAQ DMA is not working on STM32H7 devices.
Please let me know if the problem is solved.
Thank you.
Kaouthar
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.
2022-11-04 03:27 AM
I did not enable caching at all (want to have it working first).
I found out that the DCMI_DMAError() function is called and the DMA error code is HAL_DMA_ERROR_TE (transfer error).
According the documentation this is because of a bus error.
things I did:
Any idea why I can get this bus error?
2022-11-04 05:28 AM
And the CFSR register stays 0. So I do not know what the bus error is.
2022-11-04 05:29 AM
PS: should I post a new question for this? Because it is kind of different problem now?
2022-11-04 06:09 AM
Hello @CJans.1,
If your first question has been answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
It is recommended to post a new question because it is kind of different problem.
Thank you for your contribution in the ST Community 🙂.
Kaouthar
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.
2022-11-10 05:39 AM
Hello @CJans.1,
This issue is already reported in this post.
The MX_DMA_Init() order is not set correctly in H7 devices.
Sorry for this inconvenience.
Thank you.
Kaouthar
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.