Skip to content

Commit 74fb918

Browse files
committed
Couple more updates for the overclocking and updated the README
1 parent 5890a4a commit 74fb918

File tree

2 files changed

+34
-18
lines changed

2 files changed

+34
-18
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,26 @@ for the binding.
1616
### *New changes*
1717
___________________________
1818

19+
ESP32-ALL
20+
Flash sizes that are able to be used are 4, 8, 16, 32, 64 and 128 across all
21+
variants of the ESP32. It is up to the user to know what their board is using.
22+
23+
24+
ESP32-S3
25+
2 new command line arguments.
26+
--onboard-mem-speed: allowed values = 120 or 80
27+
--flash-mode: allowed values = QIO, QOUT, DIO, DOUT, OPI, DTR, STR
28+
29+
30+
OK so this is how this works is wanting to use 120,hz speed
31+
* octal spi FLASH, octal spi PSRAM: `--onboard-mem-speed=120 --flash-mode=DTR`
32+
* quad spi FLASH, octal spi PSRAM: `--onboard-mem-speed=120 --flash-mode=STR`
33+
* quad spi FLASH, quad spi PSRAM: `--onboard-mem-speed=120`
34+
35+
There is one other use case. If you have 32mb worth of flash storage you will
36+
need to set `--flash-mode=DOUT` as well as `--flash-size=32`
37+
38+
1939
ESP32
2040
MicroPython SPI class has been modified
2141
The SPI implimentation in MicroPython for the ESP32 was written so it would fail

builder/esp32.py

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,14 @@ def get_partition_file_name(otp):
3838
class Partition:
3939

4040
def __init__(self, file_path):
41-
self.file_path = file_path
41+
self.load_file_path = file_path
42+
self.save_file_path = f'"{SCRIPT_DIR}/build/partitions-{flash_size}MiB.csv"'
4243
self._saved_data = None
4344
self.csv_data = self.read_csv()
4445
last_partition = self.csv_data[-1]
4546

4647
self.total_space = last_partition[-2] + last_partition[-3]
4748

48-
def revert_to_original(self):
49-
with open(self.file_path, 'w') as f:
50-
f.write(self._saved_data)
51-
5249
def get_app_size(self) -> int:
5350
for part in self.csv_data:
5451
if part[1] in ('app', 'factory'):
@@ -77,7 +74,7 @@ def set_app_size(self, size):
7774
if next_offset > self.total_space:
7875
raise RuntimeError(
7976
f'Board does not have enough space, overflow of '
80-
f'{next_offset - self.total_space} bytes ({self.file_path})\n'
77+
f'{next_offset - self.total_space} bytes ({self.load_file_path})\n'
8178
)
8279

8380
def save(self):
@@ -91,12 +88,12 @@ def convert_to_hex(itm):
9188
for line in self.csv_data:
9289
otp.append(','.join(convert_to_hex(item) for item in line))
9390

94-
with open(self.file_path, 'w') as f:
91+
with open(self.save_file_path, 'w') as f:
9592
f.write(PARTITION_HEADER)
9693
f.write('\n'.join(otp))
9794

9895
def read_csv(self):
99-
with open(self.file_path, 'r') as f:
96+
with open(self.load_file_path, 'r') as f:
10097
csv_data = f.read()
10198

10299
self._saved_data = csv_data
@@ -682,10 +679,7 @@ def compile(): # NOQA
682679
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n',
683680
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n',
684681
'CONFIG_ESPTOOLPY_FLASHSIZE_64MB=n',
685-
'CONFIG_ESPTOOLPY_FLASHSIZE_128MB=n',
686-
f'CONFIG_ESPTOOLPY_FLASHSIZE_{flash_size}MB=y',
687-
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='
688-
f'"{SCRIPT_DIR}/build/partitions-{flash_size}MiB.csv"',
682+
'CONFIG_ESPTOOLPY_FLASHSIZE_128MB=n'
689683
]
690684

691685
if DEBUG:
@@ -718,12 +712,14 @@ def compile(): # NOQA
718712

719713
base_config.append('')
720714

721-
if onboard_mem_speed == 120:
722-
base_config.append('CONFIG_ESPTOOLPY_FLASHFREQ_120M=y')
723-
base_config.append('CONFIG_SPIRAM_SPEED_120M=y')
724-
else:
725-
base_config.append('CONFIG_ESPTOOLPY_FLASHFREQ_80M=y')
726-
base_config.append('CONFIG_SPIRAM_SPEED_80M=y')
715+
base_config.append(f'CONFIG_ESPTOOLPY_FLASHSIZE_{flash_size}MB=y')
716+
base_config.append(''.join([
717+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=',
718+
f'"{SCRIPT_DIR}/build/partitions-{flash_size}MiB.csv"'
719+
]))
720+
721+
base_config.append('CONFIG_ESPTOOLPY_FLASHFREQ_{onboard_mem_speed}M=y')
722+
base_config.append('CONFIG_SPIRAM_SPEED_{onboard_mem_speed}M=y')
727723

728724
if oct_flash:
729725
base_config.append('CONFIG_ESPTOOLPY_OCT_FLASH=y')

0 commit comments

Comments
 (0)