I am trying to use the libflash (or better libquadflash) from inside the bootloader; I have seen there are a number of past threads about accessing the data partition (using the readFlashDataPage function) from the bootloader but none about accessing the image partition; is it possible?
My aim is to create a failsafe mechanism that on boot if the user presses a button long enough it deletes the update images and restarts with the factory image.
Use libflash in the bootloader
-
- Member++
- Posts: 28
- Joined: Fri Jun 14, 2024 9:55 am
-
Verified
- Experienced Member
- Posts: 69
- Joined: Wed Feb 17, 2016 5:10 pm
It may be possible to do this using a generated bootloader from xflash:
https://www.xmos.com/download/AN00109:- ... .1rc1).pdf
https://www.xmos.com/download/AN00109:- ... .1rc1).pdf
-
- Member++
- Posts: 28
- Joined: Fri Jun 14, 2024 9:55 am
Thanks for the reply, andrewxcav.andrewxcav wrote: ↑Thu Jan 02, 2025 4:25 pm It may be possible to do this using a generated bootloader from xflash:
https://www.xmos.com/download/AN00109:- ... .1rc1).pdf
I am aware of that AN and I actually used it to read the IO in order to indicate the boot partition to the bootloader.
What I am looking for is a method to interact with the boot partition of the Flash, which doesn't seem possible at the moment.
In the end I decided to add to the factory image a clean-up function that erases all other boot images so that when I start the system in factory mode via button press, it cleans the other images and let the be replaced by new ones (via DFU).
-
Verified
- Experienced Member
- Posts: 69
- Joined: Wed Feb 17, 2016 5:10 pm
Ah that is a good idea. I am sure you can manipulate the boot partition, but it might require using low level flash commands vs. the flash lib.
-
- Member++
- Posts: 28
- Joined: Fri Jun 14, 2024 9:55 am
That's an interesting idea, though it would tie the bootloader to the Flash model, which I want avoid if possible (hence the ideal usage of the flash libraries).andrewxcav wrote: ↑Mon Jan 06, 2025 5:21 pm Ah that is a good idea. I am sure you can manipulate the boot partition, but it might require using low level flash commands vs. the flash lib.