CycloneBOOT
2.6.6
Secure Bootloader for ARM Cortex-M MCU
Loading...
Searching...
No Matches
header.h
Go to the documentation of this file.
1
29
#ifndef __HEADER_H
30
#define __HEADER_H
31
32
#ifdef IS_LINUX
33
#include <stdint-gcc.h>
34
#endif
35
#include <stdint.h>
36
#include <time.h>
37
#include "ImageBuilderConfig.h"
38
#include "
core/crc32.h
"
39
#include "
main.h
"
40
41
#define STRINGIFY(x) #x
42
#define TOSTRING(x) STRINGIFY(x)
43
44
typedef
struct
{
45
const
char
*version;
46
const
char
*description;
47
}
HeaderVersionEntry
;
48
49
static
const
HeaderVersionEntry
ALLOWED_VERSIONS[] = {
50
{
"1.1.0"
,
"Initial version"
},
51
{
"1.2.0"
,
"Complex versions support"
},
52
{
"1.3.0"
,
"Secure boot"
},
53
{NULL, NULL}
54
};
55
56
//Image Header version
57
#define IMAGE_HEADER_VERSION (((image_builder_HEADER_VERSION_MAJOR & 0xFF) << 16) | ((image_builder_HEADER_VERSION_MINOR & 0xFF) << 8) | (image_builder_HEADER_VERSION_PATCH & 0xFF))
58
#define IMAGE_HEADER_VERSION_STRING \
59
TOSTRING(image_builder_HEADER_VERSION_MAJOR) "." \
60
TOSTRING(image_builder_HEADER_VERSION_MINOR) "." \
61
TOSTRING(image_builder_HEADER_VERSION_PATCH)
62
63
struct
builder_cli_configuration
;
64
65
// ImageVersion + ImageHeader layout
66
#include "
image_format.h
"
67
68
// Header versions before 1.2.0 numbered application images 1 and had no bootloader type
69
#define IMAGE_TYPE_APP_HEADER_V1_1_0 1
70
71
72
// Function to make the update image header
73
int
headerMake
(
ImageBuild
*build, ImageHeader *header,
struct
builder_cli_configuration
*cli_options,
CipherInfo
cipherInfo);
74
75
#endif
crc32.h
CycloneBOOT CRC32 cryptographic integrity tag.
headerMake
int headerMake(ImageBuild *build, ImageHeader *header, struct builder_cli_configuration *cli_options, CipherInfo cipherInfo)
Make the image header.
Definition
header.c:48
image_format.h
CycloneBOOT on-flash image format.
main.h
CycloneBOOT compatible Update Image Builder.
CipherInfo
Definition
main.h:47
HeaderVersionEntry
Definition
header.h:44
ImageBuild
Buffers the image passes through while it is built.
Definition
main.h:81
builder_cli_configuration
Definition
cli.h:53
ImageBuilder
inc
header.h
Generated by
1.9.8