SingingCat 0
application
partitions.h
1#ifndef PARTITIONS_H
2#define PARTITIONS_H
3#include "main-header.h"
4
5#define PARTITION_BASE 0x08007000
6
7// this is the layout in block 1 & 2 of the partitions
8#define PART_MAGIC 0x53435054
9#define PART_ENTRIES 32
10typedef struct appdef {
11 uint16_t size; // size of this appdef (0 indicates end of array)
12 uint32_t app_header; // pointer to appbase (could be void *, but we want explicitly 32 bit)
13 uint32_t app_seq; // incremented with each 'update' of the application. that means: the application that was installed most recently has the highest meta_seq.
14} _appdef;
15typedef struct partition {
16 uint32_t magic;
17 uint32_t crc;
18 uint16_t layout_version; // version of struct
19 uint16_t part_seq; // each time partition is written, seq is increased.
20 struct appdef appdefs; // start of appdefs (size points to next one) size==0 means invalid entry and end
22
23void partition_init();
24void partition_set_latest_app(void *base);
25#endif