-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bootloader working with AES encryption and SHA-256 checking.
- Loading branch information
1 parent
d11a35c
commit ad1d13d
Showing
20 changed files
with
3,884 additions
and
179 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Created by Clyde Stubbs on 4/4/17. | ||
// | ||
|
||
#ifndef BGBOOTLOAD_BLAT_H | ||
#define BGBOOTLOAD_BLAT_H | ||
|
||
// this structure is included at the beginning of each user application. It is similar in intent, but different | ||
// in format, to the Silabs AAT. | ||
|
||
#define APP_BOOT_ADDRESS_TYPE (0xFFFFFFA7) // this value set in the file | ||
#define APP_APP_ADDRESS_TYPE (0xF765FFA7) // this value written after successful download | ||
|
||
typedef struct { | ||
uint32_t *topOfStack; // Stack initialization pointer | ||
void (*resetVector)(void); // Reset vector | ||
void (*nmiHandler)(void); // NMI Handler | ||
void (*hardFaultHandler)(void); // Hardfault handler | ||
uint32_t type; // 0x0AA7 for Application Address Table, 0x0BA7 for Bootloader Address Table, 0x0EA7 for RAMEXE | ||
uint32_t *vectorTable; // Pointer to the real Cortex-M vector table | ||
uint32_t timeStamp; // Unix epoch time for EBL generation | ||
uint32_t appVersion; // Customer defined version number. | ||
uint8_t aatSize; // Size of the AAT in bytes. | ||
uint8_t unused[3]; // Reserved for bootloader expansion | ||
|
||
} blat_t; | ||
#endif //BGBOOTLOAD_BLAT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
#include <stdint.h> | ||
#include "aat_def.h" | ||
#include <blat.h> | ||
|
||
|
||
//AAT | ||
extern void NMI_Handler(void); | ||
|
||
extern void HardFault_Handler(void); | ||
|
||
extern void Reset_Handler(void); | ||
|
||
extern uint32_t __StackTop; | ||
extern uint32_t __Vectors; | ||
const aat_t app_ATT | ||
__attribute__ ((section (".AAT"))) | ||
= | ||
{ | ||
.topOfStack=&__StackTop, //.topOfStack=(uint32_t*)&CSTACK$$Limit, | ||
.resetVector=Reset_Handler, // main program for the app | ||
.nmiHandler=NMI_Handler, /* 2 - NMI */ | ||
.hardFaultHandler=HardFault_Handler, /* 3 - HardFault */ | ||
.type=APP_ADDRESS_TABLE_TYPE, //uint16_t type; | ||
.version=AAT_MAJOR_VERSION, //uint16_t version; | ||
.vectorTable=(void*)&__Vectors, //const HalVectorTableType *vectorTable; | ||
.aatSize=sizeof(AppAddressTable), | ||
.simeeBottom=(void*)0xFFFFFFFF, | ||
.imageCrc=IMAGE_CRC_MAGIC, | ||
.timeStamp=IMAGE_TIMESTAMP_MAGIC | ||
}; | ||
const blat_t app_ATT | ||
__attribute__ ((section (".AAT"))) | ||
= | ||
{ | ||
.topOfStack=&__StackTop, //.topOfStack=(uint32_t*)&CSTACK$$Limit, | ||
.resetVector=Reset_Handler, // main program for the app | ||
.nmiHandler=NMI_Handler, /* 2 - NMI */ | ||
.hardFaultHandler=HardFault_Handler, /* 3 - HardFault */ | ||
.type=APP_BOOT_ADDRESS_TYPE, // type; The bootloader will overwrite this once it's happy | ||
.vectorTable=(void *) &__Vectors, //const HalVectorTableType *vectorTable; | ||
.aatSize=sizeof(blat_t), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Created by Clyde Stubbs on 4/4/17. | ||
// | ||
|
||
#ifndef BGBOOTLOAD_BLAT_H | ||
#define BGBOOTLOAD_BLAT_H | ||
|
||
// this structure is included at the beginning of each user application. It is similar in intent, but different | ||
// in format, to the Silabs AAT. | ||
|
||
#define APP_BOOT_ADDRESS_TYPE (0xFFFFFFA7) // this value set in the file | ||
#define APP_APP_ADDRESS_TYPE (0xF765FFA7) // this value written after successful download | ||
|
||
typedef struct { | ||
uint32_t *topOfStack; // Stack initialization pointer | ||
void (*resetVector)(void); // Reset vector | ||
void (*nmiHandler)(void); // NMI Handler | ||
void (*hardFaultHandler)(void); // Hardfault handler | ||
uint32_t type; // 0x0AA7 for Application Address Table, 0x0BA7 for Bootloader Address Table, 0x0EA7 for RAMEXE | ||
uint32_t *vectorTable; // Pointer to the real Cortex-M vector table | ||
uint32_t timeStamp; // Unix epoch time for EBL generation | ||
uint32_t appVersion; // Customer defined version number. | ||
uint8_t aatSize; // Size of the AAT in bytes. | ||
uint8_t unused[3]; // Reserved for bootloader expansion | ||
|
||
} blat_t; | ||
#endif //BGBOOTLOAD_BLAT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.