When riotboot/slot.h is included, but riotboot is not enabled in the
build, a compiler error occures. This is because SLOT0_LEN is not
defined. This patch fixes this by surrounding the offending macrro with
a conditional compile. `riotboot_slot_size()` may still be called, in
which case it returns 0 for the size of any slot given.
This adds optional usage of periph_flashpage_raw for the
riotboot/flashwrite module. This removes the need to buffer a full
flashpage page, instead it must buffer two times the
FLASHPAGE_RAW_BLOCKSIZE. One is used to buffer the current write block,
the other buffers the first chunk (offset zero, page zero). This first
chunk is written when finalizing the flash operation.
Care must be taken that, when using the skiplength, the number of bytes
skipped is always a multiple of the FLASHPAGE_RAW_BLOCKSIZE.
riotboot_hdr enables to partition the internal flash memory
into "slots", each one with a header providing information
about the partition. The concept for now is limited to
firmware partitions, which are recognised by the riotboot
bootloader. In the future the concept might be extended to
represent other content.
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>