Forum rss-feed

Forum

Developers: Picodump on Win32 - hanging on DeviceIOControl (sysenter)

Most Recent

written by: john

Hi Angus

Yes, the Pico doesn't carry it's firmware in flash, it's downloaded into it each time it powers up.

John

written by: angus_fx

Thu, 12 May 2011 15:25:10 +0100 BST

Hi John, Jim & all,

I decided to try & get picodump compiling with vs2008 on my Windows box. It's building OK, finds the device, gets as far as the control() call in the pico::active_t's constructor:-

control(0x40,0xd1,0,0);

.. then hangs somewhere inside the driver. The last thing on my call stack is sysenter(); I don't have the Windows kernel debugger installed (and in any case, I'm not much use with kernel mode code) so I'm not able to dig in any deeper than that.

Anybody know what that might be?

FWIW, I had to change the define in picodump's main cpp from:-
#define BCTPICO_USBPRODUCT 0x0101
to
#define BCTPICO_USBPRODUCT 0x0001
as this matched the USB product ID reported by Windows' Device Manager.

Any ideas what's going on here? I've tried it on two different systems with identical results.

Best,
Angus.


written by: angus_fx

Thu, 12 May 2011 15:36:41 +0100 BST

Just an update - commenting out that call allows the code to get a little further, but the next DeviceIOControl (after the worker thread starts) similarly hangs, and the worker thread sends a bunch of:

GetQueuedCompletionStatus() 258 -> wait operation timed out

messages to the log.

Any ideas?


written by: jim

Thu, 12 May 2011 15:52:55 +0100 BST

Yes. There is a bunch of ancilliary stuff that doesn't work properly for windows yet.

I have a lot of fixes for this stuff in progress while I work on the Alpha port. You might want to wait
until I commit some of that before playing with it too much.

I'll try and commit to 1.4 as soon as I can.


written by: angus_fx

Thu, 12 May 2011 16:06:18 +0100 BST

Hi Jim,

Thanks for the prompt reply. Here's what I get on my Mac (OS X 10.6, Xcode 3.2.5, gcc4.2), if it's of use:-

--> With that control_out command:-

AfhMPro:Debug angus$ ./picodump
log:full speed device detected
log:control err=e0004051 req 40:d1
terminate called after throwing an instance of 'pic::error'
what(): control err=e0004051 req 40:d1 from ../../../picross/pic_log.h:86 ()
Abort trap

--> .. and without...

log:full speed device detected
log:can't find endpoint 130
log:loading calibration from device
log:control_in err=e0004051 req c0:b7
log:error reading calibration data: control_in err=e0004051 req c0:b7 from ../../../picross/pic_log.h:86 ()
log:registered for power status


written by: jim

Thu, 12 May 2011 17:31:34 +0100 BST

The pico initially comes up as device ID 0001.

After firmware is downloaded (either by EigenD or the pezload program) it disconnects and reappears as device 0101.

You can't do anything with it until the firmware is in.

The vanilla 1.4 code works for me on a Mac (gcc4.0, 10.6, Xcode 3)


written by: jim

Thu, 12 May 2011 17:42:12 +0100 BST

Plug in the Pico

luigi:eigend jim$ tmp/bin/picodump
log:usb enumerator timed out
can't find a keyboard

Download the firmward

luigi:eigend jim$ tmp/bin/pezload
using version 5 of firmware
downloading to 06200000
log:full speed device detected
log:usb shutdown starting
log:usb shutdown complete

Immediately try picodump again; doesn't work because
it's still restarting

luigi:eigend jim$ tmp/bin/picodump
log:usb enumerator timed out
can't find a keyboard

Wait a bit

luigi:eigend jim$ tmp/bin/picodump
log:full speed device detected
log:loading calibration from device
log:loading calibration done
log:registered for power status
log:in pipe starting...
log:in pipe started.
log:poll restarting pipe
log:pinging usb loop
log:usb pipe wakeup
log:(re)starting submission
log:poll restarting pipe
log:pinging usb loop
log:poll restarting pipe
log:poll restarting pipe
log:poll restarting pipe
log:poll restarting pipe
log:poll restarting pipe
log:poll restarting pipe
log:poll restarting pipe
log:poll restarting pipe
log:poll restarting pipe
log:restoring led mask:255
log:fell behind: frame count resynced to 15990840
log:usb pipe wakeup
log:skipped urb

After the USB has sorted itself out, briefly jab a key

15980593196 6 28 -58 56
15980593258 6 44 -66 64
15980593321 6 47 -66 66
15980593384 6 59 -70 70
15980593446 6 73 -70 68
15980593508 6 75 -66 62
15980597071 6 74 -64 56
15980600634 6 76 -62 52
15980600696 6 74 -56 46
15980600758 6 67 -54 38
15980600821 6 59 -52 34
15980600884 6 51 -48 32
15980600946 6 41 -44 30
15980601008 6 29 -36 30
15980601071 6 18 -32 28
15980601134 6 4 -26 24
15980601196 6 0 0 0

^C
luigi:eigend jim$


written by: angus_fx

Thu, 12 May 2011 18:06:40 +0100 BST

Aha, that sounds like it. Where do I find pezload..?


written by: jim

Thu, 12 May 2011 19:14:41 +0100 BST

Should be built in tmp/bin


written by: angus_fx

Sat, 14 May 2011 17:22:44 +0100 BST

Got it, that did the trick, thanks!


written by: angus_fx

Sun, 22 May 2011 12:46:15 +0100 BST

Got my project up and running. Seems I have to re-download firmware to my pico each time it's unplugged; I take it that's expected?


written by: john

Sun, 22 May 2011 22:07:31 +0100 BST

Hi Angus

Yes, the Pico doesn't carry it's firmware in flash, it's downloaded into it each time it powers up.

John



Please log in to join the discussions