- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have a problem of DMA function on PSoC 5LP(CY8CKIT-050).
I'm trying to sample 2ch many a time using 2 SAR-ADCs and 2 DMAs.
But, 2nd DMA does not run after 52 times.
The solution seems to be the configuration of DMAs moved to out of loop and using only "CyDmaChEnable" in loop.
But I could not find this reason.
The Attach is showing values of 52nd and 53rd. They will be same.
Thanks,
dzone.
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum, dzone!
Two things I can see.
1st: You call frequently DMA_Config() which allocates resources (DMA channels, TDs) but you never free those. When you declare the Channel and the TD as global, you might re-use them instead of freeing and re-allocate.
2nd: You did not get the error yet, but when you increase the optimization level your program will stall. Declare all global vars changed in an interrupt handler as "volatile" or they might get optimized-out of your while(!flag)Wait();
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum, dzone!
Two things I can see.
1st: You call frequently DMA_Config() which allocates resources (DMA channels, TDs) but you never free those. When you declare the Channel and the TD as global, you might re-use them instead of freeing and re-allocate.
2nd: You did not get the error yet, but when you increase the optimization level your program will stall. Declare all global vars changed in an interrupt handler as "volatile" or they might get optimized-out of your while(!flag)Wait();
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks Bob!
I can find the solution is using CyDmaTdFree everytime as you say.
And I had forgotten using volatile. You are great teacher!
thanks,
dzone.