Skip to content

fix: omit port from upload request when not set #2090

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

Merged
merged 1 commit into from
Jun 6, 2023
Merged

fix: omit port from upload request when not set #2090

merged 1 commit into from
Jun 6, 2023

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Jun 6, 2023

Motivation

Omit the port object from the compile request so the CLI can correctly fall back to the default upload port. This does not work when the port object is empty. Only null is a valid port value in such a scenario.

Change description

Previously, if the port was not set in IDE2, the compile request object was created with an empty port object ({}). IDE2 will create a compile request with the default null port value if the port is not specified.

This PR sets the hardwareId on the port object. Port#hardwareId has not been used in IDE2 since its introduction.

Other information

I went through the steps from #2089, but I am not 100% sure I could follow them. I did the followings:

  • Opened 2.1.0, and uploaded the "Soft brick" sketch to my Micro, then CLI/IDE2 couldn't detect my Micro board after. Every upload attempt failed with the Failed uploading: no upload port provided message.
  • Opened IDE2 from this PR, selected the Micro board but not the port, started the upload, and saw the followings in the Output, and could upload:
    Skipping 1200-bps touch reset: no serial port selected!
    Waiting for upload port...
    No upload port found, using  as fallback
    

2.1.0:

2089_210_build.mp4

Build from this PR:

2089_pr_build.mp4

Closes #2089

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

Previously, if the `port` was not set in IDE2, the compile request
object has been created with an empty port object (`{}`). From now on,
if the port is not specified, IDE2 will create a compile request with
the default `null` `port` value.

Closes #2089

Signed-off-by: Akos Kitta <[email protected]>
@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jun 6, 2023
@kittaakos kittaakos self-assigned this Jun 6, 2023
@kittaakos kittaakos requested review from AlbyIanna and per1234 June 6, 2023 12:23
@kittaakos kittaakos marked this pull request as ready for review June 6, 2023 12:23
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified this fixes #2089. Thanks Akos!


By the way, I see from the second screencast you shared that you uploaded the "soft brick" sketch at step (2) of the reproduction instructions from #2089. That is perfectly fine for the purposes of reproducing the fault with the build from the main branch and for validating the changes from this PR. However, it won't restore your board back to the state where it once more produces a port and can be uploaded to normally without need for a manual reset because the board is still running the program that disables the USB CDC code.

So if you want to recover your board to a state where it will be convenient for future use, simply repeat the recovery procedure, but this time upload some sketch that doesn't contain the problematic code (e.g., the one generated via File > New Sketch).

@kittaakos
Copy link
Contributor Author

So if you want to recover your board to a state where it will be convenient for future use, simply repeat the recovery procedure, but this time upload some sketch that doesn't contain the problematic code (e.g., the one generated via File > New Sketch).

Thank you, Per

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recovery of soft bricked native USB boards w/o double-tap impossible without port selection
2 participants