• AVR Freaks

[USB 2.4] v2.4 USB Framework has launched

Author
Neiwiertz
Super Member
  • Total Posts : 2094
  • Reward points : 0
  • Joined: 2004/09/01 02:58:52
  • Status: offline
2009/03/17 03:12:27 (permalink)
0

[USB 2.4] v2.4 USB Framework has launched

I just noticed that Microchip has released at MCHPFSUSB v2.4 USB Framework

Flying With --|Explorer 16|HardWare|SoftWare|-- Fav(s) Gallery Lists
#1

19 Replies Related Threads

    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/03/17 05:06:42 (permalink)
    0
    Nice!


    1.    What's New/Updated in Release v2.4
    1) Embedded Host
    Mass Storage - Simple Demo - This project demo with minimal code required to talk to a mass storage device (thumb drive, USB hard drive, etc).

    Thumb drive bootloader - this allows applications to be loaded into the microcontroller via a USB thumb drive.  Currently this release supports only PIC24F

    USB Charger Demo - this demo shows how to create a smart charger application to enumerate a device for charging purposes.

    2) Device
    LibUSB - an open source Vender class (custom) driver.
    Interrupt driven option for the device stack.
    PIC18F46J50 family support

    3) PC
    Example software talking to the LibUSB device


      USB_Links and libusb
    #2
    muhzd
    Super Member
    • Total Posts : 861
    • Reward points : 0
    • Joined: 2008/05/15 10:43:19
    • Location: Malaysia
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/03/17 13:06:28 (permalink)
    0
    The library should include a game controller...
    #3
    TCM
    Super Member
    • Total Posts : 502
    • Reward points : 0
    • Joined: 2005/06/26 02:01:25
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/03/17 14:03:36 (permalink)
    0
    Embedded Host :
    • Thumb drive bootloader 
    • Mass Storage
    • USB Charger Demo
    Device :
    • LibUSB
    • Interrupt driven option
    • PIC18F46J50 family support 
    PC :
    • Example software for the LibUSB device 
    • PIC18F46J50 family support
    post edited by TCM - 2009/03/17 14:04:59

    Once i had a spectrum computer , today i am throwing away my pentium PC , tomorow i will write to you from a Microchip internet-enabled device.
    #4
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/05/04 06:51:11 (permalink)
    0
    Today I got some time to try out the V2.4 stack with the PIC18F87J50 PIM. I tried several examples (HID bootloader, Simple HID demo, WinUSB, libusb, keyboard, mouse, CDC Basic demo, internal flash as mas storage, etc) and they seem to work fine.

    However, I could not get the HID+MSD composite device to work properly. The device is fine in Device Manager under Vista 32bit Home Premium. But then the demo program could not find it. The storage device is not working either with the prompt "Please insert a disk into Removable Disk (I:)". I checked the troubleshooting tips in the Mass Storage - Internal Flash demo but they do not help to solve the problems.

    What are your experiences with V2.4 stack?
    post edited by xiaofan - 2009/05/08 01:34:34

      USB_Links and libusb
    #5
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/05/04 07:21:19 (permalink)
    0
    The Linux Qt3 based libusb demo failed to be built under Ubuntu 9.04.

    mcuee@ubuntu904:~/Desktop/build/mchphidboot/Libusb/Qt3$ qmake-qt3

    mcuee@ubuntu904:~/Desktop/build/mchphidboot/Libusb/Qt3$ make
    /usr/share/qt3/bin/uic form1.ui -o .ui/form1.h
    g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I/usr/include/qt3 -I.ui/ -I. -I.moc/ -o .obj/main.o main.cpp
    /usr/share/qt3/bin/uic form1.ui -i form1.h -o .ui/form1.cpp
    g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I/usr/include/qt3 -I.ui/ -I. -I.moc/ -o .obj/form1.o .ui/form1.cpp
    In file included from .ui/form1.cpp:17:
    .ui/../form1.ui.h: In member function ‘virtual void Form1::Toggle_LED()’:
    .ui/../form1.ui.h:183: error: expected primary-expression before ‘,’ token
    make: *** [.obj/form1.o] Error 1

      USB_Links and libusb
    #6
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/05/07 06:51:45 (permalink)
    0
    Hmm, today the HID+MSD USB composite device demo is working under Vista 32bit. Strange.

      USB_Links and libusb
    #7
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/05/07 07:13:46 (permalink)
    0
    Regarding the error, it turns out that there is typo in that line.
     form1.ui.h
    void Form1::Toggle_LED()
    {
    char OutputPacketBuffer[64]; //Allocate a memory buffer which will contain data to send to the USB device
    if ( Connection_Status == CONNECTED)
    {
    OutputPacketBuffer[0] = 0x80; //0x80 is the "Toggle LED(s)" command in the firmware
    //For simplicity, we will leave the rest of the buffer uninitialized, but you could put real
    //data in it if you like.
    //Writes data to a bulk endpoint. The Function call will send out 64 to the USB Device.
    if(usb_bulk_write(MyLibusbDeviceHandle, EP_OUT-, &OutputPacketBuffer[0], 64, 5000) != 64)
    {
    QMessageBox::warning(this, "Toggle LED", " Write Failed", "OK", 0, 0, 1);
    return;
    }
    }
    }


    EP_OUT- should be EP_OUT.

      USB_Links and libusb
    #8
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/05/07 07:24:06 (permalink)
    0

    ORIGINAL: xiaofan
    Hmm, today the HID+MSD USB composite device demo is working under Vista 32bit. Strange.


    It seems to work under Linux as well. But I have not tried to write a simple libusb based program to talk to the HID interface.

    dmesg:
    usb 2-7: new full speed USB device using ohci_hcd and address 8
    usb 2-7: configuration #1 chosen from 1 choice
    scsi8 : SCSI emulation for USB Mass Storage devices
    usb-storage: device found at 8
    usb-storage: waiting for device to settle before scanning
    hiddev96hidraw1: USB HID v1.11 Device [Microchip Technology Inc. Microchip Mass Storage Drive] on usb-0000:00:04.0-7
    usb 2-7: New USB device found, idVendor=04d8, idProduct=0054
    usb 2-7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    usb 2-7: Product: Microchip Mass Storage Drive
    usb 2-7: Manufacturer: Microchip Technology Inc.

    cat /media/Drive\ Name/file.txt
    Data




      USB_Links and libusb
    #9
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/05/08 01:39:38 (permalink)
    0
    I am able to modify the QT3 based libusb Linux demo to talk to the HID interface under Linux.

    Actually it is rather trivial to edit the file form1.ui.h and use differnet VID/PID to talk to the Simple HID demo, WinUSB demo and LibUSB demo under Linux, all with libusb.

    But right now I have some problem with detaching the kernel HID driver within libusb so I have to do it manually. I will try to find the real problem.

      USB_Links and libusb
    #10
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/05/08 01:59:04 (permalink)
    0
    The UBW32 bootloader PC host software under Linux is supposed to work for the other HID bootloader device as well. But it does not seem to work for me with the PIC18F87J50 PIM. Strange.

    UBW32 Bootloader Under Linux and Mac oS X with libhid
    http://www.paintyourdragon.com/uc/ubw32/index.html

    UBW32 (using PIC32 and Microchip's USB stack V2.3.1 as the base now)
    http://www.schmalzhaus.com/UBW32/

      USB_Links and libusb
    #11
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/05/09 19:03:43 (permalink)
    0

    ORIGINAL: xiaofan
    I am able to modify the QT3 based libusb Linux demo to talk to the HID interface under Linux.


    Now a lot of new Linux distros ship QT4 by default.
    Under Ubuntu, I do not need to change anything to build as there is a seperate qmake version for QT3 which is called qmake-qt3.

    Under Arch Linux, qt3 is installed to /opt/qt. So I have to use /opt/qt/bin/qmake followed by make. I also have to edit the Make file to point to the correct qt lib

    /opt/qt/bin/qmake
    gedit Makefile to change -lqt to -lqt-mt
    QTDIR=/opt/qt make


      USB_Links and libusb
    #12
    corvette321
    Super Member
    • Total Posts : 727
    • Reward points : 0
    • Joined: 2006/10/31 19:17:07
    • Location: Florida
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/05/31 22:57:58 (permalink)
    0
    im getting tons of "stray character" errors in form1.ui.h
     
    im using latest ubuntu and QT 3.3
     
    cant find any stray characters in the actual files...
     
    hmmmm
     
    #13
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/06/01 00:02:12 (permalink)
    0
    Maybe your editor changes something? I use gedit under Linux and it works fine.

      USB_Links and libusb
    #14
    corvette321
    Super Member
    • Total Posts : 727
    • Reward points : 0
    • Joined: 2006/10/31 19:17:07
    • Location: Florida
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/06/01 07:46:07 (permalink)
    0
    yes perhaps, ill try it again.
     
    i also tried using QT4 with the QT4-QT3 legacy libs but no workie...
     
    if it wasnt for those 3 stray characters it would be working im sure hahaha.
    #15
    corvette321
    Super Member
    • Total Posts : 727
    • Reward points : 0
    • Joined: 2006/10/31 19:17:07
    • Location: Florida
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/06/01 10:34:42 (permalink)
    0
    got it working!!!
     
    the editor i was using was being naughty...
     
    by all means use simply old school gedit.
     
    QT4 has the bug fix for the characters errors....
    #16
    corvette321
    Super Member
    • Total Posts : 727
    • Reward points : 0
    • Joined: 2006/10/31 19:17:07
    • Location: Florida
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/06/01 12:27:38 (permalink)
    0
    you can update the project to QT4,... this fixes alot of bugs actually.

    this link shows you how to update the project to Qt4...


    http://doc.trolltech.com/4.0/qt3to4.html#qt3to4
    #17
    corvette321
    Super Member
    • Total Posts : 727
    • Reward points : 0
    • Joined: 2006/10/31 19:17:07
    • Location: Florida
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/06/01 13:44:21 (permalink)
    0
    i finished my ultra small LIBusb app under ubuntu 9.04 !!!

    microchip made it ultra easy!!

    i found that by editing the ui file in QT3 (didnt convert it over) and converting the project to QT4 then compiling through Qt4 made the few bugs i noticed dissapear... notibly, a default text in the linedits wouldnt appear... this is fixed in QT4 and they appear now!!

    anywhooo... heres my little linux app

    this was my 1st one.



    pretty simple app.

    just a few notes for others who are doing it....

    if your a linux noob then u dont know about permissions and such.....

    soo for ubuntu

    1) open a terminal
    2) sudo sh     (to get root permissions)
    3) then u can do a "exec libusb_gui_qt"

    the other way around this?

    change udev permissions permanently... create a group and add your user to the group.

    hope this helps some other linux noobs like me :)
    post edited by corvette321 - 2009/06/01 13:47:40
    #18
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/06/01 20:38:19 (permalink)
    0
    Nice for a Linux newbie. grin I am not a Linux newbie (used it on and off between 1998-2002 and then start to use Ubuntu since 5.04 in 2005) but I am a PC programming newbie. So I can only make minor modification of existing PC programs. And I do not speak C++ or QT or MFC or things like that.

    The typical Ubuntu way is to use "sudo libusb_gui_qt".

    For permisison/udev related issues, this can help.
    http://piklab.wiki.sourceforge.net/USB+Port+Problems

      USB_Links and libusb
    #19
    corvette321
    Super Member
    • Total Posts : 727
    • Reward points : 0
    • Joined: 2006/10/31 19:17:07
    • Location: Florida
    • Status: offline
    RE: [USB 2.4] v2.4 USB Framework has launched 2009/06/01 21:35:04 (permalink)
    0
    yah QT was quite interesting with its slots and such....well its very close to visual studio hahahah... just linking the GUI actions to the code functions except it doesnt do the double click and open functions which im used to in visual studio... but hey its pretty nice for linux programming, really i had never looked at linux programming before so i was surprised to find such a nice GUI tool.
     
    there is a nice forum that has plenty of examples
     
    www.qtforum.org
     
     
    nah i never thought u were a noob at anything really... u are always the goto man here on the forums ....
     
    i prefer c# mostly but just getting back into viz c++ again..
     
    i just love c#.
     
    its nice to write things from scratch... but why?
     
    why rewrite things that have already been done? especially if you have 100 projects..
     
    thats the great thing about frameworks!!
     
    gringringrin
     
     
     
     
    #20
    Jump to:
    © 2019 APG vNext Commercial Version 4.5