added system reset to bootloader command for portenta

This commit is contained in:
Dario Pennisi 2020-07-31 12:45:26 -04:00
parent 3db570fd90
commit 98402324ca
2 changed files with 9 additions and 0 deletions

View File

@ -328,6 +328,14 @@ void usbdbg_control(void *buffer, uint8_t request, uint32_t length)
NVIC_SystemReset();
break;
case USBDBG_SYS_RESET_TO_BL:{
RTC_HandleTypeDef RTCHandle;
RTCHandle.Instance = RTC;
HAL_RTCEx_BKUPWrite(&RTCHandle, RTC_BKP_DR0, 0xDF59);
NVIC_SystemReset();
break;
}
case USBDBG_FB_ENABLE: {
xfer_bytes = 0;
xfer_length = length;

View File

@ -46,6 +46,7 @@ enum usbdbg_cmd {
USBDBG_ATTR_READ =0x8A,
USBDBG_ATTR_WRITE =0x0B,
USBDBG_SYS_RESET =0x0C,
USBDBG_SYS_RESET_TO_BL =0x0E,
USBDBG_FB_ENABLE =0x0D,
USBDBG_TX_BUF_LEN =0x8E,
USBDBG_TX_BUF =0x8F,