Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd38ef69

Browse files
committed
adds --octal-flash and --flash-size for an ESP32_GENERIC_S3 build
There are variants of the esp32-s3 that have 4mb, 8mb, 16mb and 32mb flash and that is what using --flash-size=? allows us to set.The --octal-flash you have to add if the flash uses octal SPI. This is seen with the 32mb flash size. There are some changes that need to occur in order for the flash to work properly. So if you have an esp32-s3 N32R8 you will want to use the following build command```make.py esp32 clean submodules mpy_cross BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT --octal-flash --flash-size=32```
1 parentc4b34c4 commitd38ef69

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

‎builder/esp32.py‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ def get_espidf():
138138
board=None
139139
skip_partition_resize=False
140140
partition_size=None
141+
flash_size=8
142+
oct_flash=False
141143

142144

143145
defparse_args(extra_args,lv_cflags,brd):
144146
globalboard
145147
globalboard_variant
146148
globalskip_partition_resize
147149
globalpartition_size
150+
globalflash_size
151+
globaloct_flash
148152

149153
board=brd
150154

@@ -166,6 +170,28 @@ def parse_args(extra_args, lv_cflags, brd):
166170
ifarg.startswith('BOARD_VARIANT'):
167171
raiseRuntimeError(f'BOARD_VARIANT not supported by "{board}"')
168172

173+
ifboard=='ESP32_GENERIC_S3':
174+
esp_argParser=ArgumentParser(prefix_chars='-')
175+
176+
esp_argParser.add_argument(
177+
'--octal-flash',
178+
help='octal spi flash',
179+
dest='oct_flash',
180+
action='store_true'
181+
)
182+
183+
esp_argParser.add_argument(
184+
'--flash-size',
185+
dest='flash_size',
186+
help='flash size',
187+
default=8,
188+
type=int,
189+
action='store'
190+
)
191+
esp_args,extra_args=esp_argParser.parse_known_args(extra_args)
192+
flash_size=esp_args.flash_size
193+
oct_flash=esp_args.oct_flash
194+
169195
esp_argParser=ArgumentParser(prefix_chars='-')
170196

171197
esp_argParser.add_argument(
@@ -379,6 +405,65 @@ def submodules():
379405
defcompile():# NOQA
380406
env=setup_idf_environ()
381407

408+
ifboard=='ESP32_GENERIC_S3':
409+
base_config= [
410+
'CONFIG_ESPTOOLPY_FLASHMODE_QIO=y',
411+
'CONFIG_ESPTOOLPY_FLASHFREQ_80M=y',
412+
'CONFIG_ESPTOOLPY_AFTER_NORESET=y',
413+
'CONFIG_PARTITION_TABLE_CUSTOM=y',
414+
]
415+
416+
ifflash_size==4:
417+
base_config.extend([
418+
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y',
419+
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n',
420+
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n',
421+
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n',
422+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MiB.csv"'
423+
])
424+
elifflash_size==8:
425+
base_config.extend([
426+
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n',
427+
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y',
428+
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n',
429+
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n',
430+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MiB.csv"'
431+
])
432+
433+
elifflash_size==16:
434+
base_config.extend([
435+
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n',
436+
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n',
437+
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y',
438+
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n',
439+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MiB.csv"'
440+
])
441+
ifflash_size==32:
442+
base_config.extend([
443+
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n',
444+
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n',
445+
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n',
446+
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y',
447+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-32MiB.csv"'
448+
])
449+
else:
450+
base_config= [
451+
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n',
452+
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y',
453+
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n',
454+
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n',
455+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MiB.csv"'
456+
]
457+
458+
ifoct_flash:
459+
base_config[0]='CONFIG_ESPTOOLPY_FLASHMODE_DOUT=y'
460+
base_config.append('CONFIG_ESPTOOLPY_OCT_FLASH=y')
461+
462+
base_config='\n'.join(base_config)
463+
464+
withopen('lib/micropython/ports/esp32/boards/ESP32_GENERIC_S3/sdkconfig.board','w')asf:
465+
f.write(base_config+'\n')
466+
382467
ifboardin ('ESP32_GENERIC_S2','ESP32_GENERIC_S3'):
383468

384469
mphalport_path='lib/micropython/ports/esp32/mphalport.c'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp