Changeset - b2cb29d690a8
[Not reviewed]
cortex-f0
0 2 1
Ethan Zonca - 9 years ago 2015-06-05 21:07:06
ez@ethanzonca.com
Added support for soft-entering and exiting DFU bootloader
3 files changed with 13 insertions and 20 deletions:
0 comments (0 inline, 0 general)
display.c
Show inline comments
 
@@ -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);
 

	
flash.sh
Show inline comments
 
#!/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
optbytes.dat
Show inline comments
 
new file 100644
 
ªUÿˆÿÿÿÿ
 
\ No newline at end of file
0 comments (0 inline, 0 general)