I'm using the Nordic nRF52840-DK board to breadboard an SDHC card interface in Zephyr using SPI. I have it doing "basic" operations, but am trying to reconcile what I'm physically seeing versus what is documented and what I see in the code.
I was hoping to run the SPI at 8 MHz, so I included a statement in the .overlay file: clock-frequency = <8000000>; (in the SPI specification).
I also put the statement: spi-max-frequency = <8000000>; (in the specification of the SDcard sub-device (under the SPI specification)).
The Zephyr SDHC documentation page seems to imply that the spi-max-frequency parameter is the SPI running frequency applied after initialization.
But it appears that hardcoded into disk_access_spi_sdhc.c are statements that assign the speed to be 400 KHz during initialization, then 4 MHz for later operations.
But then looking at the waveform captured by a logic analyzer, it appears that the SCK signal is actually running at around 250 KHz.
What am I missing?
P.S. I submitted this as an issue at the Zephyr Git website about a week ago, but there has been no response. I thought I'd also submit here since the underlying hardware is Nordic and I'm using NCS v1.5.0 and the Zephyr code included there...