cancel
Showing results for 
Search instead for 
Did you mean: 

USB and IAR

suixingzhu
Associate II
Posted on January 22, 2008 at 03:27

USB and IAR

8 REPLIES 8
suixingzhu
Associate II
Posted on July 20, 2007 at 06:27

I seem to be having and issue with the Device struct not being populated

and getting stuck in a NOP condition. I am currently using USB Mass Storage Device program of the USB dev Kit (UM0290)

When the USB cable is plugged in Windows does not recognize the device and does not recognoze the device driver provided for windows. I really could use some advice on where to go forward. I am currently compiling under the Green Hills enviroment with the a Hitex Board with a STR710 chip

here is the snipet of code

void MASS_init()

{

pInformation->Current_Configuration = 0;

/* Connect the device */

PowerOn();

/* USB interrupts initialization */

_SetISTR(0); /* clear pending interrupts */

wInterrupt_Mask = IMR_MSK;

_SetCNTR(wInterrupt_Mask); /* set interrupts mask */

pInformation->Current_Feature = MASS_ConfigDescriptor[7];

/* Wait until device is configured */

while (pInformation->Current_Configuration == 0) NOP_Process();

bDeviceState = CONFIGURED;

}

Thanks

:-]

anis2399
Associate II
Posted on July 20, 2007 at 11:54

Hi suixingzhu;

I think your problem is due to the clock configuration... the USB developer kit is done on ST Eval board (16MHz main clock and 48MHz for the USB)... you should change the clock configuration according to your hardware (the clock configuration is done in the file hw_config.c)

🙂

Regards

The Lion heart

suixingzhu
Associate II
Posted on July 20, 2007 at 15:27

First thank you for your help

But my board also has 16MHz main clock and 48MHz for the USB,I use the Mass Storage sample and do not change the clock configuration.It also gets

stuck int the No_Process() :-[

anis2399
Associate II
Posted on July 23, 2007 at 06:02

Ouuuups:-? !!!!!! Ok could you send me the schematic of your board?

Regards

The Lion heart

suixingzhu
Associate II
Posted on July 24, 2007 at 04:04

Thank you for your help

I have solved the problem :D

giovanni239955_stm1
Associate II
Posted on January 19, 2008 at 08:23

WHAT WAS THE PROBLEM ? AND HOW WAS IT SOLVED ?

THANK YOU

jrheisey
Associate II
Posted on January 21, 2008 at 16:36

I have found that when debugging on a STR711 I need to step over the USB initialization code. I run to just before the USB initialization, step over the USB initialization, then run again. If I let the debugger run into the USB initialization that NOP_Process() loop never successfully sets the configuration variable.

This happens in both the IAR EWARM and the Anglia IDEaliST debuggers.

J.R.

giovanni239955_stm1
Associate II
Posted on January 22, 2008 at 03:27

I tried but even if I step over USB_Init function the program hang on NOP_Process()and the driver on PC doesn't recognize the hardware.

I need to use USB as a virtual com port. Will someone help me to get over this problem?

Thank You