From da75a5443f545e57bb1a5b9d00c1125d131ef88d Mon Sep 17 00:00:00 2001 From: ambraglow Date: Tue, 27 Jan 2026 17:08:45 +0100 Subject: [PATCH 1/3] Add support for Syldra development board --- src/boards/syldra/board.cmake | 1 + src/boards/syldra/board.h | 66 +++++++++++++++++++++++++++++++++++ src/boards/syldra/board.mk | 2 ++ src/boards/syldra/pinconfig.c | 19 ++++++++++ 4 files changed, 88 insertions(+) create mode 100644 src/boards/syldra/board.cmake create mode 100644 src/boards/syldra/board.h create mode 100644 src/boards/syldra/board.mk create mode 100644 src/boards/syldra/pinconfig.c diff --git a/src/boards/syldra/board.cmake b/src/boards/syldra/board.cmake new file mode 100644 index 0000000..25daf71 --- /dev/null +++ b/src/boards/syldra/board.cmake @@ -0,0 +1 @@ +set(MCU_VARIANT nrf52840) diff --git a/src/boards/syldra/board.h b/src/boards/syldra/board.h new file mode 100644 index 0000000..4afa78d --- /dev/null +++ b/src/boards/syldra/board.h @@ -0,0 +1,66 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2026 Ambraglow + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _SYLDRA_H +#define _SYLDRA_H + +#define _PINNUM(port, pin) ((port)*32 + (pin)) + +//------------------------------------------------------------------// +// LED +//------------------------------------------------------------------// +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN _PINNUM(0, 17) // AD10 LED +#define LED_STATE_ON 1 + +//------------------------------------------------------------------// +// BUTTON +//------------------------------------------------------------------// +#define BUTTONS_NUMBER 2 +#define BUTTON_1 _PINNUM(0, 24) // AD20 -- DFU +#define BUTTON_2 _PINNUM(1, 00) // AD22 -- FRST + +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + + +//-------------------------------------------------------------------// +// BLE OTA +//-------------------------------------------------------------------// +#define BLEDIS_MANUFACTURER "Ambraglow-&-localcc" +#define BLEDIS_MODEL "Syldra_dev_r1" + + +//--------------------------------------------------------------------+ +// USB - using test PIDs +//--------------------------------------------------------------------+ +#define USB_DESC_VID 0x1209 +#define USB_DESC_UF2_PID 0x0001 +#define USB_DESC_CDC_ONLY_PID 0x7A01 + +#define UF2_PRODUCT_NAME "Syldra nrf52840 Development Board" +#define UF2_VOLUME_LABEL "Syldra-boot" +#define UF2_BOARD_ID "Syldra-dev-v1" +#define UF2_INDEX_URL "https://github.com/ambraglow/nonorf" + +#endif \ No newline at end of file diff --git a/src/boards/syldra/board.mk b/src/boards/syldra/board.mk new file mode 100644 index 0000000..befd7cb --- /dev/null +++ b/src/boards/syldra/board.mk @@ -0,0 +1,2 @@ +MCU_SUB_VARIANT = nrf52840 +SD_NAME = s140 \ No newline at end of file diff --git a/src/boards/syldra/pinconfig.c b/src/boards/syldra/pinconfig.c new file mode 100644 index 0000000..2a592df --- /dev/null +++ b/src/boards/syldra/pinconfig.c @@ -0,0 +1,19 @@ +#include "boards.h" +#include "uf2/configkeys.h" + +__attribute__((used, section(".bootloaderConfig"))) +const uint32_t bootloaderConfig[] = +{ + /* CF2 START */ + CFG_MAGIC0, CFG_MAGIC1, // magic + 5, 100, // used entries, total entries + + 204, 0x100000, // FLASH_BYTES = 0x100000 + 205, 0x40000, // RAM_BYTES = 0x40000 + 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 + 209, 0xada52840, // UF2_FAMILY = 0xada52840 + 210, 0x20, // PINS_PORT_SIZE = PA_32 + + 0, 0, 0, 0, 0, 0, 0, 0 + /* CF2 END */ +}; \ No newline at end of file From 5bb68e612548690de7204fc4308b4bf736fe8579 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 2 Feb 2026 19:12:21 +0700 Subject: [PATCH 2/3] sync master --- src/boards/syldra/board.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/boards/syldra/board.h b/src/boards/syldra/board.h index 4afa78d..b48024a 100644 --- a/src/boards/syldra/board.h +++ b/src/boards/syldra/board.h @@ -25,32 +25,27 @@ #ifndef _SYLDRA_H #define _SYLDRA_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - //------------------------------------------------------------------// // LED //------------------------------------------------------------------// #define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 17) // AD10 LED +#define LED_PRIMARY_PIN PINNUM(0, 17) // AD10 LED #define LED_STATE_ON 1 //------------------------------------------------------------------// // BUTTON //------------------------------------------------------------------// -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 24) // AD20 -- DFU -#define BUTTON_2 _PINNUM(1, 00) // AD22 -- FRST +#define BUTTON_DFU PINNUM(0, 24) // AD20 -- DFU +#define BUTTON_DFU_OTA PINNUM(1, 00) // AD22 -- OTA #define BUTTON_PULL NRF_GPIO_PIN_PULLUP - //-------------------------------------------------------------------// // BLE OTA //-------------------------------------------------------------------// #define BLEDIS_MANUFACTURER "Ambraglow-&-localcc" #define BLEDIS_MODEL "Syldra_dev_r1" - //--------------------------------------------------------------------+ // USB - using test PIDs //--------------------------------------------------------------------+ From cef2651b0d08cdf7ec86d7eeb53ac03d88f201a7 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 2 Feb 2026 19:14:56 +0700 Subject: [PATCH 3/3] correct uf2 board id --- src/boards/syldra/board.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boards/syldra/board.h b/src/boards/syldra/board.h index b48024a..61539f8 100644 --- a/src/boards/syldra/board.h +++ b/src/boards/syldra/board.h @@ -55,7 +55,7 @@ #define UF2_PRODUCT_NAME "Syldra nrf52840 Development Board" #define UF2_VOLUME_LABEL "Syldra-boot" -#define UF2_BOARD_ID "Syldra-dev-v1" +#define UF2_BOARD_ID "nRF52840-Syldra-dev-v1" #define UF2_INDEX_URL "https://github.com/ambraglow/nonorf" #endif \ No newline at end of file