• Status Unconfirmed
  • Percent Complete
  • Task Type Patches
  • Category Drivers
  • Assigned To No-one
  • Operating System Another
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by mbu - 2009-02-16

FS#9917 - Cowon D2 Usb Serial

Here’s a patch to have a functional usb_serial driver allowing the use of “Logf over Usb” debug function.

I must admit I'm a little confused by this patch. I've committed the parts that are necessary to get USB support compiling again (USB_NUM_ENDPOINTS, usb_attach() etc), and it seems that logf-over-usb works for me using just those changes.

Occasionally there are some repeated and/or missing characters at the end of logf lines - presumably the rest of your changes are aimed at fixing that? Unfortunately when I apply the full patch my D2 freezes when I connect the USB cable.

Could you maybe explain what your changes are doing? I'm quite unfamiliar with the existing USB driver so need all the help I can get…

mbu commented on 2009-03-10 12:04

Yes you're right, the rest of the patch aim to fix those missing parts. It has something to do with alignment in memory.
I get some code from ifp_usb_serial.c, from the usb_get_packet and usb_send functions to have word-aligned data in memory before sending/reading register.

Another part of the patch in usb_drv_send_nonblocking :
- ep→count = count;
+ ep→count = 0;
is a bug fix I think because ep→count contains the number of send bytes and this value is changed in usb_drv_write_ep. I assumed it must be set to 0 before first call to usb_drv_write_ep.
Without this fix I got a Panic because the number of bytes send is incorrectly reported to usb_serial_transfer_complete.
It seems that recents changes in usb_serial.c made it works without this patch because the number of send bytes is not used anymore in usb_serial_transfer_complete.

I will update my working copy tonight and try to reproduce the freeze.

mbu commented on 2009-03-11 22:21

I made some test on rev 20283. I first had the freeze you described with a fresh update and no patch.
After some tests it finally worked without any changes. I experience very strange behaviors with usb.
There's some factors I don't understand.

I made an update of the patch with rev 20283.

this doesn't allows to connect D2 to PC without rebooting to original FW, isn't it?

mbu commented on 2010-10-26 07:27

This patch allowed the D2 to be seen as an usb serial device, allowing to use logfoverusb.
This does not make usb mass storage work, and this is quite old.


Available keyboard shortcuts


Task Details

Task Editing