Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GD32VF103 issue with MSC #1022

Open
hathach opened this issue Aug 15, 2021 · 3 comments
Open

GD32VF103 issue with MSC #1022

hathach opened this issue Aug 15, 2021 · 3 comments

Comments

@hathach
Copy link
Owner

hathach commented Aug 15, 2021

Operating System

Linux

Board

Sipeed Longan Nano

Firmware

examples/device/cdc_msc

What happened ?

Follow up to @KarlK90 's #959 PR:
The cdc_msc example have the cdc echo fine, however, the msc does not, I hook it into analyzer. Look like there is some issue when host read 4k of data. Notice that the data is corrupted with 0x55AA repeatedly somehow. Host give up and decide device isn't properly formatted. It is probably buffer/endpoints config/overflow issue etc .. which is typical for a new port based on existing dcd driver. I will spend sometime this week (or so) to poke at GDVF103 manual to see if I could spot any issue. Hopefully it would be only an minor change.

Originally posted by @hathach in #959 (comment)

How to reproduce ?

  1. flash the firmware and attached to pc
  2. ram disk won't appeared due to corrupted READ10 response.

Debug Log

Log is attached, though it doesn't show any abnormal, since the issue is caused by the corrupted buffer/payload of READ10.
1022.txt

Screenshots

image

@KarlK90
Copy link
Contributor

KarlK90 commented Nov 27, 2021

Hi @hathach out of curiosity I ran the MSC demo again with the latest changes to master and...

[Sa Nov 27 12:25:14 2021]  sdc:
[Sa Nov 27 12:25:14 2021] sd 9:0:0:0: [sdc] Attached SCSI removable disk
[Sa Nov 27 12:26:27 2021] usb 3-4.3.4: USB disconnect, device number 20
[Sa Nov 27 12:26:28 2021] usb 3-4.3.4: new full-speed USB device number 21 using xhci_hcd
[Sa Nov 27 12:26:28 2021] usb 3-4.3.4: New USB device found, idVendor=cafe, idProduct=4003, bcdDevice= 1.00
[Sa Nov 27 12:26:28 2021] usb 3-4.3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Sa Nov 27 12:26:28 2021] usb 3-4.3.4: Product: TinyUSB Device
[Sa Nov 27 12:26:28 2021] usb 3-4.3.4: Manufacturer: TinyUSB
[Sa Nov 27 12:26:28 2021] usb 3-4.3.4: SerialNumber: 123456789012
[Sa Nov 27 12:26:28 2021] cdc_acm 3-4.3.4:1.0: ttyACM0: USB ACM device
[Sa Nov 27 12:26:28 2021] usb-storage 3-4.3.4:1.2: USB Mass Storage device detected
[Sa Nov 27 12:26:28 2021] scsi host8: usb-storage 3-4.3.4:1.2
[Sa Nov 27 12:26:28 2021] FAT-fs (sdc): unable to read boot sector to mark fs as dirty
[Sa Nov 27 12:26:29 2021] scsi host8: scsi scan: INQUIRY result too short (5), using 36
[Sa Nov 27 12:26:29 2021] scsi 8:0:0:0: Direct-Access     TinyUSB  Mass Storage     1.0  PQ: 0 ANSI: 2
[Sa Nov 27 12:26:29 2021] sd 8:0:0:0: Attached scsi generic sg2 type 0
[Sa Nov 27 12:26:29 2021] sd 8:0:0:0: [sdc] 16 512-byte logical blocks: (8.19 kB/8.00 KiB)
[Sa Nov 27 12:26:29 2021] sd 8:0:0:0: [sdc] Write Protect is off
[Sa Nov 27 12:26:29 2021] sd 8:0:0:0: [sdc] Mode Sense: 03 00 00 00
[Sa Nov 27 12:26:29 2021] sd 8:0:0:0: [sdc] No Caching mode page found
[Sa Nov 27 12:26:29 2021] sd 8:0:0:0: [sdc] Assuming drive cache: write through
[Sa Nov 27 12:26:29 2021]  sdc:
[Sa Nov 27 12:26:29 2021] sd 8:0:0:0: [sdc] Attached SCSI removable disk

image

It works now! 🎉

I haven't investigated what commit fixed the issue but I'm super exited about it and will start to port TinyUF2. Which already enumerates successfully, now on to the flashing part.

image

@KarlK90
Copy link
Contributor

KarlK90 commented Nov 27, 2021

This works with the new dcd_dwc2 and "old" dcd_synopsys driver.

@hathach
Copy link
Owner Author

hathach commented Nov 29, 2021

@KarlK90 great to hear that works, actually I did test it out with gd32 when doing new dwc2 driver. The msc drive does show up, so thing is definitely improved. However, there is still issue here and there. It may not work as well as other ports and I haven't got time to look further at this port. Let me know if you see any issue with gd32

@hathach hathach moved this to 🆕 New in TinyUSB Mar 9, 2023
@hathach hathach added this to TinyUSB Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants