@@ -218,7 +218,7 @@ static uint8_t sd_get_csdregister(SD_CSD *SD_csd)
218
218
{
219
219
uint8_t csd_tab [18 ];
220
220
/*!< Send CMD9 (CSD register) or CMD10(CSD register) */
221
- sd_send_cmd (SD_CMD9 , 0 , 0 );
221
+ sd_send_cmd (SD_CMD9 , 0 , 1 );
222
222
/*!< Wait for response in the R1 format (0x00 is no errors) */
223
223
uint8_t resp = sd_get_response ();
224
224
debug_print ("[MaixPy] %s | resp = %x \r\n" , __func__ , resp );
@@ -322,7 +322,7 @@ static uint8_t sd_get_cidregister(SD_CID *SD_cid)
322
322
{
323
323
uint8_t cid_tab [18 ];
324
324
/*!< Send CMD10 (CID register) */
325
- sd_send_cmd (SD_CMD10 , 0 , 0 );
325
+ sd_send_cmd (SD_CMD10 , 0 , 1 );
326
326
/*!< Wait for response in the R1 format (0x00 is no errors) */
327
327
if (sd_get_response () != 0x00 )
328
328
{
@@ -463,15 +463,15 @@ uint8_t sd_init(void)
463
463
index = 0xFF ;
464
464
while (index -- )
465
465
{
466
- sd_send_cmd (SD_CMD55 , 0 , 0 );
466
+ sd_send_cmd (SD_CMD55 , 0 , 1 );
467
467
result = sd_get_response ();
468
468
sd_end_cmd ();
469
469
if (result != 0x01 )
470
470
{
471
471
debug_print ("SD_CMD55 ack %X\r\n" , result );
472
472
return 0xFF ;
473
473
}
474
- sd_send_cmd (SD_ACMD41 , 0x40000000 , 0 );
474
+ sd_send_cmd (SD_ACMD41 , 0x40000000 , 1 );
475
475
result = sd_get_response ();
476
476
sd_end_cmd ();
477
477
if (result == 0x00 )
@@ -519,7 +519,7 @@ uint8_t sd_init(void)
519
519
}
520
520
if (1 == sd_version )
521
521
{
522
- sd_send_cmd (SD_CMD16 , 512 , 0 );
522
+ sd_send_cmd (SD_CMD16 , 512 , 1 );
523
523
if (sd_get_response () != 0x00 )
524
524
{
525
525
sd_end_cmd ();
@@ -550,12 +550,12 @@ uint8_t sd_read_sector(uint8_t *data_buff, uint32_t sector, uint32_t count)
550
550
if (count == 1 )
551
551
{
552
552
flag = 0 ;
553
- sd_send_cmd (SD_CMD17 , sector , 0 );
553
+ sd_send_cmd (SD_CMD17 , sector , 1 );
554
554
}
555
555
else
556
556
{
557
557
flag = 1 ;
558
- sd_send_cmd (SD_CMD18 , sector , 0 );
558
+ sd_send_cmd (SD_CMD18 , sector , 1 );
559
559
}
560
560
/*!< Check if the SD acknowledged the read block command: R1 response (0x00: no errors) */
561
561
if (sd_get_response () != 0x00 )
@@ -577,7 +577,7 @@ uint8_t sd_read_sector(uint8_t *data_buff, uint32_t sector, uint32_t count)
577
577
sd_end_cmd ();
578
578
if (flag )
579
579
{
580
- sd_send_cmd (SD_CMD12 , 0 , 0 );
580
+ sd_send_cmd (SD_CMD12 , 0 , 1 );
581
581
sd_get_response ();
582
582
sd_end_cmd ();
583
583
sd_end_cmd ();
@@ -602,15 +602,15 @@ uint8_t sd_write_sector(uint8_t *data_buff, uint32_t sector, uint32_t count)
602
602
if (count == 1 )
603
603
{
604
604
frame [1 ] = SD_START_DATA_SINGLE_BLOCK_WRITE ;
605
- sd_send_cmd (SD_CMD24 , sector , 0 );
605
+ sd_send_cmd (SD_CMD24 , sector , 1 );
606
606
}
607
607
else
608
608
{
609
609
frame [1 ] = SD_START_DATA_MULTIPLE_BLOCK_WRITE ;
610
- sd_send_cmd (SD_ACMD23 , count , 0 );
610
+ sd_send_cmd (SD_ACMD23 , count , 1 );
611
611
sd_get_response ();
612
612
sd_end_cmd ();
613
- sd_send_cmd (SD_CMD25 , sector , 0 );
613
+ sd_send_cmd (SD_CMD25 , sector , 1 );
614
614
}
615
615
/*!< Check if the SD acknowledged the write block command: R1 response (0x00: no errors) */
616
616
if (sd_get_response () != 0x00 )
@@ -649,12 +649,12 @@ uint8_t sd_read_sector_dma(uint8_t *data_buff, uint32_t sector, uint32_t count)
649
649
if (count == 1 )
650
650
{
651
651
flag = 0 ;
652
- sd_send_cmd (SD_CMD17 , sector , 0 );
652
+ sd_send_cmd (SD_CMD17 , sector , 1 );
653
653
}
654
654
else
655
655
{
656
656
flag = 1 ;
657
- sd_send_cmd (SD_CMD18 , sector , 0 );
657
+ sd_send_cmd (SD_CMD18 , sector , 1 );
658
658
}
659
659
/*!< Check if the SD acknowledged the read block command: R1 response (0x00: no errors) */
660
660
if (sd_get_response () != 0x00 )
@@ -677,7 +677,7 @@ uint8_t sd_read_sector_dma(uint8_t *data_buff, uint32_t sector, uint32_t count)
677
677
sd_end_cmd ();
678
678
if (flag )
679
679
{
680
- sd_send_cmd (SD_CMD12 , 0 , 0 );
680
+ sd_send_cmd (SD_CMD12 , 0 , 1 );
681
681
sd_get_response ();
682
682
sd_end_cmd ();
683
683
sd_end_cmd ();
@@ -700,7 +700,7 @@ uint8_t sd_write_sector_dma(uint8_t *data_buff, uint32_t sector, uint32_t count)
700
700
shift = i << 9 ;
701
701
else
702
702
shift = i ;
703
- sd_send_cmd (SD_CMD24 , sector + shift , 0 );
703
+ sd_send_cmd (SD_CMD24 , sector + shift , 1 );
704
704
/*!< Check if the SD acknowledged the write block command: R1 response (0x00: no errors) */
705
705
if (sd_get_response () != 0x00 )
706
706
{
0 commit comments