-
Notifications
You must be signed in to change notification settings - Fork 8
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
Trouble trying to sync Handspring Treo 90 #13
Comments
I managed to capture a complete hotsync transaction with Wireshark on my Windows machine using Palm Desktop 6.2.2. Of note I can see the proper "cnys" id that pilot-link looks for in the following frame: |
I tried adding a new USB init flag for the Treo (which would undoubtedly break other Treo models, but at least for sake of attempted fixes for now) and modifying if (flags & USB_INIT_TREO) {
// weird beast
unsigned char buf[sizeof(palm_ext_connection_info_t) + 6];
ret = dev->impl.control_request (dev, 0xc2, VISOR_GET_CONNECTION_INFORMATION, 0, 0, &ci, sizeof (ci), 0);
LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "usb: VISOR_GET_CONNECTION_INFORMATION (ret=%08x)\n", ret));
ret = dev->impl.control_request (dev, 0xc2, PALM_GET_EXT_CONNECTION_INFORMATION, 0, 0, &ci, sizeof (ci), 0);
LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "usb: PALM_GET_EXT_CONNECTION_INFORMATION (ret=%08x)\n", ret));
ret = dev->impl.interrupt_read (dev, 0x82, &buf, sizeof (buf), 0);
memcpy(&ci, (buf+6), sizeof (ci));
} else {
ret = dev->impl.control_request (dev, 0xc2, PALM_GET_EXT_CONNECTION_INFORMATION, 0, 0, &ci, sizeof (ci), 0);
} However, despite getting the correct Palm hotsync header and USB endpoints (which match the ones used in the USB bulk transfers on Windows) now, the device still doesn't go any further:
EDIT: Looking closer at the USB capture, a simpler way to modify ret = dev->impl.control_request (dev, 0xc2, PALM_GET_EXT_CONNECTION_INFORMATION, 0, 0, &ci, sizeof (ci), 0);
if (ret == 0) {
// empty response from PALM_GET_EXT_CONNECTION_INFORMATION, try interrupt
unsigned char buf[sizeof(palm_ext_connection_info_t) + 6];
// 6 first bytes seem to indicate a vendor id, we don't use that yet
ret = dev->impl.interrupt_read (dev, 0x82, &buf, sizeof (buf), 0);
memcpy(&ci, (buf+6), sizeof (ci));
} This way the need to single out the Treo 90 with a USB init flag is no longer necessary, and my Palm TX still syncs over libusb without change. However the debug log for the Treo above still follows, getting the correct USB endpoints but then getting stuck. |
I'm comparing the bulk transfers past the hotsync endpoint handshake between the Treo 90 and my Palm TX from USB captures with Palm Desktop 6.2.2 and so far I haven't seen any differences that jump out to me. Which makes me think there's still some extraneous part of the device detection that's hanging when trying to read the first couple of bulk packets before sending more data, rather than a difference in the hotsync protocol itself. For comparison here's a partial dump from the TX syncing with pilot-link (flag -l to list packages):
On my USB captures, both the Treo 90 and the TX exhibit the first two bulk reads with packet lengths 6 and 22 (the Treo immediately after the interrupt read, and the TX immediately after the palm control request), which matches the first two pilot-link reads of the TX's debug. However the Treo simply doesn't send them to pilot-link and it hangs on RD_do_read instead, until it times out with 0 bytes read. Perhaps something is needed to free the device after the interrupt read, but I'm not clear on what yet. |
Ha, the answer was really quite that obvious. I noted the packet from the interrupt read in my USB capture was 64 bytes long, which meant that in trying to make it similar to the control request and asking only for as many bytes to fill the Now I need to clean up my code so I can submit a PR. |
I'm trying to hotsync a Treo 90, which doesn't seem to work with the usbserial/visor kernel modules, so it seems it needs the libusb mode. I can sync a Visor Neo with this method fine, but not the Treo. Using the debug log, I found this:
On a whim I tried to set the Treo's device configuration with the visor flag and recompiled pilot-link, just in case it would somehow work, but it doesn't:
Any ideas?
EDIT: This Treo hotsyncs fine on Windows machines with Palm Desktop, so I know neither the device or the cable should be the issue.
The text was updated successfully, but these errors were encountered: