MyUSB 1.4.0 Released

MyUSB Library, Projects No Comments »

Yes, it’s that time again - another official MyUSB release. I’ve since bumped the version number up from the BETA 1.3.3 due to the number of additions and breaking changes in the release. Suffice to say I’m pumped about the new version!

The final changelog is as follows:

  • Added HID Report Parser API to the library
  • Added Mouse and Keyboard host demo applications, using the new HID report parser engine
  • Added MouseFullInt demo, which demonstrates a fully interrupt (including control requests) mouse device
  • Fixed incorrect length value in the audio control descriptor of the AudioOutput and AudioInput demos
  • Added MIDI device demo application to the library
  • Fixed problem preventing USB devices from being resumed from a suspended state
  • Added new CDC class bootloader to the library, based on the AVR109 bootloader protocol
  • Added header to each demo application indicating the mode, class, subclass, standards used and supported speed
  • Functions expecting endpoint/pipe numbers are no longer automatically masked against ENDPOINT_EPNUM_MASK or PIPE_PIPENUM_MASK - this should be manually added to code which requires it
  • Fixed DFU class bootloader - corrected frequency of flash page writes, greatly reducing programming time
  • Renamed AVR_HOST_GetDeviceConfigDescriptor() to USB_Host_GetDeviceConfigDescriptor() and AVR_HOST_GetNextDescriptor() to USB_Host_GetNextDescriptor()
  • Added new USB_Host_GetNextDescriptorOfTypeBefore() and USB_Host_GetNextDescriptorOfTypeAfter() routines
  • Moved configuration descriptor routines to MyUSB/Drivers/USB/Class/, new accompanying ConfigDescriptors.c file
  • Added new configuration descriptor comparator API for more powerful descriptor parsing, updated host demos to use the new comparator API
  • Fixed MassStorageHost demo capacity printout, and changed data read/write mode from little-endian to the correct big-endian for SCSI devices
  • Fixed macro/function naming consistancy; USB_HOST is now USB_Host, USB_DEV is now USB_Device
  • Added better error reporting to host demos
  • Added 10 microsecond delay after addressing devices in host mode, to prevent control stalls

Those of you writing embedded hosts with the library should really appreciate the power and flexibility of the new Configuration Descriptor processing routines — check out the updated host demos in the package to see examples of how it can be used and how it simplifies/modularises the descriptor processing so well.

As always, head over to the library page for the latest download link. Happy programming, and don’t forget to send me emails about how you’re using the library!

Wiki documentation updates will be done soon, so standby for updated documentation, including the obligatory migration page.

EDIT: Wiki documentation update complete.

Which API?

MyUSB Library, Projects No Comments »

The 1.3.3 beta seems to be going well - no news must be good news. I’ve been pondering over the host demos, specifically the Configuration Descriptor processing code, and I’ve made a few steps to improve the API.
I’ve come up with two shortlisted APIs for the next version. The first API is an extention of the current API, with new functions to search for the next descriptor of a given type after another given type, and for searching for descriptors of a given type before another given type.

The second API uses a plug-in comparator system. A generic “find next descriptor” routine takes a comparator function as an argument, which the uses supplies. The second method allows for much more flexibility, at the expense of a few bytes more of FLASH.

I’ve decided to get some feedback on which API should be included in the next library version. Head over to the thread on AVRFreaks, download the API samples and vote which one you think is the superior API.

MyUSB 1.3.3 BETA Release

MyUSB Library, Projects 1 Comment »

I’ve just completed a BETA version of the new 1.3.3 MyUSB library. I’m releasing it as a public beta as the new components are quite new and complicated, and will most likely show some obscure bugs when tested against the plethora of odd gadgets that are out there.

Changelog for the new version:

  • Added HID Report Parser API to the library
  • Added Mouse and Keyboard host demo applications, using the new HID report parser engine
  • Added MouseFullInt demo, which demonstrates a fully interrupt (including control requests) mouse device
  • Fixed incorrect length value in the audio control descriptor of the AudioOutput and AudioInput demos
  • Added MIDI device demo application to the library
  • Fixed problem preventing USB devices from being resumed from a suspended state
  • Added new CDC class bootloader to the library, based on the AVR109 bootloader protocol
  • Added header to each demo application indicating the mode, class, subclass, standards used and supported speed
  • Functions expecting endpoint/pipe numbers are no longer automatically masked against ENDPOINT_EPNUM_MASK or PIPE_PIPENUM_MASK - this should be manually added to code which requires it
  • Fixed DFU class bootloader - corrected frequency of flash page writes, greatly reducing programming time

I’m very excited about the new additions to the library, the HID report parser especially. Please let me know of any problems experienced with the new version.

Download link: http://www.fourwalledcubicle.com/files/temp/MyUSB - BETA - 1.3.3.zip

Licence Part 2, CDC Bootloader Update

MyUSB Library, Projects 1 Comment »

It seems I was wrong — the LGPL does indeed allow for proprietary projects to be linked in to LGPL licenced libraries. That’s good; it saves me the hassle of changing over the library licence.

The CDC bootloader has been sending me a little insane, with a bug somewhere that I can’t find. I’m now at University severely sleep deprived, but I think I have a lead on a way to find the problem’s source. So far manually sending AVR109 protocol commands to the bootloader via a serial terminal works fine, but AVRDUDE compains of a non-response after several commands are correctly issued and responded to. Joerg Wunsch helpfully pointed me to AVRDUDE’s super-debug mode via the -vvvv option, which should give me a list of all the issued commands and recieved responses so I can find the exact point of failure.

When this is finally done, the next point release of the library will be uploaded for general consumption.

Licenced to Thrill

MyUSB Library, Projects No Comments »

I’m thinking about changing the MyUSB licence yet again. This is due to the apparent fact that the LGPL licence prohibits the use of the library in commercial applications without source disclosure, as the library is statically linked. That wasn’t my intention; my intention was to keep the library open source, but allow for its integration into commercial projects.

I think I’ll either add in a supplementary clause to allow for static linking without disclosure, or switch to the BSD style licence. The latter still allows me to keep my name on the project, while allowing for its free use. Opinions?

I’ve finished the CDC Class bootloader, which now needs to be tested. Once it passes, the new MyUSB revision will be made public.

Old becomes new again

MyUSB Library, Projects No Comments »

Bad tools can cause many hard to find faults. Such is the case with my setup; some of my previously working examples fail to enumerate correctly (after no code changes), while others work fine — all using the same stack code. I attribute this to my ailing Vista install, which has had more bluescreens and crashes due to its original “Black Screen Of Death” fault and my USB experiments rather than faults in my code. Actually, it’s probably time for a reinstall (or at least a serious repair) of the whole darn thing.

The AVR109 bootloader has turned out to be much easier than I had hoped to implement, and I’m very confident it’ll be completed in less than the 4KB maximum. The only issue I’ve had so far is the device code; originally each device returned a unique code for each supported AVR model. However, with Atmel no longer supporting the AVR109 programming software (AVRProg) the newer devices lack defined device codes. Thankfully my searching seems to indicate that all I need to do is return a valid code for any device to keep the software happy, and that AVRDude issues commands based on the signature bytes rather than the device code.

I’ve emailed Jörg (maintainer of AVRDude) about the possibility of adding USB DFU support to the AVRDude project.

CDC Bootloader

MyUSB Library, Projects 1 Comment »

Well, I’m really starting to run out of things to implement. Seriously; I’ve now made demos for the majority of the standard USB classes. Still, I’m revisiting an idea given to me by several people - a CDC class bootloader.

MyUSB already has a DFU class bootloader, of course, but that is incompatible with most of the software for AVR programming. By writing a bootloader based on the CDC class, it could enumerate as a virtual serial port and support the common AVR109 bootloader protocol. This would render it compatible with such commonly used software as AVR-OSP and AVRDude.

My only concern is size constraints; the bare CDC code with no functional use of the data sent and received leaves only about 1.5KB of space for the bootloader code. However, if the assembly nuts can get it done in half a kilobyte, I’ll be damned before I let this defeat me. Stay tuned.

Network ‘08 and MIDI Demo

General, MyUSB Library, Projects No Comments »

Well the Network ‘08 dinner turned out to be a blast, with lots of interesting people to talk to. Turns out that the guy who invited me, Michael, is a really nice and dynamic guy in person - not that I suspected anything to the contrary. Despite the whole thing looking like some sort of weird pyramid scheme at first glance, the venue was quite nice and I was able to learn a little about the current state of the job market for engineers.

Five minutes ago I managed to get my MIDI demo working. I eventually settled on the “MIDI-OX” software (free for non-commercial use) although any MIDI application capable of MIDI-IN is suitable. After much swearing over the normal MIDI specification I realized that I’d missed a crucial part of the USB-MIDI supplement specification; since the USB protocol can carry many, many MIDI streams, each standard MIDI message has to be prefixed by a byte indicating the virtual cable number and message type. All now works well, and the new demo will join the new HID parser in the next MyUSB library release.

USB-MIDI

General, MyUSB Library, Projects 2 Comments »

Reading the AVRFreaks.net forums too often can have an unintended side effect - more work. No, I’m not talking about the work of helping others, but rather the work induced by the thoughts implanted by others. A thread about MIDI had me thinking for a little too long, and so I decided to investigate the USB-MIDI class specification.

A little reading later and I’ve found that it should be relatively simple, due to the fact that the USB-MIDI class is built on top of the existing Audio class, which I’ve already experimented with. The only tasks that need to be done it seems is to add in the MIDI IN and OUT terminals to the descriptors, and then the actual MIDI note writing to the appropriate endpoint.

I think it’ll be my next addition to the library - a simple MIDI device which playes notes depending on the joystick position. My only problem is the host-side application; can anyone recommend a freeware application which can play notes sent to the host via MIDI?

I’ll be at the The IET Networking Dinner event tomorrow night, so if any of you are also attending, I’ll see you there!

Wordpress Update

Website No Comments »

Last night I finally got around to updating Wordpress to the newest version. As is the norm with all updates, the new version completely broke everything. I’ve since fixed all the problems I can find, but please leave a comment if you notice anything else not quite right.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in