RE: PICDEM FS USB demo application
Chen Xiao Fan <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.gnupic |
|---|---|
| Message-ID | <3B8AEFFADD3DD4118F8100508BACEC2C07F77441@spex> |
Thanks for the fast reply. My intention is really to port it to Windows but so far not successful. I've posted the question to libusb-win32 mailing list since I have same problems when porting usb_pickit. My quick modification is quite minimum: 1) add the makefile for Linux and Windows. I do not know how to combine both Make files since I know not so much about host programming. :( 2) add the usage prompt (copied from fsusb) to make it slightly user-friendly. :) That is because I did not download the readme file last time. 3) split the endpoint address. Linux libusb does not care about direction bits but Windows libusb-win32 cares. 4) add "#ifndef Win32" to comment out geteuid call on Windows. 5)libusb-win32 does not use global variables like usb_busses so instead of using: /* for (bus=usb_busses;bus!=NULL;bus=bus->next) */ We need to use: for (bus=usb_get_busses();bus!=NULL;bus=bus->next) 6) I was trying to debug the windows version so I copied fsusb version of "fsusb_read_version". It should be the same as "picdem_fs_usb_read_version". Anyway I think the problem is with difference of ubs_bulk_read and usb_bulk_write under Linux and Windows. All the modification should not affect the Linux version and I've tested it on Ubuntu Linux 5.04. I will try again with the Windows port if I get some answers from libusb-win32 mailing list. At the same time I am learning the usb stuff by going through the firmware codes and the datasheets. I think PICDEM FS USB is quite a good learning tool for me. Regards, Xiaofan -----Original Message----- From: Manuel Bessler [mailto:[email protected]] Sent: Friday, August 12, 2005 9:08 AM Hi Xiaofan, On Fri, Aug 12, 2005 at 08:12:23AM +0800, Chen Xiao Fan wrote: > I found out a file in my hard disk named fsusb_demo_linux.c > written by Manuel Bessler but I forgot where I got it. Right here: :) http://www.varxec.net/picdem_fs_usb/ yep. it was based on the code for the pickit1 linux stuff. > For those interested, please go to Microchip Forum USB > section. > http://forum.microchip.com/tm.asp?m=107340 I'll check it out later and integrate your changes into my code. Manuel