I had to take over a project that used this driver and find the source of the low throughput obtained (only around 20kB/s when way more should have been possible).
Looking at the driver, I changed the lines for(UINT i=0; i<btx; i++) { xchg_spi(*(buff+i)); } in function xmit_spi_multi in file user_diskio_spi.c to HAL_SPI_Transmit(&SD_SPI_HANDLE, buff, btx, 100);.
This greatly improved throughput (I am now around 800kB/s). I think there would be no difference if my SPI clock was way slower than my CPU clock, which is not my case but I don't see any advantage at the current way it is implemented.
Is there any reason why this is not done by default? I can do a pull request if this change would be accepted.
Ah I expect this was an oversight on my part when this code was made (I had refactored some older code to suit the HAL). I'd love if you submitted a PR to fix this.
Hello everyone,
I had to take over a project that used this driver and find the source of the low throughput obtained (only around 20kB/s when way more should have been possible).
Looking at the driver, I changed the lines
for(UINT i=0; i<btx; i++) { xchg_spi(*(buff+i)); }
in functionxmit_spi_multi
in file user_diskio_spi.c toHAL_SPI_Transmit(&SD_SPI_HANDLE, buff, btx, 100);
.This greatly improved throughput (I am now around 800kB/s). I think there would be no difference if my SPI clock was way slower than my CPU clock, which is not my case but I don't see any advantage at the current way it is implemented.
Is there any reason why this is not done by default? I can do a pull request if this change would be accepted.
Have a good day!