From ac430fe89b2c8a7ec1ea997c120d0b2af0055562 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 16 Feb 2024 22:59:14 +0800 Subject: [PATCH] docs: finish the create_project section Signed-off-by: Haobo Gu --- docs/src/SUMMARY.md | 3 +-- docs/src/compile_and_flash.md | 8 ++++++++ docs/src/create_project.md | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 docs/src/compile_and_flash.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 09fadf98..8f8d1915 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -9,8 +9,7 @@ - [Overview](guide_overview.md) - [Setup RMK environment](setup_environment.md) - [Create RMK project](create_project.md) -- [Choose your microcontroller]() -- [Compile and flash!]() +- [Compile and flash!](compile_and_flash.md) # Features - [Keymap configuration]() diff --git a/docs/src/compile_and_flash.md b/docs/src/compile_and_flash.md new file mode 100644 index 00000000..46e82a6c --- /dev/null +++ b/docs/src/compile_and_flash.md @@ -0,0 +1,8 @@ +# Compile and flash! + +So far so good, your firmware should be ready now! + +In this section, you'll be able to compile your firmware and flash it to your microcontroller. + +## 1. Compile the firmware + diff --git a/docs/src/create_project.md b/docs/src/create_project.md index 5c001fbf..8e77210e 100644 --- a/docs/src/create_project.md +++ b/docs/src/create_project.md @@ -47,3 +47,23 @@ The followings are the detailed steps: ### 2.2 Update USB interrupt binding in `main.rs` +Next, you have to check generated `src/main.rs`, make sure that the binded USB interrupt is right. Different microcontrollers have different types of USB peripheral, so does binded interrupt. You can check out [Embassy's examples](https://github.com/embassy-rs/embassy/tree/main/examples) for how to bind the USB interrupt correctly. + +For example, if you're using stm32f4, there is a [usb serial example](https://github.com/embassy-rs/embassy/blob/main/examples/stm32f4/src/bin/usb_serial.rs) there. And code for binding USB interrupt is at [line 15-17](https://github.com/embassy-rs/embassy/blob/main/examples/stm32f4/src/bin/usb_serial.rs#L15-L17): + +```rust +bind_interrupts!(struct Irqs { + OTG_FS => usb_otg::InterruptHandler; +}); +``` + +Don't forget to import all used items! + +### 2.3 Add your own keymap + +The next step is to add your own keymap for your firmware. RMK supports [vial app](https://get.vial.today/), an open-source cross-platform(windows/macos/linux/web) keyboard configurator. So the vial like keymap definition has to be imported to the firmware project. + +Fortunately, RMK does most of the heavy things for you, all you need to do is to create your own keymap definition and convert it to `vial.json` following vial's doc **[here](https://get.vial.today/docs/porting-to-via.html)**, and place it at the root of the firmware project, replacing the default one. RMK would do all the rest things for you. + +### +