How to store a 1-bit bootloader flag without wasting 1 Flash page
Hello,
I am working on custom bootloader + application setup on a STM32G070CBT6
Currently, I need to store bootloader flag that indicate whether the MCU should jump to the bootloader code or to the application code.
- Since the movement i am reserving 1 flash page(2KB) ,just to store single flag bit.
- This feels like a waste of memory, since I only need 1 bit of storage.
My questions are:
1. Can I use Option Bytes memory area to store the custom flag?
- Are Option bytes writable at runtime for application/bootloader use, or are they limited to ST system configurations (e.g., RDP, WRP, BOR levels)?
2. If Option Bytes memory area are not suitable ,is there another small memory area(apart from flash)
that is recommended for storing such a small boot flag?
I need only one bit for this flag, but dedicating a full 2KB flash feel inefficient.
