Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 67ae452

Browse files
authored
v1.7.2 to use auto LittleFS size
### Releases v1.7.2 1. Back to using auto LittleFS size to fix bug and to permit 8 LittleFS files instead of 4 in previous release. There is a bug somewhere in the [`ArduinoCore-mbed mbed_portenta core`](https://github.com/arduino/ArduinoCore-mbed) and we have to live with it.
1 parent 1c95a08 commit 67ae452

File tree

8 files changed

+106
-117
lines changed

8 files changed

+106
-117
lines changed

README.md

Lines changed: 86 additions & 84 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.7.2](#releases-v172)
1516
* [Releases v1.7.1](#releases-v171)
1617
* [Major Releases v1.7.0](#major-releases-v170)
1718
* [Major Releases v1.6.0](#major-releases-v160)
@@ -27,6 +28,10 @@
2728

2829
## Changelog
2930

31+
### Releases v1.7.2
32+
33+
1. Back to using auto LittleFS size to fix bug and to permit 8 LittleFS files instead of 4 in previous release. There is a bug somewhere in the [`ArduinoCore-mbed mbed_portenta core`](https://github.com/arduino/ArduinoCore-mbed) and we have to live with it.
34+
3035
### Releases v1.7.1
3136

3237
1. Change the default and minimum LITTLEFS_PORTENTA_H7_SIZE_KB to 1024KB, instead at maximum available size. This is done to avoid the cases where the code size is larger, and LittleFS size has to be changed, reformatted, leading to data loss.

examples/minimal/minimal.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
Built by Khoi Hoang https://github.com/khoih-prog/MultiResetDetector_Generic
1414
Licensed under MIT license
15-
Version: 1.7.1
15+
Version: 1.7.2
1616
1717
Version Modified By Date Comments
1818
------- ----------- ---------- -----------
@@ -25,6 +25,7 @@
2525
1.6.0 K Hoang 29/08/2021 Add support to MBED Nano_33_BLE, Nano_33_BLE_Sense, etc. using LittleFS
2626
1.7.0 K Hoang 10/09/2021 Add support to MBED Portenta_H7 using LittleFS
2727
1.7.1 K Hoang 13/09/2021 Select fix LittleFS size of 1024KB
28+
1.7.2 K Hoang 14/09/2021 Back to using auto LittleFS to fix bug
2829
*****************************************************************************************************************************/
2930
/****************************************************************************************************************************
3031
This example will open a configuration portal when the reset button is pressed twice.

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "MultiResetDetector_Generic",
3-
"version": "1.7.1",
3+
"version": "1.7.2",
44
"keywords": "device, control, flashstorage-samd, flashstorage-stm32, nano-rp2040-connect, nano-33-ble, samd, stm32, nRF52, portenta-h7, rp2040, multi-reset, flashstorage, mbed-portenta, portenta-h7, portentah7, dueflashstorage, littlefs, spiffs, mbed-portenta, teensy, sam-due, mbed, rpi-pico, raspberry-pico, flashstorage-rtl8720, eeprom, reset, detector, data",
55
"description": "Library to detect a multi reset, using EEPROM, DueFlashStorage, FlashStorage_SAMD, FlashStorage_RTL8720, FlashStorage_STM32 or LittleFS/InternalFS. For AVR, Teensy, SAM DUE, SAMD, STM32F/L/H/G/WB/MP1, nRF52, RP2040-based Nano_RP2040_Connect, RASPBERRY_PI_PICO, RTL8720DN, MBED nRF52840-based Nano_33_BLE, Portenta_H7, etc. boards. Now using efficient FlashStorage_STM32 library and supporting new RP2040-based Nano_RP2040_Connect, RASPBERRY_PI_PICO and STM32 core v2.0.0",
66
"authors":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=MultiResetDetector_Generic
2-
version=1.7.1
2+
version=1.7.2
33
author=Khoi Hoang
44
maintainer=Khoi Hoang <khoih.prog@gmail.com>
55
license=MIT

platformio/platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ upload_speed = 921600
3838
lib_deps =
3939
; PlatformIO 4.x
4040
; FlashStorage_STM32@>=1.1.0
41-
; FlashStorage_SAMD@>=1.1.0
41+
; FlashStorage_SAMD@>=1.2.0
4242
; FlashStorage_RTL8720@>=1.0.0
4343
; PlatformIO 5.x
4444
; khoih.prog/FlashStorage_STM32@>=1.1.0
45-
; khoih.prog/FlashStorage_SAMD@>=1.1.0
45+
; khoih.prog/FlashStorage_SAMD@>=1.2.0
4646
; khoih.prog/FlashStorage_RTL8720@>=1.0.0
4747

4848
build_flags =

src/MultiResetDetector_Generic.h

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Built by Khoi Hoang https://github.com/khoih-prog/MultiResetDetector_Generic
1414
Licensed under MIT license
1515
16-
Version: 1.7.1
16+
Version: 1.7.2
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
@@ -26,14 +26,15 @@
2626
1.6.0 K Hoang 29/08/2021 Add support to MBED Nano_33_BLE, Nano_33_BLE_Sense, etc. using LittleFS
2727
1.7.0 K Hoang 10/09/2021 Add support to MBED Portenta_H7 using LittleFS
2828
1.7.1 K Hoang 13/09/2021 Select fix LittleFS size of 1024KB
29+
1.7.2 K Hoang 14/09/2021 Back to using auto LittleFS to fix bug
2930
************************************************************************************************************************************/
3031

3132
#pragma once
3233

3334
#ifndef MultiResetDetector_Generic_H
3435
#define MultiResetDetector_Generic_H
3536

36-
#define MULTIRESETDETECTOR_GENERIC_VERSION "MultiResetDetector_Generic v1.7.1"
37+
#define MULTIRESETDETECTOR_GENERIC_VERSION "MultiResetDetector_Generic v1.7.2"
3738

3839
#if ( defined(ESP32) || defined(ESP8266) )
3940
#error Please use ESP_MultiResetDetector library (https://github.com/khoih-prog/ESP_MultiResetDetector) for ESP8266 and ESP32!
@@ -377,15 +378,6 @@
377378
#include "BlockDevice.h"
378379

379380
#include "mbed_portenta/FlashIAPLimits.h"
380-
381-
#if !defined(LITTLEFS_PORTENTA_H7_SIZE_KB)
382-
#define LITTLEFS_PORTENTA_H7_SIZE_KB 1024
383-
#warning Force LITTLEFS_PORTENTA_H7_SIZE_KB to 1024 (KB)
384-
#elif (LITTLEFS_PORTENTA_H7_SIZE_KB < 1024)
385-
#undef LITTLEFS_PORTENTA_H7_SIZE_KB
386-
#define LITTLEFS_PORTENTA_H7_SIZE_KB 1024
387-
#warning Correct LITTLEFS_PORTENTA_H7_SIZE_KB to 1024 (KB)
388-
#endif
389381

390382
#if !defined(FORCE_REFORMAT)
391383
#define FORCE_REFORMAT false
@@ -641,24 +633,12 @@ class MultiResetDetector_Generic
641633
// Get limits of the the internal flash of the microcontroller
642634
_flashIAPLimits = getFlashIAPLimits();
643635

644-
if (_flashIAPLimits.available_size < LITTLEFS_PORTENTA_H7_SIZE_KB * 1024)
645-
{
646-
#if (MRD_GENERIC_DEBUG)
647-
Serial.print("Too small Max LittleFS size (KB) = "); Serial.println(_flashIAPLimits.available_size / 1024.0);
648-
#endif
649-
return;
650-
}
651-
652-
uint32_t deltaSize = _flashIAPLimits.available_size - LITTLEFS_PORTENTA_H7_SIZE_KB * 1024;
653-
654636
Serial.print("Flash Size: (KB) = "); Serial.println(_flashIAPLimits.flash_size / 1024.0);
655-
Serial.print("FlashIAP Start Address: 0x"); Serial.println(_flashIAPLimits.start_address, HEX);
656-
Serial.print("New FlashIAP Start Address: 0x"); Serial.println(_flashIAPLimits.start_address + deltaSize, HEX);
657-
Serial.print("Max FlashIAP Size (KB): "); Serial.println(_flashIAPLimits.available_size / 1024.0);
658-
Serial.print("Current FlashIAP Size(KB): "); Serial.println(LITTLEFS_PORTENTA_H7_SIZE_KB);
659-
660-
blockDevicePtr = new FlashIAPBlockDevice(_flashIAPLimits.start_address + deltaSize, LITTLEFS_PORTENTA_H7_SIZE_KB * 1024);
637+
Serial.print("FlashIAP Start Address: = 0x"); Serial.println(_flashIAPLimits.start_address, HEX);
638+
Serial.print("LittleFS size (KB) = "); Serial.println(_flashIAPLimits.available_size / 1024.0);
661639

640+
blockDevicePtr = new FlashIAPBlockDevice(_flashIAPLimits.start_address, _flashIAPLimits.available_size);
641+
662642
if (!blockDevicePtr)
663643
{
664644
#if (MRD_GENERIC_DEBUG)

src/mbed_portenta/FlashIAPLimits.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Built by Khoi Hoang https://github.com/khoih-prog/MultiResetDetector_Generic
1515
Licensed under MIT license
1616
17-
Version: 1.7.1
17+
Version: 1.7.2
1818
1919
Version Modified By Date Comments
2020
------- ----------- ---------- -----------
@@ -27,6 +27,7 @@
2727
1.6.0 K Hoang 29/08/2021 Add support to MBED Nano_33_BLE, Nano_33_BLE_Sense, etc. using LittleFS
2828
1.7.0 K Hoang 10/09/2021 Add support to MBED Portenta_H7 using LittleFS
2929
1.7.1 K Hoang 13/09/2021 Select fix LittleFS size of 1024KB
30+
1.7.2 K Hoang 14/09/2021 Back to using auto LittleFS to fix bug
3031
*****************************************************************************************************************************/
3132

3233
#pragma once

0 commit comments

Comments
 (0)