Hello Genode comunity, I 'm testing the SD Card driver for Raspberry Pi model B, essentially I execute the sd_card.run scenario. The test fail when the reading process is called. This is the serial output:
Genode 15.05-150-g4bc5872 <local changes> int main(): --- create local services --- int main(): --- start init --- int main(): transferred 249 MB to init int main(): --- init created, waiting for exit condition --- [init] Could not open ROM session for module "ld.lib.so" [init -> platform_drv] --- Raspberry Pi platform driver --- [init -> sd_card_drv] --- SD card driver --- [init -> platform_drv] Input message: [init -> platform_drv] 00000018 00000000 00020001 00000008 00000004 00000000 00000000 [init -> platform_drv] Output message: [init -> platform_drv] 00000018 80000001 00020001 00000008 80000008 00000000 00000001 [init -> sd_card_drv] -> index=0x00000000, arg=0x00000000, rsp_type=0 [init -> sd_card_drv] -> index=0x00000008, arg=0x000001aa, rsp_type=2 [init -> sd_card_drv] -> index=0x00000037, arg=0x00000000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000029, arg=0x40018000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000037, arg=0x00000000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000029, arg=0x40018000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000002, arg=0x00000000, rsp_type=1 [init -> sd_card_drv] CID: 0x1b534d30 0x30303030 0x100702ac 0x1200cc00 [init -> sd_card_drv] -> index=0x00000003, arg=0x00000000, rsp_type=2 [init -> sd_card_drv] RCA: 0x59b4 [init -> sd_card_drv] -> index=0x00000009, arg=0x59b40000, rsp_type=1 [init -> sd_card_drv] -> index=0x00000007, arg=0x59b40000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000037, arg=0x59b40000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000006, arg=0x00000002, rsp_type=2 [init -> sd_card_drv] SD card detected [init -> sd_card_drv] capacity: 7523 MiB [init -> test-blk-cli] block device with block size 512 sector count 15407104 (testing 131072 sectors) [init -> sd_card_drv] -> index=0x00000000, arg=0x00000000, rsp_type=0 [init -> sd_card_drv] -> index=0x00000008, arg=0x000001aa, rsp_type=2 [init -> sd_card_drv] -> index=0x00000037, arg=0x00000000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000029, arg=0x40018000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000037, arg=0x00000000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000029, arg=0x40018000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000002, arg=0x00000000, rsp_type=1 [init -> sd_card_drv] CID: 0x1b534d30 0x30303030 0x100702ac 0x1200cc00 [init -> sd_card_drv] -> index=0x00000003, arg=0x00000000, rsp_type=2 [init -> sd_card_drv] RCA: 0x59b4 [init -> sd_card_drv] -> index=0x00000009, arg=0x59b40000, rsp_type=1 [init -> sd_card_drv] -> index=0x00000007, arg=0x59b40000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000037, arg=0x59b40000, rsp_type=2 [init -> sd_card_drv] -> index=0x00000006, arg=0x00000002, rsp_type=2 [init -> sd_card_drv] SD card detected [init -> sd_card_drv] capacity: 7523 MiB [init -> test-blk-cli] reading block 0 - 131071, 246 per request [init -> sd_card_drv] -> index=0x00000012, arg=0x00000000, rsp_type=2 [init -> sd_card_drv] command timed out [init -> sd_card_drv] Read_multiple_block failed, Status: 0x01ff0207 [init -> test-blk-cli] Test failed! [init -> test-blk-cli] couldn't read block 0 - 246 [init] virtual void Genode::Child_policy::exit(int): child "test-blk-cli" exited with exit value -2
Regards waldo
Hello Waldo,
[init -> test-blk-cli] reading block 0 - 131071, 246 per request [init -> sd_card_drv] -> index=0x00000012, arg=0x00000000, rsp_type=2 [init -> sd_card_drv] command timed out [init -> sd_card_drv] Read_multiple_block failed, Status: 0x01ff0207 [init -> test-blk-cli] Test failed! [init -> test-blk-cli] couldn't read block 0 - 246
you seem to be using a non-HC SD-card. So far, the driver has been used and tested with high-capacity (HC) cards only. So you are walking on new ground. But just to double check that we are not entirely on the wrong track, may you give a high-capacity card a try?
I suspect that the driver issues commands not understood by your standard-capacity card. For example, as far as I remember, the block addresses are specified in differently between the standard and high-capacity protocol versions. But there may be also other subtle differences between the protocol versions. To solve this issue, you may need to review the SD protocol specification [1] for the standard-capacity version and compare the SD protocol code [2] against it.
[1] https://www.sdcard.org/downloads/pls/part1_410.pdf [2] repos/os/src/drivers/sd_card/sd_card.h repos/os/src/drivers/sd_card/rpi/sdhci.h
Best regards Norman
Hi Norman, the serial output I sent you in the previous mail is for high capacity SD cards.
Best Regards, waldo
On 04/09/15 04:52, Norman Feske wrote:
Hello Waldo,
[init -> test-blk-cli] reading block 0 - 131071, 246 per request [init -> sd_card_drv] -> index=0x00000012, arg=0x00000000, rsp_type=2 [init -> sd_card_drv] command timed out [init -> sd_card_drv] Read_multiple_block failed, Status: 0x01ff0207 [init -> test-blk-cli] Test failed! [init -> test-blk-cli] couldn't read block 0 - 246
you seem to be using a non-HC SD-card. So far, the driver has been used and tested with high-capacity (HC) cards only. So you are walking on new ground. But just to double check that we are not entirely on the wrong track, may you give a high-capacity card a try?
I suspect that the driver issues commands not understood by your standard-capacity card. For example, as far as I remember, the block addresses are specified in differently between the standard and high-capacity protocol versions. But there may be also other subtle differences between the protocol versions. To solve this issue, you may need to review the SD protocol specification [1] for the standard-capacity version and compare the SD protocol code [2] against it.
[1] https://www.sdcard.org/downloads/pls/part1_410.pdf [2] repos/os/src/drivers/sd_card/sd_card.h repos/os/src/drivers/sd_card/rpi/sdhci.h
Best regards Norman
Hi Waldo,
On 04.09.2015 15:02, Waldo Paz Rodriguez wrote:
Hi Norman, the serial output I sent you in the previous mail is for high capacity SD cards.
oh, thanks for the clarification. I have to admit then, I am puzzled.
[init -> sd_card_drv] command timed out [init -> sd_card_drv] Read_multiple_block failed, Status: 0x01ff0207 [init -> test-blk-cli] Test failed! [init -> test-blk-cli] couldn't read block 0 - 246
To investigate, one would need to find out what the reported status bits are trying to tell us. It looks like there is no way around studying the SD protocol specification and experimenting with the code.
Best regards Norman