Skip to content

Commit 275f117

Browse files
committed
Add a warning if there is a flash size mismatch with IDF config
1 parent 89d7ed2 commit 275f117

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

builder/frameworks/espidf.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,22 @@ def _skip_prj_source_files(node):
15821582
if sdk_config.get("MBEDTLS_CERTIFICATE_BUNDLE", False):
15831583
generate_mbedtls_bundle(sdk_config)
15841584

1585+
#
1586+
# Check if flash size is set correctly in the IDF configuration file
1587+
#
1588+
1589+
board_flash_size = board.get("upload.flash_size", "4MB")
1590+
idf_flash_size = sdk_config.get("ESPTOOLPY_FLASHSIZE", "4MB")
1591+
if board_flash_size != idf_flash_size:
1592+
print(
1593+
"Warning! Flash memory size mismatch detected. Expected %s, found %s!"
1594+
% (board_flash_size, idf_flash_size)
1595+
)
1596+
print(
1597+
"Please select a proper value in your `sdkconfig.defaults` "
1598+
"or via the `menuconfig` target!"
1599+
)
1600+
15851601
#
15861602
# To embed firmware checksum a special argument for esptool.py is required
15871603
#

0 commit comments

Comments
 (0)