SDHC on P2020DS, read block return null data

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SDHC on P2020DS, read block return null data

ソリューションへジャンプ
2,871件の閲覧回数
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,607件の閲覧回数
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,608件の閲覧回数
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 件の賞賛
返信