[Ovmsdev] SDCard speed / max speed

Mark Webb-Johnson mark at webb-johnson.net
Tue Jul 30 11:05:45 HKT 2024


From my understanding, m_host.max_freq_khz is the max speed of the SPI bus and is what our setting controls.

No idea what csd.tr_speed is. Presumably the max speed of the microSD card? I think the limiting factor will pretty much always be our max_freq_khz and the fact we are 1 bit wide bus (due to limited GPIOs).

Regards, Mark

> On 29 Jul 2024, at 11:03 AM, Michael Geddes via OvmsDev <ovmsdev at lists.openvehicles.com> wrote:
> 
> I was looking at adding the maximum host speed as well as the sdcard speed to the SD Card information.  My question is whether the 'max speed' is apples-for-apples comparable with the card frequency or whether they are not quite the same thing?
> 
> //.
> 
> if (verbosity > COMMAND_RESULT_MINIMAL)
>      {
>      writer->printf("\nCard type: %s\n", (card->ocr & SD_OCR_SDHC_CAP)?"SDHC/SDXC":"SDSC");
> -    writer->printf("Max speed: %d kHz\n", card->csd.tr_speed/1000);
> +    int maxspeed = card->csd.tr_speed/1000;
> +    writer->printf("Max speed: %d kHz\n", maxspeed);
> +    int maxfreq = MyPeripherals->m_sdcard->m_host.max_freq_khz;
> +    if (maxspeed > maxfreq)
> +      writer->printf("Max host speed: %d kHz\n", maxfreq);
>      writer->printf("Capacity: %llu MB\n", ((uint64_t) card->csd.capacity) * card->csd.sector_size / (1024 * 1024));
>      writer->printf("CSD: ver=%d, sector_size=%d, capacity=%d read_bl_len=%d\n",
>                      card->csd.csd_ver,
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev



More information about the OvmsDev mailing list