boot directly to solo bootloader for solo hacker

This commit is contained in:
Conor Patrick
2018-12-04 01:30:53 -05:00
parent b0cc9cf582
commit 97b715881b
9 changed files with 475 additions and 13 deletions

View File

@@ -12,6 +12,7 @@
#include "ctap_errors.h"
#include "log.h"
extern uint8_t REBOOT_FLAG;
typedef enum

View File

@@ -13,6 +13,9 @@
#define IS_BOOTLOADER 1
#define SOLO_HACKER
#define ENABLE_U2F_EXTENSIONS
// #define ENABLE_U2F

View File

@@ -31,6 +31,7 @@
#include "log.h"
#include "ctap.h"
#include "app.h"
#include "stm32l4xx_ll_rcc.h"
#include "stm32l4xx.h"
@@ -92,6 +93,14 @@ int main(int argc, char * argv[])
}
}
#ifdef SOLO_HACKER
if ( RCC->CSR & (1<<29) )// check if there was independent watchdog reset
{
RCC->CSR |= (1<<23); // clear reset flags
goto start_bootloader;
}
#endif
if (boot && is_authorized_to_boot())
{
BOOT_boot();
@@ -100,6 +109,7 @@ int main(int argc, char * argv[])
{
printf1(TAG_RED,"Not authorized to boot\r\n");
}
start_bootloader:
usbhid_init();
printf1(TAG_GEN,"init usb\n");