From 17e29dfb81890addb1ab00821ca1669edce61e78 Mon Sep 17 00:00:00 2001 From: Filipe Cavalcanti Date: Wed, 16 Apr 2025 15:49:00 -0300 Subject: [PATCH 1/2] fix: flash mode exception on Nuttx Signed-off-by: Filipe Cavalcanti --- pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py b/pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py index 6fc30733..fc395a39 100644 --- a/pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py +++ b/pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py @@ -76,6 +76,12 @@ def get_key_from_value(dictionary, val): # Flash Mode self.flash_mode = get_key_from_value(FLASH_MODES, image.flash_mode) + # From esp-idf/components/esptool_py: + # We use esptool.py to flash bootloader in dio mode for QIO/QOUT, bootloader then + # upgrades itself to quad mode during initialization. + if self.flash_mode in ("qio", "qout"): + self.flash_mode = "dio" + @EspSerial.use_esptool() def flash(self) -> None: """Flash the binary files to the board.""" From 890ed19ff79f79af481c7a2ba86f6c3d03c49248 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 18:53:00 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py b/pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py index fc395a39..9a55ba60 100644 --- a/pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py +++ b/pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py @@ -79,8 +79,8 @@ def get_key_from_value(dictionary, val): # From esp-idf/components/esptool_py: # We use esptool.py to flash bootloader in dio mode for QIO/QOUT, bootloader then # upgrades itself to quad mode during initialization. - if self.flash_mode in ("qio", "qout"): - self.flash_mode = "dio" + if self.flash_mode in ('qio', 'qout'): + self.flash_mode = 'dio' @EspSerial.use_esptool() def flash(self) -> None: