diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f2f36c6e..74d9f68d4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,6 +22,7 @@ repos: .*_pb2.py| .*.pb-c.h| .*.pb-c.c| + .*.patch| .*.yuv )$ - id: end-of-file-fixer diff --git a/examples/at_override_module_config/patch/support_ext_partition.patch b/examples/at_override_module_config/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/examples/at_override_module_config/patch/support_ext_partition.patch +++ b/examples/at_override_module_config/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32-d2wd/patch/fatfs_generation.patch b/module_config/module_esp32-d2wd/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_esp32-d2wd/patch/fatfs_generation.patch +++ b/module_config/module_esp32-d2wd/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32-d2wd/patch/modify_bluedroid_conn_timeout.patch b/module_config/module_esp32-d2wd/patch/modify_bluedroid_conn_timeout.patch index 284afee68..61c822730 100644 --- a/module_config/module_esp32-d2wd/patch/modify_bluedroid_conn_timeout.patch +++ b/module_config/module_esp32-d2wd/patch/modify_bluedroid_conn_timeout.patch @@ -1,12 +1,3 @@ -From 7485572ef7e5b076d90d29f9335dcb726ef3714f Mon Sep 17 00:00:00 2001 -From: xiewenxiang -Date: Fri, 29 Mar 2024 10:41:25 +0800 -Subject: [PATCH] modify bluedroid conn timeout - ---- - components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c index 4e6c8534ec..fa7a877491 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c @@ -27,13 +18,11 @@ index 4e6c8534ec..fa7a877491 100644 uint32_t current_time = (esp_system_get_time()/1000); - link_timeout = (L2CAP_BLE_LINK_CONNECT_TOUT*1000 - (current_time - p_lcb->start_time_s))/1000; + link_timeout = (bluedroid_conn_wait_time*1000 - (current_time - p_lcb->start_time_s))/1000; - + - if(link_timeout == 0 || link_timeout > L2CAP_BLE_LINK_CONNECT_TOUT) { - link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; + if(link_timeout == 0 || link_timeout > bluedroid_conn_wait_time) { + link_timeout = bluedroid_conn_wait_time; } } - --- -2.25.1 + diff --git a/module_config/module_esp32-d2wd/patch/support_ext_partition.patch b/module_config/module_esp32-d2wd/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_esp32-d2wd/patch/support_ext_partition.patch +++ b/module_config/module_esp32-d2wd/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32-sdio/patch/fatfs_generation.patch b/module_config/module_esp32-sdio/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_esp32-sdio/patch/fatfs_generation.patch +++ b/module_config/module_esp32-sdio/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32-sdio/patch/modify_bluedroid_conn_timeout.patch b/module_config/module_esp32-sdio/patch/modify_bluedroid_conn_timeout.patch index 284afee68..61c822730 100644 --- a/module_config/module_esp32-sdio/patch/modify_bluedroid_conn_timeout.patch +++ b/module_config/module_esp32-sdio/patch/modify_bluedroid_conn_timeout.patch @@ -1,12 +1,3 @@ -From 7485572ef7e5b076d90d29f9335dcb726ef3714f Mon Sep 17 00:00:00 2001 -From: xiewenxiang -Date: Fri, 29 Mar 2024 10:41:25 +0800 -Subject: [PATCH] modify bluedroid conn timeout - ---- - components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c index 4e6c8534ec..fa7a877491 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c @@ -27,13 +18,11 @@ index 4e6c8534ec..fa7a877491 100644 uint32_t current_time = (esp_system_get_time()/1000); - link_timeout = (L2CAP_BLE_LINK_CONNECT_TOUT*1000 - (current_time - p_lcb->start_time_s))/1000; + link_timeout = (bluedroid_conn_wait_time*1000 - (current_time - p_lcb->start_time_s))/1000; - + - if(link_timeout == 0 || link_timeout > L2CAP_BLE_LINK_CONNECT_TOUT) { - link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; + if(link_timeout == 0 || link_timeout > bluedroid_conn_wait_time) { + link_timeout = bluedroid_conn_wait_time; } } - --- -2.25.1 + diff --git a/module_config/module_esp32-sdio/patch/support_ext_partition.patch b/module_config/module_esp32-sdio/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_esp32-sdio/patch/support_ext_partition.patch +++ b/module_config/module_esp32-sdio/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32_default/patch/fatfs_generation.patch b/module_config/module_esp32_default/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_esp32_default/patch/fatfs_generation.patch +++ b/module_config/module_esp32_default/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32_default/patch/modify_bluedroid_conn_timeout.patch b/module_config/module_esp32_default/patch/modify_bluedroid_conn_timeout.patch index 284afee68..61c822730 100644 --- a/module_config/module_esp32_default/patch/modify_bluedroid_conn_timeout.patch +++ b/module_config/module_esp32_default/patch/modify_bluedroid_conn_timeout.patch @@ -1,12 +1,3 @@ -From 7485572ef7e5b076d90d29f9335dcb726ef3714f Mon Sep 17 00:00:00 2001 -From: xiewenxiang -Date: Fri, 29 Mar 2024 10:41:25 +0800 -Subject: [PATCH] modify bluedroid conn timeout - ---- - components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c index 4e6c8534ec..fa7a877491 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c @@ -27,13 +18,11 @@ index 4e6c8534ec..fa7a877491 100644 uint32_t current_time = (esp_system_get_time()/1000); - link_timeout = (L2CAP_BLE_LINK_CONNECT_TOUT*1000 - (current_time - p_lcb->start_time_s))/1000; + link_timeout = (bluedroid_conn_wait_time*1000 - (current_time - p_lcb->start_time_s))/1000; - + - if(link_timeout == 0 || link_timeout > L2CAP_BLE_LINK_CONNECT_TOUT) { - link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; + if(link_timeout == 0 || link_timeout > bluedroid_conn_wait_time) { + link_timeout = bluedroid_conn_wait_time; } } - --- -2.25.1 + diff --git a/module_config/module_esp32_default/patch/support_ext_partition.patch b/module_config/module_esp32_default/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_esp32_default/patch/support_ext_partition.patch +++ b/module_config/module_esp32_default/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c2-2mb/patch/fatfs_generation.patch b/module_config/module_esp32c2-2mb/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_esp32c2-2mb/patch/fatfs_generation.patch +++ b/module_config/module_esp32c2-2mb/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32c2-2mb/patch/support_ext_partition.patch b/module_config/module_esp32c2-2mb/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_esp32c2-2mb/patch/support_ext_partition.patch +++ b/module_config/module_esp32c2-2mb/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c2-ble-2mb/patch/fatfs_generation.patch b/module_config/module_esp32c2-ble-2mb/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_esp32c2-ble-2mb/patch/fatfs_generation.patch +++ b/module_config/module_esp32c2-ble-2mb/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32c2-ble-2mb/patch/support_ext_partition.patch b/module_config/module_esp32c2-ble-2mb/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_esp32c2-ble-2mb/patch/support_ext_partition.patch +++ b/module_config/module_esp32c2-ble-2mb/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c2_default/patch/fatfs_generation.patch b/module_config/module_esp32c2_default/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_esp32c2_default/patch/fatfs_generation.patch +++ b/module_config/module_esp32c2_default/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32c2_default/patch/support_ext_partition.patch b/module_config/module_esp32c2_default/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_esp32c2_default/patch/support_ext_partition.patch +++ b/module_config/module_esp32c2_default/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c3-spi/patch/fatfs_generation.patch b/module_config/module_esp32c3-spi/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_esp32c3-spi/patch/fatfs_generation.patch +++ b/module_config/module_esp32c3-spi/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32c3-spi/patch/support_ext_partition.patch b/module_config/module_esp32c3-spi/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_esp32c3-spi/patch/support_ext_partition.patch +++ b/module_config/module_esp32c3-spi/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c3_default/patch/fatfs_generation.patch b/module_config/module_esp32c3_default/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_esp32c3_default/patch/fatfs_generation.patch +++ b/module_config/module_esp32c3_default/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32c3_default/patch/support_ext_partition.patch b/module_config/module_esp32c3_default/patch/support_ext_partition.patch index 903fef7a3..e1f82b93d 100644 --- a/module_config/module_esp32c3_default/patch/support_ext_partition.patch +++ b/module_config/module_esp32c3_default/patch/support_ext_partition.patch @@ -1,5 +1,5 @@ diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake -index d0969ba408..89a0f02cbd 100644 +index d0969ba408..cbd14f2796 100644 --- a/components/partition_table/project_include.cmake +++ b/components/partition_table/project_include.cmake @@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c3_rainmaker/patch/fatfs_generation.patch b/module_config/module_esp32c3_rainmaker/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_esp32c3_rainmaker/patch/fatfs_generation.patch +++ b/module_config/module_esp32c3_rainmaker/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32c3_rainmaker/patch/support_ext_partition.patch b/module_config/module_esp32c3_rainmaker/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_esp32c3_rainmaker/patch/support_ext_partition.patch +++ b/module_config/module_esp32c3_rainmaker/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c6_default/patch/fatfs_generation.patch b/module_config/module_esp32c6_default/patch/fatfs_generation.patch index 221dba02e..2f191ceba 100644 --- a/module_config/module_esp32c6_default/patch/fatfs_generation.patch +++ b/module_config/module_esp32c6_default/patch/fatfs_generation.patch @@ -16,12 +16,12 @@ index d2180c76bd..5acdff196b 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + # the regex pattern defines symbols that are allowed by long file names but not by short file names INVALID_SFN_CHARS_PATTERN = re.compile(r'[.+,;=\[\]]') @@ -206,6 +209,11 @@ def get_args_for_partition_generator(desc: str, wl: bool) -> argparse.Namespace: @@ -33,7 +33,7 @@ index d2180c76bd..5acdff196b 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -215,6 +223,9 @@ def get_args_for_partition_generator(desc: str, wl: bool) -> argparse.Namespace: @@ -44,8 +44,8 @@ index d2180c76bd..5acdff196b 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index 4a685434a0..a26404650c 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -55,7 +55,7 @@ index 4a685434a0..a26404650c 100755 # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 +from typing import Optional - + -from construct import Const, Int32ul, Struct +from construct import Const +from construct import Int32ul @@ -70,14 +70,14 @@ index 4a685434a0..a26404650c 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -53,6 +60,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -97,7 +105,8 @@ class WLFATFS: @@ -95,11 +95,11 @@ index 4a685434a0..a26404650c 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -114,6 +124,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -115,6 +115,6 @@ index 4a685434a0..a26404650c 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.plain_fatfs.generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32c6_default/patch/support_ext_partition.patch b/module_config/module_esp32c6_default/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_esp32c6_default/patch/support_ext_partition.patch +++ b/module_config/module_esp32c6_default/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32s2_default/patch/fatfs_generation.patch b/module_config/module_esp32s2_default/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_esp32s2_default/patch/fatfs_generation.patch +++ b/module_config/module_esp32s2_default/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_esp32s2_default/patch/support_ext_partition.patch b/module_config/module_esp32s2_default/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_esp32s2_default/patch/support_ext_partition.patch +++ b/module_config/module_esp32s2_default/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_wrover-32/patch/fatfs_generation.patch b/module_config/module_wrover-32/patch/fatfs_generation.patch index 97489fc0a..243d4e623 100644 --- a/module_config/module_wrover-32/patch/fatfs_generation.patch +++ b/module_config/module_wrover-32/patch/fatfs_generation.patch @@ -15,12 +15,12 @@ index e7d2e25a7f..ddc68c9225 100644 +from typing import List +from typing import Optional +from typing import Tuple - + -from construct import BitsInteger, BitStruct, Int16ul +from construct import BitsInteger +from construct import BitStruct +from construct import Int16ul - + FAT12_MAX_CLUSTERS: int = 4085 FAT16_MAX_CLUSTERS: int = 65525 @@ -200,6 +203,11 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -32,7 +32,7 @@ index e7d2e25a7f..ddc68c9225 100644 + type=str, + choices=['safe', 'perf'], + help='Wear levelling mode to use. Safe or performance. Only for sector size of 512') - + args = parser.parse_args() if args.fat_type == 0: @@ -207,6 +215,9 @@ def get_args_for_partition_generator(desc: str) -> argparse.Namespace: @@ -43,8 +43,8 @@ index e7d2e25a7f..ddc68c9225 100644 + if args.sector_size != 512: + raise ValueError('Wear levelling mode can be set only for sector size 512') return args - - + + diff --git a/components/fatfs/wl_fatfsgen.py b/components/fatfs/wl_fatfsgen.py index b6c5dd4fe7..8881938f03 100755 --- a/components/fatfs/wl_fatfsgen.py @@ -56,7 +56,7 @@ index b6c5dd4fe7..8881938f03 100755 # SPDX-License-Identifier: Apache-2.0 +from typing import List +from typing import Optional - + -from typing import List, Optional - -from construct import Const, Int32ul, Struct @@ -73,14 +73,14 @@ index b6c5dd4fe7..8881938f03 100755 +from fatfs_utils.utils import get_args_for_partition_generator +from fatfs_utils.utils import UINT32_MAX from fatfsgen import FATFS - - + + @@ -55,6 +61,7 @@ class WLFATFS: WL_STATE_HEADER_SIZE = 64 WL_STATE_COPY_COUNT = 2 # always 2 copies for power failure safety WL_SECTOR_SIZE = 0x1000 + WL_SAFE_MODE_DUMP_SECTORS = 2 - + WL_STATE_T_DATA = Struct( 'pos' / Int32ul, @@ -99,7 +106,8 @@ class WLFATFS: @@ -98,11 +98,11 @@ index b6c5dd4fe7..8881938f03 100755 self.total_sectors = self.partition_size // FATDefaults.WL_SECTOR_SIZE self.wl_state_size = WLFATFS.WL_STATE_HEADER_SIZE + WLFATFS.WL_STATE_RECORD_SIZE * self.total_sectors + self.wl_mode = wl_mode - + # determine the number of required sectors (roundup to sector size) self.wl_state_sectors = (self.wl_state_size + FATDefaults.WL_SECTOR_SIZE - 1) // FATDefaults.WL_SECTOR_SIZE @@ -116,6 +125,9 @@ class WLFATFS: - + wl_sectors = (WLFATFS.WL_DUMMY_SECTORS_COUNT + WLFATFS.WL_CFG_SECTORS_COUNT + self.wl_state_sectors * WLFATFS.WL_STATE_COPY_COUNT) + if self.wl_mode is not None and self.wl_mode == 'safe': @@ -118,6 +118,6 @@ index b6c5dd4fe7..8881938f03 100755 - use_default_datetime=args.use_default_datetime) + use_default_datetime=args.use_default_datetime, + wl_mode=args.wl_mode) - + wl_fatfs.wl_generate(args.input_directory) wl_fatfs.init_wl() diff --git a/module_config/module_wrover-32/patch/modify_bluedroid_conn_timeout.patch b/module_config/module_wrover-32/patch/modify_bluedroid_conn_timeout.patch index f7918bd49..61c822730 100644 --- a/module_config/module_wrover-32/patch/modify_bluedroid_conn_timeout.patch +++ b/module_config/module_wrover-32/patch/modify_bluedroid_conn_timeout.patch @@ -1,12 +1,3 @@ -From 7485572ef7e5b076d90d29f9335dcb726ef3714f Mon Sep 17 00:00:00 2001 -From: xiewenxiang -Date: Fri, 29 Mar 2024 10:41:25 +0800 -Subject: [PATCH] modify bluedroid conn timeout - ---- - components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c index 4e6c8534ec..fa7a877491 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c @@ -27,14 +18,11 @@ index 4e6c8534ec..fa7a877491 100644 uint32_t current_time = (esp_system_get_time()/1000); - link_timeout = (L2CAP_BLE_LINK_CONNECT_TOUT*1000 - (current_time - p_lcb->start_time_s))/1000; + link_timeout = (bluedroid_conn_wait_time*1000 - (current_time - p_lcb->start_time_s))/1000; - + - if(link_timeout == 0 || link_timeout > L2CAP_BLE_LINK_CONNECT_TOUT) { - link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; + if(link_timeout == 0 || link_timeout > bluedroid_conn_wait_time) { + link_timeout = bluedroid_conn_wait_time; } } - - --- -2.25.1 + diff --git a/module_config/module_wrover-32/patch/support_ext_partition.patch b/module_config/module_wrover-32/patch/support_ext_partition.patch index 903fef7a3..eae8aadd7 100644 --- a/module_config/module_wrover-32/patch/support_ext_partition.patch +++ b/module_config/module_wrover-32/patch/support_ext_partition.patch @@ -15,6 +15,6 @@ index d0969ba408..89a0f02cbd 100644 get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" - ABSOLUTE BASE_DIR "${project_dir}") + ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") - + if(NOT EXISTS "${PARTITION_CSV_PATH}") message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. "