In the file stm32_otg.h there is one bug: the lines
Code: Select all
#define HCCHAR_MPS_MASK (11U<<0) /**< Maximum packet size mask. */
#define HCCHAR_MPS(n) (11U<<0) /**< Maximum packet size value. */
should read:
Code: Select all
#define HCCHAR_MPS_MASK (0x7FFU<<0) /**< Maximum packet size mask. */
#define HCCHAR_MPS(n) ((n)<<0) /**< Maximum packet size value. */
This impacts only OTG Host mode, which is not present in ChibiOS HAL, so it's not very important.
Also, there are some missing definitions which could be useful:
Code: Select all
#define HCINT_AHBERR (1U<<2) /**< AHB error interrupt. */
#define HCINTMSK_AHBERRM (1U<<2) /**< AHB error interrupt mask. */
#define HCTSIZ_DPID_SETUP (3U<<29) /**< SETUP. */
I attach a patch, in case you want to apply it.
Thanks!
Diego.