Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BOARD]: CanaryOne #3150

Merged
merged 30 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c6661f1
compiling w/o e-ink display
lolsborn Jun 12, 2023
74ce390
pinout changes
lolsborn Jun 12, 2023
4e2ee5a
progress getting LoRa and LCD working
lolsborn Jun 18, 2023
8df6273
fix for bootloader, gps pins
lolsborn Jul 17, 2023
7ce5964
add canary to build matrix
lolsborn Jul 23, 2023
2934a10
Merge branch 'canary' of github.com:canaryradio/firmware into canary
lolsborn Jul 23, 2023
6daa9c6
merge with main
lolsborn Jul 23, 2023
1b876b6
Merge pull request #2 from meshtastic/master
lolsborn Jul 23, 2023
265f206
fix build by excluding BellModem in RadioLib
lolsborn Jul 23, 2023
3da3f4a
Merge branch 'master' into canary
lolsborn Aug 5, 2023
de43b4a
fixes for GPS
lolsborn Aug 17, 2023
8c361dd
Fix LED_BLUE and GPS RX/TX pins
lolsborn Sep 11, 2023
35e0952
Merge branch 'master' into canary
lolsborn Jan 27, 2024
cc68530
Variant changes for merge
lolsborn Jan 27, 2024
5cf36cb
make GPS baud rate configurable
lolsborn Jan 27, 2024
8c747e6
fix debug config
lolsborn Jan 27, 2024
d9a5c3f
Canary v1.2 changes
lolsborn Jan 27, 2024
91e6185
Merge branch 'canary' of github.com:canaryradio/firmware into canary
lolsborn Jan 27, 2024
1fb779b
Fixes for GPS
lolsborn Jan 28, 2024
1c6c9d3
pass trunk check
hdngr Jan 28, 2024
c7f2311
bump protobufs to master
hdngr Jan 31, 2024
aaf55a2
update build flags to use CANARYONE enum
hdngr Jan 31, 2024
6a21b26
use canaryone throughout for consistency.
lolsborn Jan 31, 2024
05bac92
Merge pull request #5 from canaryradio/canaryone-consistency
hdngr Jan 31, 2024
7873f3c
Merge pull request #4 from canaryradio/canary-update-proto
hdngr Jan 31, 2024
1531241
#define 0 is still defined
lolsborn Feb 4, 2024
4a2b4b1
add back .vscode/extensions.json
hdngr Feb 9, 2024
33a8f95
bump protobufs
hdngr Feb 9, 2024
d0d85b5
Merge branch 'master' into canary
hdngr Feb 10, 2024
5585bf5
revert manual change to generated file
hdngr Feb 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
- board: rak4631_eink
- board: monteops_hw1
- board: t-echo
- board: canaryone
- board: pca10059_diy_eink
- board: feather_diy
- board: nano-g2-ultra
Expand Down
2 changes: 1 addition & 1 deletion bin/check-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [[ $# -gt 0 ]]; then
# can override which environment by passing arg
BOARDS="$@"
else
BOARDS="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 rak4631 rak4631_eink rak11200 t-echo pca10059_diy_eink"
BOARDS="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 rak4631 rak4631_eink rak11200 t-echo canaryone pca10059_diy_eink"
fi

echo "BOARDS:${BOARDS}"
Expand Down
8 changes: 4 additions & 4 deletions bin/check-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
set -e

if [[ $# -gt 0 ]]; then
# can override which environment by passing arg
BOARDS="$@"
# can override which environment by passing arg
BOARDS="$@"
else
BOARDS="rak4631 rak4631_eink t-echo pca10059_diy_eink pico rak11200 tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 nano-g1 station-g1 m5stack-core m5stack-coreink tbeam-s3-core"
BOARDS="rak4631 rak4631_eink t-echo canaryone pca10059_diy_eink pico rak11200 tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 nano-g1 station-g1 m5stack-core m5stack-coreink tbeam-s3-core"
fi

echo "BOARDS:${BOARDS}"

CHECK=""
for BOARD in $BOARDS; do
CHECK="${CHECK} -e ${BOARD}"
CHECK="${CHECK} -e ${BOARD}"
done

echo $CHECK
Expand Down
49 changes: 49 additions & 0 deletions boards/canaryone.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_CANARY -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [["0x239A", "0x4405"]],
"usb_product": "CanaryOne",
"mcu": "nrf52840",
"variant": "canaryone",
"variants_dir": "variants",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Canary (Adafruit BSP)",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://canaryradio.io/",
"vendor": "Canary Radio Company"
}
3 changes: 2 additions & 1 deletion boards/eink0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "TTGO eink (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/lora-relay-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Meshtastic Lora Relay V1 (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/lora-relay-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Meshtastic Lora Relay V1 (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/lora_isp4520.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
"svd_path": "nrf52.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "lora ISP4520",
Expand Down
3 changes: 2 additions & 1 deletion boards/nordic_pca10059.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "nRF52840 Dongle",
Expand Down
3 changes: 2 additions & 1 deletion boards/nrf52840_dk.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "A modified NRF52840-DK devboard (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/nrf52840_dk_modified.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "A modified NRF52840-DK devboard (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/ppr.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Meshtastic PPR (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/ppr1.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52833_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52833.svd"
"svd_path": "nrf52833.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Meshtastic PPR1 (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/t-echo.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "TTGO eink (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/wiscore_rak4600.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
"svd_path": "nrf52.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino", "zephyr"],
"name": "Adafruit Bluefruit nRF52832 Feather",
Expand Down
3 changes: 2 additions & 1 deletion boards/wiscore_rak4631.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "WisCore RAK4631 Board",
Expand Down
3 changes: 2 additions & 1 deletion boards/xiao_ble_sense.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Seeed Xiao BLE Sense",
Expand Down
2 changes: 2 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ default_envs = tbeam
;default_envs = tlora-t3s3-v1
;default_envs = lora-relay-v1 # nrf board
;default_envs = t-echo
;default_envs = canaryone
;default_envs = nrf52840dk-geeksville
;default_envs = native # lora-relay-v1 # nrf52840dk-geeksville # linux # or if you'd like to change the default to something like lora-relay-v1 put that here
;default_envs = nano-g1
Expand Down Expand Up @@ -57,6 +58,7 @@ build_flags = -Wno-missing-field-initializers
-DRADIOLIB_EXCLUDE_SI443X
-DRADIOLIB_EXCLUDE_RFM2X
-DRADIOLIB_EXCLUDE_AFSK
-DRADIOLIB_EXCLUDE_BELL
-DRADIOLIB_EXCLUDE_HELLSCHREIBER
-DRADIOLIB_EXCLUDE_MORSE
-DRADIOLIB_EXCLUDE_RTTY
Expand Down
2 changes: 1 addition & 1 deletion src/DebugConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define DEBUG_PORT (*console) // Serial debug port

#ifdef USE_SEGGER
#define DEBUG_PORT
// #undef DEBUG_PORT
#define LOG_DEBUG(...) SEGGER_RTT_printf(0, __VA_ARGS__)
#define LOG_INFO(...) SEGGER_RTT_printf(0, __VA_ARGS__)
#define LOG_WARN(...) SEGGER_RTT_printf(0, __VA_ARGS__)
Expand Down
14 changes: 13 additions & 1 deletion src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// -----------------------------------------------------------------------------
// GPS
// -----------------------------------------------------------------------------

#ifndef GPS_BAUDRATE
#define GPS_BAUDRATE 9600
#endif

#ifndef GPS_THREAD_INTERVAL
#define GPS_THREAD_INTERVAL 200
Expand All @@ -161,6 +162,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

/* Step #3: mop up with disabled values for HAS_ options not handled by the above two */

// -----------------------------------------------------------------------------
// GPS
// -----------------------------------------------------------------------------

#ifndef GPS_BAUDRATE
#define GPS_BAUDRATE 9600
#endif
#ifndef GPS_THREAD_INTERVAL
#define GPS_THREAD_INTERVAL 100
#endif

#ifndef HAS_WIFI
#define HAS_WIFI 0
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/modules/SerialModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
SerialModule *serialModule;
SerialModuleRadio *serialModuleRadio;

#ifdef TTGO_T_ECHO
#if defined(TTGO_T_ECHO) || defined(CANARYONE)
SerialModule::SerialModule() : StreamAPI(&Serial), concurrency::OSThread("SerialModule") {}
static Print *serialPrint = &Serial;
#else
Expand Down Expand Up @@ -140,7 +140,7 @@ int32_t SerialModule::runOnce()
Serial.begin(baud);
Serial.setTimeout(moduleConfig.serial.timeout > 0 ? moduleConfig.serial.timeout : TIMEOUT);
}
#elif !defined(TTGO_T_ECHO)
#elif !defined(TTGO_T_ECHO) && !defined(CANARYONE)
if (moduleConfig.serial.rxd && moduleConfig.serial.txd) {
#ifdef ARCH_RP2040
Serial2.setFIFOSize(RX_BUFFER);
Expand Down Expand Up @@ -188,7 +188,7 @@ int32_t SerialModule::runOnce()
}
}
}
#if !defined(TTGO_T_ECHO)
#if !defined(TTGO_T_ECHO) && !defined(CANARYONE)
else {
while (Serial2.available()) {
serialPayloadSize = Serial2.readBytes(serialBytes, meshtastic_Constants_DATA_PAYLOAD_LEN);
Expand Down
2 changes: 2 additions & 0 deletions src/platform/nrf52/architecture.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#define HW_VENDOR meshtastic_HardwareModel_T_ECHO
#elif defined(NANO_G2_ULTRA)
#define HW_VENDOR meshtastic_HardwareModel_NANO_G2_ULTRA
#elif defined(CANARYONE)
#define HW_VENDOR meshtastic_HardwareModel_CANARYONE
#elif defined(NORDIC_PCA10059)
#define HW_VENDOR meshtastic_HardwareModel_NRF52840_PCA10059
#elif defined(PRIVATE_HW) || defined(FEATHER_DIY)
Expand Down
15 changes: 15 additions & 0 deletions variants/canaryone/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; Public Beta oled/nrf52840/sx1262 device
[env:canaryone]
extends = nrf52840_base
board = canaryone
debug_tool = jlink

# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling.
build_flags = ${nrf52840_base.build_flags} -Ivariants/canaryone
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m4/fpv4-sp-d16-hard"
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/canaryone>
lib_deps =
${nrf52840_base.lib_deps}
adafruit/Adafruit BusIO@^1.13.2
lewisxhe/PCF8563_Library@^1.0.1
;upload_protocol = fs
56 changes: 56 additions & 0 deletions variants/canaryone/variant.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
Copyright (c) 2018, Adafruit Industries (adafruit.com)

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "variant.h"
#include "nrf.h"
#include "wiring_constants.h"
#include "wiring_digital.h"

const uint32_t g_ADigitalPinMap[] = {
// P0 - pins 0 and 1 are hardwired for xtal and should never be enabled
0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,

// P1
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};

void initVariant()
{
// LEDs
pinMode(PIN_LED1, OUTPUT);
ledOff(PIN_LED1);

pinMode(PIN_LED2, OUTPUT);
ledOff(PIN_LED2);

pinMode(PIN_LED3, OUTPUT);
ledOff(PIN_LED3);

// Turn on power to the GPS and LoRa
pinMode(PIN_PWR_EN, OUTPUT);
digitalWrite(PIN_PWR_EN, HIGH);

// Pull the GPS out of reset
pinMode(GPS_RESET_PIN, OUTPUT);
digitalWrite(GPS_RESET_PIN, HIGH);

// Pull the LoRa out of reset
pinMode(LORA_RF_PWR, OUTPUT);
digitalWrite(LORA_RF_PWR, HIGH);
}
Loading
Loading