Closed ddkn closed 3 years ago
So the DMA issue seems to be caused by the Dcache of this specific chip. In the beginning of the program if I pass,
void main(void)
{
› SCB_DisableDCache();
› _dma_init();
› ...
}
The DMA works as expected, I assume this is an issue with how that is stored in the startup file in the chip? My friend pointed me to this, which suggests it is a problem with ChibiOS and NuttX possibly, otherwise an annoyance to handle.
I was sifting around trying to disable CACHE_MANAGEMENT in Kconfig, but to no avail. I am just posting this here in the event it helps someone else.
I will leave this open if someone would like to add more relevant information or a better approach within the Zephyr eco-system.
It is very similar to the reported issue "UART failure with CONFIG_UART_ASYNC_API" #31711 As you did, a workaround is about to avoid using Dcache with stm32F7 during DMA operations (https://github.com/zephyrproject-rtos/zephyr/pull/32833). Starting point to fix this could be found in cleaning/invalidating the cache (like https://github.com/zephyrproject-rtos/zephyr/pull/32832 or https://github.com/zephyrproject-rtos/zephyr/pull/27911)
@ddkn can you check the following PR could answer your request ? https://github.com/zephyrproject-rtos/zephyr/pull/33846
Also, I'm removing the 'bug' tag as not directly showing issue with existing feature.
Hi @erwango, Sorry I have been busy with classes and wasn't able to respond for a bit, only now getting back to things.
I ended up just implementing the ADC+DMA outside the zephyr ecosystem. Looking at #33846 looks like it is specific to the DAC DMA continuous mode with hardware triggering, andthat could provide some needed guidance for the ADC continuous mode. I also saw that there is this #32719 but haven't played with it.
@ddkn, thanks for your feedback. I'm closing the point then.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
Describe the bug End goal is to use a Nucleo F767ZI board (STM32F767) to do continuous ADC sampling and write to an SD card with the DMA to assist. Currently I am trying to get a handle on the DMA functionality by implementing it without the Zehpyr driver.
I am currently trying to do a basic memory-to-memory transfer, the code currently generates a "transfer complete" interrupt, but no data is ever written to the destination array. I have printed out the registers to see if there are any conflicts, and checked for the better part of this week online researching other settings that I may have missed.
Unfortunately, no one seems to have an issue with successful interrupt generation and no DMA data transfers. Even with the ADC, I have the same issue, but I can do basic polling outside of a disabled ADC Zephyr driver (no DMA either) so I know I can work outside of the ecosystem if need be.
My question is, is there something that Zehpyr may do to prevent DMA transfers outside of the DMA driver, while still allowing "successful interrupt transfers"? Something to do with memory being protected? Or something I may be unfamiliar with?
In the log and additional notes I have attached what should be relevant. I tried to implement on DMA2->Stream0 set with Channel 0, with a simple one time transfer of 10 half-words. Using the
sample/basic/button
code from Zehpyr as a base.Expected behavior I expect data from one array (test_src) to transfer to the other array (test_dst) which is just a memory-to-memory on DMA2 Stream 0, Channel 0.
Impact Looking to move forward on working with the ADC + DMA functionality
Logs and console output
Environment (please complete the following information):
Additional context Here is the relevant code snippets that is added to the
sample/basic/button
code from ZehpyrSnippet added to the main loop