Skip to content

Commit 00c1d01

Browse files
committed
Fix default partitioning for OPTA boards
1 parent 2e2facc commit 00c1d01

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/flashFormatter/H7FlashFormatter.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,19 @@ bool MBEDH7FlashFormatter::checkPartition()
5858

5959
bool MBEDH7FlashFormatter::formatPartition() {
6060
_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
6170
mbed::MBRBlockDevice::partition(_root, 1, 0x0B, 0, 1024 * 1024);
6271
mbed::MBRBlockDevice::partition(_root, 2, 0x0B, 1024 * 1024, 13 * 1024 * 1024);
6372
mbed::MBRBlockDevice::partition(_root, 3, 0x0B, 13 * 1024 * 1024, 14 * 1024 * 1024);
73+
#endif
6474

6575
if(_ota_data_fs.mount(&_ota_data) != 0) {
6676
if(_ota_data_fs.reformat(&_ota_data) != 0) {

0 commit comments

Comments
 (0)