cancel
Showing results for 
Search instead for 
Did you mean: 

definition problem in stm32_f105-07_f2_f4_usb-host-device_lib ( usb_regs.h )

pascal239955_st
Associate II
Posted on March 06, 2013 at 16:51

Hi,

I have a problem in file usb_regs.h of stm32_f105-07_f2_f4_usb-host-device_lib (version 2.10 )

typedef union _USB_OTG_DEP0XFRSIZ_TypeDef

{

uint32_t d32;

struct

{

uint32_t xfersize :

7;

uint32_t Reserved7_18 :

12;

uint32_t pktcnt :

2;

uint32_t Reserved20_28 :

9;

uint32_t supcnt :

2;

uint32_t Reserved31;

}

b;

} USB_OTG_DEP0XFRSIZ_TypeDef ;

For me, the definition found in ref manual is pktcnt : 1 , not :2;

and reserved31 is :1 .

what is wrong ?

Thanks in advance.

Pascal

#stm32-usb-library

2 REPLIES 2
tsuneo
Senior
Posted on March 06, 2013 at 17:28

On usb_core.c, these functions use USB_OTG_DEP0XFRSIZ_TypeDef structure to access to these OTG_FS registers,

USB_OTG_EP0StartXfer() - OTG_FS_DIEPTSIZ0

USB_OTG_EP0_OutStart() - OTG_FS_DOEPTSIZ0

These registers have almost similar bit fields, but PKTCNT field on OTG_FS_DIEPTSIZ0 is two bits, and OTG_FS_DOEPTSIZ0, one-bit.

Tsuneo

pascal239955_st
Associate II
Posted on March 06, 2013 at 19:10

Thank you for

your answer.

If I understand correctly

, the structure does

not correspond to a

register

STM32

, but

is a structure of

'work'.

So

, I thought

wrongly

that

usb_regs.h

corresponded to

the USB

registers

.

Thank you again.

Pascal