- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
We have run into an issue in our project where a DMA channel stops before it has finished a transfer.
Here are the configs for the DMA:
In top design:
In user app:
Now, I have this chunk of code in the DMA interrupt handler
This if statement is meant to trigger when we finish the final X loop, and restart the DMA channel. So, this channel is basically supposed to keep going forever until an external condition stops it.
We are currently running into a case where the DMA channel stops transferring data, and the callback function stops getting called.
I tried logging the value of the following variable:
I see this value change when I call DMA Enable or DMA Disable, and it also changes when the DMA channel finishes the transfer (if I don't re-enable it in the interrupt handler). However, if the DMA stops by itself, the value stays constant before and after the DMA channel stops working.
Any insights into this issue will be much appreciated. Let me know if you need more information from me.
UPDATE: The issue turned out to be that we were turning off the I2C without realizing it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue turned out to be that we were turning off the I2S without realizing it. This DMA is responsible for moving data from SRAM to I2S, hence it would also stop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @SepehrZ
You have mentioned that the DMA channel stops transferring data. Could you please let me know when you observe this? Does this occur after one complete DMA descriptor transfer, i.e. after 16 times the 128 data elements are transferred?
Does this occur always?
Can you also attach your project so we can debug the issue at our end?
Best Regards
Ekta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ekta,
Thank you for the response. Unfortunately I can not post our full project publicly.
As far as I can tell, it stops before a full transfer. I logged the value of the following variable
and I observed a different value each time the DMA was stopped. If there is a different way to know if the transfer is complete please let me know.
To give you some context, we are programming a communication application that transfers audio over BLE. This DMA channel is responsible for playing the audio through the headphone jack after it is received by BLE and decoded. This issue occurs 1-3 minutes after I have established communication between two devices. It always occurs but the time it takes for it to fail is different each time.
Do you know of anything that can cause DMA to fail mid-transfer? Would this happen if the CPU tries to write to a block that is being read by the DMA (Edit: I double checked out code and I don't think this is a possibility)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue turned out to be that we were turning off the I2S without realizing it. This DMA is responsible for moving data from SRAM to I2S, hence it would also stop.