diff --git a/display.c b/display.c --- a/display.c +++ b/display.c @@ -101,22 +101,11 @@ void display_process(therm_settings_t* s case 0: { ssd1306_clearscreen(); - ssd1306_DrawString("Entering Bootloader", 1, 0); - ssd1306_DrawString("(hopefully)", 2, 0); - HAL_Delay(1000); - bootloader_enter(); - -/* - HAL_RCC_DeInit(); - SysTick->CTRL = 0; - SysTick->LOAD = 0; - SysTick->VAL = 0; - __set_PRIMASK(1); - __set_MSP(0x200010000); - *((unsigned long *)0x200017F0) = 0xDEADBEEF; // 6KB STM32F042 - NVIC_SystemReset(); -*/ - status->state = STATE_IDLE; + ssd1306_DrawString("Bootloader Entered", 0, 0); + ssd1306_DrawString("Device won't boot", 2, 0); + ssd1306_DrawString("until reflashed!", 3, 0); + bootloader_enter(); // Resets into bootloader + status->state = STATE_IDLE; // Just in case } break; default: @@ -505,6 +494,7 @@ void display_process(therm_settings_t* s ssd1306_DrawString("#4, Check Sensor", 1, 0); else ssd1306_DrawString("#?, Unknown Error", 1, 0); + ssd1306_DrawString(" ", 2, 0); ssd1306_DrawString("Press -> to ignore", 3, 0); diff --git a/flash.sh b/flash.sh --- a/flash.sh +++ b/flash.sh @@ -1,8 +1,10 @@ #!/bin/bash -cd build -st-flash write main.bin 0x8000000 -cd .. +#cd build +#st-flash write main.bin 0x8000000 +#cd .. # USB DFU: -# sudo dfu-util -a 0 -d 0483:df11 -s 0x08000000:leave -D build/main.bin +dfu-util -a 0 -d 0483:df11 -s 0x08000000:leave -D build/main.bin +sleep 1 +dfu-util -a 1 -s 0x1FFFF800:8 -D optbytes.dat diff --git a/optbytes.dat b/optbytes.dat new file mode 100644 --- /dev/null +++ b/optbytes.dat @@ -0,0 +1,1 @@ +ªUÿˆÿÿÿÿ \ No newline at end of file