Skip to content

Accept VID/PID or configuration file from CLI or environment #1023

Description

@chrysn

Motivations

I'm building applications that can be built for and flashed onto different devices, with different options running on different ESPs or other chips. (This is enabled by Ariel OS).

At the time of building/flashing, I know what device family I'm building for, and I can keep track of which VID/PID pair that presents to the flasher, but the VID/PID is not something constant I can put into a file in the project.

  • Would you like to implement this feature? yes (if you can give a preference for the solution)

Solution

Passing in either a VID/PID pair or just the name of a config file to be read instead of the local one would be viable options.

The one that would be most practical for me would just to accept VID and PID on the CLI, eg. as:

$ espflash flash --port-vid-pid 303a:1001 target/some/path.elf

A more general solution would be to accept the configuraton file through either input way (I have no preference which):

$ ESPFLASH_CONFIG=variants/ulanzi-tc001/espflash.config espflash flash target/some/path.elf
$ espflash --config variants/ulanzi-tc001/espflash.config flash target/some/path.elf

Alternatives

I could chdir into a per-build directory, place a config file there, and then run the flasher, but that appears to me like a crude workaround.

I could run a manual process to identify which --port currently corresponds to my known VID/PID, but that's a lot of duplication for something that is already in espflash.

Additional context

I started sketching that before I opened #1022; without that PR, adding this would be more urgent. (But I'd PR it anyway after getting some feedback of which of the 3-4 ways to get the state in you prefer).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequest for new feature/functionality

    Type

    No type

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions