2025-11-21 4:38 AM - edited 2025-11-21 4:39 AM
I think I have found a bug in the mentioned file (in my case the file comes from x-cube_azrtos-h7, but the problem seems to be present in other versions to).
In the function fx_stm32_sd_driver() there is a check that the passed Databuffer (media_ptr→fx_media_driver_buffer) is 4 Byte alligned, if this is true then the function sd_read_data() uses directly the passed buffer otherwise it uses a local scratch buffer. But after the DMA the function needs to invalidate the cache (by calling invalidate_cache_by_addr), on the Cortex M7 a cache line is 32 Byte.
This may overwrite data in the cache out side of the buffer.
Correction:
Set use_scratch_buffer to false only when fx_media_driver_buffer is 32 Byte aligned and a multiple of 32 Byte.
2025-12-03 5:22 AM
Hello @MHoll.2 ,
Thank you for bringing this issue to our attention.
I have escalated it to the relevant internal team for further investigation.
Internal ticket number: 223007 (This is an internal tracking number and is not accessible or usable by customers).
Kind regards,
DHIF Khaled