cancel
Showing results for 
Search instead for 
Did you mean: 

File writing bug with FatFs over FreeRTOS on H743

ranciere
Associate III

Hi!

I would like to store files on an SD card that are transmitted via HTTP POST (lwIP HTTP server). The files are correctly transmitted (hash calculating on both sides, the hashes are equal) and then written out to the card. But the content of the file is wrong: there is an additional byte before my content (and the last byte is missing, e.g. the file size is correct).

I've checked the data in the HAL_SD_WriteBlocks_DMA method before write, and everything is correct.

The cache maintenance (ENABLE_SD_DMA_CACHE_MAINTENANCE) macro is also defined. (And 1-byte offset bug cannot be by cache miss).

Another interesting thing it seems to be somehow timing related.

What can I check?

Regards,

1 ACCEPTED SOLUTION

Accepted Solutions
ranciere
Associate III

This ST code base is a joke. Of course I ran into other problems immediately:

https://community.st.com/s/question/0D53W0000055hTvSAI/bug-errors-in-template-for-sddiskioc-in-stm32cubemx-5601

and this:

https://community.st.com/s/question/0D50X0000ArVPjuSQG/hal-bug-sddiskiodmatemplate-in-stm32cubefwf4v1241

How is it possible to publish such a garbage which contains 2 years old bugs? It doesn't even compile and after fixing doesn't run ;(

***Moderation Edit: while the negative feedback is welcome, please refrain from using curse words or inflammatory language as it goes against the Community Ground Rules***

View solution in original post

4 REPLIES 4

memory alignment?

Shifted by 1-byte does seem a bit strange.

Buffer locked/protected from modification until the command completes?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ranciere
Associate III

You are right, thanks a lot! I debugged and it was a memory alignment issue. BUT: why doesn't the driver complain in any form? Assert? Exit? It is very annoying! How can I ask feature from the FW developers?

ranciere
Associate III

This ST code base is a joke. Of course I ran into other problems immediately:

https://community.st.com/s/question/0D53W0000055hTvSAI/bug-errors-in-template-for-sddiskioc-in-stm32cubemx-5601

and this:

https://community.st.com/s/question/0D50X0000ArVPjuSQG/hal-bug-sddiskiodmatemplate-in-stm32cubefwf4v1241

How is it possible to publish such a garbage which contains 2 years old bugs? It doesn't even compile and after fixing doesn't run ;(

***Moderation Edit: while the negative feedback is welcome, please refrain from using curse words or inflammatory language as it goes against the Community Ground Rules***