34#include "boot_config.h"
56#elif (NB_MEMORIES < 1)
57#error NB_MEMORIES parameter is not valid
61#ifndef NB_MAX_MEMORY_SLOTS
62#define NB_MAX_MEMORY_SLOTS 2
63#elif (NB_MAX_MEMORY_SLOTS < 1)
64#error NB_MEMORIES parameter is not valid
68#ifndef MEMORIES_FS_SUPPORT
69#define MEMORIES_FS_SUPPORT DISABLED
70#elif ((MEMORIES_FS_SUPPORT != DISABLED) && (MEMORIES_FS_SUPPORT != ENABLED))
71#error MEMORIES_FS_SUPPORT parameter is not valid
75#ifndef EXTERNAL_MEMORY_SUPPORT
76#define EXTERNAL_MEMORY_SUPPORT DISABLED
77#elif ((EXTERNAL_MEMORY_SUPPORT != DISABLED) && (EXTERNAL_MEMORY_SUPPORT != ENABLED))
78#error EXTERNAL_MEMORY_SUPPORT parameter is not valid
81#if (MEMORIES_FS_SUPPORT == ENABLED)
98#if (MEMORIES_FS_SUPPORT == ENABLED)
111 MEMORY_ROLE_SECONDARY
131 MEMORY_WRITE_DEFAULT_FLAG,
132 MEMORY_WRITE_FORCE_FLAG,
133 MEMORY_WRITE_RESET_FLAG
142 SLOT_TYPE_DIRECT = 1,
143#if (MEMORIES_FS_SUPPORT == ENABLED)
165 SLOT_CONTENT_NONE = 0x00,
166 SLOT_CONTENT_APP = 0x01,
167 SLOT_CONTENT_UPDATE = 0x02,
168 SLOT_CONTENT_BACKUP = 0x04,
169 SLOT_CONTENT_BINARY = 0x08,
170 SLOT_CONTENT_DATA = 0x10,
171 SLOT_CONTENT_CONFIGURATION = 0x20,
172 SLOT_CONTENT_BOOT = 0x40,
173 SLOT_CONTENT_FACTORY = 0x80
184 const void *memParent;
193#if (MEMORIES_FS_SUPPORT == ENABLED)
228 Slot slots[NB_MAX_MEMORY_SLOTS];
258 size_t *written, uint8_t flag);
cboot_error_t
Error codes.
Definition cboot_error.h:57
cboot_error_t memoryInit(Memory *memories, size_t nbMemories)
Memory initialization function.
Definition memory.c:63
SlotStatus
Slot status definition.
Definition memory.h:153
void memoryInitWriteBuffer(void)
Initialize memory write buffer.
Definition memory.c:916
cboot_error_t memoryCopySlot(Slot *src, Slot *dst, size_t bytesNumber)
Make a backup of the internal slot.
Definition memory.c:488
MemoryType
Memory Type definition.
Definition memory.h:96
cboot_error_t memoryGetSlotByCType(Memory *memory, uint8_t slotCType, Slot **slot)
Search a slot in memory that match the given slot content type.
Definition memory.c:855
cboot_error_t memoryDeInit(Memory *memories, size_t nbMemories)
Memory de-initialization function.
Definition memory.c:132
MemoryStatus
Memory status definition.
Definition memory.h:119
MemoryRole
Memory Role definition.
Definition memory.h:109
cboot_error_t memoryEraseSlot(Slot *slot, uint32_t offset, size_t length)
Erase Data from Memory function.
Definition memory.c:565
cboot_error_t memoryCleanup(Memory *memories, size_t nbMemories)
Memory cleanup function.
Definition memory.c:679
SlotContentType
Slot Type definition.
Definition memory.h:164
void memoryResetWriteBuffer(void)
Reset memory write buffer.
Definition memory.c:927
MemoryWriteFlag
Memory write flag definition.
Definition memory.h:130
cboot_error_t memoryCompareSlotContent(Slot *src, Slot *dst, uint8_t *result)
Compare two given slots content.
Definition memory.c:630
void memoryCompareSlot(Slot *src, Slot *dst, uint8_t *result)
Compare two given slots metadata.
Definition memory.c:610
cboot_error_t memoryGetSlotStatus(Slot *slot, SlotStatus *status)
Get Memory Status function.
Definition memory.c:252
cboot_error_t memoryGetInfo(Memory *memory, MemoryInfo *info)
Memory get driver information function.
Definition memory.c:181
cboot_error_t memoryReadSlot(Slot *slot, uint32_t offset, uint8_t *buffer, size_t length)
Read Data from Memory function.
Definition memory.c:441
cboot_error_t memoryWriteSlot(Slot *slot, uint32_t offset, uint8_t *buffer, size_t length, size_t *written, uint8_t flag)
Write Data into Memory function.
Definition memory.c:291
SlotType
Slot Type definition.
Definition memory.h:141
CycloneBOOT Memory Layer Abstraction (Extended)
Memory Information.
Definition memory.h:210
Memory Definition.
Definition memory.h:225
Slot Type definition.
Definition memory.h:181