Skip to content

Commit

Permalink
Merge branch 'main' into rust-software
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyoxis committed Jan 21, 2025
2 parents d0966a1 + ac767b4 commit 858d1ca
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 108 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust-cargo-deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:

steps:
- name: Checkout Sources
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.0

- name: Run cargo-deny
uses: EmbarkStudios/cargo-deny-action@v1
uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check ${{ matrix.checks }}

2 changes: 1 addition & 1 deletion .github/workflows/rust-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.0
with:
fetch-depth: 50
submodules: 'recursive'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.0
with:
fetch-depth: 50
submodules: 'recursive'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust-test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.0
with:
fetch-depth: 50
submodules: 'recursive'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.0
with:
fetch-depth: 50
submodules: 'recursive'
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/semantic.yml

This file was deleted.

67 changes: 11 additions & 56 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@

# Pilkki
SWD flashing tool for EFM32 microcontrollers.

## Project structure

Utility to interact with flasher could be found in [software](software) folder.
The project is divided into three parts:

1. **[Software](software)**: The flashing utility.
2. **[Electronics](electronics)**: Schematics and PCB (KiCAD).
3. **[Firmware](firmware)**: Firmware for the target device.

### How to Use

To use flasher, call `cargo run`, or build by `cargo build --release`
To use the flasher, you can either:

Schematics and PCB (KiCAD) are in [electronics](electronics) folder.
- Run the utility directly with `cargo run`
- Build the project in release mode with `cargo build --release`

Firmware sources are [here](firmware)
More info on how to use pilkki in [Readme.md](software/Readme.md) in the [Software](software) section
10 changes: 10 additions & 0 deletions electronics/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Pilkki Electronics
This folder contains the schematics and PCB layout for the Pilkki, created in KiCad.

### Files

- `pilkki.kicad_pcb`: The PCB layout.
- `pilkki.kicad_sch`: The circuit schematics.
- `pilkki.kicad_pro`: The KiCad project file.

To view and edit these files, use [KiCad](https://kicad.org/).
17 changes: 11 additions & 6 deletions software/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
[package]
name = "pilkki"
version = "0.1.0"
description = "Flasher tool for Kampela project"
license = "GPL-3.0-or-later"
version = "0.1.1"
authors = ["Alexander Slesarev <[email protected]>", "Vera Abramova <[email protected]>"]
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
repository = "https://github.com/Kalapaja/pilkki"
homepage = "https://kampe.la"
documentation = "https://docs.rs/pilkki/"
keywords = ["embedded", "kampela", "serial"]

[dependencies]
clap = { version = "4.5.1", features = ["cargo"] }
crc = "3.0.1"
clap = { version = "4.5.18", features = ["cargo"] }
crc = "3.2.1"
hex = "0.4.3"
memmem = "0.1.1"
serialport = { version = "4.3.0", default-features = false }
serialport = { version = "4.5.1", default-features = false }

[target.'cfg(target_os = "linux")'.dependencies]
serialport = {version = "4.3.0", features = ["libudev"]}
Expand Down
52 changes: 52 additions & 0 deletions software/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

# Pilkki Software
This folder contains the utility to interact with the flasher.

## How to Use

To run the flashing tool:
- Use `cargo run` to run the tool.
- Use `cargo build --release` to build the release version.

The utility should automatically detect the connected port; otherwise, you can specify it manually with the `--port` flag.

### Getting help
```sh
cargo run -- help
```

### Finding the Port to Which Your Device Is Connected:

**Linux:**
```sh
ls /dev/ttyUSB*
```

**MacOS:**
```sh
ls /dev/tty.* /dev/cu.*
```

### Verify Connection to the Device

To connect to the device, run:
```sh
cargo run -- --port /port/address connect
```

### Flash a New Binary:

To flash a new binary to the device:
```sh
cargo run -- write --input /path/to/your/binary.bin
```
Or, if you need to specify the port manually:
```sh
cargo run -- write --port /port/address --input /path/to/your/binary.bin
```

### Getting the Firmware Binary

You can either:
- Build the binary using the code from the [kampela-firmware](https://github.com/Kalapaja/kampela-firmware) repository.
- Download the compiled binary from the [releases](https://github.com/Kalapaja/kampela-firmware/releases) section.

0 comments on commit 858d1ca

Please sign in to comment.