-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rBoot partition support #2258
Add rBoot partition support #2258
Conversation
1deffb7
to
a248a0c
Compare
4d31392
to
787a900
Compare
OK, I've checked this out as follows on a nodeMCU with 4MByte flash memory:
Check the map looks sensible. The partition table is at the end of flash; anywhere else and it could collide with SPIFFS, etc.
And we should now be running with Sming 4.3. |
The OTA stuff I haven't yet tested. Volunteers?! |
NB. This PR is on top of #2263 so I'll rebase once that's merged. |
PR #2263 is merged. Feel free to rebase when you have time. |
8761077
to
6932420
Compare
Minor fix to #2263 required... |
62b57e5
to
736fb01
Compare
Support ESP8266 partition table in any sector Support calculated `partition_table_offset` and partition `address` values
736fb01
to
a27f59e
Compare
@@ -4,6 +4,7 @@ | |||
"devices": { | |||
// Override default (conservative) flash settings for maximum performance | |||
"spiFlash": { | |||
// "mode": "qio", // This doesn't always work, depends on the flash chip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace the comment // This doesn't always work, depends on the flash chip
with // Make sure to set the mode according to your flash chip. Allowed SPI modes are listed here: https://sming.readthedocs.io/en/latest/_inc/Sming/Components/esptool/index.html#envvar-SPI_MODE
.
Sming/Arch/Esp8266/options.json
Outdated
@@ -6,5 +6,24 @@ | |||
"filename": "$(FLASH_INIT_DATA_VCC)" | |||
} | |||
} | |||
}, | |||
"legacy": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikee47 Why we need a new memory layout for ESP8266 given the fact that now the partition table can be moved to a different location? Why not keep the current layout and not introduce a legacy layout?
- OTA will function out of the box for ESP8266 applications
- The firmware ROMs for big flashes can be as big as possible AND use the same entry point address
Doesn't work with regular paths or environment variables, has to be a URL. This is important because schemas can be integrated into IDE to ease editing of hardware profiles and IFS build configs.
Sming/Arch/Esp8266/standard.hw
Outdated
"address": "0x008000", | ||
"size": "992K", | ||
"address": "0x002000", | ||
"size": "0x0F8000", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikee47 Thanks a lot for the changes. Would it be possible to change the value here back to a human readable size in K? At least for me it is easier to see the max size without going to another tool to calculate the size in K.
7001a29
to
decff1d
Compare
decff1d
to
580dbd1
Compare
FLASH_INIT_DATA is built as part of esp8266 Component, and written via partition mechanism There are no longer any FLASH_INIT_CHUNKS So flashinit -> wipe flash.
Layout changed with the introduction of partition tables in PR SmingHub#2258, but reverted back to standard default layout in SmingHub#2332.
Layout changed with the introduction of partition tables in PR SmingHub#2258, but reverted back to standard default layout in SmingHub#2332.
Layout changed with the introduction of partition tables in PR SmingHub#2258, but reverted back to standard default layout in SmingHub#2332.
Layout changed with the introduction of partition tables in PR SmingHub#2258, but reverted back to standard default layout in SmingHub#2332.
Layout changed with the introduction of partition tables in PR SmingHub#2258, but reverted back to standard default layout in SmingHub#2332.
Layout changed with the introduction of partition tables in PR SmingHub#2258, but reverted back to standard default layout in SmingHub#2332.
…2729) Leaving `blockErase` parameter at `false` when constructing a `PartitionStream` will result in corruption unless partition has already been erased. This is not always immediately apparent so can be difficult to diagnose. - **Breaking change** Replacing `blockErase` with an enumerated `mode` parameter enforces read-only behaviour by default (new feature and a good thing), with write access more explicitly defined. It's a simple change to existing code and will ensure it gets manually checked to ensure correct behaviour. - Update the `Basic_Ota` sample to check that an OTA update is not being attempted on the active running partition. This can happen with esp8266, for example, when running in temporary boot mode. (NB. Other checks may include active filing system partitions but that is application-specific.) - Update notes on migrating from Sming 4.2 to include updating boot sector. (Learning points froim #2727.) - Remove redundant flashsize calculation from rboot and update version string to `Sming v1.5` (from v1.4.2). Note this should have been done in #2258. - Fix rboot README regarding use of slot 2, should correspond with subtype `ota_2` not `ota_1`.
This PR adds partition table support to the ESP8266 bootloader (rBoot). See #2254 #2251.
The ESP8266 flash layout has been reverted to the original Sming 4.2 layout, with the addition of the partition table in the sector before the RF calibration data at end of flash.
Update rBoot
Update bootloader to read ROM addresses from partition table on boot. These overwrite whatever values have been set in its own configuration, thus avoiding inconsistencies. rBoot has been forked to simplify management.
An additional partition subtype has been added for RF calibration data, so existing applications running off the develop branch will need re-building and re-flashing.
The partition table may now be freely relocated for the Esp8266 (+ Host) to allow compatibility with existing devices which must be upgrade OTA.
Methods have been added to OTA classes to allow update regions to be set using partitions; this is safer than working with raw flash addresses but the underlying mechanism hasn't changed.
TODO: