2016-02-07 08:05 PM
I found incorrect code in SD_write andSD_read code (sd_diskio.c). This conversion will fail on sectors above8388608 (4GB):
(uint64_t) (sector * BLOCK_SIZE)
It should be
(uint64_t) sector * BLOCK_SIZE
(uint64_t) sector * BLOCK_SIZE
(uint64_t) sector * BLOCK_SIZE
It should be
#sdio #sd_diskio #cubemx #sdio
2016-02-07 11:34 PM
2016-02-07 11:57 PM
2016-02-08 07:03 AM
Hi, Mark!
I read your post. Another thing about SDIO DMA transfers is that CubeMX not only should give that as a setting, but it should correctly set Preemption priorities, as DMA Handler can deadlock waiting for SDIO Handler to set completion flag.And about RTC - yes, it's silly to reset date/time in initialization code as RTCs are 99% battery backuped.2016-02-08 08:58 AM
I've never quite understood ST's need to convert block numbers into 64-bit byte offsets, and all the unnecessary back-and-forth that requires, along with all the issues of casting/scope that seem to be ignored. All the examples I've furnished keep blocks in 32-bit, and support up to 2TB. There is no need for all the excursions with the math, and the block devices, well, want block addressing.