DMA error on PSOC5 (adc to SRAM)

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

cross mob
xaca_4630371
Level 1
Level 1
First like given

Hi everybody,

I'm coding a adc lecture (14 bits) to SRAM with DMA. The idea is, save the row size of flash (255 bytes) first on the SRAM. When the transaction is complete, move the SRAM data to the flash.

The problem is simple, i got mi DMA configured on 0x1fff8000, so i will use to 0x1fff80ff, but using the transfer count with 255 bytes, crash the program, but using around 60 transfer count never crash on the debug process (the data limit it's 4096 if i'm not wrong).

The next step it's stop when the 255 bytes are wrote on SRAM for later write to flash using CyWriteRowData();

Regards and thanks in advance,

Xavier.

0 Likes
1 Solution
WaMa_286156
Level 5
Level 5
First comment on blog 100 replies posted 50 replies posted

I looked at your project.

You need to try to use the DMA wizard to configure your DMA, and transfer into an Array of data  (which could be called ADC_DATA[]) rather than into CYDEV_SRAM_BASE.

The software Heap exists at the beginning of SRAM (which is CYDEV_SRAM_BASE), among other things.  Using a destination array variable will fix some of this problem and get you farther down the road.

View solution in original post

0 Likes
3 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

xaca,

It is hard to advise w/o seeing the code. Please post your code

Select project in the Explorer window. Then File->Create project bundle->Minimal. In created *.zip file delete Generated_files folder to reduce size of the archive.

The simptoms you mentioned indicate that DMA pointer moves beyond allocated array space and basically wanders across RAM.

/odissey1

0 Likes
lock attach
Attachments are accessible only for community members.

Here's the project.

0 Likes
WaMa_286156
Level 5
Level 5
First comment on blog 100 replies posted 50 replies posted

I looked at your project.

You need to try to use the DMA wizard to configure your DMA, and transfer into an Array of data  (which could be called ADC_DATA[]) rather than into CYDEV_SRAM_BASE.

The software Heap exists at the beginning of SRAM (which is CYDEV_SRAM_BASE), among other things.  Using a destination array variable will fix some of this problem and get you farther down the road.

0 Likes