SDHC on P2020DS, read block return null data

cancel
Showing results for 
Search instead for 
Did you mean: 

SDHC on P2020DS, read block return null data

Jump to solution
314 Views
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.

Labels (1)
0 Kudos
1 Solution
50 Views
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

View solution in original post

0 Kudos
1 Reply
51 Views
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

View solution in original post

0 Kudos