cancel
Showing results for 
Search instead for 
Did you mean: 

USB Demos for IAR eval board - no work

bbowling
Associate II
Posted on March 18, 2009 at 09:40

USB Demos for IAR eval board - no work

5 REPLIES 5
bbowling
Associate II
Posted on May 17, 2011 at 13:06

I have been extremely frustrated in getting any of the HID demos to work at all using IAR tools. I have the IAR Kickstart eval board and have tried running the HID example that they provide that supposedly moves the mouse on the screen. I have also tried the HID_Custom demo app download.

I can compile fine. But when I connect the USB port to my PC it comes up with ''Unknown Device'' error, and the PC reports the VID and PID are 0000.

I have tried these demos with two different IAR kickstart boards, 8 different PCs (literally) and two different versions of the compiler (4.0 ad 5.3).

My question - has *anyone* ever got these demos to actually run?I have spent weeks on this without getting anywhere. I have verified that I have 8MHz crystals (which I think the demos want have), etc, etc,etc. I cannot believe these demos do not work so it must be me, but I have spent many, many hours researching this without any luck. It should not be this hard to get a demo supplied by IAR to work on the IAR board its targeted for.....

Thanks in advance for any help - Bruce

brunoalltest
Associate II
Posted on May 17, 2011 at 13:06

I don´t use IAR, but the demos you´re talking about are probably the same demos from ST.

Check if there is these defines on your firmware and if they match your hardware schmatic.

#define USB_DISCONNECT

#define USB_DISCONNECT_PIN

#define RCC_APB2Periph_GPIO_DISCONNECT

[ This message was edited by: brunoalltest on 18-03-2009 04:38 ]

jj
Associate II
Posted on May 17, 2011 at 13:06

Sorry for your struggle - please identify your exact IAR demo board. Offer these suggestions:

a) phone/email IAR - provide specifics - if there is an ''IAR specific'' problem they should confirm - hopefully have solution

b) this forum has many skilled/helpful contributors - post ''before'' you get too frustrated. Provide specifics & a logical sequence of your issue

c) bruno has identified a key point - search ST's USB examples (under documents, this site) which often are newer/more detailed than those of board maker. Be sure you study the code/examples based upon ST's 2 Eval boards with the TFT (believe these are ''B'' and ''E'') which have USB demos which do work under IAR

d) have you installed ST's ''virtual com port'' software? Suggest that you start with the most basic - only simplify/complicate ''after'' you have mastered basic operation

bbowling
Associate II
Posted on May 17, 2011 at 13:06

Quote:

Check if there is these defines on your firmware and if they match your hardware schmatic.

#define USB_DISCONNECT

#define USB_DISCONNECT_PIN

#define RCC_APB2Periph_GPIO_DISCONNECT

[ This message was edited by: brunoalltest on 18-03-2009 04:38 ]

Thanks for the response on this. I stumbled upon these a while back and I did set then to match the port that is attached to the two transistor circuit. From what I gather this circuit applies the pullup resistor to one of the D lines for USB to indicate what speed USB device is out there.

If you do not set this correctly when the USB device is plugged in nothing happens - the PC host has no idea there is something plugged in.

When I fixed this and set it to the correct port, the PC wakes up and attempts to enumerate, but this then fails with the result of VID and PID being set to zero on the PC end. You can single-step the board while connected to the PC and the point in the code where the USB_DISCONNECT pin is enabled, the PC end immediately wakes up but fails enumeration.

I have also tried so many combinations of making sure the embedded app is running before connecting the PC, connecting the PC then running the app, etc. I have also gone thru the PC registry an cleaned out any reference to this device, removed the assigned drivers (the PC never assigns drivers) and reconnect, all with the same failures.

The demos I am trying are the ST demos (Custom HID), also, IAR supplies their own demos (in the IAR-STM32-SK application)... one of these is a HID mode demo where it takes over the mouse and *supposedly* moves it in a small square. Neither work, tried on multiple hardware and PCs. The boards use a 8MHz crystal and I assume the original apps want this crystal speed, and I would expect the IAR supplied app to be set up for the board already.

Thanks for the help here, sorry to rant and rave on this but I am literally losing sleep on this because I cannot figure it out.

I will try the virtual COM program, this may at least flush out the hardware. But I have to get the HID mode operational and with all of the H/W and PC combos I have tried I really suspect there is something else going on.

- Bruce

ccowdery9
Associate III
Posted on May 17, 2011 at 13:06

I had huge difficulty getting my USB app to work (rolling USB HID+MSD+Audio into one app). Unfortunately for you I didn't use IAR, I used IDEaliST instead.

The most useful technique I used (as we couldn't afford a proper USB analyser) was to use SnoopyPro to examine the USB conversation:

http://sourceforge.net/projects/usbsnoop/

In you case, I'd compare (with printouts and a marker pen!) the enumeration of your device and an equivalent (working) device, e.g. a mouse?

Then you can correlate it with the enumeration process descriptions in the USB specs to try to find out where it's going wrong.

It's a bl**dy nuisance though I can assure you!

Chris.