cancel
Showing results for 
Search instead for 
Did you mean: 

weird behavior storing 65000 float data in RAM stm32f767

akosodry
Associate II
Posted on January 25, 2017 at 15:14

Hello,

i am working on a project, where i shall store the converted ADC data in a float fftChData[65000] array.

(the ADC data is received through I2S1 and I2S2 working in a double buffer DMA mode)

I got weird behavior:

-When the array size is smaller (for example 24000 or 30000) the received data is the one we expect (see FIG1 attached, a sine wave which is our excitation). 

-When i increase the array size to 65000 i don't know why but i get bad data (see FIG2, the same sine signal is expected however we get bad data).

The data was collected and sent to the PC through UART.

Do you have any idea what could be the problem?

Thanks for the help in advance.

Best regards.

#huge-array #stm32-array #stm32-ram #big-array
3 REPLIES 3
gbm
Lead III
Posted on January 25, 2017 at 15:25

Not all the RAM is the same. Look at the very first picture in RefMan - connections between DMA controllers and various RAM blocks - some of them are missing, so it may not be possible to use DMA for transfering data to/from some RAM block.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
akosodry
Associate II
Posted on January 25, 2017 at 15:29

Hello.

The DMA is using different arrays. For example:

HAL_I2S_Receive_DMA(&hi2s1, (uint16_t*) recDataI2S1_1, ADC_REC_MONODATA_NO, (uint16_t*) recDataI2S1_2);

here 

recDataI2S1_1 and recDataI2S1_2 arrays are used.

Once the DMA fills one of them (lets say recDataI2S1_1), i use this array and convert its elements to float, however the float results are stored in the aforementioned fftChData[65000] array.

Posted on February 06, 2017 at 23:01

Here is the solution,

float fftChData[FFT_PACKAGE_SIZE] __attribute__((at(0x20020000)));

which places the array in the sram1 territory.