From 6e86659c6274cf37ddd8a52236369348f661b8fe Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 4 Mar 2025 16:06:29 +0100 Subject: [PATCH] Made HOWTO a tiny bit better. --- ...firmware-and-compile-it_MeesElectronics.md | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Documentation/HOWTO-change-firmware-and-compile-it_MeesElectronics.md b/Documentation/HOWTO-change-firmware-and-compile-it_MeesElectronics.md index c74172e..feeeee9 100644 --- a/Documentation/HOWTO-change-firmware-and-compile-it_MeesElectronics.md +++ b/Documentation/HOWTO-change-firmware-and-compile-it_MeesElectronics.md @@ -1,12 +1,12 @@ # How to compile the rnode firmware yourself -## +## Required knowledge -This document +This document assumes some basic knowledge of programming. Like using code editors to edit source code and using basic commands like `make`. Plus some basic Linux knowledge. ## Dependencies -Make sure *git*, *make*, *python* and *pip* are instaled. Most likely these are already availble on your system. Otherwise do: +Make sure *git*, *make*, *python* and *pip* are installed. Most likely these are already available on your system. Otherwise do: $ sudo apt install git $ sudo apt install make @@ -32,6 +32,7 @@ Download arduino-cli: ## Clone git repo + $ cd $ git clone https://github.com/liberatedsystems/RNode_Firmware_CE.git ## Prepare @@ -49,7 +50,7 @@ To test if you can compile the firmware try it: $ make firmware-heltec32_v3 -Fingers crossed! +Be patient, this can take up to 15 minutes to complete. Wait for the command prompt to return. You should not see any errors. ## Define new board, the theory @@ -64,7 +65,7 @@ Every target board has a section 'firmware-', 'upload-' ### boards.h -Both BOARD_MODEL and BOARD_VARIANT are #defines in this file. They are used to define the pinout of the SPI port and if it has certain perifirals such as a screen BLE etc. +Both BOARD_MODEL and BOARD_VARIANT are #defines in this file. They are used to define the pinout of the SPI port and if it has certain peripherals such as a screen BLE etc. Let's see an example: @@ -123,13 +124,15 @@ If we want to add support for a new board we have to add a new section for this ## Define new board for real -Let's say we want to add support for the Waveshare ESP32-S3 Pico with an SX1278 LoRa transceiver. First we have to define a BOARD_MODEL. This is a 8 bit value that is used in the source code to select the right code for the hardware. Let's choose 0x61 as the BOARD_MODEL as this number is not used yet. +Go to the directory `~/RNode_Firmware_CE`. This is the source code of the RNode firmware. Here you will find all the files needed to compile the firmware. You can edit these files with any text editor you like. + +Let's say we want to add support for the Waveshare ESP32-S3 Pico with an SX1278 LoRa transceiver. First we have to define a BOARD_MODEL. This is an 8 bit value that is used in the source code to select the right code for the hardware. Let's choose 0x61 as the BOARD_MODEL as this number is not used yet. -Now we add the following three entries in the Makefile. The exact place is not critical. But it is good practice to put them allongside the already present sections for firmware, upload and release. +The source code is compiled using `make` and the file called *Makefile*. In this file, the following three entries for our new board have to be added. The exact place is not critical. But it is good practice to put them alongside the already present sections for firmware, upload and release. ``` # Added board from Mees Electronics -firmware-waveshare-esp32-s3-pico: check_bt_buffers +firmware-waveshare-esp32-s3-pico: arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" $(COMMON_BUILD_FLAGS) --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x61\"" ``` @@ -145,7 +148,7 @@ upload-waveshare-esp32-s3-pico: ``` release-waveshare-esp32-s3-pico: - arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" $(COMMON_BUILD_FLAGS) --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x61\" \"-DBOARD_VARIANT=0x31\"" + arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" $(COMMON_BUILD_FLAGS) --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x61\"" cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_waveshare-esp32-s3-pico.boot_app0 cp build/esp32.esp32.waveshare-esp32-s3-pico/RNode_Firmware_CE.ino.bin build/rnode_firmware_waveshare-esp32-s3-pico.bin cp build/esp32.esp32.waveshare-esp32-s3-pico/RNode_Firmware_CE.ino.bootloader.bin build/rnode_firmware_waveshare-esp32-s3-pico.bootloader