update link speed detection for nuc505

This commit is contained in:
hathach 2020-07-16 20:44:06 +07:00
parent 0517f4a2f1
commit dc00f0cae1
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
2 changed files with 13 additions and 1 deletions

View File

@ -46,6 +46,16 @@ FREERTOS_PORT = ARM_CM4F
JLINK_DEVICE = NUC505YO13Y
JLINK_IF = swd
# Note
# To be able to program the SPI flash, it need to boot with ICP mode "1011".
# However, in ICP mode, opencod cannot establish connection to the mcu.
# Therefore, there is no easy command line flash for NUC505
# It is probably better to just use Nuvoton NuMicro ICP programming on windows to program the board
# - 1111 "SPI" (run from internal flash)
# - 1110 "USB" (mass storage emulator that accepts a .bin file)
# - 0111 "ICE-SPI" (allow external debugger access, but may not be programmable)
# - 1011 ICP mode (programmable via NuMicro ICP programming tool)
# Flash using Nuvoton's openocd fork at https://github.com/OpenNuvoton/OpenOCD-Nuvoton
# Please compile and install it from github source
flash: $(BUILD)/$(BOARD)-firmware.elf

View File

@ -452,7 +452,9 @@ void dcd_int_handler(uint8_t rhport)
USBD->CEPINTEN = USBD_CEPINTEN_SETUPPKIEN_Msk;
USBD->BUSINTEN = USBD_BUSINTEN_RSTIEN_Msk | USBD_BUSINTEN_RESUMEIEN_Msk | USBD_BUSINTEN_SUSPENDIEN_Msk | USBD_BUSINTEN_DMADONEIEN_Msk;
USBD->CEPINTSTS = 0x1ffc;
dcd_event_bus_signal(0, DCD_EVENT_BUS_RESET, true);
tusb_speed_t speed = (USBD->OPER & USBD_OPER_CURSPD_Msk) ? TUSB_SPEED_HIGH : TUSB_SPEED_FULL;
dcd_event_bus_reset(0, speed, true);
}
if (bus_state & USBD_BUSINTSTS_RESUMEIF_Msk)