![](/media/cache/profiles/827ccb0eea8a706c4c34a16891f84e7b.jpg.50x50_q85.jpg)
Bootload from SD card to sector 0, and jump to sector 24 where new firmware resides
Fork of Panel-Controller-Bootloader by
flash.h@0:c3a652eff606, 2015-04-21 (annotated)
- Committer:
- bonchenko
- Date:
- Tue Apr 21 09:30:11 2015 +0000
- Revision:
- 0:c3a652eff606
Able to remove flash content, write new firmware from sd card, and jump to that new firmware. But its still not running completely
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bonchenko | 0:c3a652eff606 | 1 | #ifndef FLASH_H_ |
bonchenko | 0:c3a652eff606 | 2 | #define FLASH_H_ |
bonchenko | 0:c3a652eff606 | 3 | |
bonchenko | 0:c3a652eff606 | 4 | #include "main.h" |
bonchenko | 0:c3a652eff606 | 5 | #include "stm32f10x_flash.h" |
bonchenko | 0:c3a652eff606 | 6 | #include "ff.h" |
bonchenko | 0:c3a652eff606 | 7 | |
bonchenko | 0:c3a652eff606 | 8 | /* Private typedef */ |
bonchenko | 0:c3a652eff606 | 9 | typedef enum { |
bonchenko | 0:c3a652eff606 | 10 | FLASH_OK = 0, /* (0) Succeeded */ |
bonchenko | 0:c3a652eff606 | 11 | FLASH_NO_SD_CARD, /* (1) No SD Card Inserted */ |
bonchenko | 0:c3a652eff606 | 12 | FLASH_NO_FILE, /* (2) No New firmware.bin file */ |
bonchenko | 0:c3a652eff606 | 13 | FLASH_DISK_ERR, /* (3) Error reading firmware from sd card */ |
bonchenko | 0:c3a652eff606 | 14 | FLASH_MEMORY_MISMATCH /* (4) Flashed Memory does not match value */ |
bonchenko | 0:c3a652eff606 | 15 | } FLASH_RESULT; |
bonchenko | 0:c3a652eff606 | 16 | |
bonchenko | 0:c3a652eff606 | 17 | uint32_t CheckFirmware(FIL *file); |
bonchenko | 0:c3a652eff606 | 18 | FLASH_RESULT FlashFirmware(void); |
bonchenko | 0:c3a652eff606 | 19 | uint32_t FLASH_PagesMask(__IO uint32_t Size); |
bonchenko | 0:c3a652eff606 | 20 | void FLASH_DisableWriteProtectionPages(void); |
bonchenko | 0:c3a652eff606 | 21 | |
bonchenko | 0:c3a652eff606 | 22 | #endif /* FLASH_H_ */ |