added comment note for beta chip walkaround

This commit is contained in:
hathach 2020-04-10 20:25:53 +07:00
parent d8d5902ccb
commit 8953bc9255
1 changed files with 11 additions and 1 deletions

View File

@ -170,7 +170,17 @@ void dcd_init(uint8_t rhport)
USB0.gusbcfg |= USB_FORCEDEVMODE_M; // force devmode
USB0.gotgctl &= ~(USB_BVALIDOVVAL_M | USB_BVALIDOVEN_M | USB_VBVALIDOVVAL_M); //no overrides
#ifdef CONFIG_IDF_TARGET_ESP32S2BETA // needed for beta chip only
#ifdef CONFIG_IDF_TARGET_ESP32S2BETA
// needed for beta chip only
// there was a bug in the phy logic that made the chip reset as soon as it transmitted anything.
// Setting the B override value made it ignore resets (any resets, generated by the faulty logic or not),
// which 'fixed' the problem well enough to test usb with it.
// Also, do note that the beta silicon run was very small and software support for it is not in mainstream esp-idf,
// as such you may consider phasing out support for it alltogether somewhere in the future
// TODO we could safely remove this later (maybe after 2020)
//C. chip 7.2.2 hack
ESP_LOGV(TAG, "DCD init - chip ESP32-S2 beta hack");
USB0.gotgctl = (0 << USB_BVALIDOVVAL_S); //B override value