Hi,
I finally figure out how to change the speed, not 100% sure if it is the best way to do so. I am still waiting for someone from Nodic DevZone to confirm on this thread.
So what I have done is changing the SDHC_SPI_INITIAL_SPEED under zephyr\subsys\disk\disk_access_spi_sdhc.c to any frequency you want, in my case 4000000 (4MHz).
Theoretically, I should change SDHC_SPI_SPEED instead, since it is the SPI speed after initialization, but somehow it is not working according to my observation. I guess that is because the SPI hardware register is not updated with the new speed according to the code, even though it is assigned to the data struct, so it keep using the initial speed all the time.
Here is the result with the same code I posted:
From the log:
[00:00:00.480,438] <inf> main: Opening file path
[00:00:00.569,824] <inf> main: Done opening file path
[00:00:00.688,964] <inf> main: Done writing
Speed is 32256 Bytes / (0.688964 - 0.569824) sec ~= 270 KB/s, almost ten times faster!
From the scope:
Hope that helps someone facing the similar issue!! Also thanks for your help @jaredwolff !
Zirun