71 #ifndef CONFIG_RIOTBOOT_FLASHWRITE_RAW 
   72 #define CONFIG_RIOTBOOT_FLASHWRITE_RAW  1 
   78 #if CONFIG_RIOTBOOT_FLASHWRITE_RAW 
   80 #if (FLASHPAGE_WRITE_BLOCK_SIZE < 4) 
   81 #define RIOTBOOT_FLASHPAGE_BUFFER_SIZE 4 
   83 #define RIOTBOOT_FLASHPAGE_BUFFER_SIZE FLASHPAGE_WRITE_BLOCK_SIZE 
   88 #define RIOTBOOT_FLASHPAGE_BUFFER_SIZE FLASHPAGE_SIZE 
   95 #define RIOTBOOT_FLASHPAGE_BUFFER_ATTRS \ 
   96     __attribute__((aligned(FLASHPAGE_WRITE_BLOCK_ALIGNMENT))) 
  115 #if CONFIG_RIOTBOOT_FLASHWRITE_RAW || DOXYGEN 
  128 #define RIOTBOOT_FLASHWRITE_SKIPLEN     sizeof(RIOTBOOT_MAGIC) 
  186                                  const uint8_t *bytes, 
size_t len, 
bool more);
 
  208                                    const uint8_t *bytes, 
size_t len);
 
  273                                       size_t img_size, 
int target_slot);
 
Low-level flash page peripheral driver interface.
 
#define RIOTBOOT_FLASHPAGE_BUFFER_ATTRS
Extra attributes required for the firmware intermediate buffer.
 
static int riotboot_flashwrite_init(riotboot_flashwrite_t *state, int target_slot)
Initialize firmware update (riotboot version)
 
int riotboot_flashwrite_verify_sha256(const uint8_t *sha256_digest, size_t img_size, int target_slot)
Verify the digest of an image.
 
int riotboot_flashwrite_invalidate(int slot)
Invalidate a slot header (riotboot version)
 
size_t riotboot_flashwrite_slotsize(const riotboot_flashwrite_t *state)
Get a slot's size.
 
int riotboot_flashwrite_init_raw(riotboot_flashwrite_t *state, int target_slot, size_t offset)
Initialize firmware update (raw version)
 
int riotboot_flashwrite_finish_raw(riotboot_flashwrite_t *state, const uint8_t *bytes, size_t len)
Finish a firmware update (raw version)
 
int riotboot_flashwrite_flush(riotboot_flashwrite_t *state)
Force flush the buffer onto the flash.
 
#define RIOTBOOT_FLASHWRITE_SKIPLEN
Amount of bytes to skip at initial write of first page.
 
#define RIOTBOOT_FLASHPAGE_BUFFER_SIZE
Intermediate buffer size for firmware image data.
 
int riotboot_flashwrite_invalidate_latest(void)
Invalidate the latest firmware version (riotboot version)
 
static int riotboot_flashwrite_finish(riotboot_flashwrite_t *state)
Finish a firmware update (riotboot version)
 
int riotboot_flashwrite_putbytes(riotboot_flashwrite_t *state, const uint8_t *bytes, size_t len, bool more)
Feed bytes into the firmware writer.
 
firmware update state structure
 
size_t offset
update is at this position
 
unsigned flashpage
update is at this flashpage
 
int target_slot
update targets this slot