2017-01-25 06:14 AM
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-array2017-01-25 06:25 AM
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.
2017-01-25 06:29 AM
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.
2017-02-06 03:01 PM
Here is the solution,
float fftChData[FFT_PACKAGE_SIZE] __attribute__((at(0x20020000)));
which places the array in the sram1 territory.