(Unimportant) bug in stm32_otg.h

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
dismirlian
Posts: 65
Joined: Fri Dec 20, 2013 3:59 pm
Has thanked: 1 time
Been thanked: 16 times

(Unimportant) bug in stm32_otg.h

Post by dismirlian »

Hi Giovanni,

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.
Attachments
stm32_otg.h.zip
Patch for stm32_otg.h file
(787 Bytes) Downloaded 264 times
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: (Unimportant) bug in stm32_otg.h

Post by Giovanni »

Thanks, patched.

Giovanni
Post Reply