diff --git a/README.md b/README.md index 10473e13d..83b2379d1 100644 --- a/README.md +++ b/README.md @@ -127,8 +127,6 @@ Anything after the `--` delimeter is passed directly to the CLI ([docs](https:// - `npm run update-firmware-binaries ` where `` is the newly released system firmware version like 0.7.0 -- If a particular device requires `requiresBootloaderAscenderApp: true` found in `src/lib/deviceSpecs/specifications.js` then a manual step is required that replaces the firmware files copied from the above step with the special system firmware required that allows the bootloader to be updated by the ascender.bin user app. There will be a draft release in the `particle-iot/firmware` repo containing these files. - - Test on each platform by doing ``` diff --git a/assets/updates/argon-bootloader@1.2.1.bin b/assets/updates/argon-bootloader@1.2.1.bin new file mode 100755 index 000000000..22adbeedf Binary files /dev/null and b/assets/updates/argon-bootloader@1.2.1.bin differ diff --git a/assets/updates/argon-system-part1@1.1.1.bin b/assets/updates/argon-system-part1@1.1.1.bin deleted file mode 100755 index ca4af8e74..000000000 Binary files a/assets/updates/argon-system-part1@1.1.1.bin and /dev/null differ diff --git a/assets/updates/argon-system-part1@1.2.1.bin b/assets/updates/argon-system-part1@1.2.1.bin new file mode 100755 index 000000000..460ecaf5d Binary files /dev/null and b/assets/updates/argon-system-part1@1.2.1.bin differ diff --git a/assets/updates/ascender-1.1.1-p1.bin b/assets/updates/ascender-1.1.1-p1.bin deleted file mode 100755 index f38123aae..000000000 Binary files a/assets/updates/ascender-1.1.1-p1.bin and /dev/null differ diff --git a/assets/updates/ascender-1.1.1-photon.bin b/assets/updates/ascender-1.1.1-photon.bin deleted file mode 100755 index d4b7842d8..000000000 Binary files a/assets/updates/ascender-1.1.1-photon.bin and /dev/null differ diff --git a/assets/updates/asom-bootloader@1.2.1.bin b/assets/updates/asom-bootloader@1.2.1.bin new file mode 100755 index 000000000..e77117ddc Binary files /dev/null and b/assets/updates/asom-bootloader@1.2.1.bin differ diff --git a/assets/updates/asom-system-part1@1.1.1.bin b/assets/updates/asom-system-part1@1.1.1.bin deleted file mode 100755 index 13eca7d6a..000000000 Binary files a/assets/updates/asom-system-part1@1.1.1.bin and /dev/null differ diff --git a/assets/updates/asom-system-part1@1.2.1.bin b/assets/updates/asom-system-part1@1.2.1.bin new file mode 100755 index 000000000..b6e444874 Binary files /dev/null and b/assets/updates/asom-system-part1@1.2.1.bin differ diff --git a/assets/updates/boron-bootloader@1.2.1.bin b/assets/updates/boron-bootloader@1.2.1.bin new file mode 100755 index 000000000..d788d73e1 Binary files /dev/null and b/assets/updates/boron-bootloader@1.2.1.bin differ diff --git a/assets/updates/boron-system-part1@1.1.1.bin b/assets/updates/boron-system-part1@1.1.1.bin deleted file mode 100755 index a3365674a..000000000 Binary files a/assets/updates/boron-system-part1@1.1.1.bin and /dev/null differ diff --git a/assets/updates/boron-system-part1@1.2.1.bin b/assets/updates/boron-system-part1@1.2.1.bin new file mode 100755 index 000000000..f112ebe28 Binary files /dev/null and b/assets/updates/boron-system-part1@1.2.1.bin differ diff --git a/assets/updates/bsom-bootloader@1.2.1.bin b/assets/updates/bsom-bootloader@1.2.1.bin new file mode 100755 index 000000000..2d98f69cf Binary files /dev/null and b/assets/updates/bsom-bootloader@1.2.1.bin differ diff --git a/assets/updates/bsom-system-part1@1.1.1.bin b/assets/updates/bsom-system-part1@1.1.1.bin deleted file mode 100755 index 1e7cb7887..000000000 Binary files a/assets/updates/bsom-system-part1@1.1.1.bin and /dev/null differ diff --git a/assets/updates/bsom-system-part1@1.2.1.bin b/assets/updates/bsom-system-part1@1.2.1.bin new file mode 100755 index 000000000..751069900 Binary files /dev/null and b/assets/updates/bsom-system-part1@1.2.1.bin differ diff --git a/assets/updates/electron-system-part1@1.1.1+debug.bin b/assets/updates/electron-system-part1@1.2.1+debug.bin similarity index 61% rename from assets/updates/electron-system-part1@1.1.1+debug.bin rename to assets/updates/electron-system-part1@1.2.1+debug.bin index 64cea9ddf..71600bfff 100755 Binary files a/assets/updates/electron-system-part1@1.1.1+debug.bin and b/assets/updates/electron-system-part1@1.2.1+debug.bin differ diff --git a/assets/updates/electron-system-part2@1.1.1+debug.bin b/assets/updates/electron-system-part2@1.2.1+debug.bin similarity index 66% rename from assets/updates/electron-system-part2@1.1.1+debug.bin rename to assets/updates/electron-system-part2@1.2.1+debug.bin index 007b364d9..4d602bfdc 100755 Binary files a/assets/updates/electron-system-part2@1.1.1+debug.bin and b/assets/updates/electron-system-part2@1.2.1+debug.bin differ diff --git a/assets/updates/electron-system-part3@1.1.1+debug.bin b/assets/updates/electron-system-part3@1.1.1+debug.bin deleted file mode 100755 index a08188969..000000000 Binary files a/assets/updates/electron-system-part3@1.1.1+debug.bin and /dev/null differ diff --git a/assets/updates/electron-system-part3@1.2.1+debug.bin b/assets/updates/electron-system-part3@1.2.1+debug.bin new file mode 100755 index 000000000..0b2f6468a Binary files /dev/null and b/assets/updates/electron-system-part3@1.2.1+debug.bin differ diff --git a/assets/updates/ota-flag-a5.bin b/assets/updates/ota-flag-a5.bin new file mode 100755 index 000000000..dd6737691 --- /dev/null +++ b/assets/updates/ota-flag-a5.bin @@ -0,0 +1 @@ +¥ \ No newline at end of file diff --git a/assets/updates/p1-bootloader@1.2.1.bin b/assets/updates/p1-bootloader@1.2.1.bin new file mode 100755 index 000000000..df9466a57 Binary files /dev/null and b/assets/updates/p1-bootloader@1.2.1.bin differ diff --git a/assets/updates/system-part1-1.1.1-p1-no-boot-dep.bin b/assets/updates/p1-system-part1@1.2.1.bin similarity index 87% rename from assets/updates/system-part1-1.1.1-p1-no-boot-dep.bin rename to assets/updates/p1-system-part1@1.2.1.bin index e73301b77..b31c81d1f 100755 Binary files a/assets/updates/system-part1-1.1.1-p1-no-boot-dep.bin and b/assets/updates/p1-system-part1@1.2.1.bin differ diff --git a/assets/updates/p1-system-part2@1.2.1.bin b/assets/updates/p1-system-part2@1.2.1.bin new file mode 100755 index 000000000..22e19b2f0 Binary files /dev/null and b/assets/updates/p1-system-part2@1.2.1.bin differ diff --git a/assets/updates/photon-bootloader@1.2.1.bin b/assets/updates/photon-bootloader@1.2.1.bin new file mode 100755 index 000000000..380a3c8f9 Binary files /dev/null and b/assets/updates/photon-bootloader@1.2.1.bin differ diff --git a/assets/updates/system-part1-1.1.1-photon-no-boot-dep.bin b/assets/updates/photon-system-part1@1.2.1.bin similarity index 87% rename from assets/updates/system-part1-1.1.1-photon-no-boot-dep.bin rename to assets/updates/photon-system-part1@1.2.1.bin index b7ff9a692..0bfd136c1 100755 Binary files a/assets/updates/system-part1-1.1.1-photon-no-boot-dep.bin and b/assets/updates/photon-system-part1@1.2.1.bin differ diff --git a/assets/updates/photon-system-part2@1.2.1.bin b/assets/updates/photon-system-part2@1.2.1.bin new file mode 100755 index 000000000..ba048f49d Binary files /dev/null and b/assets/updates/photon-system-part2@1.2.1.bin differ diff --git a/assets/updates/system-part2-1.1.1-p1-no-boot-dep.bin b/assets/updates/system-part2-1.1.1-p1-no-boot-dep.bin deleted file mode 100755 index 7b720e877..000000000 Binary files a/assets/updates/system-part2-1.1.1-p1-no-boot-dep.bin and /dev/null differ diff --git a/assets/updates/system-part2-1.1.1-photon-no-boot-dep.bin b/assets/updates/system-part2-1.1.1-photon-no-boot-dep.bin deleted file mode 100755 index 42c5a301a..000000000 Binary files a/assets/updates/system-part2-1.1.1-photon-no-boot-dep.bin and /dev/null differ diff --git a/assets/updates/xenon-bootloader@1.2.1.bin b/assets/updates/xenon-bootloader@1.2.1.bin new file mode 100755 index 000000000..512155866 Binary files /dev/null and b/assets/updates/xenon-bootloader@1.2.1.bin differ diff --git a/assets/updates/xenon-system-part1@1.1.1.bin b/assets/updates/xenon-system-part1@1.1.1.bin deleted file mode 100755 index 85b460180..000000000 Binary files a/assets/updates/xenon-system-part1@1.1.1.bin and /dev/null differ diff --git a/assets/updates/xenon-system-part1@1.2.1.bin b/assets/updates/xenon-system-part1@1.2.1.bin new file mode 100755 index 000000000..3cfbd7e99 Binary files /dev/null and b/assets/updates/xenon-system-part1@1.2.1.bin differ diff --git a/assets/updates/xsom-bootloader@1.2.1.bin b/assets/updates/xsom-bootloader@1.2.1.bin new file mode 100755 index 000000000..4632b20df Binary files /dev/null and b/assets/updates/xsom-bootloader@1.2.1.bin differ diff --git a/assets/updates/xsom-system-part1@1.1.1.bin b/assets/updates/xsom-system-part1@1.1.1.bin deleted file mode 100755 index 7200fe924..000000000 Binary files a/assets/updates/xsom-system-part1@1.1.1.bin and /dev/null differ diff --git a/assets/updates/xsom-system-part1@1.2.1.bin b/assets/updates/xsom-system-part1@1.2.1.bin new file mode 100755 index 000000000..a2f9b6a13 Binary files /dev/null and b/assets/updates/xsom-system-part1@1.2.1.bin differ diff --git a/settings.js b/settings.js index 469b12d52..b75a41ae2 100644 --- a/settings.js +++ b/settings.js @@ -86,38 +86,55 @@ var settings = { }, updates: { '2b04:d006': { - systemFirmwareOne: 'system-part1-1.1.1-photon-no-boot-dep.bin', - systemFirmwareTwo: 'system-part2-1.1.1-photon-no-boot-dep.bin', - userFirmware: 'ascender-1.1.1-photon.bin' + systemFirmwareOne: 'photon-system-part1@1.2.1.bin', + systemFirmwareTwo: 'photon-system-part2@1.2.1.bin', + otaRegion: 'photon-bootloader@1.2.1.bin', + otaFlag: 'ota-flag-a5.bin' }, '2b04:d008': { - systemFirmwareOne: 'system-part1-1.1.1-p1-no-boot-dep.bin', - systemFirmwareTwo: 'system-part2-1.1.1-p1-no-boot-dep.bin', - userFirmware: 'ascender-1.1.1-p1.bin' + systemFirmwareOne: 'p1-system-part1@1.2.1.bin', + systemFirmwareTwo: 'p1-system-part2@1.2.1.bin', + otaRegion: 'p1-bootloader@1.2.1.bin', + otaFlag: 'ota-flag-a5.bin' }, '2b04:d00a': { // The bin files MUST be in this order to be flashed to the correct memory locations - systemFirmwareOne: 'electron-system-part2@1.1.1+debug.bin', - systemFirmwareTwo: 'electron-system-part3@1.1.1+debug.bin', - systemFirmwareThree: 'electron-system-part1@1.1.1+debug.bin' + systemFirmwareOne: 'electron-system-part2@1.2.1+debug.bin', + systemFirmwareTwo: 'electron-system-part3@1.2.1+debug.bin', + systemFirmwareThree: 'electron-system-part1@1.2.1+debug.bin' + // For now, electron still contains the bootloader in system firmware + // otaRegion: 'electron-bootloader@1.2.1.bin', + // otaFlag: 'ota-flag-a5.bin' }, '2b04:d00c': { - systemFirmwareOne: 'argon-system-part1@1.1.1.bin' + systemFirmwareOne: 'argon-system-part1@1.2.1.bin', + otaRegion: 'argon-bootloader@1.2.1.bin', + otaFlag: 'ota-flag-a5.bin' }, '2b04:d00d': { - systemFirmwareOne: 'boron-system-part1@1.1.1.bin' + systemFirmwareOne: 'boron-system-part1@1.2.1.bin', + otaRegion: 'boron-bootloader@1.2.1.bin', + otaFlag: 'ota-flag-a5.bin' }, '2b04:d00e': { - systemFirmwareOne: 'xenon-system-part1@1.1.1.bin' + systemFirmwareOne: 'xenon-system-part1@1.2.1.bin', + otaRegion: 'xenon-bootloader@1.2.1.bin', + otaFlag: 'ota-flag-a5.bin' }, '2b04:d016': { - systemFirmwareOne: 'asom-system-part1@1.1.1.bin' + systemFirmwareOne: 'asom-system-part1@1.2.1.bin', + otaRegion: 'asom-bootloader@1.2.1.bin', + otaFlag: 'ota-flag-a5.bin' }, '2b04:d017': { - systemFirmwareOne: 'bsom-system-part1@1.1.1.bin' + systemFirmwareOne: 'bsom-system-part1@1.2.1.bin', + otaRegion: 'bsom-bootloader@1.2.1.bin', + otaFlag: 'ota-flag-a5.bin' }, '2b04:d018': { - systemFirmwareOne: 'xsom-system-part1@1.1.1.bin' + systemFirmwareOne: 'xsom-system-part1@1.2.1.bin', + otaRegion: 'xsom-bootloader@1.2.1.bin', + otaFlag: 'ota-flag-a5.bin' }, }, }; diff --git a/src/cmd/update.js b/src/cmd/update.js index 13c777210..7829029a4 100644 --- a/src/cmd/update.js +++ b/src/cmd/update.js @@ -5,8 +5,6 @@ const dfu = require('../lib/dfu'); const when = require('when'); const whenNode = require('when/node'); const Spinner = require('cli-spinner').Spinner; -const deviceSpecs = require('../lib/deviceSpecs'); -const utilities = require('../lib/utilities'); Spinner.setDefaultSpinnerString(Spinner.spinners[7]); const spin = new Spinner('Updating system firmware on the device...'); @@ -33,34 +31,6 @@ function doUpdate(id) { ); } const parts = Object.keys(updates); - const specs = deviceSpecs[id]; - /** - * Some firmwares also require updating the system bootloader. - */ - if (specs.requiresBootloaderAscenderApp) { - const filename = 'user_firmware_backup.bin'; - - steps.push((next) => { - utilities.tryDelete(filename); - - // save the current user firmware - whenNode.bindCallback( - dfu.read(filename, 'userFirmware', false) - , next); - }); - - steps.push((next) => { - whenNode.bindCallback( - dfu.write(filename, 'otaRegion', false) - , next); - }); - - steps.push((next) => { - whenNode.bindCallback( - utilities.tryDelete(filename) - , next); - }); - } parts.forEach((part, partNumber) => { steps.push((next) => { @@ -74,7 +44,7 @@ function doUpdate(id) { console.log(); console.log(chalk.cyan('>'), 'Your device is ready for a system update.'); - console.log(chalk.cyan('>'), 'This process should take about ' + (specs.requiresBootloaderAscenderApp?50:30) + ' seconds. Here it goes!'); + console.log(chalk.cyan('>'), 'This process should take about 30 seconds. Here it goes!'); console.log(); if (global.verboseLevel > 0) { diff --git a/src/lib/deviceSpecs/specifications.js b/src/lib/deviceSpecs/specifications.js index abc4c5f98..eb0aeac75 100644 --- a/src/lib/deviceSpecs/specifications.js +++ b/src/lib/deviceSpecs/specifications.js @@ -57,7 +57,6 @@ const specs = { }, '2b04:d006': { productName: 'Photon', - requiresBootloaderAscenderApp: true, tcpServerKey: { address: '2082', size: 512, @@ -99,10 +98,6 @@ const specs = { alt: '0', size: 128*1024 }, - otaRegion: { - address: '0x080C0000', - alt: '0' - }, systemFirmwareOne: { address: '0x08020000', alt: '0' @@ -111,6 +106,15 @@ const specs = { address: '0x08060000', alt: '0' }, + otaRegion: { + address: '0x080C0000', + alt: '0' + }, + otaFlag: { + address: '1753', + alt: '1', + size: '1' + }, knownApps: { 'tinker': 'tinker-0.4.5-photon.bin', 'doctor': 'photon_doctor.bin', @@ -133,7 +137,6 @@ const specs = { }, '2b04:d008': { productName: 'P1', - requiresBootloaderAscenderApp: true, tcpServerKey: { address: '2082', size: 512, @@ -164,10 +167,6 @@ const specs = { alt: '1', alg: 'ec' }, - otaRegion: { - address: '0x080C0000', - alt: '0' - }, factoryReset: { address: '0x080E0000', alt: '0' @@ -185,6 +184,15 @@ const specs = { address: '0x08060000', alt: '0' }, + otaRegion: { + address: '0x080C0000', + alt: '0' + }, + otaFlag: { + address: '1753', + alt: '1', + size: '1' + }, knownApps: { 'tinker': 'tinker-0.4.5-p1.bin', 'doctor': 'p1_doctor.bin', @@ -254,6 +262,15 @@ const specs = { address: '0x08060000', alt: '0' }, + otaRegion: { + address: '0x080C0000', + alt: '0' + }, + otaFlag: { + address: '1753', + alt: '1', + size: '1' + }, userFirmware: { address: '0x08080000', alt: '0' @@ -372,6 +389,15 @@ const specs = { address: '0x00030000', alt: '0' }, + otaRegion: { + address: '0x80289000', + alt: '2' + }, + otaFlag: { + address: '1753', + alt: '1', + size: '1' + }, knownApps: { 'tinker': 'tinker-0.8.0-rc.27-argon.bin' }, @@ -426,6 +452,15 @@ const specs = { address: '0x00030000', alt: '0' }, + otaRegion: { + address: '0x80289000', + alt: '2' + }, + otaFlag: { + address: '1753', + alt: '1', + size: '1' + }, knownApps: { }, serial: { @@ -479,6 +514,15 @@ const specs = { address: '0x00030000', alt: '0' }, + otaRegion: { + address: '0x80289000', + alt: '2' + }, + otaFlag: { + address: '1753', + alt: '1', + size: '1' + }, knownApps: { 'tinker': 'tinker-0.8.0-rc.27-boron.bin' }, @@ -533,6 +577,15 @@ const specs = { address: '0x00030000', alt: '0' }, + otaRegion: { + address: '0x80289000', + alt: '2' + }, + otaFlag: { + address: '1753', + alt: '1', + size: '1' + }, knownApps: { }, serial: { @@ -586,6 +639,15 @@ const specs = { address: '0x00030000', alt: '0' }, + otaRegion: { + address: '0x80289000', + alt: '2' + }, + otaFlag: { + address: '1753', + alt: '1', + size: '1' + }, knownApps: { 'tinker': 'tinker-0.8.0-rc.27-xenon.bin' }, @@ -641,6 +703,15 @@ const specs = { address: '0x00030000', alt: '0' }, + otaRegion: { + address: '0x80289000', + alt: '2' + }, + otaFlag: { + address: '1753', + alt: '1', + size: '1' + }, knownApps: { }, serial: {