From 2867ab8b9b3ba3d477e82c3beb42ebf54bc3d354 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 31 Mar 2020 13:18:31 +0200 Subject: [PATCH] sys/riotboot: add a warning about the size of riotboot_flashwrite_t On e.g. samd5x FLASHPAGE_SIZE is 8k (4k on kinetis, stm32w, nrf52) so placing this struct on the stack will almost always cause a stack overflow. --- sys/include/riotboot/flashwrite.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/include/riotboot/flashwrite.h b/sys/include/riotboot/flashwrite.h index eac6cc793c..2591b375c6 100644 --- a/sys/include/riotboot/flashwrite.h +++ b/sys/include/riotboot/flashwrite.h @@ -59,6 +59,9 @@ extern "C" { /** * @brief firmware update state structure + * + * @note @ref FLASHPAGE_SIZE can be very large on some platforms, don't place + * this struct on the stack or increase the thread stack size accordingly. */ typedef struct { int target_slot; /**< update targets this slot */