commit | 29d3a77d3bf7baa10d951ecea03e304d58fbbf3c | [log] [tgz] |
---|---|---|
author | Marti Bolivar <marti.bolivar@linaro.org> | Mon Mar 20 10:44:25 2017 -0400 |
committer | Marti Bolivar <marti.bolivar@linaro.org> | Tue Mar 21 15:48:15 2017 -0400 |
tree | 6066979defc82b5d8c70fcf4ec512aea9552194a | |
parent | 94f3f91ca77fe46ad605e32715d98b4cb3aa2cb5 [diff] |
zephyr: fix flash_area_to_sectors() This fixes MCUB-39. On Zephyr targets, flash_area_to_sectors() assumes that the flash device's sector size is equal to the size of the scratch area. That breaks swap and rollback when scratch size doesn't divide image size, since the image flash areas will not be correctly configured. This is a valid configuration supported by the rest of mcuboot. The best way to fix this would be to get the flash layout from Zephyr, but that's not possible yet. Instead, provide a new FLASH_AREA_IMAGE_SECTOR_SIZE define from target.h. This must be the sector size for these areas: - FLASH_AREA_IMAGE_0 - FLASH_AREA_IMAGE_1 - FLASH_AREA_IMAGE_SCRATCH Other areas on the device may have sizes different than FLASH_AREA_IMAGE_SECTOR_SIZE. This won't work on platforms where those areas have nonuniform sector sizes, but we'll cross that bridge when we come to it. (At that point, an upstream Zephyr change to the flash API really seems needed.) Revert to the old/buggy behavior when FLASH_AREA_IMAGE_SECTOR_SIZE isn't provided, but emit a warning. Additionally, touch up the logging and error handling while we're here. Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
MCUBoot is a secure bootloader for 32-bit MCUs. The goal of MCUBoot is to define a common infrastructure for the bootloader, system flash layout on microcontroller systems, and to provide a secure bootloader that enables easy software upgrade.
MCUboot is operating system and hardware independent, and relies on hardware porting layers from the operating system it works with. Currently mcuboot works with both the Apache Mynewt, and Zephyr operating systems, but more ports are planned in the future.
The MCUBoot project was originally taken from the Apache Mynewt operating system, which had secure boot and software upgrade functionality instrinsic to it. Currently development is heads down on a first release of MCUboot that works across both the Zephyr operating system and Apache Mynewt operating system.
For more information on what's being planned, and worked on, please visit:
https://runtimeco.atlassian.net/projects/MCUB/summary
Information and documentation on the bootloader is stored within the source, and on confluence:
https://runtimeco.atlassian.net/wiki/discover/all-updates
For more information in the source, here are some pointers:
Developers welcome! To join in the discussion, please join the developer mailing list: