esp-rs / espflash

Serial flasher utility for Espressif SoCs and modules based on esptool.py
Apache License 2.0
474 stars 116 forks source link

Remove serde-hex crate due to save / load conflict #381

Closed jamesgraves closed 1 year ago

jamesgraves commented 1 year ago

When using serde-hex, the vid and pid are saved as:

[connection]

[[usb_device]]
vid = "303a"
pid = "1001"

in the ~/.config/espflash/espflash.toml file.

However, upon loading, we see an error message:

Error:
  × TOML parse error at line 4, column 7
  │   |
  │ 4 | vid = "303a"
  │   |       ^^^^^^
  │ invalid type: string "303a", expected a borrowed byte array
  │

The serde-hex source code hasn't been updated in 4 years, and is not apparently compatible with the toml crate.

Storing the vid and pid as decimal integers is not ideal, but it at least works correctly.

SergioGasquez commented 1 year ago

Thanks for your contribution! I was about to have a look at this as we were discussing it in: https://github.com/esp-rs/espflash/pull/374. I wonder if we could easily use the hex crate with the serde feature to keep it in hexadecimal.

SergioGasquez commented 1 year ago

Closed by #383 to make it backward compatible, it needed to use hex instead of decimal

jamesgraves commented 1 year ago

Thank you!