SiliconLabs / simplicity_sdk

The Simplicity Software Development Kit (SDK) is an embedded software development platform for building IoT products based on our Series 2 and upcoming Series 3 wireless and MCU devices.
https://www.silabs.com/
Other
25 stars 5 forks source link

AppLoader exception when no actual application is present #9

Open LeZerb opened 3 months ago

LeZerb commented 3 months ago

When reading OTA service Application Version with no application currently flashed AppLoader gets stuck.

This is caused by trying to read from an invalid address in bootload_checkApplicationPropertiesMagic and can be resolved by checking that the appProperties pointer is inside the actual flash area.

#if (FLASH_BASE > 0x0UL)
  if ((uint32_t)appProperties < FLASH_BASE) {
    return false;
  }
#endif

+  if ((uint32_t)appProperties > (FLASH_BASE + FLASH_SIZE - 16)) {
+    return false;
+  }