Skip to content

Commit

Permalink
Update README and .gitignore, fix CI (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebraham committed May 11, 2022
1 parent c0069cb commit 52da13c
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 58 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ jobs:
runs-on: ${{ inputs.runs_on }}

steps:
- name: build dependencies
- name: Change apt mirror and install dependencies
if: ${{ inputs.runs_on == 'ubuntu-latest' }}
run: |
sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install musl-tools libudev-dev
- uses: actions/checkout@v2
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- name: build dependencies
- name: Change apt mirror and install dependencies
run: |
sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install musl-tools libudev-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -30,8 +32,10 @@ jobs:
name: Check MSRV
runs-on: ubuntu-latest
steps:
- name: build dependencies
- name: Change apt mirror and install dependencies
run: |
sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install musl-tools libudev-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -48,8 +52,10 @@ jobs:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: build dependencies
- name: Change apt mirror and install dependencies
run: |
sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install musl-tools libudev-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -84,8 +90,10 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: build dependencies
- name: Change apt mirror and install dependencies
run: |
sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install musl-tools libudev-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand Down
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
/target
/Cargo.lock
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# Ignore any files used by text editors or operating systems.
.vscode/
.DS_Store
*.swp
/.vscode
83 changes: 33 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,95 +7,78 @@ Serial flasher utility for Espressif SoCs and modules based on [esptool.py].

Currently supports the **ESP32**, **ESP32-C3**, **ESP32-S2**, **ESP32-S3**, and **ESP8266**.

This repository contains two applications:
### cargo-espflash

| Application | Description |
| :--------------- | :---------------------------------------------------------- |
| [cargo-espflash] | Cargo subcommand for espflash |
| [espflash] | Library and `espflash` binary (_without_ Cargo integration) |
[cargo-espflash] is a subcommand for Cargo which utilizes the [espflash] library. This tool integrates with your Cargo projects and handles compilation, flashing, and monitoring of target devices.

> **NOTE:** requires `rustc >= 1.59.0` in order to build either application
Please see the [cargo-espflash README] for more information.

## Installation
#### Example

```shell
$ cargo install cargo-espflash
$ cargo install espflash
$ cargo espflash --release --example=blinky /dev/ttyUSB0
```

## cargo-espflash
[cargo-espflash readme]: https://github.com/esp-rs/espflash/blob/master/cargo-espflash/README.md

[cargo-espflash] is a subcommand for Cargo which utilizes the [espflash] library. This tool integrates with your Cargo projects and handles compilation, flashing, and monitoring for target devices.
### espflash

Please see the [cargo-espflash README] for more information.
[espflash] is a standalone binary and library contained within the same crate. This tool does not integrate with Cargo, but supports all of the same features as [cargo-espflash] which are not related to compilation.

### Example
Please see the [espflash README] for more information.

#### Example

```shell
$ cargo espflash --release --example=blinky /dev/ttyUSB0
$ espflash /dev/ttyUSB0 target/xtensa-esp32-none-elf/release/examples/blinky
```

## espflash
[espflash readme]: https://github.com/esp-rs/espflash/blob/master/espflash/README.md
[esptool.py]: https://github.com/espressif/esptool
[cargo-espflash]: https://github.com/esp-rs/espflash/tree/master/cargo-espflash
[espflash]: https://github.com/esp-rs/espflash/tree/master/espflash

## Installation

[espflash] is a standalone binary and library contained within the same crate. This tool does not integrate with Cargo, but supports all of the same features as [cargo-espflash] which are not related to compilation.
Either application can be installed using `cargo` as you normally would:

Please see the [espflash README] for more information.
```shell
$ cargo install cargo-espflash
$ cargo install espflash
```

### Example
Alternatively, you can use [cargo-binstall] to install pre-compiled binaries on any supported system. Please check the [releases] to see which architectures and operating systems have pre-compiled binaries.

```shell
$ espflash /dev/ttyUSB0 target/xtensa-esp32-none-elf/release/examples/blinky
$ cargo binstall cargo-espflash
$ cargo binstall espflash
```

[cargo-binstall]: https://github.com/ryankurte/cargo-binstall
[releases]: https://github.com/esp-rs/espflash/releases

## Notes on Building

In order to build from source, in addition to the Rust toolchain [libuv](https://libuv.org/) must be present on your system. This can be installed via most popular package managers.
Requires `rustc >= 1.59.0` in order to build either application from source. In addition to the Rust toolchain [libuv](https://libuv.org/) must also be present on your system; this can be installed via most popular package managers.

### macOS
#### macOS

```bash
$ brew install libuv
```

### Ubuntu
#### Ubuntu

```bash
$ sudo apt-get install libuv-dev
```

### Fedora
#### Fedora

```bash
$ dnf install systemd-devel
```

## Quickstart - Docker

The `esprs/espflash` Docker image contains all necessary toolchains and tooling (including espflash) to build an application and flash it to a target device.

To clone, build and flash the [esp32-hal] examples run the following:

```shell
$ git clone https://github.com/esp-rs/esp32-hal
$ cd esp32-hal
$ docker run -v "$(pwd):/espflash" --device=/dev/ttyUSB0 -ti esprs/espflash --release --example=blinky /dev/ttyUSB0
```

### Custom Docker Build

```shell
$ git clone --depth 1 https://github.com/esp-rs/espflash.git
$ cd espflash
$ docker build -t esprs/espflash .
```

## License

Licensed under the GNU General Public License Version 2. See [LICENSE](./espflash/LICENSE) for more details.

[esptool.py]: https://github.com/espressif/esptool
[cargo-espflash]: https://github.com/esp-rs/espflash/tree/master/cargo-espflash
[espflash]: https://github.com/esp-rs/espflash/tree/master/espflash
[cargo-espflash readme]: https://github.com/esp-rs/espflash/blob/master/cargo-espflash/README.md
[espflash readme]: https://github.com/esp-rs/espflash/blob/master/espflash/README.md
[esp32-hal]: https://github.com/esp-rs/esp32-hal

0 comments on commit 52da13c

Please sign in to comment.