usb part [dev] 显示USB 存储设备[dev]的分区信息 usb read addr blk# cnt 读取USB 存储设备数据【2】准备一个fat32格式的U盘 【3】在编译完成后,nor 档下载nand 档启动,操作如下: [u-boot@MINI2440]# usb help USB is stopped. Please issue 'usb start' first. [u-boot@MINI2440]# usb start (Re)...
19if(HAL_SD_ReadBlocks_DMA(&hsd1,(uint32_t *)buf, blk_addr * STORAGE_BLK_SIZ, STORAGE_BLK_SIZ, blk_len) == SD_OK) 20{ 21ret = USBD_OK; 22} 23 24/* Wait until transfer is complete */ 25if(ret == USBD_OK) 26{ 27if(HAL_SD_CheckReadOperation(&hsd1, (uint32_t)10000...
6.3 修改存储读写函数 /** * @brief . * @param lun: . * @retval USBD_OK if all operations are OK else USBD_FAIL */int8_t STORAGE_Read_FS(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len){ /* USER CODE BEGIN 6 */ int8_t ret = USBD_FAIL; if(HAL_...
int8_t STORAGE_Read_FS(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len) { /* USER CODE BEGIN 6 */ if(HAL_OK != HAL_SD_ReadBlocks(&hsd,(uint8_t *)buf, blk_addr , blk_len, 1000)) { return USBD_FAIL ; } return (USBD_OK); /* USER CODE END 6 ...
usb read addr blk# cnt - read `cnt' blocks starting at block `blk#' to memory address `addr' usb write addr blk# cnt - write `cnt' blocks starting at block `blk#' from memory address `addr' => usb start starting USB...
blk_len * 512);break;case 1: /* SD卡 */res = sd_read_disk(buf, blk_addr, blk_len);...
在/media/mmcblk0p2/目录下创建usb目录并在下面创建devices文件。 当我们执行cat devices会调用usbfs_devices_fops->read(usb_device_read)函数去搜寻usb_bus_list链表下的usb设备信息,也就是所有总线下的设备。 bus_register: 是将usb总线注册到系统中,总线可是linux设备模型中的领导者,不管是多大的领导,也是...
4,官方例程不支持大于 4G 的 SD 卡,得修改 usbd_msc_scsi.c 里面的 SCSI_blk_addr 类型 为uint64_t,才可以支持大于 4G 的卡,官方默认是 uint32_t,最大只能支持 4G 卡。 5,官方例程在 2 个或以上磁盘支持的时候,存在 bug,需要修改 usbd_msc_scsi.c 里面的 ...
4,官方例程不支持大于 4G 的 SD 卡,得修改 usbd_msc_scsi.c 里面的 SCSI_blk_addr 类型 为uint64_t,才可以支持大于 4G 的卡,官方默认是 uint32_t,最大只能支持 4G 卡。注意: usbd_msc_scsi.c 文件,是只读的,得先修改属性,去掉只读属性,才可以更改。
6、virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/home/image/win7-13.img,if=none,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive file=/home/image/virtio-win...