请代码维护者改正 USB 代码错误,从4.2到4.4都没改过来 [IDFGH-5223]
Posted: Thu May 06, 2021 8:15 am
以下说的是 4.4 master 的版本,4.2版本路径略有不同。
1.文件:
esp-idf/components/soc/esp32s2/include/soc/usb_struct.h
volatile uint32_t grxstsp; /*!< 0x20 */
volatile uint32_t grxfsiz;
volatile uint32_t gnptxfsiz;
volatile uint32_t gnptxsts;
volatile uint32_t reserved0x2c;
volatile uint32_t gpvndctl; /*!< 0x30 */
reserved0x2c; 这句其实就已经是 0x30 了
volatile uint32_t ghwcfg1; /*!< 0x40 */
volatile uint32_t ghwcfg2;
volatile uint32_t ghwcfg3;
volatile uint32_t ghwcfg4; /*!< 0x50 */
ghwcfg4; 这句虽然确实是 0x5C,但前面注释的偏移位置全部错误了
2.文件:
esp-idf/components/hal/esp32s2/include/hal/usb_ll.h
函数:
static inline void usb_ll_int_phy_pullup_conf(bool dp_pu, bool dp_pd, bool dm_pu, bool dm_pd)
{
usb_wrap_otg_conf_reg_t conf = USB_WRAP.otg_conf;
conf.pad_pull_override = 1;
conf.dp_pullup = dp_pu;
conf.dp_pulldown = dp_pd;
conf.dm_pullup = dm_pu;
conf.dm_pulldown = dp_pd;
USB_WRAP.otg_conf = conf;
}
错误:
conf.dp_pulldown = dp_pd;
conf.dm_pulldown = dp_pd;
这两个明显有一个是错的,都指向同一个参数
1.文件:
esp-idf/components/soc/esp32s2/include/soc/usb_struct.h
volatile uint32_t grxstsp; /*!< 0x20 */
volatile uint32_t grxfsiz;
volatile uint32_t gnptxfsiz;
volatile uint32_t gnptxsts;
volatile uint32_t reserved0x2c;
volatile uint32_t gpvndctl; /*!< 0x30 */
reserved0x2c; 这句其实就已经是 0x30 了
volatile uint32_t ghwcfg1; /*!< 0x40 */
volatile uint32_t ghwcfg2;
volatile uint32_t ghwcfg3;
volatile uint32_t ghwcfg4; /*!< 0x50 */
ghwcfg4; 这句虽然确实是 0x5C,但前面注释的偏移位置全部错误了
2.文件:
esp-idf/components/hal/esp32s2/include/hal/usb_ll.h
函数:
static inline void usb_ll_int_phy_pullup_conf(bool dp_pu, bool dp_pd, bool dm_pu, bool dm_pd)
{
usb_wrap_otg_conf_reg_t conf = USB_WRAP.otg_conf;
conf.pad_pull_override = 1;
conf.dp_pullup = dp_pu;
conf.dp_pulldown = dp_pd;
conf.dm_pullup = dm_pu;
conf.dm_pulldown = dp_pd;
USB_WRAP.otg_conf = conf;
}
错误:
conf.dp_pulldown = dp_pd;
conf.dm_pulldown = dp_pd;
这两个明显有一个是错的,都指向同一个参数