cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

xaca_4630371
New Contributor II

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
Contributor II

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
Honored Contributor II

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
xaca_4630371
New Contributor II

Here's the project.

0 Likes
WaMa_286156
Contributor II

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