Bootload from SD card to sector 0, and jump to sector 24 where new firmware resides

Dependencies:   FatFS mbed

Fork of Panel-Controller-Bootloader by Emma

Committer:
bonchenko
Date:
Wed Apr 22 10:18:55 2015 +0000
Revision:
2:0fa89ba8f6fe
Parent:
0:c3a652eff606
Bootloader from SD card works perfectly. Compiled with offset in EmBlocks, ADE cannot print readings - but its happened without bootloader too. The problem is Emblocks compiler settings

Who changed what in which revision?

UserRevisionLine numberNew 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_ */