dmitrystu / sboot_stm32

Secure USB DFU1.1 bootloader for STM32
Apache License 2.0
303 stars 63 forks source link

User firmware stuck or not starting after reset. #26

Closed curiousmindsdev closed 3 years ago

curiousmindsdev commented 3 years ago

I have a demo firmware toggling 6 LEDs in sequence. I uploaded it using dfu-util but it does not start. First LED turns on and it stops there. I'm guessing that I forgot to add something in my code. DFU_APP_START is set to 0x08001000 and DFU_APP_SIZE is set to 126976 in config file. Also I set FLASH (rx) : ORIGIN = 0x08001000, LENGTH = 124K in my demo project. I've uploaded my demo project along with bootloader.map and config.h file to Google Drive. Can you check if something is wrong?

https://drive.google.com/drive/folders/17VR4t5-j2v8Tgzqlx1nVWkIIFzimskdh?usp=sharing

dmitrystu commented 3 years ago

Tried to debug with your code. I was surprised that F0 series doesn't support ISR table relocation. I see no way to fix this.

dmitrystu commented 3 years ago

Probably I have found a solution. But it needs to be tested.

dmitrystu commented 3 years ago

Could you test with this branch? In a few words, since if we can't set a VTOR we must handle ISR in the bootloader then do a jump to the application ISR.

curiousmindsdev commented 3 years ago

IT WORKED!!! Thank you so much!!!

dzarda commented 3 years ago

Nice solution. I think we want to have this merged