cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7: corrupt data to the eMMC (configured as FatFs) using 16-bit data SDRAM.

Fran9
Associate II

Hello everyone,


I wanted to ask you about a problem we are having with the combination of the STM32H7 chip and a 16-bit SDRAM memory, AS4C16M16SA.


To give you some context, we are reading data from a sensor, a radar, which generates 18432 bytes per frame, and we have 47 frames. So, in each frame, we receive an IRQ and we start the process of reading the data via SPI and DMA. When the DMA has finished copying all the data to an external RAM buffer, we do a memcpy to a larger buffer (in the SDRAM) that collects all the frames.

Then, once we have these 47 frames in the SDRAM, we simply copy them to the eMMC memory (configured as a FatFS) with the f_write command.


This is where the problem arises: the data we get is not what we expected. Since it is radar data, we have an algorithm that returns images, and they do not match what we should be getting. The key is that we have the same system but with 8-bit data memory, and with this, the data we get is what we expected.

 

The question is, is there a special configuration for using 16-bit data memory? Could it be the FatFS configuration?

To clarify,

  • The SDRAM configuration is correct, as I have tried writing to all memory locations and it works fine.
  • I can write buffers to the external RAM and copy them to FatFS, and they display correctly (a hello_world.txt file).
  • I am invalidating the cache after the DMA is complete, and I am cleaning it when I write to both the sensor and the FatFS.
  • I have tried copying to FatFS with the buffer divided into 4096-byte blocks but with no luck.
  • The buffers involved are aligned 32.

Is there any other test I should do?
Do you have any idea what it could be?

 

Thank you very much and best regards,

Fran

0 REPLIES 0