If I don't force then the sd card is working with 1bit bus (checked the lines with an oscilloscope).
I setted (forced) the 4bit at the end of the sdhc init process (after SDCARD_DRV_Init()).
After that I do a f_mount() (that is just preparing the data structures of the fat fs) and then the f_open() (that gives me the FR_DISK_ERR).
In the SDCARD_DRV_Init() there is this code:
if (DOES_HOST_SUPPORT_4BITS(card->host) && DOES_CARD_SUPPORT_4BITS(card))
{
if (kStatus_SDHC_NoError != SDCARD_DRV_SetBusWidth(card, kSdBusWidth4Bit))
{
return kStatus_SDHC_SetCardWideBusFailed;
}
if (kStatus_SDHC_NoError !=
SDHC_DRV_SetBusWidth(card->hostInstance, kSdhcBusWidth4Bit))
{
return kStatus_SDHC_SetBusWidthFailed;
}
}
but DOES_HOST_SUPPORT_4BITS(card->host) return always false.
So probably I need to set something before the init, but I can't figure out what.
Some ideas?
Thanks
Best Regards Giacomo