Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command flash fails with port option (IDFGH-9072) #10475

Closed
3 tasks done
harryzcy opened this issue Jan 2, 2023 · 4 comments
Closed
3 tasks done

Command flash fails with port option (IDFGH-9072) #10475

harryzcy opened this issue Jan 2, 2023 · 4 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@harryzcy
Copy link

harryzcy commented Jan 2, 2023

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.1-dev-2658-g0025915dc4

Operating System used.

macOS

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

What is the expected behavior?

It should flash successfully

What is the actual behavior?

Prints out error Option "port" provided for "flash" is already defined to a different value. This option can appear at most once in the command line.

Steps to reproduce.

  1. Use hello-world from examples
  2. Set target and run idf.py build
  3. Run idf.py flash

Build or installation Logs.

No response

More Information.

I'm using ESP32-C3-DevKitM-1 and flashing using it's native usb port starts with /dev/cu.usbserial-*

Update: I have the ESPPORT env set. But I think it's still an issue that command line option should replace ESPPORT when provided.

@harryzcy harryzcy added the Type: Bug bugs in IDF label Jan 2, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 2, 2023
@github-actions github-actions bot changed the title Command flash fails with port option Command flash fails with port option (IDFGH-9072) Jan 2, 2023
@dobairoland
Copy link
Collaborator

Hi @harryzcy. Could you please try to run idf.py fullclean in your project and then idf.py set-target esp32c3, idf.py build, and share the full log of idf.py flash.

I'm setting ESPPORT as well but cannot reproduce the issue.

@harryzcy
Copy link
Author

harryzcy commented Jan 2, 2023

@dobairoland maybe I didn't explain clearly.

I'm getting the error when I use idf.py -p /dev/cu.usbserial-1130 flash, and when my ESPPORT is set to a different value /dev/cu.SLAB_USBtoUART

image

Unsetting ESPPORT solves the issue

@dobairoland
Copy link
Collaborator

Thanks @harryzcy. I've got it now.

For our reference, here is how to reproduce this:

ESPPORT=/dev/ttyUSB1 idf.py monitor -p /dev/ttyUSB0

The issue is not present when the same value is specified with the argument and the environment variable.

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Jan 2, 2023
@dobairoland
Copy link
Collaborator

After looking into this more, I think the current behavior is correct. Changing this could lead to confusion when one forgets about that have set the environment variable in some of environment scripts. I agree that running idf.py flash -p <port> in that case could be clear but what about idf.py flash? One would expect port autodetection but instead only ESPPORT would be tested. Finding the root cause in this case could take long.

However, this failure will at least remind one to not set ESPPORT in environment script if it is not the same one is desired to use every time.

I'll improve the error message because it is not clear in this situation.

@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Jan 3, 2023
espressif-bot pushed a commit that referenced this issue Feb 5, 2023
espressif-bot pushed a commit that referenced this issue Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

3 participants