Skip to content

Commit

Permalink
Update documentation to include updating boot sector during migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Mar 11, 2024
1 parent db6010d commit a124b33
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sming/Components/Storage/ota-migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Add this to your application::
{
// Note: This file won't exist on initial build!
IMPORT_FSTR(partitionTableData, PROJECT_DIR "/out/Esp8266/debug/firmware/partitions.bin")
// Current bootloader is partition-aware
IMPORT_FSTR(rbootData, PROJECT_DIR "/out/Esp8266/debug/firmware/rboot.bin")
}

extern "C" void __wrap_user_pre_init(void)
Expand All @@ -45,6 +47,11 @@ Add this to your application::
flash.erase_range(PARTITION_TABLE_OFFSET, flash.getBlockSize());
flash.write(PARTITION_TABLE_OFFSET, data, partitionTableData.size());
flash.loadPartitions(PARTITION_TABLE_OFFSET);

// For consistency update bootloader as well
LOAD_FSTR(data, rbootData)
flash.erase_range(0, flash.getBlockSize());
flash.write(0, data, rbootData.size());
}

extern void __real_user_pre_init(void);
Expand Down

0 comments on commit a124b33

Please sign in to comment.