Fix ESP32 GENERIC board name resolving to ESP8266 firmware when port is specified#54
Conversation
Agent-Logs-Url: https://github.com/Josverl/mpflash/sessions/d279fa82-02f3-4d34-88b3-cf0d5c5a330d Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Josverl/mpflash/sessions/d279fa82-02f3-4d34-88b3-cf0d5c5a330d Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #54 +/- ##
==========================================
+ Coverage 72.99% 74.82% +1.82%
==========================================
Files 54 54
Lines 2744 2780 +36
Branches 421 434 +13
==========================================
+ Hits 2003 2080 +77
+ Misses 608 572 -36
+ Partials 133 128 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Patch coverage is 68.62745% with 16 lines in your changes missing coverage. Please review. |
|
Additional details and impacted files main #54 +/-==========================================
|
Agent-Logs-Url: https://github.com/Josverl/mpflash/sessions/16dec710-6e35-445e-acc3-05274a807748 Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
Added tests in commit e843d69 that increase patch coverage from 68.6% to 93%. New tests cover:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/Josverl/mpflash/sessions/aa04d353-9662-4e16-af82-a6e9dd592f2d Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Josverl/mpflash/sessions/aa04d353-9662-4e16-af82-a6e9dd592f2d Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
mpflash flash --port esp32 --board GENERICincorrectly flashed ESP8266 firmware onto an ESP32 board.GENERICis only an ESP8266 board in the DB; the--port esp32hint was silently ignored throughout the call chain, and the old-styleGENERIC_Xboard names (pre-v1.21.0) didn't map to their hyphen-variant equivalents (ESP32_GENERIC-SPIRAM, etc.).Root causes
find_known_board("GENERIC")returned the esp8266 DB entry regardless of user-specified--port--portwas never forwarded fromcli_flash→create_worklist→_create_manual_boardin the manual board pathfind_downloaded_firmwarestable-version query lacked a port filter (present for preview but missing for stable)alternate_board_names("GENERIC_SPIRAM", "esp32")generatedESP32_GENERIC_SPIRAM(underscore), but firmware from v1.21.0+ usesESP32_GENERIC-SPIRAM(hyphen), so old board names silently missed their firmwareChanges
mpboard_id/known.py—find_known_boardaccepts an optionalport; when exact candidates don't match the requested port, falls back throughalternate_board_namesbefore last-resort fallbackmpboard_id/alternate.py—GENERIC_Xnames now also emit the hyphen form (ESP32_GENERIC-X) alongside the underscore form, covering the v1.20.0→v1.21.0 naming change for all variant suffixes (_SPIRAM,_OTA,_D2WD, etc.)downloaded.py— port filter applied consistently to both preview and stable firmware queriesflash/worklist.py— addedportfield toWorklistConfig; propagated throughcreate_manual_worklist→_create_manual_boardcli_flash.py—params.ports[0]forwarded tocreate_worklistin both manual board flash pathsNaming convention reference
GENERICESP8266_GENERICGENERIC_SPIRAMESP32_GENERIC-SPIRAMGENERIC_OTAESP32_GENERIC-OTAGENERIC_D2WDESP32_GENERIC-D2WDalternate_board_names("GENERIC_SPIRAM", "esp32")now returns:Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/micropython/micropython/home/REDACTED/work/mpflash/mpflash/.venv/bin/python python -m pytest tests/test_downloaded.py tests/mpboard_id/ tests/flash/ -v ndor/bin/git hub.com/.extraheiptables(http block)/home/REDACTED/work/mpflash/mpflash/.venv/bin/python python -m pytest tests/mpboard_id/test_known_boards.py::test_known_stored_boards_basic -v(http block)/home/REDACTED/work/mpflash/mpflash/.venv/bin/python python -m pytest tests/test_downloaded.py tests/mpboard_id/test_known_boards.py tests/flash/ -v ndor/bin/git(http block)If you need me to access, download, or install something from one of these locations, you can either: