Цитата(adnega @ Feb 1 2016, 20:45)

Попробуйте конкретнее утверждать, а то сплошные "где-то читал" видел в "каких-то примерах".
Вот описание из стандартной библиотеки файл stm32_eval_sdio_sd.c
CODE
* A - SD Card Initialization and configuration
* ============================================
* - To initialize the SD Card, use the SD_Init() function. It
* Initializes the SD Card and put it into StandBy State (Ready
* for data transfer). This function provide the following operations:
*
* 1 - Apply the SD Card initialization process at 400KHz and check
* the SD Card type (Standard Capacity or High Capacity). You
* can change or adapt this frequency by adjusting the
* "SDIO_INIT_CLK_DIV" define inside the stm32xx_eval.h file.
* The SD Card frequency (SDIO_CK) is computed as follows:
*
* +---------------------------------------------+
* | SDIO_CK = SDIOCLK / (SDIO_INIT_CLK_DIV + 2) |
* +---------------------------------------------+
*
* In initialization mode and according to the SD Card standard,
* make sure that the SDIO_CK frequency don't exceed 400KHz.
*
* 2 - Get the SD CID and CSD data. All these information are
* managed by the SDCardInfo structure. This structure provide
* also ready computed SD Card capacity and Block size.
*
* 3 - Configure the SD Card Data transfer frequency. By Default,
* the card transfer frequency is set to 24MHz. You can change
* or adapt this frequency by adjusting the "SDIO_TRANSFER_CLK_DIV"
* define inside the stm32xx_eval.h file.
* The SD Card frequency (SDIO_CK) is computed as follows:
*
* +---------------------------------------------+
* | SDIO_CK = SDIOCLK / (SDIO_INIT_CLK_DIV + 2) |
* +---------------------------------------------+
*
* In transfer mode and according to the SD Card standard,
* make sure that the SDIO_CK frequency don't exceed 25MHz
* and 50MHz in High-speed mode switch.
* To be able to use a frequency higher than 24MHz, you should
* use the SDIO peripheral in bypass mode. Refer to the
* corresponding reference manual for more details.
спасибо. просто я подключил библиотеку FATFS к проекту и в примере не нашел явного переключения частоты.
Код
int main(void)
{
FRESULT result;
FATFS FATFS_Obj;
result = f_mount(&FATFS_Obj, "0", 1);
if (result != FR_OK)
{
//printf("Îøèáêà ìîíòèðîâàíèÿ äèñêà %d\r\n", result);
}
DIR dir;
FILINFO fileInfo;
int nFiles = 0;
result = f_opendir(&dir, "/");
if (result == FR_OK)
{
while (((result = f_readdir(&dir, &fileInfo)) == FR_OK) && fileInfo.fname[0])
{
nFiles++;
}
}
f_closedir(&dir);
FIL file;
UINT nRead, nWritten;
result = f_open(&file, "readme.txt", FA_OPEN_EXISTING | FA_READ);
if (result == FR_OK)
{
f_read(&file, &buff, 1024, &nRead);
f_close(&file);
}
result = f_open(&file, "write.txt", FA_CREATE_ALWAYS | FA_WRITE);
if (result == FR_OK)
{
f_write(&file, &buff, nRead, &nWritten);
f_close(&file);
}
while(1)
{
}
}