Flash-to-SPI DMA channel (UC3B)

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Device: UC3B0256

I need to transfer data from Flash to SPI using DMA (PDCA).

It works as expected if I do RAM-to-SPI, but if I simply change "from" address so it points to the internal flash region, it fails after sending 2 bytes.

I am not certain on the exact nature of the failure, I just see that it stops working.

Are there some obvious considerations for setting up Flash-to-SPI DMA channel?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,
I don't know any reason for it. It should work from Flash.
Some ideas. Did you check for HSB and PBA speed? Do you get if it stops working any kind of exception?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I have a similar question. I work with arrays, used for sinwave genaration via DMA - on event I load the DAC.

It works perfectly, but when I try using const variables to unload my RAM a bit, it does not work.

 

unsigned int DAC_RX_AmplTable[DMA_RX_SIN_BUFFER_SIZE] = {2047, 2640, 3175, 3600, 3872, 3966, 3872, 3600, 3175, 2640, 2047, 1454, 919, 494, 222, 128, 222, 494, 919, 1454, 2047, 2640, 3175, 3600, 3872};

I just put const in front and that's it.

 

So, I guess DMA does not support Flash or I need to address the variable in a specific manner?

DMA_CH2_SRCADDR0 = ((unsigned int)&DAC_RX_AmplTable) & 0xFF;
DMA_CH2_SRCADDR1 = (((unsigned int)&DAC_RX_AmplTable)>>8) & 0xFF;
DMA_CH2_SRCADDR2 = 0;

 

I also tried using:

const unsigned int* ptr = DAC_RX_AmplTable;

const unsigned int* ptr = &DAC_RX_AmplTable[0];

and then using that for DMA_CH2_SRCADDR, but again with no luck.

 

So, I suppose DMA can't address flash or we are missing something.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What is DMA_CH2_SRCADDR ?
Show how you configure the PDC.