From d8af625cc422d90628d0e881f303e3f8e22d0619 Mon Sep 17 00:00:00 2001 From: tomuk5 Date: Wed, 11 Sep 2024 22:46:35 +0100 Subject: [PATCH 1/2] E22 Board --- Boards.h | 42 +++++++++++++++++++++++++++++++++++++++++- Makefile | 21 ++++++++++++++++++++- Utilities.h | 5 +++++ 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/Boards.h b/Boards.h index eb2527b..19dff5b 100644 --- a/Boards.h +++ b/Boards.h @@ -38,8 +38,9 @@ #define BOARD_HELTEC32_V3 0x3A #define BOARD_RNODE_NG_20 0x40 #define BOARD_RNODE_NG_21 0x41 - #define BOARD_T3S3 0x42 + #define BOARD_T3S3 0x42 #define BOARD_TECHO 0x43 + #define BOARD_E22_ESP32 0x44 #define BOARD_GENERIC_NRF52 0x50 #define BOARD_RAK4631 0x51 @@ -625,6 +626,45 @@ -1 // pin_tcxo_enable } }; + + #elif BOARD_MODEL == BOARD_E22_ESP32 + #define HAS_DISPLAY true + #define DISPLAY OLED + #define HAS_BLUETOOTH true + #define HAS_BLE true + #define HAS_CONSOLE true + #define HAS_SD false + #define HAS_EEPROM true + #define I2C_SDA 21 + #define I2C_SCL 22 + #define INTERFACE_COUNT 1 + const int pin_led_rx = 2; + const int pin_led_tx = 4; + + const uint8_t interfaces[INTERFACE_COUNT] = {SX1262}; + const bool interface_cfg[INTERFACE_COUNT][3] = { + // SX1262 + { + true, // DEFAULT_SPI + true, // HAS_TCXO + true // DIO2_AS_RF_SWITCH + }, + }; + const int8_t interface_pins[INTERFACE_COUNT][10] = { + // SX1262 + { + 18, // pin_ss + 5, // pin_sclk + 27, // pin_mosi + 19, // pin_miso + 32, // pin_busy + 33, // pin_dio + 23, // pin_reset + -1, // pin_txen + 14, // pin_rxen + -1 // pin_tcxo_enable + } + }; #else #error An unsupported ESP32 board was selected. Cannot compile RNode firmware. #endif diff --git a/Makefile b/Makefile index 4618f95..6686947 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,9 @@ firmware-t3s3_sx1262: firmware-t3s3_sx1280_pa: arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DBOARD_VARIANT=0xA5\"" +firmware-e22_esp32: + arduino-cli compile --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x44\" \"-DEXTERNAL_LEDS=true\"" + firmware-lora32_v10: arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\"" @@ -200,6 +203,13 @@ upload-t3s3: @sleep 1 rnodeconf $(or $(port), /dev/ttyACM0) --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware_CE.ino.bin) +upload-e22_esp32: + arduino-cli upload -p $(or $(port), /dev/ttyUSB0) --fqbn esp32:esp32:esp32 + @sleep 1 + rnodeconf $(or $(port), /dev/ttyUSB0) --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32/RNode_Firmware_CE.ino.bin) + @sleep 3 + python3 ./Release/esptool/esptool.py --chip esp32 --port $(or $(port), /dev/ttyUSB0) --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin + upload-featheresp32: arduino-cli upload -p $(or $(port), /dev/ttyUSB0) --fqbn esp32:esp32:featheresp32 @sleep 1 @@ -214,7 +224,7 @@ upload-rak4631: release: release-all -release-all: console-site spiffs-image release-tbeam release-tbeam_sx1262 release-lora32_v10 release-lora32_v20 release-lora32_v21 release-lora32_v10_extled release-lora32_v20_extled release-lora32_v21_extled release-lora32_v21_tcxo release-featheresp32 release-genericesp32 release-heltec32_v2 release-heltec32_v3 release-heltec32_v2_extled release-rnode_ng_20 release-rnode_ng_21 release-t3s3 release-hashes +release-all: console-site spiffs-image release-tbeam release-tbeam_sx1262 release-lora32_v10 release-lora32_v20 release-lora32_v21 release-lora32_v10_extled release-lora32_v20_extled release-lora32_v21_extled release-lora32_v21_tcxo release-featheresp32 release-genericesp32 release-heltec32_v2 release-heltec32_v3 release-heltec32_v2_extled release-rnode_ng_20 release-rnode_ng_21 release-t3s3 release-e22_esp32 release-hashes release-hashes: python3 ./release_hashes.py > ./Release/release.json @@ -354,6 +364,15 @@ release-t3s3: zip --junk-paths ./Release/rnode_firmware_t3s3.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_t3s3.boot_app0 build/rnode_firmware_t3s3.bin build/rnode_firmware_t3s3.bootloader build/rnode_firmware_t3s3.partitions rm -r build +release-e22_esp32: + arduino-cli compile --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x44\"" + cp ~/.arduino15/packages/esp32/hardware/esp32/$(ESP_IDF_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_esp32_e22.boot_app0 + cp build/esp32.esp32.esp32/RNode_Firmware_CE.ino.bin build/rnode_firmware_esp32_e22.bin + cp build/esp32.esp32.esp32/RNode_Firmware_CE.ino.bootloader.bin build/rnode_firmware_esp32_e22.bootloader + cp build/esp32.esp32.esp32/RNode_Firmware_CE.ino.partitions.bin build/rnode_firmware_esp32_e22.partitions + zip --junk-paths ./Release/rnode_firmware_esp32_e22.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_esp32_e22.boot_app0 build/rnode_firmware_esp32_e22.bin build/rnode_firmware_esp32_e22.bootloader build/rnode_firmware_esp32_e22.partitions + rm -r build + release-featheresp32: arduino-cli compile --fqbn esp32:esp32:featheresp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x34\"" cp ~/.arduino15/packages/esp32/hardware/esp32/$(ESP_IDF_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_featheresp32.boot_app0 diff --git a/Utilities.h b/Utilities.h index 0424984..1006833 100644 --- a/Utilities.h +++ b/Utilities.h @@ -142,6 +142,11 @@ uint8_t boot_vector = 0x00; void led_rx_off() { digitalWrite(pin_led_rx, LOW); } void led_tx_on() { digitalWrite(pin_led_tx, HIGH); } void led_tx_off() { digitalWrite(pin_led_tx, LOW); } + #elif BOARD_MODEL == BOARD_E22_ESP32 + void led_rx_on() { digitalWrite(pin_led_rx, HIGH); } + void led_rx_off() { digitalWrite(pin_led_rx, LOW); } + void led_tx_on() { digitalWrite(pin_led_tx, HIGH); } + void led_tx_off() { digitalWrite(pin_led_tx, LOW); } #elif BOARD_MODEL == BOARD_TBEAM void led_rx_on() { digitalWrite(pin_led_rx, HIGH); } void led_rx_off() { digitalWrite(pin_led_rx, LOW); } From 50a60f07d2e52cc2861e841696afd618020d33d0 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 16 Sep 2024 12:50:56 -0400 Subject: [PATCH 2/2] fixes adds missing adafruit repo used for prep-nrf, and adds prep-nrf to the make prep --- Makefile | 2 +- arduino-cli.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4618f95..6ed3007 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ clean: -rm -r ./build -rm ./Release/rnode_firmware* -prep: prep-esp32 prep-samd +prep: prep-esp32 prep-nrf prep-samd prep-esp32: arduino-cli core update-index --config-file arduino-cli.yaml diff --git a/arduino-cli.yaml b/arduino-cli.yaml index a8ad233..2f836f0 100644 --- a/arduino-cli.yaml +++ b/arduino-cli.yaml @@ -1,5 +1,6 @@ board_manager: additional_urls: + - https://adafruit.github.io/arduino-board-index/package_adafruit_index.json - https://liberatedsystems.co.uk/rnode-firmware-ce/esp-custom-package.json - https://raw.githubusercontent.com/RAKwireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless_index.json - http://unsigned.io/arduino/package_unsignedio_UnsignedBoards_index.json