diff --git a/docs/development/firmware/building.mdx b/docs/development/firmware/building.mdx index f36ab5cd..2c8863ba 100644 --- a/docs/development/firmware/building.mdx +++ b/docs/development/firmware/building.mdx @@ -2,6 +2,7 @@ id: build title: Building Meshtastic Firmware sidebar_label: Building Firmware +sidebar_position: 2 --- Meshtastic uses [PlatformIO](https://platformio.org), a development environment that enables easy multi-platform development and centralized tooling. @@ -17,9 +18,9 @@ Meshtastic uses [PlatformIO](https://platformio.org), a development environment ```shell cd firmware && git submodule update --init ``` -:::info -If you want to build the RP2040 targets and get a 'Filename too long' error on Windows, please refer to [the Platformio documentation for this toolchain](https://arduino-pico.readthedocs.io/en/latest/platformio.html#important-steps-for-windows-users-before-installing) -::: + :::info + If you want to build the RP2040 targets and get a 'Filename too long' error on Windows, please refer to [the Platformio documentation for this toolchain](https://arduino-pico.readthedocs.io/en/latest/platformio.html#important-steps-for-windows-users-before-installing) + ::: ## Build diff --git a/docs/development/firmware/nrf52-guide.mdx b/docs/development/firmware/nrf52-guide.mdx new file mode 100644 index 00000000..5f22f66a --- /dev/null +++ b/docs/development/firmware/nrf52-guide.mdx @@ -0,0 +1,55 @@ +--- +id: nrf52-guide +title: Development Guide for nRF52 +sidebar_label: NRF52 Guide +sidebar_position: 6 +--- + +This document is a collection of tips and best practices for developing on the nRF52 platform. It is designed to evolve continuously with the latest information, and contributions are welcome through pull requests on GitHub. + +## Using the NanoDAP USB debugging probe + +This is a mini-HOWTO on installing the appropriate firmware and adapter software, it is loosely based on [this tutorial by RAK](https://docs.rakwireless.com/Product-Categories/Accessories/RAKDAP1-Flash-and-Debug-Tool/Quickstart/#rak4600-evaluation-board). + +### Required hardware + +The [RAKDAP1/NanoDAP](https://store.rakwireless.com/products/daplink-tool) is a very reasonably priced ($10) USB-based debugging probe. It can be used on many ARM targets but is particularly suited for the nRF52 CPUs. It seems to be based on the ARM [daplink](https://daplink.io/) [project](https://github.com/ARMmbed/DAPLink). The fork of this project is located here: [nanoDAP](https://github.com/wuxx/nanoDAP). The fork is fairly old with respect to the latest daplink goodness, but it seems fine. + +If you are looking to buy a probe, there are many other daplink-based devices available. They are suspected to be mostly identical. If you find one that works well, please add a note to this document. + +### Required software + +You'll need to install the [pyocd](https://pyocd.io/) application to allow VSCode to talk to the NanoDAP. You first install the tool itself but then must add the support files for the nrf52840: + +```bash +pip3 install pyocd +pyocd pack --i nrf52840 +pyocd pack -s +``` + +If you are developing on a linux system, you will need to install the udev rules for the NanoDAP. + +This is done by copying the rules file from the pyocd distribution to the udev rules directory [per these instructions](https://github.com/pyocd/pyOCD/tree/main/udev). + +### Connecting the NanoDAP to your nRF52 target + +The NanoDAP has a 10-pin connector, but only three of these pins need to be connected: + +- **Ground**: Connects to the ground on the target. +- **TMS-IO**: Connects to SWDIO on the target. +- **TCK-CK**: Connects to SWCLK on the target. + +Some web instructions recommend connecting the RESET and 3V3 pins, but this is usually not necessary. + +#### Wiring Guide + +This image shows an example connection to a RAK4630 board: +![RAK4630 DAP connection](/img/RAKDAP1_New_1.webp) +Photo Courtesy of [RAK Wireless](https://docs.rakwireless.com/assets/images/accessories/rakdap1-flash-and-debug-tool/RAKDAP1_New_1.png). + +### Using the NanoDAP with VSCode + +The Meshtastic project has a special build environment/target which has been configured to work with the NanoDAP. To use it select the "env:rak3631_dap" target via the command palette or in the bottom left of your VSCode/PlatformIO window. Once that target is selected it changes two things: + +- Device programming is no longer performed via the USB bootloader. Instead you you select "Upload" it will use the NanoDAP to program the device. +- The "Debug" button in VSCode will be enabled. If you click that button it will launch the ICE assisted debugger and you can set breakpoints etc... diff --git a/docs/development/firmware/oled-guide.mdx b/docs/development/firmware/oled-guide.mdx index 4a814d4e..2c24ea82 100644 --- a/docs/development/firmware/oled-guide.mdx +++ b/docs/development/firmware/oled-guide.mdx @@ -2,6 +2,7 @@ id: oled-guide title: OLED Localization Guide sidebar_label: OLED Localization +sidebar_position: 3 --- 1. Create an extended ASCII custom font. Use a glyph editor to create a new font file. The easiest way is to use the online [glyph editor](https://rawgit.com/ThingPulse/esp8266-oled-ssd1306/master/resources/glyphEditor.html) from the OLED library. ([glyph editor source code](https://github.com/ThingPulse/esp8266-oled-ssd1306/tree/master/resources)) diff --git a/docs/development/firmware/port-numbers.mdx b/docs/development/firmware/port-numbers.mdx index c0bfea43..a936b8c0 100644 --- a/docs/development/firmware/port-numbers.mdx +++ b/docs/development/firmware/port-numbers.mdx @@ -2,6 +2,7 @@ id: portnum title: Meshtastic Port Numbers sidebar_label: Port Numbers +sidebar_position: 4 --- Any new app that runs on the device or via sister apps on phones/PCs should pick and use a unique "portnum" for their applications use. diff --git a/docs/development/firmware/stacktraces.mdx b/docs/development/firmware/stacktraces.mdx index cd5cf2bd..e120a93e 100644 --- a/docs/development/firmware/stacktraces.mdx +++ b/docs/development/firmware/stacktraces.mdx @@ -2,6 +2,7 @@ id: stacktraces title: Stacktraces sidebar_label: Stacktraces +sidebar_position: 5 --- ## Decoding Stacktraces diff --git a/static/img/RAKDAP1_New_1.webp b/static/img/RAKDAP1_New_1.webp new file mode 100644 index 00000000..4fc5b155 Binary files /dev/null and b/static/img/RAKDAP1_New_1.webp differ