Skip to content

Commit

Permalink
esp32/Makefile: Only set port & baud for jobs that access hardware.
Browse files Browse the repository at this point in the history
In idf v5.2.1 if the port flag is set it's validated
even on jobs that don't access hardware like clean.
This causes the job to fail if device isn't connected.

Signed-off-by: Andrew Leech <[email protected]>
  • Loading branch information
andrewleech committed Apr 2, 2024
1 parent ddf565a commit ea0cf75
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ports/esp32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ifdef USER_C_MODULES
endif

IDFPY_FLAGS += -D MICROPY_BOARD=$(BOARD) -D MICROPY_BOARD_DIR="$(abspath $(BOARD_DIR))" $(CMAKE_ARGS)
DEVICE += -p $(PORT) -b $(BAUD)

ifdef FROZEN_MANIFEST
IDFPY_FLAGS += -D MICROPY_FROZEN_MANIFEST=$(FROZEN_MANIFEST)
Expand All @@ -59,7 +60,7 @@ endif
HELP_BUILD_ERROR ?= "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m"

define RUN_IDF_PY
idf.py $(IDFPY_FLAGS) -B $(BUILD) -p $(PORT) -b $(BAUD) $(1)
idf.py $(IDFPY_FLAGS) -B $(BUILD) $(1)
endef

all:
Expand All @@ -78,13 +79,13 @@ clean:
$(call RUN_IDF_PY,fullclean)

deploy:
$(call RUN_IDF_PY,flash)
$(call RUN_IDF_PY,$(DEVICE) flash)

erase:
$(call RUN_IDF_PY,erase-flash)
$(call RUN_IDF_PY,$(DEVICE) erase-flash)

monitor:
$(call RUN_IDF_PY,monitor)
$(call RUN_IDF_PY,$(DEVICE) monitor)

size:
$(call RUN_IDF_PY,size)
Expand Down

0 comments on commit ea0cf75

Please sign in to comment.