Skip to content

Commit

Permalink
Add a warning if there is a flash size mismatch with IDF config
Browse files Browse the repository at this point in the history
  • Loading branch information
valeros committed Dec 8, 2023
1 parent 89d7ed2 commit 275f117
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,22 @@ def _skip_prj_source_files(node):
if sdk_config.get("MBEDTLS_CERTIFICATE_BUNDLE", False):
generate_mbedtls_bundle(sdk_config)

#
# Check if flash size is set correctly in the IDF configuration file
#

board_flash_size = board.get("upload.flash_size", "4MB")
idf_flash_size = sdk_config.get("ESPTOOLPY_FLASHSIZE", "4MB")
if board_flash_size != idf_flash_size:
print(
"Warning! Flash memory size mismatch detected. Expected %s, found %s!"
% (board_flash_size, idf_flash_size)
)
print(
"Please select a proper value in your `sdkconfig.defaults` "
"or via the `menuconfig` target!"
)

#
# To embed firmware checksum a special argument for esptool.py is required
#
Expand Down

0 comments on commit 275f117

Please sign in to comment.