2013-03-06 07:51 AM
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-library2013-03-06 08:28 AM
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. Tsuneo2013-03-06 10:10 AM
Thank you for
your answer.
If I understand correctly
, the structure does
not correspond to a
register
STM32
, butis a structure of
'work'.
So
, I thoughtwrongly
that
usb_regs.h
corresponded to
the USB
registers
.Thank you again.
Pascal