cancel
Showing results for 
Search instead for 
Did you mean: 

USB Developer Kit for STR7 - Beta1 Posted

anis23
Associate II
Posted on June 01, 2007 at 11:55

USB Developer Kit for STR7 - Beta1 Posted

19 REPLIES 19
graziano
Associate II
Posted on July 24, 2006 at 15:06

I'm trying to port the joystick mouse demo on a custom board based on sta2051, with the old ADS 1.2 IDE. The board uses as input USB clock a 4 MHz oscillator on the HCLK PIN.

I'm setting

GPIO_Config(GPIO1, 0x2000, GPIO_AF_OD);

RCCU_PLL2Config( RCCU_PLL2_Mul_12, RCCU_Div_1 );

RCCU_USBCLKConfig( RCCU_PLL2_Output );

but, even if I see packets coming on the micro pind, I can't see the correct communication handshake.

Any comments/suggestions ?

thanx in advance

mohamed23
Associate II
Posted on July 24, 2006 at 16:44

Hello meola,

you have to configure PLL2 correctly while using a dedicated 4Mhz for USB

connected on HCK Pin with the STR710 or STR711 series, you can use the

function already provided in the ''hw.config.c'', by just removing the comments as the following :

void Set_USBClock(void)

{

/* Configure the PLL2 ( * 12 , / 1 ) assuming HCLK=4MHz */

PCU->PLL2CR = 0x01D0;

while(!(PCU->PLL2CR & 0x8000)); /*Waiting PLL2 Locking */

}

If you run your application after this modification, you will see USB events working correctly 🙂

Regards,

Rave

[ This message was edited by: Rave on 24-07-2006 20:25 ]

graziano
Associate II
Posted on July 25, 2006 at 08:03

it has no effect....

any other suggestions ??

thanx

GM

anis23
Associate II
Posted on July 26, 2006 at 07:37

Hi meola,

Are you sure that your problem is related to clock configuration??? Just to be sure, could you put a break point in the ''Joystick_Reset ()'' function and plug the USB cable... If the debugger enters this function that means there are no problem in the clock configuration... Please ensure also that the init.s and the vect.s files are putted and correctly configured in your project...

It can be also a hardware problem… could you send me your hardware implementation (just the USB part)?...

Regards,

AnisAS.

anis23
Associate II
Posted on July 26, 2006 at 07:44

Hi Antonicliu,

You can use directly the mass storage demo (simple buffer) and delete the ''usb_bot.c'', ''usb_scsi.c'', ''memory.c'' and ''scsi_data.c'' from the project...

When the host send a data to your device (using the endpoint 2) we will receive a CTR interrupt and the function ''EP2_OUT_Callback ()'' will be called and you have to copy the received data...

To send the data to the host, you have to copy the needed data to the PMA (endpoint 1) and set the endpoint status as VALID. After the achievement of the transfer the ''EP1_IN_Callback ()'' will be called and you can prepare the next data to send.

Note 1: you can use the usb_mem.c functions to copy the data from/into the PMA.

Note 2: the choice of the endpoint 1 and 2 is related to the example of the mass storage demo. You can choose any other endpoints (or many endpoints in IN or OUT direction).

Regards,

AnisAS.

graziano
Associate II
Posted on July 26, 2006 at 10:46

i can see USB interrupt coming, but just of ESOF kind (never CTR). I've never entered ''Joystick_Reset''; the application hangs in the line

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

cheers and thanks for your help

GM

>Are you sure that your problem is related to clock configuration??? Just >to be sure, could you put a break point in the ''Joystick_Reset ()'' >function and plug the USB cable... If the debugger enters this function >that means there are no problem in the clock configuration... Please >ensure also that the init.s and the vect.s files are putted and correctly >configured in your project...

>It can be also a hardware problem… could you send me your hardware

> implementation (just the USB part)?...

mohamed23
Associate II
Posted on July 26, 2006 at 17:49

Hi Meola,

Could you please check your Pull-up of 1.5KOhm on your D+ Line ?

Regards,

rave

graziano
Associate II
Posted on July 28, 2006 at 06:03

>Could you please check your Pull-up of 1.5KOhm on your D+ Line ?

Hi Rave,

we have a pull-up on our D- line (the sta2051 cell is USB 1.1 compliant), but, even moving the pull-up to D+ but nothing has changed. The only effect I see is that now the data enter the micro pin @12 MHz instead of 1.5

cheers

GM

jmcallister
Associate II
Posted on August 01, 2006 at 13:10

This may not help, but I just chased down this problem on a board with a 4MHz oscillator...

In the 71x_conf.h file referenced by the library header, you must set your #define RCCU_Main_Osc to the correct input frequency. For many boards this is 16000000, for my board it is 4000000 using a 4MHz oscillator.

This affected my baud rate generation for the UARTs, but I don't know if this will have any effect on USB configuration. I was getting UART interrupts just fine but only trash coming out of the serial port. It turned out my baud rate was 4x too slow (115200/4=28800) because in the library, RCCU_FrequencyValue() uses this #define to calculate the value to feed the baud rate generator.

gfr
Associate II
Posted on June 01, 2007 at 11:55

Quote:

On 26-07-2006 at 14:16, Anonymous wrote:

i can see USB interrupt coming, but just of ESOF kind (never CTR). I've never entered ''Joystick_Reset''; the application hangs in the line

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

cheers and thanks for your help

GM

>Are you sure that your problem is related to clock configuration??? Just >to be sure, could you put a break point in the ''Joystick_Reset ()'' >function and plug the USB cable... If the debugger enters this function >that means there are no problem in the clock configuration... Please >ensure also that the init.s and the vect.s files are putted and correctly >configured in your project...

>It can be also a hardware problem… could you send me your hardware

> implementation (just the USB part)?...

Hi everybody

I have the same problem , Im working on STR711 and I try to use Mass storage device but the application hangs in the line

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

If I comment this line it works but I dont think that its a good solution !!

Can anyone help us ?

Thx in advance