Announcements

Curious on how you can apply PSoC™ 6 to Smart Home Appliances? Register for the ASEAN Smart Home Appliance Webinar here to find out how.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 6 Forum Discussions

SepehrZ
Level 2
First like received First solution authored 10 sign-ins
Level 2

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:
SepehrZ_0-1656982403351.png
In user app:

SepehrZ_1-1656982530967.png

 

 

Now, I have this chunk of code in the DMA interrupt handler

SepehrZ_2-1656982704853.png

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: 
SepehrZ_3-1656983107824.png
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.

 

 

0 Likes
1 Solution
SepehrZ
Level 2
First like received First solution authored 10 sign-ins
Level 2

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.

View solution in original post

3 Replies
Ekta
Moderator
Moderator 250 solutions authored 100 likes received 250 sign-ins
Moderator

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

 

 

0 Likes
SepehrZ
Level 2
First like received First solution authored 10 sign-ins
Level 2

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
SepehrZ_0-1657040077299.png
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)?

 

0 Likes
SepehrZ
Level 2
First like received First solution authored 10 sign-ins
Level 2

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.