- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I config a DMA channel to do 16384 burst, saving them on SRAM. I debuged the program and the transaction is perfectly done ( i think ), but when it finish, sometimes crashes the program, doesn't continue or in debug section goes do dissasembly section. I think it's a interrupt error, but i can't find a properly solution.
The DMA is configured with 9 TD ( last 1 with 1 byte trans to change a flag i created on a specific mem location) the other 8 TD's got 2 bytes burst with a total of 2048 TC.
Here the code.
Regards, Xc.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are using memory addresses directly and this creates a problem.
In your case, ADC_StartConvert () causes the program to hang.
I removed FLAG_DMA and replaced with uint8 flag = 0;
I also added uint16 adc_Array [16000] = {0};
and changed
CyDmaTdSetAddress (......................, LO16 ((uint32) & adc_Array [0 + 0x ....]));
and further:
CyDmaTdSetConfiguration(DMA_ADC_TD[7], 2048, DMA_ADC_TD[0], CY_DMA_TD_INC_DST_ADR | DMA_ADC__TD_TERMOUT_EN );
as CY_DMA_DISABLE_TD requires restarting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your project is like a example project Eg5_TD_Chaining from AN52705 - PSoC® 3 and PSoC 5LP - Getting Started with DMA
Have you tested it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah, i check that project and tried what they do on it, like put the interruption on the ISR_DMA, but doesn't work correctly (on my project). Like i said, i think the interruption isn't working well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello xaca_4630371
I debugged the code and I too ran into the error causing it to move to the disassembly window. I changed the datatype of Data_time from float to uint16 and it resolved this error in my case. Please try it out at your end as well.
Thanks,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tried and got the same problem :S . A curious thing, when i add the stuff of the Data_time doesn't run the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DMA fires 1 time after reset (8 + 1)
it seems if there is a CY_DMA_DISABLE_TD then somewhere there must be CyDmaChEnable (DMA_ADC_Chan, 1)
to restart.
p.s.
In older projects, the code is located in .c interrupt file.
eg:
AN52705\Eg5_TD_Chaining.cydsn\Generated_Source\PSoC5\ISR_DMA_Done.c ---> line 147 DMADone_flag = 1;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are using memory addresses directly and this creates a problem.
In your case, ADC_StartConvert () causes the program to hang.
I removed FLAG_DMA and replaced with uint8 flag = 0;
I also added uint16 adc_Array [16000] = {0};
and changed
CyDmaTdSetAddress (......................, LO16 ((uint32) & adc_Array [0 + 0x ....]));
and further:
CyDmaTdSetConfiguration(DMA_ADC_TD[7], 2048, DMA_ADC_TD[0], CY_DMA_TD_INC_DST_ADR | DMA_ADC__TD_TERMOUT_EN );
as CY_DMA_DISABLE_TD requires restarting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I solved it with your help . He enters correctly on the interruption, moreover, i just do one data burst, that why i choosed CY_DMA_DISABLE_TD.
Now i'm working on solve the slowness that generates create the array adc_Array[16000], but thats another issue.
Thanks a lot,
Xavier.