SD Card Logical Blocks

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SD Card Logical Blocks

378 次查看
audim
Contributor I

I am working with...
MCUXpresso IDE v24.9 [Build 25][2024-09-26]
FreeRTOS Kernel V10.3.0
SDK 2.9.0
K64 processor

I have setup my SDHC something like this...

// global variables
static sd_card_t g_sdCard;
SDK_ALIGN(uint8_t g_dataBuf[DATA_BUFFER_SIZE], BOARD_SDMMC_DATA_BUFFER_ALIGN_SIZE);

// configure SD card descriptor, include card detect ISR
BOARD_SD_Config(&g_sdCard, isr_SDHC_CD, BOARD_SDMMC_SD_HOST_IRQ_PRIORITY, NULL);
SD_HostInit(&g_sdCard);
SD_SetCardPower(&g_sdCard, false);
SD_SetCardPower(&g_sdCard, true);
SD_CardInit(&g_sdCard);

To read block 0, I issue the following command...
SD_ReadBlocks(&g_sdCard, g_dataBuf, 0U, 1U);

Unfortunately, this is returning data from the physical block, not the logical block.

I don't care which physical block the Flash controller in the SD card is using to store my data.
When I say I need "block 0," I need the data in logical block 0.

How do I read logical blocks from an SD card?

标记 (5)
0 项奖励
回复
1 回复

336 次查看
Habib_MS
NXP Employee
NXP Employee

Hello @audim,

I will ask internally if there is any recommendation for using logic blocks. However, this API is propably not currently implemented. In that case, the application will implement itself.

BR
Habib

0 项奖励
回复