Skip to main content
Visitor II
January 22, 2008
Question

USB and IAR

  • January 22, 2008
  • 8 replies
  • 1647 views
Posted on January 22, 2008 at 03:27

USB and IAR

    This topic has been closed for replies.

    8 replies

    Visitor II
    July 20, 2007
    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

    :-]

    Visitor II
    July 20, 2007
    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

    Visitor II
    July 20, 2007
    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() :-[

    Visitor II
    July 23, 2007
    Posted on July 23, 2007 at 06:02

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

    Regards

    The Lion heart

    Visitor II
    July 24, 2007
    Posted on July 24, 2007 at 04:04

    Thank you for your help

    I have solved the problem :D

    Visitor II
    January 19, 2008
    Posted on January 19, 2008 at 08:23

    WHAT WAS THE PROBLEM ? AND HOW WAS IT SOLVED ?

    THANK YOU

    Visitor II
    January 21, 2008
    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.

    Visitor II
    January 22, 2008
    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