@@ -58,9 +58,19 @@ bool MBEDH7FlashFormatter::checkPartition()
58
58
59
59
bool MBEDH7FlashFormatter::formatPartition () {
60
60
_root->erase (0x0 , _root->get_erase_size ());
61
+ /* Default partitioning of OPTA boards includes a 4th partition for PLC ide runtime
62
+ * This partition is not used in the context of ArduinoCloud and is not needed,
63
+ * but we try to preserve the default partitioning for compatibility.
64
+ */
65
+ #if defined(ARDUINO_OPTA)
66
+ mbed::MBRBlockDevice::partition (_root, 1 , 0x0B , 0 , 1024 * 1024 );
67
+ mbed::MBRBlockDevice::partition (_root, 2 , 0x0B , 1024 * 1024 , 6 * 1024 * 1024 );
68
+ mbed::MBRBlockDevice::partition (_root, 3 , 0x0B , 6 * 1024 * 1024 , 7 * 1024 * 1024 );
69
+ #else
61
70
mbed::MBRBlockDevice::partition (_root, 1 , 0x0B , 0 , 1024 * 1024 );
62
71
mbed::MBRBlockDevice::partition (_root, 2 , 0x0B , 1024 * 1024 , 13 * 1024 * 1024 );
63
72
mbed::MBRBlockDevice::partition (_root, 3 , 0x0B , 13 * 1024 * 1024 , 14 * 1024 * 1024 );
73
+ #endif
64
74
65
75
if (_ota_data_fs.mount (&_ota_data) != 0 ) {
66
76
if (_ota_data_fs.reformat (&_ota_data) != 0 ) {
0 commit comments