hello-nrfcloud / backend

Cloud backend for hello.nrfcloud.com developed using AWS CDK in TypeScript
https://github.com/hello-nrfcloud/backend#readme
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

[FOTA] implement incremental modem firmware updates #901

Open coderbyheart opened 4 weeks ago

coderbyheart commented 4 weeks ago

Allow the user to request a modem firmware update using incremental (delta) updates.

Depending on the current version, the latest version may be reached by

  1. issuing a single delta upgrade (e.g. 2.0.1 -> 2.0.2)
  2. issuing a single full modem upgrade (e.g. 2.0.0 -> 2.1.0)
  3. issuing a combination of those (e.g. 2.0.0 -> 2.1.0 + 2.1.0 -> 2.1.1)

We can implement this either with a static map (e.g. use a full update if five or more delta's can be skipped), or with a static map:

flowchart LR
    1_3_0["1.3.0"] --delta--> 1_3_1
    1_3_0 --full--> 1_3_6
    1_3_1["1.3.1"] --delta--> 1_3_2
    1_3_1 --full--> 1_3_6
    1_3_2["1.3.2"] --delta--> 1_3_3
    1_3_3["1.3.3"] --delta--> 1_3_4
    1_3_4["1.3.4"] --delta--> 1_3_5
    1_3_5["1.3.5"] --delta--> 1_3_6
    1_3_6["1.3.6"]
    2_0_0["2.0.0"] --delta--> 2_0_1
    2_0_1["2.0.1"]
coderbyheart commented 3 weeks ago

Right now we cannot assume that there is always a direct delta upgrade from one firmware to another, because for the 9160 there are only delta files that increment the minor version:

[
  {
    "bundleId": "MODEM*2e724a42*mfw_nrf9160_1.3.4",
    "lastModified": "2023-02-16T23:53:33.000Z",
    "size": 221396,
    "version": "mfw_nrf9160_1.3.4",
    "type": "MODEM",
    "filenames": [
      "mfw_nrf9160_update_from_1.3.3_to_1.3.4.bin"
    ],
    "name": "MFW delta: 1.3.3 to 1.3.4",
    "description": "This updates the device from version 1.3.3 to version 1.3.4."
  },
  {
    "bundleId": "MODEM*5c029d47*mfw_nrf9160_1.3.5",
    "lastModified": "2023-06-14T20:03:35.000Z",
    "size": 228032,
    "version": "mfw_nrf9160_1.3.5",
    "type": "MODEM",
    "filenames": [
      "mfw_nrf9160_update_from_1.3.4_to_1.3.5.bin"
    ],
    "name": "MFW delta: 1.3.4 to 1.3.5",
    "description": "This updates your modem firmware from v1.3.4 to v1.3.5. See https://tinyurl.com/nRF9160-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  },
  {
    "bundleId": "MODEM*87407457*mfw_nrf9160_1.3.3",
    "lastModified": "2022-11-30T01:14:27.000Z",
    "size": 240460,
    "version": "mfw_nrf9160_1.3.3",
    "type": "MODEM",
    "filenames": [
      "mfw_nrf9160_update_from_1.3.1_to_1.3.3.bin"
    ],
    "name": "MFW delta: 1.3.1 to 1.3.3",
    "description": "This updates the device from version 1.3.1 to version 1.3.3."
  },
  {
    "bundleId": "MODEM*9b21ec6d*mfw_nrf9160_1.3.4",
    "lastModified": "2023-02-16T23:47:10.000Z",
    "size": 227616,
    "version": "mfw_nrf9160_1.3.4",
    "type": "MODEM",
    "filenames": [
      "mfw_nrf9160_update_from_1.3.2_to_1.3.4.bin"
    ],
    "name": "MFW delta: 1.3.2 to 1.3.4",
    "description": "This updates the device from version 1.3.2 to version 1.3.4."
  },
  {
    "bundleId": "MODEM*abdc6961*mfw_nrf9160_1.3.3",
    "lastModified": "2022-11-29T23:09:05.000Z",
    "size": 82120,
    "version": "mfw_nrf9160_1.3.3",
    "type": "MODEM",
    "filenames": [
      "mfw_nrf9160_update_from_1.3.2_to_1.3.3.bin"
    ],
    "name": "MFW delta: 1.3.2 to 1.3.3",
    "description": "This updates version 1.3.2 to version 1.3.3."
  },
  {
    "bundleId": "MODEM*be0ef0bd*mfw_nrf9160_1.3.1",
    "lastModified": "2021-10-29T01:09:38.000Z",
    "size": 220948,
    "version": "mfw_nrf9160_1.3.1",
    "type": "MODEM",
    "filenames": [
      "mfw_nrf9160_update_from_1.3.0_to_1.3.1.bin"
    ],
    "name": "MFW delta: 1.3.0 to 1.3.1",
    "description": "This updates your modem firmware from v1.3.0 to v1.3.1. See https://tinyurl.com/nRF9160-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  },
  {
    "bundleId": "MODEM*d293df71*mfw_nrf9160_1.3.6",
    "lastModified": "2023-12-21T20:26:22.000Z",
    "size": 213896,
    "version": "mfw_nrf9160_1.3.6",
    "type": "MODEM",
    "filenames": [
      "mfw_nrf9160_update_from_1.3.5_to_1.3.6.bin"
    ],
    "name": "MFW delta: 1.3.5 to 1.3.6",
    "description": "This updates your modem firmware from v1.3.4 to v1.3.5. See https://tinyurl.com/nRF9160-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  },
  {
    "bundleId": "MODEM*eb9b40e8*mfw_nrf9160_1.3.2",
    "lastModified": "2022-05-25T00:51:46.000Z",
    "size": 233292,
    "version": "mfw_nrf9160_1.3.2",
    "type": "MODEM",
    "filenames": [
      "mfw_nrf9160_update_from_1.3.1_to_1.3.2.bin"
    ],
    "name": "MFW delta: 1.3.1 to 1.3.2",
    "description": "This updates your modem firmware from v1.3.1 to v1.3.2. See https://tinyurl.com/nRF9160-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  }
]
coderbyheart commented 3 weeks ago

For reference, full updates:

[
  {
    "bundleId": "MDM_FULL*132full1*mfw_nrf9160_full_1.3.2",
    "lastModified": "2022-05-25T00:50:03.000Z",
    "size": 2032053,
    "version": "mfw_nrf9160_full_1.3.2",
    "type": "MDM_FULL",
    "filenames": [
      "",
      "mfw_nrf9160_full_1.3.2.bin"
    ],
    "name": "MFW full: 1.3.2",
    "description": "Complete modem firmware version 1.3.2. See https://tinyurl.com/nRF9160-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  },
  {
    "bundleId": "MDM_FULL*551ba99b*mfw_nrf9160_full_1.3.6",
    "lastModified": "2023-12-27T19:45:22.000Z",
    "size": 2081253,
    "version": "mfw_nrf9160_full_1.3.6",
    "type": "MDM_FULL",
    "filenames": [
      "",
      "mfw_nrf9160_full_1.3.6.bin"
    ],
    "name": "MFW full: 1.3.6",
    "description": "Complete modem firmware version 1.3.6. See https://tinyurl.com/nRF9160-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  },
  {
    "bundleId": "MDM_FULL*6a1daa9f*mfw_nrf9160_full_1.3.3",
    "lastModified": "2022-11-29T23:47:56.000Z",
    "size": 2032053,
    "version": "mfw_nrf9160_full_1.3.3",
    "type": "MDM_FULL",
    "filenames": [
      "",
      "mfw_nrf9160_full_1.3.3.bin"
    ],
    "name": "MFW full: 1.3.3",
    "description": "Complete modem firmware version 1.3.3. See https://tinyurl.com/nRF9160-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  },
  {
    "bundleId": "MDM_FULL*7aa4c80b*mfw_nrf91x1_full_2.0.0",
    "lastModified": "2024-01-03T01:22:40.000Z",
    "size": 2114441,
    "version": "mfw_nrf91x1_full_2.0.0",
    "type": "MDM_FULL",
    "filenames": [
      "mfw_nrf91x1_full_2.0.0.bin"
    ],
    "name": "MFW full: 2.0.0",
    "description": "Complete modem firmware version 2.0.0. See http://tinyurl.com/nRF9161-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  },
  {
    "bundleId": "MDM_FULL*987e4e4c*mfw_nrf9160_full_1.3.4",
    "lastModified": "2023-02-17T18:45:33.000Z",
    "size": 2048453,
    "version": "mfw_nrf9160_full_1.3.4",
    "type": "MDM_FULL",
    "filenames": [
      "mfw_nrf9160_full_1.3.4.bin"
    ],
    "name": "MFW full: 1.3.4",
    "description": "Complete modem firmware version 1.3.4. See https://tinyurl.com/nRF9160-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  },
  {
    "bundleId": "MDM_FULL*bdd24c80*mfw_nrf91x1_full_2.0.1",
    "lastModified": "2024-03-22T22:28:34.000Z",
    "size": 2114729,
    "version": "mfw_nrf91x1_full_2.0.1",
    "type": "MDM_FULL",
    "filenames": [
      "mfw_nrf91x1_full_2.0.1.bin"
    ],
    "name": "MFW full: 2.0.1",
    "description": "Complete modem firmware version 2.0.1. See https://tinyurl.com/nRF9161-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  },
  {
    "bundleId": "MDM_FULL*eec0f453*mfw_nrf9160_full_1.3.5",
    "lastModified": "2023-06-14T20:03:35.000Z",
    "size": 2064853,
    "version": "mfw_nrf9160_full_1.3.5",
    "type": "MDM_FULL",
    "filenames": [
      "mfw_nrf9160_full_1.3.5.bin"
    ],
    "name": "MFW full: 1.3.5",
    "description": "Complete modem firmware version 1.3.5. See https://tinyurl.com/nRF9160-modem-fw for the change log and other important info in the description. There you can also download the full release package that contains complete release notes, test libraries, etc."
  }
]