From 3d0610f1cceb8f13b5b73dfe4dfd855450e69664 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 19:50:20 +0000 Subject: SDC write seems to work. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2941 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/SDIO/main.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'testhal/STM32/SDIO/main.c') diff --git a/testhal/STM32/SDIO/main.c b/testhal/STM32/SDIO/main.c index bd5375910..075af2cc3 100644 --- a/testhal/STM32/SDIO/main.c +++ b/testhal/STM32/SDIO/main.c @@ -28,7 +28,7 @@ static const SDCConfig sdccfg = { 0 }; -static uint8_t buf[SDC_BLOCK_SIZE * 16]; +static uint8_t buf[SDC_BLOCK_SIZE * 2]; /* * Application entry point. @@ -52,9 +52,18 @@ int main(void) { if (!sdcConnect(&SDCD1)) { int i; /* Repeated multiple reads.*/ - for (i = 0; i < 1000; i++) - if (sdcRead(&SDCD1, 0, buf, 16)) + for (i = 0; i < 5000; i++) { + if (sdcRead(&SDCD1, 0, buf, 2)) chSysHalt(); + } + if (sdcRead(&SDCD1, 0x10000, buf, 2)) + chSysHalt(); + if (sdcWrite(&SDCD1, 0x10000, buf, 2)) + chSysHalt(); + if (sdcRead(&SDCD1, 0x10000, buf, 2)) + chSysHalt(); + if (sdcDisconnect(&SDCD1)) + chSysHalt(); } /* -- cgit v1.2.3