然后在之前读取信息的代码之后添加读取数据的代码:
- /* 读取未操作之前的数据 */
- printf("------------------- Read SD card block data Test ------------------\r\n");
- sdcard_status = HAL_SD_ReadBlocks(&hsd1,(uint8_t *)read_buf,0,1,0xffff);
- if(sdcard_status == 0)
- {
- printf("Read block data ok \r\n" );
- for(i = 0; i < 512; i++)
- {
- printf("0x%02x ", read_buf[i]);
- if((i+1)%16 == 0)
- {
- printf("\r\n");
- }
- }
- }
- else
- {
- printf("Read block data fail!\r\n " );
- }
|