SDHC on P2020DS, read block return null data

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

SDHC on P2020DS, read block return null data

跳至解决方案
2,292 次查看
oliver123
Contributor II

Hi,

I'm working with the P2020DS system. I use the linux driver for the eSDHC (cmd_mmc, mmc, fsl_esdhc....).

When I step in the init, the card is detected, the registers are read and the the registers content (OCR, CSD, CID...) appears to be as my SD specification is (TS2GSD150).

The configuration values are also set according to the SD capacity (4bits, voltage and frequency).

But as soon as I read the MBR (512 bytes @ block number 0), the only ouptut I get in my buffer is a null values expected for the MBR signature 0x55AA.

The only difference between the init and the read block memory, is the DMA and the SD card is in transfer mode instead of idle.

Can someone help me to figure out what I am missing?

Also, how the P2020 eSDHC peripheral handles the SD read access time? My SD card has a TAAC = 0x26 and NSAC = 0 which is 1.5ms.

标签 (1)
0 项奖励
回复
1 解答
2,028 次查看
oliver123
Contributor II

ok, I finally figure out the problem. I was reading the sector 0 which is not the disk 0 MBR.

To find the location of the disk 0 boot sector, we need to read the appropriate entry in the MBR. The entries start at the address 0x01be and are 16 bytes each. The point of interest in the entry lies at the offset 0x08, is 4 bytes long and is called an LBA sector. [Wikipedia]. The LBA sector contains the MBR of the disk.

An other interesting link that explains the sector 0: microchip

在原帖中查看解决方案

0 项奖励
回复
1 回复
2,029 次查看
oliver123
Contributor II

ok, I finally figure out the problem. I was reading the sector 0 which is not the disk 0 MBR.

To find the location of the disk 0 boot sector, we need to read the appropriate entry in the MBR. The entries start at the address 0x01be and are 16 bytes each. The point of interest in the entry lies at the offset 0x08, is 4 bytes long and is called an LBA sector. [Wikipedia]. The LBA sector contains the MBR of the disk.

An other interesting link that explains the sector 0: microchip

0 项奖励
回复