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

Commit998b4bc

Browse files
committed
Fixes ESP32 build failure
Fixeslvgl-micropython#32
1 parent1270aad commit998b4bc

File tree

2 files changed

+38
-28
lines changed

2 files changed

+38
-28
lines changed

‎builder/esp32.py‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -148,27 +148,33 @@ def parse_args(extra_args, lv_cflags, brd):
148148

149149
board=brd
150150

151-
esp_argParser=ArgumentParser(prefix_chars='-B')
152-
153-
esp_argParser.add_argument(
154-
'--skip-partition-resize',
155-
dest='skip_partition_resize',
156-
help='clean the build',
157-
action='store_true'
158-
)
151+
ifboardisNone:
152+
board='ESP32_GENERIC'
159153

160154
ifboardin ('ESP32_GENERIC','ESP32_GENERIC_S3'):
155+
esp_argParser=ArgumentParser(prefix_chars='B')
161156
esp_argParser.add_argument(
162157
'BOARD_VARIANT',
163158
dest='board_variant',
164159
default='',
165160
action='store'
166161
)
162+
esp_args,extra_args=esp_argParser.parse_known_args(extra_args)
163+
board_variant=esp_args.board_variant
167164
else:
168165
forarginextra_args:
169166
ifarg.startswith('BOARD_VARIANT'):
170167
raiseRuntimeError(f'BOARD_VARIANT not supported by "{board}"')
171168

169+
esp_argParser=ArgumentParser(prefix_chars='-')
170+
171+
esp_argParser.add_argument(
172+
'--skip-partition-resize',
173+
dest='skip_partition_resize',
174+
help='clean the build',
175+
action='store_true'
176+
)
177+
172178
esp_argParser.add_argument(
173179
'--partition-size',
174180
dest='partition_size',
@@ -178,15 +184,9 @@ def parse_args(extra_args, lv_cflags, brd):
178184
)
179185

180186
esp_args,extra_args=esp_argParser.parse_known_args(extra_args)
181-
182187
skip_partition_resize=esp_args.skip_partition_resize
183188
partition_size=esp_args.partition_size
184189

185-
ifboardisNone:
186-
board='ESP32_GENERIC'
187-
188-
board_variant=esp_args.board_variant
189-
190190
iflv_cflags:
191191
lv_cflags+=' -DLV_KCONFIG_IGNORE=1'
192192
else:
@@ -218,6 +218,7 @@ def build_commands(_, extra_args, __, lv_cflags, ___):
218218
submodules_cmd.append(f'BOARD={board}')
219219

220220
esp_cmd.extend([
221+
'SECOND_BUILD=0',
221222
f'LV_CFLAGS="{lv_cflags}"',
222223
f'LV_PORT=esp32',
223224
f'BOARD={board}',
@@ -475,6 +476,7 @@ def compile(): # NOQA
475476
ifdeploy:
476477
compile_cmd.append('deploy')
477478

479+
compile_cmd[4]='SECOND_BUILD=1'
478480
ret_code,output=spawn(compile_cmd,env=env,cmpl=True)
479481

480482
ifret_code!=0:
@@ -528,6 +530,8 @@ def compile(): # NOQA
528530
compile_cmd.append('deploy')
529531

530532
ifremaining>4096orpartition_size!=-1ordeploy:
533+
compile_cmd[4]='SECOND_BUILD=1'
534+
531535
ret_code,output=spawn(compile_cmd,env=env,cmpl=True)
532536

533537
ifret_code!=0:
@@ -565,7 +569,7 @@ def compile(): # NOQA
565569

566570
build_name=f'build-{board}'
567571

568-
ifboard_variantisnotNone:
572+
ifboard_variant:
569573
build_name+=f'-{board_variant}'
570574

571575
build_bin_file=os.path.abspath(

‎micropython.cmake‎

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ find_package(Python3 REQUIRED COMPONENTS Interpreter)
55
separate_arguments(LV_CFLAGS_ENV UNIX_COMMAND$ENV{LV_CFLAGS})
66
list(APPEND LV_CFLAGS${LV_CFLAGS_ENV} -Wno-unused-function)
77

8+
separate_arguments(SECOND_BUILD_ENV UNIX_COMMAND$ENV{SECOND_BUILD})
9+
10+
811
include(${CMAKE_CURRENT_LIST_DIR}/ext_mod/micropython.cmake)
912

1013
set(LVGL_HEADER"${CMAKE_CURRENT_LIST_DIR}/build/lvgl_header.h")
@@ -18,20 +21,23 @@ file(GLOB_RECURSE LVGL_HEADERS ${CMAKE_CURRENT_LIST_DIR}/lib/lvgl/src/*.h ${CMAK
1821
# the compilation to error because the source file doesn't exist. It needs to
1922
# exist before it gets added to the source list and this is the only way I have
2023
# found to go about doing it.
21-
execute_process(
22-
COMMAND
23-
${Python3_EXECUTABLE}${CMAKE_CURRENT_LIST_DIR}/gen/$ENV{GEN_SCRIPT}_api_gen_mpy.py${LV_CFLAGS} --output=${CMAKE_BINARY_DIR}/lv_mp.c --include=${CMAKE_CURRENT_LIST_DIR} --include=${CMAKE_CURRENT_LIST_DIR}/include --include=${CMAKE_CURRENT_LIST_DIR}/lvgl --board=$ENV{LV_PORT} --module_name=lvgl --module_prefix=lv --metadata=${CMAKE_BINARY_DIR}/lv_mp.c.json${LVGL_HEADER}
24-
WORKING_DIRECTORY
25-
${CMAKE_CURRENT_LIST_DIR}
26-
27-
RESULT_VARIABLE mpy_result
28-
OUTPUT_VARIABLE mpy_output
29-
)
3024

31-
if(${mpy_result}GREATER"0")
32-
message("OUTPUT:${mpy_output}")
33-
message("RESULT:${mpy_result}")
34-
message( FATAL_ERROR"Failed to generate${CMAKE_BINARY_DIR}/lv_mp.c" )
25+
if(${SECOND_BUILD_ENV}EQUAL"0")
26+
execute_process(
27+
COMMAND
28+
${Python3_EXECUTABLE}${CMAKE_CURRENT_LIST_DIR}/gen/$ENV{GEN_SCRIPT}_api_gen_mpy.py${LV_CFLAGS} --output=${CMAKE_BINARY_DIR}/lv_mp.c --include=${CMAKE_CURRENT_LIST_DIR} --include=${CMAKE_CURRENT_LIST_DIR}/include --include=${CMAKE_CURRENT_LIST_DIR}/lvgl --board=$ENV{LV_PORT} --module_name=lvgl --module_prefix=lv --metadata=${CMAKE_BINARY_DIR}/lv_mp.c.json --header_file=${LVGL_HEADER}
29+
WORKING_DIRECTORY
30+
${CMAKE_CURRENT_LIST_DIR}
31+
32+
RESULT_VARIABLE mpy_result
33+
OUTPUT_VARIABLE mpy_output
34+
)
35+
36+
if(${mpy_result}GREATER"0")
37+
message("OUTPUT:${mpy_output}")
38+
message("RESULT:${mpy_result}")
39+
message( FATAL_ERROR"Failed to generate${CMAKE_BINARY_DIR}/lv_mp.c" )
40+
endif()
3541
endif()
3642

3743
# file(WRITE ${CMAKE_BINARY_DIR}/lv_mp.c ${mpy_output})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp