DMA carsh after complete transaction.

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

cross mob
lock attach
Attachments are accessible only for community members.
xaca_4630371
Level 1
Level 1
First like given

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.

0 Likes
1 Solution

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

View solution in original post

7 Replies
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

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?

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.

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

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

Tried and got the same problem :S . A curious thing, when i add the stuff of the Data_time doesn't run the code.

0 Likes

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;

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

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.

0 Likes