Commit Graph

536 Commits

Author SHA1 Message Date
Jesse Braham
151ca29a09 Update the CI workflow 2023-06-01 07:17:00 -07:00
Jesse Braham
092a637e98 Override the flash size in Flasher if provided via command-line argument 2023-05-31 05:48:59 -07:00
Jesse Braham
d9f8f8bdf2 Fix handling of serial ports on BSD systems 2023-05-31 05:48:43 -07:00
Sergio Gasquez Arcos
f447c4ea8f Add CHANGELOG (#416)
* docs:  Add changelog

* ci:  Add changelog CI check

* ci: 🔥 Remove changelog check
2023-05-31 05:48:08 -07:00
Jesse Braham
4a11489a6f Downgrade crossterm to 0.25.0 2023-05-30 09:37:27 -07:00
Jesse Braham
2c00fd1aab Make erasing partitions possible when using package metadata, improve error help 2023-05-30 07:15:07 -07:00
Scott Mabin
33e32c196b limit default partition size
Some chips can have more than 16MB of flash, mine as 32MB. Historically
espflash failed to detect this flash size but now can. Without this
change the board will boot loop because the esp idf bootloader max size
is only 16MB.
2023-05-29 10:02:57 -07:00
Jesse Braham
984d95cddd Update to the latest version of addr2line and address breaking changes 2023-05-29 07:44:04 -07:00
Sergio Gasquez Arcos
d7ef525cb9 Add issue templates (#403)
* feat:  Add issue template

* feat:  Add Target

* feat:  Allow blank issues

* style: 🎨 Use checkboxes

* Update .github/workflows/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2023-05-26 09:52:40 -07:00
Sergio Gasquez Arcos
ad8e6a40c3 Fix Windows installation (#399)
* build:  Avoid vendored openssl in Windows

* build: ⬆️ Update cargo version

* feat:  Add resolver property

* build: ⬆️ Bump MSRV to 1.65
2023-05-26 09:40:27 -07:00
Loïc Damien
59c62fd0bd docs: add configuration file examples 2023-05-11 11:29:12 -07:00
Scott Mabin
93fe962cd2 Reword elf to big error
See https://github.com/esp-rs/espflash/pull/397#discussion_r1184959133
2023-05-05 09:07:50 -07:00
Scott Mabin
6d521938d4 Add a diagnostic to tell the user about the partition table format when the image doesn't fit (#397) 2023-05-04 11:50:13 +01:00
Sergio Gasquez
b50f90a062 docs: 📝 Add note about permissions on Linux 2023-04-25 05:37:15 -07:00
Sergio Gasquez Arcos
f26240398f Generate Shell completions (#388)
* feat:  Add shell completions for espflash

* docs: 📝 Update usage

* feat:  Use crate_name! macro from clap instead of hardcoded name

* feat:  Remove log level

* build: ️ Remove cargo feature from clap

* feat:  Add shell completions

* docs: 📝 Add docstring for completions

* docs: 📝 Document cargo-espflash completions

* feat: ️ Avoid duplicating code
2023-04-19 08:04:42 -07:00
Sergio Gasquez Arcos
327f8d40e4 Make the default flashing frequency target specific (#389)
* feat:  Add flash_freq to Esp32Params

* feat:  Add flash_freq for all targets

* feat:  Use the params flash_freq if no freq argment was used

* test: 🧪 Fix tests

* feat: ️ Update default freq
2023-04-18 05:20:52 -07:00
Sergio Gasquez
f098b0eca9 build: ⬆️ Bump version to rc.4 2023-04-04 15:39:09 +02:00
Sergio Gasquez Arcos
e8cd385be1 Fix config file parsing (#382)
* build:  Update dependencies

* feat:  Add hex_u16 parser

* test: 🧪 Add test fn

* build: ⬆️ Make hex optional

* fix: 🎨 Fix clippy warnings

* feat:  Add serialization method

* test: 🧪 Add test fn

* fix:  Avoid panicking by underflow

* docs: 📝 Remove confusing docstring

* docs: 📝 Remove confusing docstring

* style: 🎨 Improve test format

* style: 🎨 Improve test format
2023-04-04 14:19:47 +01:00
jneem
cdddf539bc If exactly one port matches, use it (#374)
* If exactly one port matches, use it

* Update espflash/src/cli/serial.rs

Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>

---------

Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
2023-04-04 07:51:38 +02:00
Max Wase
8d9973eb00 Image header improvements and bugfixes (#375)
* Image header improvements and bugfixes

* Review fixes
2023-03-31 08:33:44 -07:00
Jesse Braham
21f1fa1912 Update toml dependency and fix errors, feature gate ctrlc dependency (#378)
* Update `toml` dependency to latest version and make required changes

* Put the `ctrl` dependency behind the `cli` option where it belongs
2023-03-30 11:09:03 -07:00
Sergio Gasquez Arcos
259b5d944a Fix Raspberry ci (#377)
* ci: 🔥 Delete duplicated file

* ci:  Add rustfmt check
2023-03-28 08:05:59 -07:00
Sergio Gasquez Arcos
3516c4bfd0 Update documentation (#368)
* ci:  Add Rasberry CI

* ci: 🐛 Fix typo

* ci: 🐛 Fix args order

* ci: 🐛 Fix args order

* ci: ⬆️ Bump actions/checkout

* ci: ⬆️ Bump Swatinem/rust-cache

* ci: ️ Avoid using actions-rs

* ci: ️ Replace actions-rs/toolchain by dtolnay/rust-toolchain

* ci: ️ Fix CI warnings

* ci: 🎨 Fix inputs

* ci: ️ Update mad9000/actions-find-and-replace-string and remove action-rs

* ci: ️ Update mad9000/actions-find-and-replace-string and remove action-rs

* style: 🚨 Fix clippy warning

* docs: 🎨 Fix links

* build: 🎨 Format includes

* style: 🎨 Sort dependencies

* build: ⬆️ Bump dependencies

* build: ⬆️ Bump dependencies

* ci: ️ Fail if there is a clippy warning

* docs: 📝 Remove docstrings

* docs: 📝 Update docstrings

* docs: 📝 Update monitor docstrings

* docs: 📝 Update monitor docstrings

* docs: 📝 Update config docstrings

* docs: 📝 Update cli mod docstrings

* docs: 📝 Update docstrings

* style: 🔊 Update log

* revert: ️ Revert cargo version upgrade

* revert: ️ Revert cargo version upgrade

* ci: ️ Fail on clippy warnings

* build: ⬇️ Downgrade dependencies to maintain msrv

* build: ️ Rever pinned dependency

* Update espflash/src/flasher/mod.rs

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* docs: 📝 Add refences to types

* docs: 📝 Fix typo

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2023-03-27 11:45:10 -07:00
Jesse Braham
6f6322b3c0 Fix chip revision check during flashing for the ESP8266 2023-03-24 11:45:58 -07:00
Jesse Braham
4e9aba6aa4 Bump the MSRV to 1.64.0 2023-03-24 11:04:42 -07:00
Jesse Braham
e6daeccdcb Restore the cursor when exiting from serial port selection via Ctrl-c 2023-03-24 11:04:42 -07:00
Joseph Ross
e1209135fa Disable watchdog timer before build. (#363)
* Ignore CLion project.

* Disable watchdog timer before build.

* Fix formatting.

* Re-enable the code to disable the watchdog, even if the flash stub is in use.
2023-03-24 10:21:22 -07:00
Kirill Mikhailov
62b882e07b Added ESP32-H2 support (#371)
* Added ESP32-H2 support

* fix esp32h2.rs (fmt)

* fix mod.rs (fmt)
2023-03-24 10:08:37 -07:00
Scott Mabin
194a0b2e55 Update stubs from espflash v4.5 (#359)
* Update stubs from v4.5 release of espflash

* Disable RTC watchdog when not using the stub

- Re add explicit RTC watchdog disable when **not** using the stub
- Add support for disabling esp32c6 RTC watchdog
2023-03-15 08:06:04 -07:00
Matteo Carnelos
4aa38f171c Add ESPFLASH_PORT environment variable 2023-03-15 07:18:37 -07:00
sethp
7a67c4186b fix: esp32c3 direct boot (#358)
* fix: esp32c3 direct-boot format

Prior to this change, attempting to `espflash flash` with the `--format
direct-boot` argument targeting an esp32c3 would fail, reporting:

```
Error: espflash::unsupported_image_format

  × Image format direct-boot is not supported by the esp32c3 revision v0.3
  help: The esp32c3 only supports direct-boot starting with revision 3
```

However, direct-boot on this board was working prior to the changes in
b25af06, and looking at the [docs][esp32c3 revisions] it seems that the
mapping that was chosen for the `c3` specifically was `v0.REVISION`:

> ECO  | Revision (Major.Minor)
> -----------------------------
> ECO1 | v0.1
> ECO2 | v0.2
> ECO3 | v0.3
> ECO4 | v0.4

[esp32c3 revisions]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/system/chip_revision.html#revisions

* refactor+docs: move & reword esp32c3 specific err

This change rewords the error message from "revision 3" to "revision 3
(v0.3)" in an effort to clarify the mapping between hardware revisions
and major/minor version numbers.

Additionally, it moves the esp32c3-specific error closer to the actual
version check to make it easier to keep both in sync.

* chore: remove unused import

Previously, `cargo check --all-targets` reported this import as unused.
Since it's just `const u16`, the import is probably side-effect free and
indeed safe to remove.
2023-03-08 08:12:43 -08:00
Dániel Buga
4665742898 Make Interface constructor public 2023-02-15 07:42:15 -08:00
Riccardo Ripanti
32bb9510b0 Fix espflash::write_bin
The problem with `write_bin` is that `board_info`, that was used instead of `print_board_info`, tries to open a new connection to the serial port and because a connection is made at the start of `write_bin`, when `board_info` gets called, it fails because the port is already being used
2023-02-15 07:41:18 -08:00
Sergio Gasquez Arcos
5095641efc Fix CI warnings (#350)
* ci: ⬆️ Bump actions/checkout

* ci: ⬆️ Bump Swatinem/rust-cache

* ci: ️ Avoid using actions-rs

* ci: ️ Replace actions-rs/toolchain by dtolnay/rust-toolchain

* ci: ️ Fix CI warnings

* ci: 🎨 Fix inputs

* ci: ️ Update mad9000/actions-find-and-replace-string and remove action-rs

* ci: ️ Update mad9000/actions-find-and-replace-string and remove action-rs
2023-02-02 07:01:47 -08:00
Jesse Braham
1c054e8412 Remove the USB Serial JTAG watchdog workaround now that we use the stub 2023-01-17 11:18:44 -08:00
Jesse Braham
123dfe1df8 No longer build releases for the Windows GNU target 2023-01-16 11:24:51 -08:00
Jesse Braham
90056f4691 Organize, simplify, and generally improve the errors (#342)
* Allow bin and csv partition tables for `cargo-espflash`, clean up errors

* Derive `EnumString` for `Chip` instead of manually implementing `FromStr`

* Organize, simplify, and generally improve the errors in `espflash`
2023-01-16 11:11:14 -08:00
Jesse Braham
60224d1e2a Version 2.0.0-rc.3 v2.0.0-rc.3 2023-01-12 08:29:58 -08:00
Jesse Braham
770b2f8761 Fix some clippy warnings, documentation updates 2023-01-12 08:29:58 -08:00
Jesse Braham
421a8dc54c Add an optional callback trait which can be implemented and provided to most flashing functions 2023-01-11 08:49:41 -08:00
Jesse Braham
911b28d0dc If a bootloader and/or partition table other than the defaults have been provided, indicate such 2023-01-10 12:57:15 -08:00
Jesse Braham
59d62c1de2 Mark public enums as #[non_exhaustive] for semver compatibility 2023-01-10 11:23:29 -08:00
Jesse Braham
50946ce517 Use the flasher stub by default 2023-01-10 09:58:11 -08:00
Jesse Braham
3aee2b2351 CLI improvements and dependency updates (#334)
* Update dependencies to their latest versions

* Derive `clap::ValueEnum` instead of using a macro

* Simplify flash config enums, make them more consistent

* Fix a bunch of clippy warnings
2023-01-10 09:26:11 -08:00
Björn Quentin
a0a9aef0f6 Fix monitor after flash for ESP32-C2 (#330)
* Fix espflash flashing

* Make sure to not read the xtal-freq after reset

* Fix cargo-espflash flashing
2023-01-05 06:06:34 -08:00
Scott Mabin
5727ed5a05 Update runner command 2023-01-04 23:42:10 +00:00
Jesse Braham
1a0a8481ff Make the flasher return a struct of device information instead of printing directly 2022-12-21 07:44:36 -08:00
Jesse Braham
f10d0fd334 Mention the bootloader/partition table auto-detection feature of cargo-espflash 2022-12-20 09:28:35 -08:00
Jesse Braham
8f3483667d Fix the CI badge in the README 2022-12-19 06:41:55 -08:00
Matous Hybl
bfbdece844 Reorder ports so that known ports appear first in CLI 2022-12-19 06:00:36 -08:00