Skip to content

Commit

Permalink
Merge pull request #215 from fhanrath/chore/update-docs
Browse files Browse the repository at this point in the history
chore: updated the docs for this [PR](https://github.com/HaoboGu/rmk-…
  • Loading branch information
HaoboGu authored Dec 25, 2024
2 parents 44ba0df + d1846fb commit a9fe18e
Show file tree
Hide file tree
Showing 26 changed files with 275 additions and 882 deletions.
13 changes: 3 additions & 10 deletions docs/po/zh_CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,9 @@ msgstr ""

#: src\user_guide/4_compile_and_flash.md:36
msgid ""
"Then, update the chip family argument(aka argument after -f) in `Makefile."
"toml` in your project. You can get your chip's family ID in `scripts/uf2conv."
"py`."
"Then, update the chip family argument(aka argument after --family) in `Makefile."
"toml` in your project. You can get your chip's family ID [here](https://git.sr.ht"
"/~fenris/hex-to-uf2/tree/main/item/hex_to_uf2/src/families.rs#L7)"
msgstr ""

#: src\user_guide/4_compile_and_flash.md:38
Expand Down Expand Up @@ -729,13 +729,6 @@ msgid ""
"used to generate uf2 firmware:"
msgstr ""

#: src\faq.md:39
msgid ""
"This script requires you have `python` command available in your "
"commandline. Some platforms have `python3` command only, you can change "
"`python` in `Makefile.toml` to `python3` in this case."
msgstr ""

#: src\faq.md:41
msgid "I can see a `RMK Start` log, but nothing else"
msgstr ""
Expand Down
2 changes: 0 additions & 2 deletions docs/src/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ By default, Rust compiler generates `elf` file in target folder. There're a litt
cargo make uf2 --release
```

This script requires you have `python` command available in your commandline. Some platforms have `python3` command only, you can change `python` in `Makefile.toml` to `python3` in this case.

### I changed keymap in `keyboard.toml`, but the keyboard is not updated

RMK assumes that users change the keymap using [vial](https://vial.rocks). So reflashing the firmware won't change the keymap by default. For testing senario, RMK provides a config `clear_storage` under `[storage]` section, you can enable it to clear the storage when the keyboard boots.
Expand Down
6 changes: 2 additions & 4 deletions docs/src/user_guide/2-2_local_compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ You can use the following commands to install them:
irm https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.ps1 | iex
```

Generating uf2 firmware also requires you have `python` command available. [Here](https://wiki.python.org/moin/BeginnersGuide/Download) is a guide for installing python.

## Create firmware project

You can use `rmkit` to create the firmware project:
Expand Down Expand Up @@ -153,9 +151,9 @@ If you encountered any problems when compiling the firmware, please report it [h

By default, Rust firmware is an ELF file, so we have to do some extra steps converting it to uf2 format.

RMK uses [cargo-make](https://github.com/sagiegurari/cargo-make) to automate the uf2 firmware generation. Generating uf2 firmware also requires you have `python` command available.
RMK uses [cargo-make](https://github.com/sagiegurari/cargo-make) to automate the uf2 firmware generation.

Then you should make sure the chip family argument(aka argument after -f) in `Makefile.toml` is correct. You can get your chip's family ID in `scripts/uf2conv.py`.
Then you should make sure the chip family argument(aka argument after --family) in `Makefile.toml` is correct. You can get your chip's family [here](https://github.com/fhanrath/hex-to-uf2/blob/main/hex_to_uf2/src/families.rs#L7).

That's all you need to set up. The final step is to run

Expand Down
16 changes: 10 additions & 6 deletions examples/use_config/nrf52832_ble/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"]
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk.hex",
"-c",
"-f",
"0x72721d4e", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk.uf2",
"--family",
"nrf52832xx-aa",
]
dependencies = ["objcopy"]
16 changes: 10 additions & 6 deletions examples/use_config/nrf52840_ble/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"]
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk.hex",
"-c",
"-f",
"0xADA52840", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk.uf2",
"--family",
"nrf52840",
]
dependencies = ["objcopy"]
32 changes: 20 additions & 12 deletions examples/use_config/nrf52840_ble_split/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,36 @@ args = [
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2-central]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk-central.hex",
"-c",
"-f",
"0xADA52840", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk-central.uf2",
"--family",
"nrf52840",
]
dependencies = ["objcopy-central"]

[tasks.uf2-peripheral]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk-peripheral.hex",
"-c",
"-f",
"0xADA52840", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk-peripheral.uf2",
"--family",
"nrf52840",
]
dependencies = ["objcopy-peripheral"]

Expand Down
32 changes: 20 additions & 12 deletions examples/use_config/nrf52840_ble_split_direct_pin/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,36 @@ args = [
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2-central]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk-central.hex",
"-c",
"-f",
"0xADA52840", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk-central.uf2",
"--family",
"nrf52840",
]
dependencies = ["objcopy-central"]

[tasks.uf2-peripheral]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk-peripheral.hex",
"-c",
"-f",
"0xADA52840", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk-peripheral.uf2",
"--family",
"nrf52840",
]
dependencies = ["objcopy-peripheral"]

Expand Down
16 changes: 10 additions & 6 deletions examples/use_config/nrf52840_usb/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"]
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk.hex",
"-c",
"-f",
"0xADA52840", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk.uf2",
"--family",
"nrf52840",
]
dependencies = ["objcopy"]
16 changes: 10 additions & 6 deletions examples/use_config/rp2040/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"]
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk.hex",
"-c",
"-f",
"0xe48bff56", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk.uf2",
"--family",
"rp2040",
]
dependencies = ["objcopy"]
16 changes: 10 additions & 6 deletions examples/use_config/rp2040_direct_pin/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"]
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk.hex",
"-c",
"-f",
"0xe48bff56", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk.uf2",
"--family",
"rp2040",
]
dependencies = ["objcopy"]
32 changes: 20 additions & 12 deletions examples/use_config/rp2040_split/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,36 @@ args = [
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2-central]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk-central.hex",
"-c",
"-f",
"0xe48bff56", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk-central.uf2",
"--family",
"rp2040",
]
dependencies = ["objcopy-central"]

[tasks.uf2-peripheral]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk-peripheral.hex",
"-c",
"-f",
"0xe48bff56", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk-peripheral.uf2",
"--family",
"rp2040",
]
dependencies = ["objcopy-peripheral"]

Expand Down
16 changes: 10 additions & 6 deletions examples/use_config/stm32f1/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"]
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk.hex",
"-c",
"-f",
"0x6db66082", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk.uf2",
"--family",
"stm32f1",
]
dependencies = ["objcopy"]
16 changes: 10 additions & 6 deletions examples/use_config/stm32f4/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"]
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2]
command = "python"
install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [
"hex-to-uf2",
"--help",
] }
command = "cargo"
args = [
"../../../scripts/uf2conv.py",
"hex-to-uf2",
"--input-path",
"rmk.hex",
"-c",
"-f",
"0x6db66082", # Use your chip family ID in the uf2conv.py file as -f argument
"-o",
"--output-path",
"rmk.uf2",
"--family",
"stm32f4",
]
dependencies = ["objcopy"]
Loading

0 comments on commit a9fe18e

Please sign in to comment.