mirror of
https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX.git
synced 2026-10-24 04:14:11 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e49b3fd2e4 | ||
|
|
51f241024e | ||
|
|
241675ea0d | ||
|
|
656585e9d2 | ||
|
|
711e6d7e22 | ||
|
|
54a9e85788 | ||
|
|
5cb23173c6 | ||
|
|
7e69127005 | ||
|
|
02fc9bdeb9 | ||
|
|
db8dc4d720 | ||
|
|
afc721a5d8 | ||
|
|
6e6c9c6725 | ||
|
|
d0ce3f8ba9 | ||
|
|
cbe95f8832 | ||
|
|
addc04d999 | ||
|
|
68975fc585 | ||
|
|
4774154467 | ||
|
|
1f47704642 | ||
|
|
11e390be4c | ||
|
|
f2ff6c88d1 | ||
|
|
8fd6845784 | ||
|
|
1aa95b4ee5 | ||
|
|
f9f9f51424 | ||
|
|
557f9cbdc6 | ||
|
|
d0d107df3e | ||
|
|
903a05177e | ||
|
|
d130299e54 | ||
|
|
7215059fae | ||
|
|
c5a862234c | ||
|
|
99b637eab1 | ||
|
|
0d9b659353 | ||
|
|
58f6ab43e0 | ||
|
|
ceb1cd9f22 | ||
|
|
19493941ab | ||
|
|
a48e944f0b | ||
|
|
54f2eecaa1 | ||
|
|
c83fa9fc2b | ||
|
|
3f7312e98e | ||
|
|
25454a8f6b | ||
|
|
2f18890500 | ||
|
|
4329614a8f | ||
|
|
bd12455029 | ||
|
|
3a2708b30a | ||
|
|
fb557b2af9 | ||
|
|
7f2b127506 | ||
|
|
5a96435322 | ||
|
|
f3b3a0de40 | ||
|
|
6940c5b73e | ||
|
|
4786a4a251 | ||
|
|
9027359cec | ||
|
|
eefbe6bda9 | ||
|
|
ab74be4811 | ||
|
|
488711a9b3 | ||
|
|
91fc6735e9 | ||
|
|
6b62aacdc9 | ||
|
|
4f747e416b | ||
|
|
155dedb048 |
No files matched your search
@@ -0,0 +1 @@
|
||||
ko_fi: oltaco
|
||||
@@ -1,9 +1,9 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
repository_dispatch:
|
||||
# pull_request:
|
||||
# push:
|
||||
# repository_dispatch:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
@@ -65,3 +65,10 @@ TAGS
|
||||
|
||||
.DS_Store
|
||||
Makefile.user
|
||||
|
||||
# Python virtual environments
|
||||
venv/
|
||||
.python-version
|
||||
lib/python3.13/
|
||||
lib64
|
||||
pyvenv.cfg
|
||||
@@ -49,6 +49,8 @@ OUT_NAME = $(BOARD)_bootloader-$(GIT_VERSION)
|
||||
# merged file = compiled + sd
|
||||
MERGED_FILE = $(OUT_NAME)_$(SD_NAME)_$(SD_VERSION)
|
||||
|
||||
UF2_FAMILY_ID_BOOTLOADER = 0xd663823c
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Tool Configure
|
||||
#------------------------------------------------------------------------------
|
||||
@@ -334,8 +336,8 @@ endif
|
||||
CFLAGS += -DDFU_APP_DATA_RESERVED=$(DFU_APP_DATA_RESERVED)
|
||||
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
|
||||
# Fixes for gcc version 12 and 13.
|
||||
ifneq (,$(filter 12.% 13.%,$(shell $(CC) -dumpversion 2>/dev/null)))
|
||||
# Fixes for gcc version 12, 13 and 14.
|
||||
ifneq (,$(filter 12.% 13.% 14.%,$(shell $(CC) -dumpversion 2>/dev/null)))
|
||||
CFLAGS += --param=min-pagesize=0
|
||||
endif
|
||||
|
||||
@@ -435,7 +437,7 @@ $(BUILD)/$(OUT_NAME)_nosd.hex: $(BUILD)/$(OUT_NAME).hex
|
||||
# Bootolader self-update uf2
|
||||
$(BUILD)/update-$(OUT_NAME)_nosd.uf2: $(BUILD)/$(OUT_NAME)_nosd.hex
|
||||
@echo Create $(notdir $@)
|
||||
@python3 lib/uf2/utils/uf2conv.py -f 0xd663823c -c -o $@ $^
|
||||
@python3 lib/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID_BOOTLOADER) -c -o $@ $^
|
||||
|
||||
# merge bootloader and sd hex together
|
||||
$(BUILD)/$(MERGED_FILE).hex: $(BUILD)/$(OUT_NAME).hex
|
||||
@@ -488,12 +490,17 @@ flash-mbr:
|
||||
@echo Flashing: $(MBR_HEX)
|
||||
$(call FLASH_NOUICR_CMD,$(MBR_HEX))
|
||||
|
||||
# flash using uf2
|
||||
flash-uf2: $(BUILD)/update-$(OUT_NAME)_nosd.uf2
|
||||
@echo Flashing: $(notdir $<)
|
||||
python lib/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID_BOOTLOADER) --deploy $<
|
||||
|
||||
# dfu with adafruit-nrfutil using CDC interface
|
||||
dfu-flash: flash-dfu
|
||||
flash-dfu: $(BUILD)/$(MERGED_FILE).zip
|
||||
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
|
||||
$(NRFUTIL) --verbose dfu serial --package $< -p $(SERIAL) -b 115200 --singlebank --touch 1200
|
||||
|
||||
|
||||
# flash skip crc magic ( app valid = 0x0001, crc = 0x0000 )
|
||||
#flash-skip-crc:
|
||||
# nrfjprog --memwr $(BOOT_SETTING_ADDR) --val 0x00000001 -f nrf52
|
||||
|
||||
@@ -1,204 +1,158 @@
|
||||
# Adafruit nRF52 Bootloader
|
||||
# Adafruit nRF52 Bootloader with Enhanced OTA DFU
|
||||
|
||||
[](https://github.com/adafruit/Adafruit_nRF52_Bootloader/actions)
|
||||
## Changes in OTAFIX 2.1
|
||||
|
||||
A CDC/DFU/UF2 bootloader for Nordic nRF52 microcontroller. UF2 is an easy-to-use bootloader that appears as a flash drive. You can just copy `.uf2`-format application images to the flash drive to load new firmware. See https://github.com/Microsoft/uf2 for more information.
|
||||
- **Defaults to OTA DFU mode**
|
||||
When no valid application is present, the bootloader defaults to OTA DFU mode.
|
||||
This prevents devices from becoming stuck in UF2 mode after a failed OTA update.
|
||||
|
||||
DFU via serial/CDC requires [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil), a modified version of [Nordic nrfutil](https://github.com/NordicSemiconductor/pc-nrfutil). Install `python3` if it is not installed already and run this command to install adafruit-nrfutil from PyPi:
|
||||
- **High-MTU BLE support**
|
||||
Enables larger DFU packets for improved throughput when supported by the client.
|
||||
The Android DFU app and [`dfu.py`](https://github.com/recrof/nrf_dfu_py) support large packets; the iOS DFU app is limited to 20-byte packets.
|
||||
|
||||
```
|
||||
$ pip3 install --user adafruit-nrfutil
|
||||
```
|
||||
- **Lazy flash erase**
|
||||
Flash pages are erased on demand during the transfer instead of upfront, significantly reducing the delay during DFU initialisation before the transfer begins.
|
||||
|
||||
## Supported Boards
|
||||
- **Small-packet accumulation**
|
||||
Packets smaller than 64 bytes are combined at the transport layer and written to flash in chunks of up to 240 bytes.
|
||||
This improves OTA performance from iOS devices and other small-packet DFU hosts by reducing flash write overhead.
|
||||
|
||||
Officially supported boards are:
|
||||
- **Automatic application boot after OTA over USB**
|
||||
When connected to a USB host, devices now automatically reboot into the application after a successful OTA update, instead of requiring a manual reset.
|
||||
|
||||
- [Adafruit CLUE](https://www.adafruit.com/product/4500)
|
||||
- [Adafruit Circuit Playground Bluefruit](https://www.adafruit.com/product/4333)
|
||||
- [Adafruit Feather nRF52832](https://www.adafruit.com/product/3406)
|
||||
- [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
|
||||
- [Adafruit Feather nRF52840 Sense](https://www.adafruit.com/product/4516)
|
||||
- [Adafruit ItsyBitsy nRF52840 Express](https://www.adafruit.com/product/4481)
|
||||
- [Adafruit LED Glasses Driver nRF52840](https://www.adafruit.com/product/5217)
|
||||
- Adafruit Metro nRF52840 Express
|
||||
- [Raytac MDBT50Q-RX Dongle](https://www.adafruit.com/product/5199)
|
||||
- **Unique BLE advertising names per board**
|
||||
In OTA DFU mode, devices advertise using a board-specific name instead of the generic `AdaDFU`:
|
||||
- **Heltec T114** → `T114_DFU`
|
||||
- **ProMicro NRF52840** → `PROM_DFU`
|
||||
- **T1000e** → `T1KE_DFU`
|
||||
- **WioTracker L1** → `WTL1_DFU`
|
||||
- **RAK 4631** → `4631_DFU`
|
||||
- **RAK WisMesh Tag** → `RTAG_DFU`
|
||||
- **XIAO NRF52 BLE / SENSE** → `XIAO_DFU`
|
||||
|
||||
In addition, there is also lots of other 3rd-party boards which are added by other makers, users and community. Check out the [complete list of all boards here](/src/boards).
|
||||
---
|
||||
|
||||
## Features
|
||||
## Boards supported
|
||||
|
||||
- DFU over Serial and OTA ( application, Bootloader+SD )
|
||||
- Self-upgradable via Serial and OTA
|
||||
- DFU using UF2 (https://github.com/Microsoft/uf2) (application only)
|
||||
- Auto-enter DFU briefly on startup for DTR auto-reset trick (832 only)
|
||||
- Heltec Automation Mesh Node T114 / HT-nRF5262
|
||||
- Nologo ProMicro NRF52840 (aka SuperMini NRF52840)
|
||||
- Seeed Studio SenseCAP Card Tracker T1000-E
|
||||
- Seeed Studio Wio Tracker L1
|
||||
- Seeed Studio XIAO nRF52840 BLE (and Seeed SenseCAP Solar Node)
|
||||
- Seeed Studio XIAO nRF52840 BLE SENSE
|
||||
- RAK 4631 ([See note](#notes-on-RAK4631-bootloader))
|
||||
- RAK WisMesh Tag (new 28/11/2025)
|
||||
|
||||
## How to use
|
||||
Any board already supported by the Adafruit nRF52 bootloader can be added.
|
||||
If there is another nRF52840-based board you are interested in, please raise an issue.
|
||||
|
||||
There are two pins, `DFU` and `FRST` that bootloader will check upon reset/power:
|
||||
---
|
||||
|
||||
- `Double Reset` Reset twice within 500 ms will enter DFU with UF2 and CDC support (only works with nRF52840)
|
||||
- `DFU = LOW` and `FRST = HIGH`: Enter bootloader with UF2 and CDC support
|
||||
- `DFU = LOW` and `FRST = LOW`: Enter bootloader with OTA, to upgrade with a mobile application such as Nordic nrfConnect/Toolbox
|
||||
- <s>`DFU = HIGH` and `FRST = LOW`: Factory Reset mode: erase firmware application and its data</s>
|
||||
- `DFU = HIGH` and `FRST = HIGH`: Go to application code if it is present, otherwise enter DFU with UF2
|
||||
- The `GPREGRET` register can also be set to force the bootloader can enter any of above modes (plus a CDC-only mode for Arduino).
|
||||
`GPREGRET` is set by the application before performing a soft reset.
|
||||
## Installation
|
||||
|
||||
```c
|
||||
#include "nrf_nvic.h"
|
||||
void reset_to_uf2(void) {
|
||||
NRF_POWER->GPREGRET = 0x57; // 0xA8 OTA, 0x4e Serial
|
||||
NVIC_SystemReset(); // or sd_nvic_SystemReset();
|
||||
}
|
||||
```
|
||||
**IMPORTANT:** If you are running a MeshCore companion firmware or Ripple firmware on your device **you will need to run an erase after flashing a new bootloader**. Use the MeshCore web flasher to do the erase, it will guide you to the correct erase firmware for your device. Other erase firmwares will not work, they will not erase the ExtraFS area.
|
||||
|
||||
On the Nordic PCA10056 DK board, `DFU` is connected to **Button1**, and `FRST` is connected to **Button2**.
|
||||
So holding down **Button1** while clicking **RESET** will put the board into USB bootloader mode, with UF2 and CDC support.
|
||||
Holding down **Button2** while clicking **RESET** will put the board into OTA (over-the-air) bootloader mode.
|
||||
The recommended way to install the bootloader is using the UF2 file.
|
||||
Download the UF2 file for your board (they can be found in the releases with filenames beginning with `update-`), enter UF2 mode (usually by double pressing the reset button within 0.5s) and copy the UF2 file across.
|
||||
|
||||
On the Nordic PCA10059 Dongle board, `DFU` is connected to the white button.
|
||||
`FRST` is connected to pin 1.10. Ground it to pull `FRST` low, as if you had pushed an `FRST` button.
|
||||
There is an adjacent ground pad.
|
||||
If you have somehow managed to accidentally flash an incorrect bootloader to your device you will likely require flashing a full bootloader and SoftDevice zip package using ``adafruit-nrfutil``
|
||||
|
||||
For other boards, please check the board definition for details.
|
||||
---
|
||||
|
||||
### Making your own UF2
|
||||
## Troubleshooting
|
||||
|
||||
To create your own UF2 DFU update image, simply use the [Python conversion script](https://github.com/Microsoft/uf2/blob/master/utils/uf2conv.py) on a .bin file or .hex file, specifying the family as **0xADA52840** (nRF52840) or **0x621E937A** (nRF52833).
|
||||
### Device does not appear as a USB drive or serial port
|
||||
|
||||
```
|
||||
nRF52840
|
||||
uf2conv.py firmware.hex -c -f 0xADA52840
|
||||
If the device does not show up on your computer after flashing the bootloader or performing an OTA update, it may be **waiting in OTA DFU mode**.
|
||||
|
||||
nRF52833
|
||||
uf2conv.py firmware.hex -c -f 0x621E937A
|
||||
```
|
||||
In **OTAFIX 2.0**, OTA DFU is the default state when no valid application is present.
|
||||
In this mode:
|
||||
- No UF2 drive is exposed
|
||||
- No serial port is available
|
||||
- The device is waiting for an OTA firmware update over BLE
|
||||
|
||||
If using a .bin file with the conversion script you must specify application address with the -b switch, this address depend on the SoftDevice size/version e.g S140 v6 is 0x26000, v7 is 0x27000
|
||||
**What to do:**
|
||||
- Perform an OTA update using a supported DFU app, **or**
|
||||
- Explicitly request UF2/serial mode using **double-reset**.
|
||||
|
||||
```
|
||||
nRF52840
|
||||
uf2conv.py firmware.bin -c -b 0x26000 -f 0xADA52840
|
||||
This behaviour is intentional and prevents devices from getting stuck in UF2 mode after failed OTA updates.
|
||||
|
||||
nRF52833
|
||||
uf2conv.py firmware.bin -c -b 0x27000 -f 0x621E937A
|
||||
```
|
||||
---
|
||||
|
||||
To create a UF2 image for bootloader from a .hex file using separated family of **0xd663823c**
|
||||
### OTA update fails with `Error: Operation Failed`
|
||||
|
||||
```
|
||||
uf2conv.py bootloader.hex -c -f 0xd663823c
|
||||
```
|
||||
If an OTA update consistently fails early with `Error: Operation Failed`, this is often caused by BLE stack incompatibilities when **Request High MTU** is enabled.
|
||||
|
||||
## Burn & Upgrade with pre-built binaries
|
||||
**What to try:**
|
||||
- Experiment with different PRN settings. Try 12, 8, 1, or even off altogether!
|
||||
- Disable **Request High MTU** in your DFU app
|
||||
|
||||
You can burn and/or upgrade the bootloader with either a J-link or DFU (serial) to a specific pre-built binary version
|
||||
without the hassle of installing a toolchain and compiling the code.
|
||||
This is preferred if you are not developing/customizing the bootloader.
|
||||
Pre-builtin binaries are available on GitHub [releases](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases)
|
||||
While high MTU significantly improves performance on supported devices, it is not required for a successful OTA update.
|
||||
|
||||
Note: The bootloader can be downgraded. Since the binary release is a merged version of
|
||||
both bootloader and the Nordic SoftDevice, you can freely upgrade/downgrade to any version you like.
|
||||
---
|
||||
|
||||
## How to compile and build
|
||||
## Recommended OTA DFU settings
|
||||
|
||||
You should only continue if you are looking to develop bootloader for your own.
|
||||
You must have have a J-Link available to "unbrick" your device.
|
||||
To perform the OTA update you can use **nRF Device Firmware Update**
|
||||
([Android](https://play.google.com/store/apps/details?id=no.nordicsemi.android.dfu&hl=en&gl=US) / [iOS](https://apps.apple.com/sa/app/device-firmware-update/id1624454660))
|
||||
or **nRF Connect**
|
||||
([Android](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&hl=en&gl=US) / [iOS](https://apps.apple.com/gb/app/nrf-connect-for-mobile/id1054362403)).
|
||||
|
||||
### Prerequisites
|
||||
My preference is the **nRF Device Firmware Update** app.
|
||||
|
||||
- ARM GCC
|
||||
- Nordic's [nRF5x Command Line Tools](https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Command-Line-Tools)
|
||||
- [Python IntelHex](https://pypi.org/project/IntelHex/)
|
||||
For **OTAFIX 2.0**, the following settings are recommended (these may change — feel free to experiment and report your findings):
|
||||
|
||||
### Build:
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
|
||||
Firstly clone this repo with following commands
|
||||
**Packet Receipt Notification (PRN):** ON
|
||||
**Number of packets:** 30
|
||||
**Reboot time:** 0ms
|
||||
**Scan timeout:** 2000ms
|
||||
**Request high MTU:** ON for Android (See notes below) / Not available on iOS
|
||||
**Disable resume:** ON
|
||||
**Prepare object delay:** 0ms
|
||||
**Force scanning:** ON
|
||||
**Keep bond:** OFF
|
||||
**External MCU DFU:** OFF
|
||||
|
||||
```
|
||||
git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader
|
||||
cd Adafruit_nRF52_Bootloader
|
||||
git submodule update --init
|
||||
```
|
||||
**Notes:**
|
||||
- Some Android devices and BLE stacks do not behave well with **Request high MTU** enabled.
|
||||
If the transfer fails early with `ERROR: Operation Failed`, retry with **Request high MTU turned OFF**.
|
||||
- For maximum speed, Packet Receipt Notification can be disabled, and the number of packets increased.
|
||||
Android is generally more tolerant of higher values; on iOS and other small-packet hosts, values above ~60 are not recommended.
|
||||
|
||||
Then build it with `make BOARD={board} all`, for example:
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
```
|
||||
make BOARD=feather_nrf52840_express all
|
||||
```
|
||||
[Recommended settings for versions prior to 2.0 can be found here](docs/oldsettings.md).
|
||||
|
||||
For the list of supported boards, run `make` without `BOARD=` :
|
||||
**IMPORTANT:**
|
||||
On <u>older versions</u> of the bootloader, performing an OTA update while the device was connected to a computer USB host would complete successfully but **would not automatically boot into the new application firmware**, requiring a manual reset.
|
||||
This issue is fixed in **OTAFIX 2.0**.
|
||||
|
||||
```
|
||||
$ make
|
||||
You must provide a BOARD parameter with 'BOARD='
|
||||
Supported boards are: feather_nrf52840_express feather_nrf52840_express pca10056
|
||||
Makefile:90: *** BOARD not defined. Stop
|
||||
```
|
||||
---
|
||||
|
||||
### Flash
|
||||
## OTA update on a MeshCore repeater
|
||||
|
||||
To flash the bootloader (without softdevice/mbr) using JLink:
|
||||
First you will need to login to the repeater and issue the `start ota` CLI command.
|
||||
|
||||
```
|
||||
make BOARD=feather_nrf52840_express flash
|
||||
```
|
||||
Next, open the nRF Device Firmware Update app, select the appropriate MeshCore firmware zip file for your device, select your device (it will be advertised as `ProMicro_OTA` / `RAK4631_OTA`, etc), and press start.
|
||||
|
||||
If you are using pyocd as debugger, add `FLASHER=pyocd` to make command:
|
||||
---
|
||||
|
||||
```
|
||||
make BOARD=feather_nrf52840_express FLASHER=pyocd flash
|
||||
```
|
||||
## Donations
|
||||
|
||||
To upgrade the bootloader using DFU Serial via port /dev/ttyACM0
|
||||
Although it's not necessary, if you find this useful please consider donating to support my work!
|
||||
|
||||
```
|
||||
make BOARD=feather_nrf52840_express SERIAL=/dev/ttyACM0 flash-dfu
|
||||
```
|
||||
[](https://ko-fi.com/oltaco)
|
||||
|
||||
To flash SoftDevice (will also erase chip):
|
||||
---
|
||||
|
||||
```
|
||||
make BOARD=feather_nrf52840_express flash-sd
|
||||
```
|
||||
## Notes on RAK4631 bootloader
|
||||
|
||||
To flash MBR only
|
||||
This version of the RAK4631 bootloader is based on a much newer version (0.9.2) of the Adafruit nRF52 bootloader than what RAK Wireless uses on their official bootloader (0.6.2-11).
|
||||
|
||||
```
|
||||
make BOARD=feather_nrf52840_express flash-mbr
|
||||
```
|
||||
|
||||
### Common makefile problems
|
||||
|
||||
#### `arm-none-eabi-gcc`: No such file or directory
|
||||
|
||||
If you get the following error ...
|
||||
|
||||
```
|
||||
$ make BOARD=feather_nrf52840_express all
|
||||
Compiling file: main.c
|
||||
/bin/sh: /usr/bin/arm-none-eabi-gcc: No such file or directory
|
||||
make: *** [_build/main.o] Error 127
|
||||
```
|
||||
|
||||
... you may need to pass the location of the GCC ARM toolchain binaries to `make` using
|
||||
the variable `CROSS_COMPILE` as below:
|
||||
```
|
||||
$ make CROSS_COMPILE=/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi- BOARD=feather_nrf52832 all
|
||||
```
|
||||
|
||||
For other compile errors, check the gcc version with `arm-none-eabi-gcc --version` to insure it is at least 9.x.
|
||||
|
||||
#### `ModuleNotFoundError: No module named 'intelhex'`
|
||||
|
||||
Install python-intelhex with
|
||||
|
||||
```
|
||||
pip install intelhex
|
||||
```
|
||||
|
||||
#### `make: nrfjprog: No such file or directory`
|
||||
|
||||
Make sure that `nrfjprog` is available from the command-line. This binary is
|
||||
part of Nordic's nRF5x Command Line Tools.
|
||||
I haven't looked to see what changes (if any) that RAK made to the Adafruit bootloader, so I'm not sure if there's any difference but I have tested this bootloader and I haven't found any problems thus far. If you would rather use the original RAK bootloader but with these patches included you can find that [here](https://github.com/oltaco/WisCore_RAK4631_Bootloader/releases).
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 217 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
@@ -0,0 +1,30 @@
|
||||
|
||||
These are the recommended settings for OTAFIX-v1.2 and earlier.<br/><br/>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
|
||||
**Packets Receipt Notification:** ON
|
||||
**Number of packets:** 8
|
||||
**Reboot time:** 0ms
|
||||
**Scan timeout:** 2000ms
|
||||
**Request high MTU:** OFF
|
||||
**Disable resume:** ON
|
||||
**Prepare object delay:** 400ms
|
||||
**Force Scanning:** ON
|
||||
**Keep bond:** OFF
|
||||
**External MCU DFU:** OFF
|
||||
|
||||
</td>
|
||||
<td valign="top">
|
||||
|
||||
Click the screenshot to view full.
|
||||
|
||||
<a href="Screenshot_20251114_142334_DFU.jpg">
|
||||
<img src="Screenshot_20251114_142334_DFU.jpg" width="200">
|
||||
</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <stddef.h>
|
||||
#include "sdk_common.h"
|
||||
|
||||
#define MAX_DFU_PKT_LEN 20 /**< Maximum length (in bytes) of the DFU Packet characteristic. */
|
||||
#define MAX_DFU_PKT_LEN (247 - 3) // MTU - 3 bytes for ATT header /**< Maximum length (in bytes) of the DFU Packet characteristic. */
|
||||
#define PKT_START_DFU_PARAM_LEN 2 /**< Length (in bytes) of the parameters for Packet Start DFU Request. */
|
||||
#define PKT_INIT_DFU_PARAM_LEN 2 /**< Length (in bytes) of the parameters for Packet Init DFU Request. */
|
||||
#define PKT_RCPT_NOTIF_REQ_LEN 3 /**< Length (in bytes) of the Packet Receipt Notification Request. */
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
|
||||
#include "pstorage_platform.h"
|
||||
|
||||
extern uint8_t* dfu_page_erased;
|
||||
extern uint32_t dfu_image_page_count;
|
||||
extern int32_t dfu_pending_erase_page;
|
||||
extern uint32_t dfu_base_address;
|
||||
|
||||
/**@defgroup ps_opcode Persistent Storage Access Operation Codes
|
||||
* @{
|
||||
|
||||
@@ -47,6 +47,15 @@
|
||||
#error No target defined
|
||||
#endif
|
||||
|
||||
#define PENDING_PACKET_SIZE 256 /**< Maximum size of a single pending packet data buffer. */
|
||||
#define PENDING_PACKET_COUNT 8 /**< Maximum number of packets that can be buffered during lazy erase. */
|
||||
|
||||
uint8_t * dfu_page_erased; /**< Pointer to page erased status array, set by DFU layer. */
|
||||
uint32_t dfu_image_page_count; /**< Number of pages in DFU image, set by DFU layer. */
|
||||
uint32_t dfu_base_address; /**< Base address for DFU image, set by DFU layer. */
|
||||
|
||||
static bool lazy_erase_check_and_trigger(pstorage_handle_t * p_dest, pstorage_size_t size, pstorage_size_t offset);
|
||||
static void process_pending_packets(void);
|
||||
|
||||
/**
|
||||
* @brief Application registration information.
|
||||
@@ -93,10 +102,29 @@ typedef struct
|
||||
cmd_queue_element_t cmd[PSTORAGE_CMD_QUEUE_SIZE]; /**< Array to maintain flash access operation details */
|
||||
}cmd_queue_t;
|
||||
|
||||
static cmd_queue_t m_cmd_queue; /**< Flash operation request queue. */
|
||||
static pstorage_module_table_t m_app_table[PSTORAGE_NUM_OF_PAGES]; /**< Registered application information table. */
|
||||
static pstorage_size_t m_next_app_instance; /**< Points to the application module instance that can be allocated next */
|
||||
static pstorage_size_t m_round_val; /**< Round value for multiple round operations. For erase operations, the round value will contain current round counter which is identical to number of pages erased. For store operations, the round value contains current round of operation * SOC_MAX_WRITE_SIZE to ensure each store to the SoC Flash API is within the SoC limit. */
|
||||
/**@brief Structure for buffering packets during lazy page erase. */
|
||||
typedef struct
|
||||
{
|
||||
bool valid; /**< Whether this slot contains valid data. */
|
||||
pstorage_handle_t handle; /**< Storage handle for destination. */
|
||||
uint32_t offset; /**< Offset within the storage block. */
|
||||
uint32_t size; /**< Size of data in bytes. */
|
||||
uint8_t * p_data_orig; /**< Original data pointer for callback. */
|
||||
uint8_t data[PENDING_PACKET_SIZE] __attribute__((aligned(4))); /**< Buffered packet data. */
|
||||
} pending_packet_t;
|
||||
|
||||
static cmd_queue_t m_cmd_queue; /**< Flash operation request queue. */
|
||||
static pstorage_module_table_t m_app_table[PSTORAGE_NUM_OF_PAGES]; /**< Registered application information table. */
|
||||
static pstorage_size_t m_next_app_instance; /**< Points to the application module instance that can be allocated next */
|
||||
static pstorage_size_t m_round_val; /**< Round value for multiple round operations. For erase operations, the round value will contain current round counter which is identical to number of pages erased. For store operations, the round value contains current round of operation * SOC_MAX_WRITE_SIZE to ensure each store to the SoC Flash API is within the SoC limit. */
|
||||
|
||||
static pending_packet_t m_pending_packets[PENDING_PACKET_COUNT]; /**< Ring buffer for pending packets. */
|
||||
static uint8_t m_pending_read_idx; /**< Read index for pending packet ring buffer. */
|
||||
static uint8_t m_pending_write_idx; /**< Write index for pending packet ring buffer. */
|
||||
static uint8_t m_pending_count; /**< Number of pending packets in buffer. */
|
||||
static bool m_lazy_erase_active; /**< True if a lazy erase is in progress. */
|
||||
static uint32_t m_lazy_erase_page; /**< Page index currently being erased. */
|
||||
static bool m_processing_pending; /**< True if processing a pending packet store. */
|
||||
|
||||
/**
|
||||
* @brief Function for processing of commands and issuing flash access request to the SoftDevice.
|
||||
@@ -160,6 +188,82 @@ static void cmd_queue_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function for initializing the pending packets buffer.
|
||||
*/
|
||||
static void pending_packets_init(void)
|
||||
{
|
||||
for (int i = 0; i < PENDING_PACKET_COUNT; i++)
|
||||
{
|
||||
m_pending_packets[i].valid = false;
|
||||
}
|
||||
m_pending_read_idx = 0;
|
||||
m_pending_write_idx = 0;
|
||||
m_pending_count = 0;
|
||||
m_lazy_erase_active = false;
|
||||
m_lazy_erase_page = 0;
|
||||
m_processing_pending = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function for adding a packet to the pending buffer.
|
||||
*
|
||||
* @param[in] p_handle Pointer to the storage handle.
|
||||
* @param[in] p_data Pointer to the data to buffer.
|
||||
* @param[in] size Size of data in bytes.
|
||||
* @param[in] offset Offset within the storage block.
|
||||
*
|
||||
* @retval true If the packet was successfully added.
|
||||
* @retval false If the buffer is full or size exceeds maximum.
|
||||
*/
|
||||
static bool pending_packet_add(pstorage_handle_t * p_handle, uint8_t * p_data,
|
||||
uint32_t size, uint32_t offset)
|
||||
{
|
||||
if (m_pending_count >= PENDING_PACKET_COUNT || size > PENDING_PACKET_SIZE)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
pending_packet_t * p = &m_pending_packets[m_pending_write_idx];
|
||||
p->handle = *p_handle;
|
||||
p->offset = offset;
|
||||
p->size = size;
|
||||
p->p_data_orig = p_data;
|
||||
memcpy(p->data, p_data, size);
|
||||
p->valid = true;
|
||||
|
||||
m_pending_write_idx = (m_pending_write_idx + 1) % PENDING_PACKET_COUNT;
|
||||
m_pending_count++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function for getting a pointer to the next pending packet without removing it.
|
||||
*
|
||||
* @return Pointer to the next pending packet, or NULL if buffer is empty.
|
||||
*/
|
||||
static pending_packet_t * pending_packet_peek(void)
|
||||
{
|
||||
if (m_pending_count == 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return &m_pending_packets[m_pending_read_idx];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function for removing the next pending packet from the buffer.
|
||||
*/
|
||||
static void pending_packet_pop(void)
|
||||
{
|
||||
if (m_pending_count > 0)
|
||||
{
|
||||
m_pending_packets[m_pending_read_idx].valid = false;
|
||||
m_pending_read_idx = (m_pending_read_idx + 1) % PENDING_PACKET_COUNT;
|
||||
m_pending_count--;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function for enqueueing a flash access operation.
|
||||
@@ -196,6 +300,7 @@ static uint32_t cmd_queue_enqueue(uint8_t opcode,
|
||||
m_cmd_queue.cmd[write_index].storage_addr = (*p_storage_addr);
|
||||
m_cmd_queue.cmd[write_index].size = size;
|
||||
m_cmd_queue.cmd[write_index].offset = offset;
|
||||
m_cmd_queue.count++;
|
||||
retval = NRF_SUCCESS;
|
||||
if (m_cmd_queue.flash_access == false)
|
||||
{
|
||||
@@ -206,7 +311,6 @@ static uint32_t cmd_queue_enqueue(uint8_t opcode,
|
||||
retval = NRF_SUCCESS;
|
||||
}
|
||||
}
|
||||
m_cmd_queue.count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -261,15 +365,132 @@ static void app_notify(uint32_t result, cmd_queue_element_t * p_elem)
|
||||
{
|
||||
pstorage_ntf_cb_t ntf_cb;
|
||||
uint8_t op_code = p_elem->op_code;
|
||||
|
||||
ntf_cb = m_app_table[p_elem->storage_addr.module_id].cb;
|
||||
|
||||
// Indicate result to client.
|
||||
ntf_cb(&p_elem->storage_addr,
|
||||
op_code,
|
||||
result,
|
||||
p_elem->p_data_addr,
|
||||
p_elem->size);
|
||||
if (p_elem->storage_addr.module_id < PSTORAGE_NUM_OF_PAGES)
|
||||
{
|
||||
ntf_cb = m_app_table[p_elem->storage_addr.module_id].cb;
|
||||
if (ntf_cb != NULL)
|
||||
{
|
||||
ntf_cb(&p_elem->storage_addr,
|
||||
op_code,
|
||||
result,
|
||||
p_elem->p_data_addr,
|
||||
p_elem->size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function for notifying application of buffered store completion.
|
||||
*
|
||||
* @param[in] result Result of event being notified.
|
||||
* @param[in] p_handle Pointer to the storage handle.
|
||||
* @param[in] p_data Pointer to the data buffer.
|
||||
* @param[in] size Size of data in bytes.
|
||||
*/
|
||||
static void app_notify_buffered(uint32_t result, pstorage_handle_t * p_handle,
|
||||
uint8_t * p_data, uint32_t size)
|
||||
{
|
||||
if (p_handle->module_id < PSTORAGE_NUM_OF_PAGES)
|
||||
{
|
||||
pstorage_ntf_cb_t ntf_cb = m_app_table[p_handle->module_id].cb;
|
||||
if (ntf_cb != NULL)
|
||||
{
|
||||
ntf_cb(p_handle, PSTORAGE_STORE_OP_CODE, result, p_data, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function for processing packets from the pending buffer.
|
||||
*
|
||||
* @details Attempts to process the next pending packet. If the target page needs
|
||||
* erasing, triggers a lazy erase. Otherwise enqueues the store operation.
|
||||
*/
|
||||
static void process_pending_packets(void)
|
||||
{
|
||||
if (m_processing_pending || m_lazy_erase_active || m_cmd_queue.count > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pending_packet_t * p = pending_packet_peek();
|
||||
if (p == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if this packet needs an erase first
|
||||
if (lazy_erase_check_and_trigger(&p->handle, p->size, p->offset))
|
||||
{
|
||||
// Erase triggered, don't process this packet yet
|
||||
return;
|
||||
}
|
||||
|
||||
// Page is ready, enqueue the store
|
||||
m_processing_pending = true;
|
||||
|
||||
uint32_t ret = cmd_queue_enqueue(PSTORAGE_STORE_OP_CODE, &p->handle, p->data, p->size, p->offset);
|
||||
|
||||
if (ret != NRF_SUCCESS)
|
||||
{
|
||||
m_processing_pending = false;
|
||||
pending_packet_pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Function for checking and triggering lazy erase if needed.
|
||||
* @param[in] p_dest Destination address where data is to be stored persistently.
|
||||
* @param[in] size Size of data to be stored expressed in bytes.
|
||||
* @param[in] offset Offset in bytes to be applied when writing to the block.
|
||||
* @retval true Lazy erase was triggered.
|
||||
* @retval false No lazy erase was needed.
|
||||
*/
|
||||
static bool lazy_erase_check_and_trigger(pstorage_handle_t * p_handle, pstorage_size_t size, pstorage_size_t offset)
|
||||
{
|
||||
uint32_t target_addr = p_handle->block_id + offset;
|
||||
|
||||
if (target_addr < dfu_base_address || dfu_page_erased == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t rel_addr = target_addr - dfu_base_address;
|
||||
uint32_t page_index = rel_addr / PSTORAGE_FLASH_PAGE_SIZE;
|
||||
|
||||
// Also check end of packet
|
||||
uint32_t end_addr = target_addr + size - 1;
|
||||
uint32_t end_rel_addr = end_addr - dfu_base_address;
|
||||
uint32_t end_page_index = end_rel_addr / PSTORAGE_FLASH_PAGE_SIZE;
|
||||
|
||||
// Check if start page needs erase
|
||||
bool start_needs_erase = (page_index < dfu_image_page_count && !dfu_page_erased[page_index]);
|
||||
|
||||
// Check if end page needs erase (and is different from start page)
|
||||
bool end_needs_erase = (end_page_index != page_index) &&
|
||||
(end_page_index < dfu_image_page_count && !dfu_page_erased[end_page_index]);
|
||||
|
||||
if (!start_needs_erase && !end_needs_erase)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Determine which page to erase (start page takes priority)
|
||||
uint32_t erase_page = start_needs_erase ? page_index : end_page_index;
|
||||
|
||||
m_lazy_erase_active = true;
|
||||
m_lazy_erase_page = erase_page;
|
||||
|
||||
pstorage_handle_t erase_handle;
|
||||
erase_handle.block_id = dfu_base_address + (erase_page * PSTORAGE_FLASH_PAGE_SIZE);
|
||||
erase_handle.module_id = p_handle->module_id;
|
||||
|
||||
cmd_queue_enqueue(PSTORAGE_CLEAR_OP_CODE, &erase_handle, NULL,
|
||||
PSTORAGE_FLASH_PAGE_SIZE, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -279,7 +500,7 @@ static void app_notify(uint32_t result, cmd_queue_element_t * p_elem)
|
||||
* @param[in] sys_evt System event received.
|
||||
*/
|
||||
void pstorage_sys_event_handler(uint32_t sys_evt)
|
||||
{
|
||||
{
|
||||
uint32_t retval = NRF_SUCCESS;
|
||||
|
||||
// The event shall only be processed if requested by this module.
|
||||
@@ -293,13 +514,19 @@ void pstorage_sys_event_handler(uint32_t sys_evt)
|
||||
{
|
||||
p_cmd = &m_cmd_queue.cmd[m_cmd_queue.rp];
|
||||
m_round_val++;
|
||||
|
||||
|
||||
bool command_finished = ((m_round_val * SOC_MAX_WRITE_SIZE) >= p_cmd->size);
|
||||
|
||||
if (p_cmd->op_code == PSTORAGE_CLEAR_OP_CODE)
|
||||
{
|
||||
command_finished = true;
|
||||
}
|
||||
|
||||
if (command_finished)
|
||||
{
|
||||
uint8_t queue_rp = m_cmd_queue.rp;
|
||||
|
||||
uint8_t completed_op = p_cmd->op_code;
|
||||
|
||||
m_round_val = 0;
|
||||
m_cmd_queue.count--;
|
||||
m_cmd_queue.rp++;
|
||||
@@ -309,24 +536,78 @@ void pstorage_sys_event_handler(uint32_t sys_evt)
|
||||
m_cmd_queue.rp -= PSTORAGE_CMD_QUEUE_SIZE;
|
||||
}
|
||||
|
||||
app_notify(retval, &m_cmd_queue.cmd[queue_rp]);
|
||||
if (m_lazy_erase_active && completed_op == PSTORAGE_CLEAR_OP_CODE)
|
||||
{
|
||||
// Lazy erase completed
|
||||
if (dfu_page_erased != NULL && m_lazy_erase_page < dfu_image_page_count)
|
||||
{
|
||||
dfu_page_erased[m_lazy_erase_page] = 1;
|
||||
}
|
||||
|
||||
// Initialize/free the element as it is now processed.
|
||||
cmd_queue_element_init(queue_rp);
|
||||
m_lazy_erase_active = false;
|
||||
cmd_queue_element_init(queue_rp);
|
||||
|
||||
process_pending_packets();
|
||||
}
|
||||
else if (m_processing_pending && completed_op == PSTORAGE_STORE_OP_CODE)
|
||||
{
|
||||
// Store from pending buffer completed
|
||||
pending_packet_t * p = pending_packet_peek();
|
||||
if (p != NULL)
|
||||
{
|
||||
pstorage_handle_t cb_handle = p->handle;
|
||||
uint8_t* cb_data = p->p_data_orig;
|
||||
uint32_t cb_size = p->size;
|
||||
|
||||
pending_packet_pop();
|
||||
|
||||
cmd_queue_element_init(queue_rp);
|
||||
|
||||
// Clear flag BEFORE callback
|
||||
m_processing_pending = false;
|
||||
|
||||
// Notify application that buffered this buffered store is done
|
||||
app_notify_buffered(retval, &cb_handle, cb_data, cb_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_processing_pending = false;
|
||||
cmd_queue_element_init(queue_rp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
app_notify(retval, &m_cmd_queue.cmd[queue_rp]);
|
||||
|
||||
// Initialize/free the element as it is now processed.
|
||||
cmd_queue_element_init(queue_rp);
|
||||
}
|
||||
}
|
||||
// Schedule any queued flash access operations.
|
||||
retval = cmd_queue_dequeue();
|
||||
|
||||
// Process next queued command OR next pending packet
|
||||
if (m_cmd_queue.count > 0)
|
||||
{
|
||||
retval = cmd_queue_dequeue();
|
||||
}
|
||||
else if (m_pending_count > 0 && !m_processing_pending && !m_lazy_erase_active)
|
||||
{
|
||||
// Queue is empty but we have pending packets - process one
|
||||
process_pending_packets();
|
||||
}
|
||||
|
||||
if (retval != NRF_SUCCESS)
|
||||
{
|
||||
app_notify(retval, &m_cmd_queue.cmd[m_cmd_queue.rp]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case NRF_EVT_FLASH_OPERATION_ERROR:
|
||||
m_lazy_erase_active = false;
|
||||
m_processing_pending = false;
|
||||
app_notify(NRF_ERROR_TIMEOUT, &m_cmd_queue.cmd[m_cmd_queue.rp]);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
// No implementation needed.
|
||||
break;
|
||||
@@ -348,6 +629,11 @@ static uint32_t cmd_process(void)
|
||||
|
||||
retval = NRF_ERROR_FORBIDDEN;
|
||||
|
||||
if (m_cmd_queue.count == 0)
|
||||
{
|
||||
return NRF_SUCCESS;
|
||||
}
|
||||
|
||||
p_cmd = &m_cmd_queue.cmd[m_cmd_queue.rp];
|
||||
|
||||
storage_addr = p_cmd->storage_addr.block_id;
|
||||
@@ -379,7 +665,7 @@ static uint32_t cmd_process(void)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case PSTORAGE_CLEAR_OP_CODE:
|
||||
{
|
||||
uint32_t page_number;
|
||||
@@ -390,12 +676,12 @@ static uint32_t cmd_process(void)
|
||||
retval = sd_flash_page_erase(page_number);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
// Should never reach here.
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (retval == NRF_SUCCESS)
|
||||
{
|
||||
m_cmd_queue.flash_access = true;
|
||||
@@ -409,7 +695,8 @@ static uint32_t cmd_process(void)
|
||||
uint32_t pstorage_init(void)
|
||||
{
|
||||
cmd_queue_init();
|
||||
|
||||
pending_packets_init();
|
||||
|
||||
m_next_app_instance = 0;
|
||||
m_round_val = 0;
|
||||
|
||||
@@ -451,11 +738,22 @@ uint32_t pstorage_store(pstorage_handle_t * p_dest,
|
||||
pstorage_size_t offset)
|
||||
{
|
||||
// Verify word alignment.
|
||||
if ((!is_word_aligned(p_src)) || (!is_word_aligned(p_src+offset)))
|
||||
if ((!is_word_aligned(p_src)) || (!is_word_aligned((void *)(p_dest->block_id + offset))))
|
||||
{
|
||||
return NRF_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
if (m_lazy_erase_active || lazy_erase_check_and_trigger(p_dest, size, offset))
|
||||
{
|
||||
// Buffer this packet - erase in progress or just triggered
|
||||
if (!pending_packet_add(p_dest, p_src, size, offset))
|
||||
{
|
||||
return NRF_ERROR_NO_MEM;
|
||||
}
|
||||
return NRF_SUCCESS;
|
||||
}
|
||||
|
||||
// Page already erased, proceed with store
|
||||
return cmd_queue_enqueue(PSTORAGE_STORE_OP_CODE, p_dest, p_src, size, offset);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,12 @@ static void pstorage_callback_handler(pstorage_handle_t * p_handle,
|
||||
case PSTORAGE_CLEAR_OP_CODE:
|
||||
if (m_dfu_state == DFU_STATE_PREPARING)
|
||||
{
|
||||
// Special case for lazy erase - mark first page as erased
|
||||
if (dfu_page_erased != NULL && dfu_image_page_count > 0)
|
||||
{
|
||||
dfu_page_erased[0] = 1;
|
||||
}
|
||||
|
||||
m_functions.cleared();
|
||||
m_dfu_state = DFU_STATE_RDY;
|
||||
if (m_data_pkt_cb != NULL)
|
||||
@@ -80,39 +86,48 @@ static void pstorage_callback_handler(pstorage_handle_t * p_handle,
|
||||
APP_ERROR_CHECK(result);
|
||||
}
|
||||
|
||||
/**@brief Function for preparing of flash before receiving SoftDevice image.
|
||||
/**@brief Function for preparing flash before receiving image.
|
||||
*
|
||||
* @details This function will erase current application area to ensure sufficient amount of
|
||||
* storage for the SoftDevice image. Upon erase complete a callback will be done.
|
||||
* See \ref dfu_bank_prepare_t for further details.
|
||||
* @details For lazy erase mode (OTA), this sets up the tracking array and erases
|
||||
* only the first page to signal readiness. Subsequent pages are erased
|
||||
* on-demand when stores target them.
|
||||
* For non-OTA mode, all pages are erased upfront.
|
||||
*/
|
||||
static void dfu_prepare_func_app_erase(uint32_t image_size)
|
||||
{
|
||||
mp_storage_handle_active = &m_storage_handle_app;
|
||||
mp_storage_handle_active = &m_storage_handle_app;
|
||||
|
||||
// Doing a SoftDevice update thus current application must be cleared to ensure enough space
|
||||
// for new SoftDevice.
|
||||
m_dfu_state = DFU_STATE_PREPARING;
|
||||
m_dfu_state = DFU_STATE_PREPARING;
|
||||
dfu_base_address = m_storage_handle_app.block_id;
|
||||
|
||||
if ( is_ota() )
|
||||
{
|
||||
uint32_t err_code = pstorage_clear(&m_storage_handle_app, m_image_size);
|
||||
APP_ERROR_CHECK(err_code);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t const page_count = NRFX_CEIL_DIV(m_image_size, CODE_PAGE_SIZE);
|
||||
|
||||
for ( uint32_t i = 0; i < page_count; i++ )
|
||||
if ( is_ota() )
|
||||
{
|
||||
uint32_t const addr = DFU_BANK_0_REGION_START + i * CODE_PAGE_SIZE;
|
||||
PRINTF("Erase 0x%08lX\r\n", addr);
|
||||
nrfx_nvmc_page_erase(addr);
|
||||
}
|
||||
// Setup for lazy erase
|
||||
dfu_image_page_count = NRFX_CEIL_DIV(m_image_size, CODE_PAGE_SIZE);
|
||||
|
||||
// invoke complete callback
|
||||
pstorage_callback_handler(&m_storage_handle_app, PSTORAGE_CLEAR_OP_CODE, NRF_SUCCESS, NULL, 0);
|
||||
}
|
||||
if (dfu_image_page_count < 1) dfu_image_page_count = 1; // This should not happen
|
||||
|
||||
static uint8_t dfu_page_erased_static[256];
|
||||
dfu_page_erased = dfu_page_erased_static;
|
||||
memset(dfu_page_erased, 0, dfu_image_page_count);
|
||||
|
||||
uint32_t err_code = pstorage_clear(&m_storage_handle_app, CODE_PAGE_SIZE);
|
||||
APP_ERROR_CHECK(err_code);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t const page_count = NRFX_CEIL_DIV(m_image_size, CODE_PAGE_SIZE);
|
||||
|
||||
for ( uint32_t i = 0; i < page_count; i++ )
|
||||
{
|
||||
uint32_t const addr = DFU_BANK_0_REGION_START + i * CODE_PAGE_SIZE;
|
||||
PRINTF("Erase 0x%08lX\r\n", addr);
|
||||
nrfx_nvmc_page_erase(addr);
|
||||
}
|
||||
|
||||
// invoke complete callback
|
||||
pstorage_callback_handler(&m_storage_handle_app, PSTORAGE_CLEAR_OP_CODE, NRF_SUCCESS, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -234,6 +249,11 @@ uint32_t dfu_init(void)
|
||||
|
||||
m_init_packet_length = 0;
|
||||
m_image_crc = 0;
|
||||
|
||||
// Reset lazy erase state
|
||||
dfu_page_erased = NULL;
|
||||
dfu_image_page_count = 0;
|
||||
dfu_base_address = 0;
|
||||
|
||||
err_code = pstorage_register(&storage_module_param, &m_storage_handle_app);
|
||||
if (err_code != NRF_SUCCESS)
|
||||
@@ -363,8 +383,8 @@ uint32_t dfu_data_pkt_handle(dfu_update_packet_t * p_packet)
|
||||
}
|
||||
else
|
||||
{
|
||||
flash_nrf5x_write(DFU_BANK_0_REGION_START + m_data_received, p_data, data_length, false);
|
||||
pstorage_callback_handler(mp_storage_handle_active, PSTORAGE_STORE_OP_CODE, NRF_SUCCESS, (uint8_t *) p_data, data_length);
|
||||
flash_nrf5x_write(DFU_BANK_0_REGION_START + m_data_received, p_data, data_length, false);
|
||||
pstorage_callback_handler(mp_storage_handle_active, PSTORAGE_STORE_OP_CODE, NRF_SUCCESS, (uint8_t *) p_data, data_length);
|
||||
}
|
||||
|
||||
m_data_received += data_length;
|
||||
@@ -378,8 +398,8 @@ uint32_t dfu_data_pkt_handle(dfu_update_packet_t * p_packet)
|
||||
{
|
||||
if ( !is_ota() ) flash_nrf5x_flush(false);
|
||||
|
||||
// The entire image has been received. Return NRF_SUCCESS.
|
||||
err_code = NRF_SUCCESS;
|
||||
// The entire image has been received. Return NRF_SUCCESS.
|
||||
err_code = NRF_SUCCESS;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
|
||||
#define BLEGAP_EVENT_LENGTH 6
|
||||
#define BLEGATT_ATT_MTU_MAX 23
|
||||
#define BLEGATT_ATT_MTU_MAX 247
|
||||
enum { BLE_CONN_CFG_HIGH_BANDWIDTH = 1 };
|
||||
|
||||
#define DFU_REV_MAJOR 0x00 /** DFU Major revision number to be exposed. */
|
||||
@@ -47,7 +47,9 @@ enum { BLE_CONN_CFG_HIGH_BANDWIDTH = 1 };
|
||||
#define BLE_HANDLE_MAX 0xFFFF /**< Max handle value is BLE. */
|
||||
|
||||
// limit of 8 chars
|
||||
#ifndef DEVICE_NAME
|
||||
#define DEVICE_NAME "AdaDFU" /**< Name of device. Will be included in the advertising data. */
|
||||
#endif //DEVICE_NAME
|
||||
|
||||
#define MIN_CONN_INTERVAL (uint16_t)(MSEC_TO_UNITS(10, UNIT_1_25_MS)) /**< Minimum acceptable connection interval (11.25 milliseconds). */
|
||||
#define MAX_CONN_INTERVAL (uint16_t)(MSEC_TO_UNITS(30, UNIT_1_25_MS)) /**< Maximum acceptable connection interval (15 milliseconds). */
|
||||
@@ -80,6 +82,16 @@ enum { BLE_CONN_CFG_HIGH_BANDWIDTH = 1 };
|
||||
#define BL_IMAGE_SIZE_OFFSET 4 /**< Offset in start packet for the size information for bootloader. */
|
||||
#define APP_IMAGE_SIZE_OFFSET 8 /**< Offset in start packet for the size information for application. */
|
||||
|
||||
// Accumulator buffer for small packets, to reduce flash write overhead
|
||||
#define ACCUMULATE_THRESHOLD 64 /**< Enable accumulator only if the first packet is <= this size */
|
||||
#define ACCUMULATE_TARGET_SIZE 240 /**< Flush when accumulator reaches this size (word-aligned) */
|
||||
|
||||
static uint8_t m_accum_buf[ACCUMULATE_TARGET_SIZE] __attribute__((aligned(4)));
|
||||
static uint16_t m_accum_len = 0;
|
||||
static bool m_accum_active = false;
|
||||
static uint32_t m_accum_bytes_pending = 0; /**< Bytes accumulated but not yet counted in m_num_of_firmware_bytes_rcvd */
|
||||
static uint32_t m_reported_image_size = 0; /**< Size of the incoming image being received over BLE DFU as reported by the host. */
|
||||
|
||||
/**@brief Packet type enumeration.
|
||||
*/
|
||||
typedef enum
|
||||
@@ -111,6 +123,13 @@ static uint8_t * mp_final_packet;
|
||||
static ble_gap_addr_t const * m_whitelist[1]; /**< List of peers in whitelist (only one) */
|
||||
static ble_gap_id_key_t const * m_gap_ids[1];
|
||||
|
||||
static ble_gap_data_length_params_t m_dl_params = {
|
||||
.max_tx_octets = 251,
|
||||
.max_rx_octets = 251,
|
||||
.max_tx_time_us = BLE_GAP_DATA_LENGTH_AUTO,
|
||||
.max_rx_time_us = BLE_GAP_DATA_LENGTH_AUTO
|
||||
};
|
||||
|
||||
// Adafruit
|
||||
static uint8_t _adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
|
||||
|
||||
@@ -324,6 +343,11 @@ static void start_data_process(ble_dfu_t * p_dfu, ble_dfu_evt_t * p_evt)
|
||||
start_packet.bl_image_size = uint32_decode(p_length_data + BL_IMAGE_SIZE_OFFSET);
|
||||
start_packet.app_image_size = uint32_decode(p_length_data + APP_IMAGE_SIZE_OFFSET);
|
||||
|
||||
// Store the reported image size for use by the accumulator logic
|
||||
m_reported_image_size = start_packet.sd_image_size +
|
||||
start_packet.bl_image_size +
|
||||
start_packet.app_image_size;
|
||||
|
||||
err_code = dfu_start_pkt_handle(&update_packet);
|
||||
if (err_code != NRF_SUCCESS)
|
||||
{
|
||||
@@ -388,6 +412,94 @@ static void init_data_process(ble_dfu_t * p_dfu, ble_dfu_evt_t * p_evt)
|
||||
}
|
||||
}
|
||||
|
||||
/**@brief Flush the accumulator buffer to HCI pool for processing
|
||||
*/
|
||||
static void accum_flush(ble_dfu_t * p_dfu)
|
||||
{
|
||||
if (m_accum_len == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t err_code;
|
||||
uint32_t length = m_accum_len;
|
||||
uint32_t original_len = m_accum_len; // Before padding
|
||||
|
||||
PRINTF("OTA: Flushing accumulator buffer (%ld bytes)\r\n", length);
|
||||
|
||||
// Word-align the length (pad with 0xFF for flash compatibility)
|
||||
uint32_t aligned_len = (length + 3) & ~3;
|
||||
while (m_accum_len < aligned_len)
|
||||
{
|
||||
m_accum_buf[m_accum_len++] = 0xFF;
|
||||
}
|
||||
length = m_accum_len;
|
||||
|
||||
err_code = hci_mem_pool_rx_produce(length, (void **) &mp_rx_buffer);
|
||||
if (err_code != NRF_SUCCESS)
|
||||
{
|
||||
PRINTF("OTA: hci_mem_pool_rx_produce failed: 0x%08lX\r\n", err_code);
|
||||
dfu_error_notify(p_dfu, err_code);
|
||||
m_accum_len = 0;
|
||||
m_accum_bytes_pending = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(mp_rx_buffer, m_accum_buf, length);
|
||||
|
||||
err_code = hci_mem_pool_rx_data_size_set(length);
|
||||
if (err_code != NRF_SUCCESS)
|
||||
{
|
||||
PRINTF("OTA: hci_mem_pool_rx_data_size_set failed: 0x%08lX\r\n", err_code);
|
||||
dfu_error_notify(p_dfu, err_code);
|
||||
m_accum_len = 0;
|
||||
m_accum_bytes_pending = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
err_code = hci_mem_pool_rx_extract(&mp_rx_buffer, &length);
|
||||
if (err_code != NRF_SUCCESS)
|
||||
{
|
||||
PRINTF("OTA: hci_mem_pool_rx_extract failed: 0x%08lX\r\n", err_code);
|
||||
dfu_error_notify(p_dfu, err_code);
|
||||
m_accum_len = 0;
|
||||
m_accum_bytes_pending = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
dfu_update_packet_t dfu_pkt;
|
||||
dfu_pkt.packet_type = DATA_PACKET;
|
||||
dfu_pkt.params.data_packet.packet_length = length / sizeof(uint32_t);
|
||||
dfu_pkt.params.data_packet.p_data_packet = (uint32_t *)mp_rx_buffer;
|
||||
|
||||
err_code = dfu_data_pkt_handle(&dfu_pkt);
|
||||
|
||||
if (err_code == NRF_SUCCESS)
|
||||
{
|
||||
// All firmware data received - this was the final packet
|
||||
m_num_of_firmware_bytes_rcvd += original_len;
|
||||
mp_final_packet = mp_rx_buffer;
|
||||
PRINTF("OTA: Final packet flushed, total bytes: %ld\r\n", m_num_of_firmware_bytes_rcvd);
|
||||
}
|
||||
else if (err_code == NRF_ERROR_INVALID_LENGTH)
|
||||
{
|
||||
// More data expected - this is the normal case
|
||||
m_num_of_firmware_bytes_rcvd += original_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
PRINTF("OTA: dfu_data_pkt_handle failed: 0x%08lX\r\n", err_code);
|
||||
uint32_t hci_error = hci_mem_pool_rx_consume(mp_rx_buffer);
|
||||
if (hci_error != NRF_SUCCESS)
|
||||
{
|
||||
dfu_error_notify(p_dfu, hci_error);
|
||||
}
|
||||
dfu_error_notify(p_dfu, err_code);
|
||||
}
|
||||
|
||||
m_accum_len = 0;
|
||||
m_accum_bytes_pending = 0;
|
||||
}
|
||||
|
||||
/**@brief Function for processing application data written by the peer to the DFU Packet
|
||||
* Characteristic.
|
||||
@@ -398,8 +510,61 @@ static void init_data_process(ble_dfu_t * p_dfu, ble_dfu_evt_t * p_evt)
|
||||
static void app_data_process(ble_dfu_t * p_dfu, ble_dfu_evt_t * p_evt)
|
||||
{
|
||||
uint32_t err_code;
|
||||
uint16_t pkt_len = p_evt->evt.ble_dfu_pkt_write.len;
|
||||
uint8_t * p_data = p_evt->evt.ble_dfu_pkt_write.p_data;
|
||||
|
||||
if ((p_evt->evt.ble_dfu_pkt_write.len & (sizeof(uint32_t) - 1)) != 0)
|
||||
// Check if this is the first data packet and decide whether to accumulate packets
|
||||
if (m_num_of_firmware_bytes_rcvd == 0 && m_accum_len == 0)
|
||||
{
|
||||
m_accum_active = (pkt_len <= ACCUMULATE_THRESHOLD);
|
||||
PRINTF("OTA: Packet accumulator %s (first packet size %d)\r\n", m_accum_active ? "enabled" : "disabled", pkt_len);
|
||||
}
|
||||
|
||||
if (m_accum_active)
|
||||
{
|
||||
// Flush the accumulator if adding this packet would overflow the buffer
|
||||
if (m_accum_len + pkt_len > ACCUMULATE_TARGET_SIZE)
|
||||
{
|
||||
PRINTF("OTA: Pre-overflow flush of accumulator\r\n");
|
||||
accum_flush(p_dfu);
|
||||
}
|
||||
|
||||
// Add packet to accumulator buffer
|
||||
memcpy(m_accum_buf + m_accum_len, p_data, pkt_len);
|
||||
m_accum_len += pkt_len;
|
||||
m_accum_bytes_pending += pkt_len;
|
||||
|
||||
// Handle PRN - must be based on RECEIVED packets not flushed packets
|
||||
// otherwise host might timeout waiting for notification
|
||||
if (m_pkt_rcpt_notif_enabled)
|
||||
{
|
||||
m_pkt_notif_target_cnt--;
|
||||
|
||||
if (m_pkt_notif_target_cnt == 0)
|
||||
{
|
||||
// Need to flush before sending PRN so byte count is accurate
|
||||
PRINTF("OTA: PRN flush of accumulator\r\n");
|
||||
accum_flush(p_dfu);
|
||||
|
||||
err_code = ble_dfu_pkts_rcpt_notify(p_dfu, m_num_of_firmware_bytes_rcvd);
|
||||
APP_ERROR_CHECK(err_code);
|
||||
|
||||
m_pkt_notif_target_cnt = m_pkt_notif_target;
|
||||
}
|
||||
}
|
||||
|
||||
// Flush the accumulator if we've received the full image in order to trigger completion
|
||||
if ((m_num_of_firmware_bytes_rcvd + m_accum_len) == m_reported_image_size)
|
||||
{
|
||||
accum_flush(p_dfu);
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Original logic for large packets (no accumulation)
|
||||
if ((pkt_len & (sizeof(uint32_t) - 1)) != 0)
|
||||
{
|
||||
// Data length is not a multiple of 4 (word size).
|
||||
err_code = ble_dfu_response_send(p_dfu,
|
||||
@@ -409,7 +574,7 @@ static void app_data_process(ble_dfu_t * p_dfu, ble_dfu_evt_t * p_evt)
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t length = p_evt->evt.ble_dfu_pkt_write.len;
|
||||
uint32_t length = pkt_len;
|
||||
|
||||
err_code = hci_mem_pool_rx_produce(length, (void **) &mp_rx_buffer);
|
||||
if (err_code != NRF_SUCCESS)
|
||||
@@ -418,9 +583,7 @@ static void app_data_process(ble_dfu_t * p_dfu, ble_dfu_evt_t * p_evt)
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t * p_data_packet = p_evt->evt.ble_dfu_pkt_write.p_data;
|
||||
|
||||
memcpy(mp_rx_buffer, p_data_packet, length);
|
||||
memcpy(mp_rx_buffer, p_data, length);
|
||||
|
||||
err_code = hci_mem_pool_rx_data_size_set(length);
|
||||
if (err_code != NRF_SUCCESS)
|
||||
@@ -745,6 +908,11 @@ static void on_ble_evt(ble_evt_t * p_ble_evt)
|
||||
case BLE_GAP_EVT_CONNECTED:
|
||||
m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
|
||||
m_is_advertising = false;
|
||||
|
||||
// APP_ERROR_CHECK( sd_ble_gattc_exchange_mtu_request(m_conn_handle, BLEGATT_ATT_MTU_MAX) );
|
||||
|
||||
sd_ble_gap_data_length_update(m_conn_handle, &m_dl_params, NULL);
|
||||
|
||||
break;
|
||||
|
||||
case BLE_GAP_EVT_DISCONNECTED:
|
||||
@@ -886,7 +1054,7 @@ static void on_ble_evt(ble_evt_t * p_ble_evt)
|
||||
case BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST:
|
||||
// Let Softdevice decide the data length
|
||||
// ble_gap_data_length_params_t* param = &evt->evt.gap_evt.params.data_length_update_request.peer_params
|
||||
APP_ERROR_CHECK( sd_ble_gap_data_length_update(m_conn_handle, NULL, NULL) );
|
||||
APP_ERROR_CHECK( sd_ble_gap_data_length_update(m_conn_handle, &m_dl_params, NULL) );
|
||||
break;
|
||||
|
||||
case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
|
||||
@@ -1023,6 +1191,9 @@ uint32_t dfu_transport_ble_update_start(void)
|
||||
{
|
||||
uint32_t err_code;
|
||||
|
||||
m_accum_len = 0;
|
||||
m_accum_active = false;
|
||||
|
||||
m_tear_down_in_progress = false;
|
||||
m_pkt_type = PKT_TYPE_INVALID;
|
||||
|
||||
@@ -1178,7 +1349,7 @@ lookup_table_t const _strevt_table =
|
||||
|
||||
void print_ble_event(uint16_t evt_id)
|
||||
{
|
||||
// const char * str = (const char *) lookup_find(&_strevt_table, evt_id);
|
||||
// const char * str = (const char *) lookup_find(&_strevt_table, evt_id);
|
||||
const char * str = NULL;
|
||||
PRINTF("BLE event: ");
|
||||
if ( str == NULL )
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 ADM_B_NRF52840_1_H
|
||||
#define ADM_B_NRF52840_1_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 19) // Red
|
||||
//#define LED_SECONDARY_PIN 12 // Blue
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
|
||||
#define BUTTON_1 _PINNUM(0, 11)
|
||||
#define BUTTON_2 _PINNUM(0, 12)
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Atelier-Du-Maker"
|
||||
#define BLEDIS_MODEL "ADM_B_NRF52840_1"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x009F
|
||||
#define USB_DESC_CDC_ONLY_PID 0x009F
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "AtelierDuMaker NRF52840 Breakout"
|
||||
#define UF2_VOLUME_LABEL "ADM840BOOT"
|
||||
#define UF2_BOARD_ID "ADM_B_NRF52840_1"
|
||||
#define UF2_INDEX_URL "https://github.com/Atelier-Du-Maker/HolyIoT_NRF52840"
|
||||
|
||||
#endif // ADM_B_NRF52840_1_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _AE_BL652_BO_H
|
||||
#define _AE_BL652_BO_H
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN 17 // LED1
|
||||
#define LED_SECONDARY_PIN 19 // LED2
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 11 // BTN1
|
||||
#define BUTTON_2 15 // BTN2
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* UART (only used by nRF52832)
|
||||
*------------------------------------------------------------------*/
|
||||
#define RX_PIN_NUMBER 8
|
||||
#define TX_PIN_NUMBER 6
|
||||
#define CTS_PIN_NUMBER 0
|
||||
#define RTS_PIN_NUMBER 0
|
||||
#define HWFC false
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Akizuki Denshi Tsusho"
|
||||
#define BLEDIS_MODEL "AE-BL652-BO"
|
||||
|
||||
#endif // _AE_BL652_BO_H
|
||||
@@ -1,2 +0,0 @@
|
||||
# nrf52 is nrf52832
|
||||
MCU_SUB_VARIANT = nrf52
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2021 Benjamin Meisels
|
||||
*
|
||||
* 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 _ARAMCON2_BADGE_H
|
||||
#define _ARAMCON2_BADGE_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 11) // Red
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(0, 8)
|
||||
#define NEOPIXELS_NUMBER 2
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(0, 2) // left Button
|
||||
#define BUTTON_2 _PINNUM(0, 29) // middle button
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
// Used as model string in OTA mode
|
||||
#define BLEDIS_MANUFACTURER "ARAMCON Badge Team"
|
||||
#define BLEDIS_MODEL "ARAMCON2 Badge"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x007B
|
||||
#define USB_DESC_CDC_ONLY_PID 0x007B
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "ARAMCON2 Badge"
|
||||
#define UF2_VOLUME_LABEL "ARAMBOOT"
|
||||
#define UF2_BOARD_ID "nrf52840-ARAMCON2-Badge"
|
||||
#define UF2_INDEX_URL "https://github.com/aramcon-badge"
|
||||
|
||||
#endif // _ARAMCON2_BADGE_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 Uri Shaked
|
||||
* Copyright (c) 2019 Benjamin Meisels
|
||||
*
|
||||
* 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 _ARAMCON_BADGE_2019_H
|
||||
#define _ARAMCON_BADGE_2019_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 11) // Red
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(0, 8)
|
||||
#define NEOPIXELS_NUMBER 4
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(0, 2) // left Button
|
||||
#define BUTTON_2 _PINNUM(0, 29) // middle button
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "ARAMCON Badge Team"
|
||||
#define BLEDIS_MODEL "ARAMCON Badge 2019"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0079
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0079
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "ARAMCON Badge 2019"
|
||||
#define UF2_VOLUME_LABEL "ARAMBOOT"
|
||||
#define UF2_BOARD_ID "nrf52840-ARAMCON-Badge-2019"
|
||||
#define UF2_INDEX_URL "https://github.com/aramcon-badge"
|
||||
|
||||
#endif // _ARAMCON_BADGE_2019_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,62 +0,0 @@
|
||||
#include "boards.h"
|
||||
|
||||
__attribute__((used, section(".bootloaderConfig")))
|
||||
const uint32_t bootloaderConfig[] = {
|
||||
/* CF2 START */
|
||||
513675505, 539130489, // magic
|
||||
49, 100, // used entries, total entries
|
||||
4, 0x18, // PIN_BTN_A = PIN_RX
|
||||
5, 0xa, // PIN_BTN_B = PIN_D2
|
||||
13, 0x29, // PIN_LED = PIN_D13
|
||||
18, 0xf, // PIN_MISO = PA15
|
||||
19, 0xd, // PIN_MOSI = PA13
|
||||
20, 0x23, // PIN_NEOPIXEL = PB03
|
||||
21, 0x18, // PIN_RX = PA24
|
||||
23, 0xe, // PIN_SCK = PA14
|
||||
24, 0xb, // PIN_SCL = PA11
|
||||
25, 0xc, // PIN_SDA = PA12
|
||||
28, 0x19, // PIN_TX = PA25
|
||||
32, 0xe, // PIN_DISPLAY_SCK = PIN_SCK
|
||||
34, 0xd, // PIN_DISPLAY_MOSI = PIN_MOSI
|
||||
35, 0x1e, // PIN_DISPLAY_CS = PIN_A2
|
||||
36, 0x1c, // PIN_DISPLAY_DC = PIN_A3
|
||||
37, 0xa0, // DISPLAY_WIDTH = 160
|
||||
38, 0x80, // DISPLAY_HEIGHT = 128
|
||||
39, 0x80, // DISPLAY_CFG0 = 0x80
|
||||
40, 0x603, // DISPLAY_CFG1 = 0x603
|
||||
41, 0x20, // DISPLAY_CFG2 = 0x20
|
||||
43, 0x2, // PIN_DISPLAY_RST = PIN_A4
|
||||
44, 0x3, // PIN_DISPLAY_BL = PIN_A5
|
||||
47, 0x6, // PIN_BTN_LEFT = PIN_D11
|
||||
48, 0x1a, // PIN_BTN_RIGHT = PIN_D9
|
||||
49, 0x1b, // PIN_BTN_UP = PIN_D10
|
||||
50, 0x7, // PIN_BTN_DOWN = PIN_D6
|
||||
51, 0x8, // PIN_BTN_MENU = PIN_D12
|
||||
56, 0x2a, // PIN_LED2 = PB10
|
||||
60, 0x19, // PIN_JACK_TX = PIN_TX
|
||||
100, 0x4, // PIN_A0 = PA04
|
||||
101, 0x5, // PIN_A1 = PA05
|
||||
102, 0x1e, // PIN_A2 = PA30
|
||||
103, 0x1c, // PIN_A3 = PA28
|
||||
104, 0x2, // PIN_A4 = PA02
|
||||
105, 0x3, // PIN_A5 = PA03
|
||||
152, 0xa, // PIN_D2 = PA10
|
||||
155, 0x28, // PIN_D5 = PB08
|
||||
156, 0x7, // PIN_D6 = PA07
|
||||
159, 0x1a, // PIN_D9 = PA26
|
||||
160, 0x1b, // PIN_D10 = PA27
|
||||
161, 0x6, // PIN_D11 = PA06
|
||||
162, 0x8, // PIN_D12 = PA08
|
||||
163, 0x29, // PIN_D13 = PB09
|
||||
200, 0x1, // NUM_NEOPIXELS = 1
|
||||
204, 0x100000, // FLASH_BYTES = 0x100000
|
||||
205, 0x40000, // RAM_BYTES = 0x40000
|
||||
208, 0xd7688ea1, // BOOTLOADER_BOARD_ID = 0xd7688ea1
|
||||
209, 0xada52840, // UF2_FAMILY = 0xada52840
|
||||
210, 0x20, // PINS_PORT_SIZE = PA_32
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
/* CF2 END */
|
||||
};
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _ARDUINOBLE33_NRF52840_H
|
||||
#define _ARDUINOBLE33_NRF52840_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1 // red LED
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 24)
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(1, 11) // D2 switch
|
||||
#define BUTTON_2 _PINNUM(1, 12) // D3 switch
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Arduino"
|
||||
#define BLEDIS_MODEL "Nano 33 BLE"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0063
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0064
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "Arduino Nano 33 BLE"
|
||||
#define UF2_VOLUME_LABEL "NANO33BOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-Nano-33"
|
||||
#define UF2_INDEX_URL "https://www.arduino.cc/"
|
||||
|
||||
#endif // _ITSY_NRF52840_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _BASTBLE_NRF52840_H
|
||||
#define _BASTBLE_NRF52840_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1 // red LED
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 24)
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(0, 05)
|
||||
#define BUTTON_2 _PINNUM(0, 10)
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "ElectronicCats"
|
||||
#define BLEDIS_MODEL "BastBLE"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Shared VID/PID with Feather nRF52840, will be disabled for building in the future
|
||||
#define USB_DESC_VID 0x1209
|
||||
#define USB_DESC_UF2_PID 0x805A
|
||||
#define USB_DESC_CDC_ONLY_PID 0x805A
|
||||
|
||||
#define UF2_PRODUCT_NAME "Bast BLE"
|
||||
#define UF2_VOLUME_LABEL "BASTBLE"
|
||||
#define UF2_BOARD_ID "Bast-ble-v1"
|
||||
#define UF2_INDEX_URL "https://www.electroniccats.com"
|
||||
|
||||
#endif // _BASTBLE_NRF52840_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Pierre Constantineau
|
||||
*
|
||||
* 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 _BLUEMICRO_NRF52833_H
|
||||
#define _BLUEMICRO_NRF52833_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 4)
|
||||
#define LED_SECONDARY_PIN _PINNUM(0, 25)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(0, 7)
|
||||
#define NEOPIXELS_NUMBER 1
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2 // none connected at all
|
||||
#define BUTTON_1 _PINNUM(0, 18) // unusable: RESET
|
||||
#define BUTTON_2 _PINNUM(1, 1) // no connection on E73-2G4M08S1E Module
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "BlueMicro"
|
||||
#define BLEDIS_MODEL "BlueMicro 833"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB PID from openmoko:
|
||||
// PR https://github.com/openmoko/openmoko-usb-oui/pull/34
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x1d50
|
||||
#define USB_DESC_UF2_PID 0x616f
|
||||
#define USB_DESC_CDC_ONLY_PID 0x616f
|
||||
|
||||
#define UF2_PRODUCT_NAME "BlueMicro"
|
||||
#define UF2_VOLUME_LABEL "BLUEMICRO"
|
||||
#define UF2_BOARD_ID "nRF52833-BlueMicro-v1"
|
||||
#define UF2_INDEX_URL "http://bluemicro.jpconstantineau.com/"
|
||||
|
||||
#endif // _BLUEMICRO_H
|
||||
@@ -1,2 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52833
|
||||
SD_VERSION=7.2.0
|
||||
@@ -1,19 +0,0 @@
|
||||
#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, 0x80000, // FLASH_BYTES
|
||||
205, 0x20000, // RAM_BYTES
|
||||
208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2
|
||||
209, 0x621e937a, // UF2_FAMILY = 0x621e937a
|
||||
210, 0x20, // PINS_PORT_SIZE = PA_32
|
||||
|
||||
0, 0, 0, 0, 0, 0, 0, 0
|
||||
/* CF2 END */
|
||||
};
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Pierre Constantineau
|
||||
*
|
||||
* 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 _BLUEMICRO_NRF52840_H
|
||||
#define _BLUEMICRO_NRF52840_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 4)
|
||||
#define LED_SECONDARY_PIN _PINNUM(1, 10)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2 // none connected at all
|
||||
#define BUTTON_1 _PINNUM(0, 18) // unusable: RESET
|
||||
#define BUTTON_2 _PINNUM(1, 1) // no connection on E73-2G4M08S1C Module
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "BlueMicro"
|
||||
#define BLEDIS_MODEL "BlueMicro 840"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB PID from openmoko:
|
||||
// Approved PR https://github.com/openmoko/openmoko-usb-oui/pull/20
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x1d50
|
||||
#define USB_DESC_UF2_PID 0x6160
|
||||
#define USB_DESC_CDC_ONLY_PID 0x6160
|
||||
|
||||
#define UF2_PRODUCT_NAME "BlueMicro"
|
||||
#define UF2_VOLUME_LABEL "BLUEMICRO"
|
||||
#define UF2_BOARD_ID "nRF52840-BlueMicro-v1"
|
||||
#define UF2_INDEX_URL "http://bluemicro.jpconstantineau.com/"
|
||||
|
||||
#endif // _BLUEMICRO_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
+8
-8
@@ -27,14 +27,14 @@
|
||||
#include "app_scheduler.h"
|
||||
#include "app_timer.h"
|
||||
|
||||
#ifdef LED_APA102
|
||||
#ifdef LED_APA102_CLK
|
||||
#include "nrf_spim.h"
|
||||
#endif
|
||||
|
||||
#define SCHED_MAX_EVENT_DATA_SIZE sizeof(app_timer_event_t) /**< Maximum size of scheduler events. */
|
||||
#define SCHED_QUEUE_SIZE 30 /**< Maximum number of events in the scheduler queue. */
|
||||
|
||||
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN) || defined(LED_APA102)
|
||||
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN) || defined(LED_APA102_CLK)
|
||||
void neopixel_init(void);
|
||||
void neopixel_write(uint8_t* pixels);
|
||||
void neopixel_teardown(void);
|
||||
@@ -86,7 +86,7 @@ void board_init(void) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN) || defined(LED_APA102)
|
||||
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN) || defined(LED_APA102_CLK)
|
||||
// use neopixel for use enumeration
|
||||
#ifdef NEOPIXEL_POWER_PIN
|
||||
nrf_gpio_cfg_output(NEOPIXEL_POWER_PIN);
|
||||
@@ -111,7 +111,7 @@ void board_init(void) {
|
||||
// #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3
|
||||
// in board.h when using that power configuration.
|
||||
#ifdef UICR_REGOUT0_VALUE
|
||||
if ((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) != (UICR_REGOUT0_VALUE << UICR_REGOUT0_VOUT_Pos)){
|
||||
if ((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) == (UICR_REGOUT0_VOUT_DEFAULT << UICR_REGOUT0_VOUT_Pos)){
|
||||
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
|
||||
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
|
||||
NRF_UICR->REGOUT0 = (NRF_UICR->REGOUT0 & ~((uint32_t)UICR_REGOUT0_VOUT_Msk)) |
|
||||
@@ -147,7 +147,7 @@ void board_teardown(void) {
|
||||
led_pwm_teardown();
|
||||
#endif
|
||||
|
||||
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN) || defined(LED_APA102)
|
||||
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN) || defined(LED_APA102_CLK)
|
||||
neopixel_teardown();
|
||||
#endif
|
||||
|
||||
@@ -362,7 +362,7 @@ static uint32_t primary_cycle_length;
|
||||
static uint32_t secondary_cycle_length;
|
||||
#endif
|
||||
|
||||
void led_tick() {
|
||||
void led_tick(void) {
|
||||
uint32_t millis = _systick_count;
|
||||
|
||||
uint32_t cycle = millis % primary_cycle_length;
|
||||
@@ -452,7 +452,7 @@ void led_state(uint32_t state) {
|
||||
final_color = (uint8_t*) &rgb_color;
|
||||
}
|
||||
|
||||
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN) || defined(LED_APA102)
|
||||
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN) || defined(LED_APA102_CLK)
|
||||
if (final_color != NULL) {
|
||||
neopixel_write(final_color);
|
||||
}
|
||||
@@ -560,7 +560,7 @@ void neopixel_write(uint8_t* pixels) {
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef LED_APA102
|
||||
#ifdef LED_APA102_CLK
|
||||
#define BYTE_PER_PIXEL 4
|
||||
|
||||
// 4 zero bytes are required to initiate update
|
||||
|
||||
@@ -122,6 +122,7 @@ void board_display_init(void);
|
||||
void board_display_teardown(void);
|
||||
void board_display_draw_line(uint16_t y, uint8_t const* buf, size_t nbytes);
|
||||
void screen_draw_drag(void);
|
||||
void screen_draw_ble(void);
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries, 2022 Invector Labs
|
||||
*
|
||||
* 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 _CHALLENGER_840_BLE_H
|
||||
#define _CHALLENGER_840_BLE_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 12)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(1, 8)
|
||||
#define NEOPIXELS_NUMBER 1
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(0, 19)
|
||||
#define BUTTON_2 _PINNUM(0, 8) // Pulls flash cs high
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* On board LDO control
|
||||
*------------------------------------------------------------------*/
|
||||
#define LDO_CONTROL_PIN _PINNUM(1, 9) // Enables external pwr
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Invector Labs"
|
||||
#define BLEDIS_MODEL "Challenger 840 BLE"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x1209
|
||||
#define USB_DESC_UF2_PID 0x7380
|
||||
#define USB_DESC_CDC_ONLY_PID 0x7381
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "ILabs Challenger 840"
|
||||
#define UF2_VOLUME_LABEL "CH840BOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-Challenger-840"
|
||||
#define UF2_INDEX_URL "https://www.ilabs.se"
|
||||
|
||||
#endif // _CHALLENGER_840_BLE_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,27 +0,0 @@
|
||||
#include "boards.h"
|
||||
#include "board.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 */
|
||||
};
|
||||
|
||||
void board_init2(void)
|
||||
{
|
||||
// Turn LDO on
|
||||
nrf_gpio_cfg_output(LDO_CONTROL_PIN);
|
||||
nrf_gpio_pin_write(LDO_CONTROL_PIN, 1);
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _CPLAY_NRF52840_H
|
||||
#define _CPLAY_NRF52840_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 14)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(0, 13)
|
||||
#define NEOPIXELS_NUMBER 10
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(1, 02) // left button
|
||||
#define BUTTON_2 _PINNUM(1, 15) // right button
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLDOWN
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Adafruit Industries"
|
||||
#define BLEDIS_MODEL "Circuit Playground nRF52840"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0045
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0045
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "Adafruit Circuit Playground nRF52840"
|
||||
#define UF2_VOLUME_LABEL "CPLAYBTBOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-CircuitPlayground-revD"
|
||||
#define UF2_INDEX_URL "https://www.adafruit.com/product/4333"
|
||||
|
||||
#endif // _CPLAY_NRF52840_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1 +0,0 @@
|
||||
set(MCU_VARIANT nrf52840)
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _CLUE_NRF52840_H
|
||||
#define _CLUE_NRF52840_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 01)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(0, 16)
|
||||
#define NEOPIXELS_NUMBER 1
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(1, 02) // left button
|
||||
#define BUTTON_2 _PINNUM(1, 10) // right button
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Display
|
||||
//--------------------------------------------------------------------+
|
||||
#define DISPLAY_CONTROLLER_ST7789
|
||||
|
||||
#define DISPLAY_PIN_SCK _PINNUM(0, 14)
|
||||
#define DISPLAY_PIN_MOSI _PINNUM(0, 15)
|
||||
|
||||
#define DISPLAY_PIN_CS _PINNUM(0, 12)
|
||||
#define DISPLAY_PIN_DC _PINNUM(0, 13)
|
||||
#define DISPLAY_PIN_RST _PINNUM(1, 3)
|
||||
#define DISPLAY_PIN_BL _PINNUM(1, 5)
|
||||
#define DISPLAY_BL_ON 1 // GPIO state to enable back light
|
||||
|
||||
#define DISPLAY_WIDTH 240
|
||||
#define DISPLAY_HEIGHT 240
|
||||
|
||||
#define DISPLAY_COL_OFFSET 0
|
||||
#define DISPLAY_ROW_OFFSET 80
|
||||
|
||||
// Memory Data Access Control & // Vertical Scroll Start Address
|
||||
#define DISPLAY_MADCTL (TFT_MADCTL_MY)
|
||||
#define DISPLAY_VSCSAD 0
|
||||
|
||||
#define DISPLAY_TITLE "CLUE"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Adafruit Industries"
|
||||
#define BLEDIS_MODEL "CLUE nRF52840"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0071
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0071
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "Adafruit CLUE nRF52840"
|
||||
#define UF2_VOLUME_LABEL "CLUEBOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-CLUE-revA"
|
||||
#define UF2_INDEX_URL "https://www.adafruit.com/product/4500"
|
||||
|
||||
#endif // _CLUE_NRF52840_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2021 Pierre Constantineau
|
||||
*
|
||||
* 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 _EBYTE_E104_BT5032A_H
|
||||
#define _EBYTE_E104_BT5032A_H
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN 31 // Red - named "Data"
|
||||
#define LED_SECONDARY_PIN 30 // Blue - named "Link" (also a red one on the Test Board)
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 29 // DISC Button on E104-BT5032A-TB Test Board
|
||||
// BUTTON_1 is DFU. The module does not have reset circuitry.
|
||||
// The Test Board from Ebyte (E104-BT5032A-TB) also does not have reset circuitry
|
||||
// To be able to upload using the Arduino IDE, (To enter DFU mode)
|
||||
// Press "DISC", press and release "RST", then release "DISC"
|
||||
#define BUTTON_2 28 // No button - WKP pin
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* UART (only used by nRF52832)
|
||||
*------------------------------------------------------------------*/
|
||||
#define RX_PIN_NUMBER 14
|
||||
#define TX_PIN_NUMBER 18
|
||||
#define CTS_PIN_NUMBER 20
|
||||
#define RTS_PIN_NUMBER 19
|
||||
#define HWFC false // leaving it false to make GPIO available
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "CDEBYTE"
|
||||
#define BLEDIS_MODEL "E104-BT5032A"
|
||||
|
||||
#define UF2_PRODUCT_NAME "Ebyte E104-BT5032A nRF52832"
|
||||
#define UF2_INDEX_URL "https://www.ebyte.com/en/product-view-news.html?id=756"
|
||||
|
||||
#endif // _EBYTE_E104_BT5032A_H
|
||||
@@ -1,2 +0,0 @@
|
||||
# nrf52 is nrf52832
|
||||
MCU_SUB_VARIANT = nrf52
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2021 Pierre Constantineau
|
||||
*
|
||||
* 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 _EBYTE_E73_TBB_H
|
||||
#define _EBYTE_E73_TBB_H
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN 17 // Red - named "LED1"
|
||||
#define LED_SECONDARY_PIN 18 // Blue - named "LED2" (also a red one on the Test Board)
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 14 // BUTTON_1 is DFU. SW1 on E73-TBB Test Board.
|
||||
// This Test board uses the E73-2G4M04S1B module which contains a nrf52832.
|
||||
// The module does not have reset circuitry.
|
||||
// The Test Board from Ebyte (E73-TBB) also does not have reset circuitry
|
||||
// To be able to upload using the Arduino IDE, (To enter DFU mode)
|
||||
// Press "SW1", momentarily ground "RST/P0.21", then release "SW1"
|
||||
#define BUTTON_2 13 // SW2 on board
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* UART (only used by nRF52832)
|
||||
*------------------------------------------------------------------*/
|
||||
#define RX_PIN_NUMBER 8
|
||||
#define TX_PIN_NUMBER 6
|
||||
#define CTS_PIN_NUMBER 5
|
||||
#define RTS_PIN_NUMBER 7
|
||||
#define HWFC false // leaving it false to make GPIO available
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "CDEBYTE"
|
||||
#define BLEDIS_MODEL "E73-TBB"
|
||||
|
||||
#define UF2_PRODUCT_NAME "Ebyte E73-TBB nRF52832"
|
||||
#define UF2_INDEX_URL "https://www.ebyte.com/en/product-view-news.aspx?id=889"
|
||||
|
||||
#endif // _EBYTE_E73_TBB_H
|
||||
@@ -1,2 +0,0 @@
|
||||
# nrf52 is nrf52832
|
||||
MCU_SUB_VARIANT = nrf52
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* @author Tavish Naruka <tavish@electronut.in>
|
||||
*
|
||||
* Copyright (c) 2018 Adafruit Industries
|
||||
*
|
||||
* 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 PAPYR_H
|
||||
#define PAPYR_H
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN 13
|
||||
#define LED_SECONDARY_PIN 14
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
// NOTE: USB UF2 bootloader can be triggered by double pressing RESET
|
||||
// App can trigger OTA bootloader by writing DFU_MAGIC_OTA_APPJUM to
|
||||
// GPREGRET register if softdevice is not initialized; or by
|
||||
// writing DFU_MAGIC_OTA_RESET in case softdevice is initialized.
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 18 // RESET also by default
|
||||
#define BUTTON_2 1 // P0.1 not exposed anywhere, FRST n/a
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Electronut Labs"
|
||||
#define BLEDIS_MODEL "Papyr"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define UF2_PRODUCT_NAME "Electronut Labs Papyr"
|
||||
#define UF2_BOARD_ID "nRF52840-Papyr-v1"
|
||||
#define UF2_INDEX_URL "https://docs.electronut.in/papyr"
|
||||
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x003B
|
||||
#define USB_DESC_CDC_ONLY_PID 0x003B
|
||||
|
||||
#endif // PPAPYR_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _FEATHER_NRF52832_H
|
||||
#define _FEATHER_NRF52832_H
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN 17 // Red
|
||||
#define LED_SECONDARY_PIN 19 // Blue
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 20
|
||||
#define BUTTON_2 22
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* UART (only used by nRF52832)
|
||||
*------------------------------------------------------------------*/
|
||||
#define RX_PIN_NUMBER 8
|
||||
#define TX_PIN_NUMBER 6
|
||||
#define CTS_PIN_NUMBER 0
|
||||
#define RTS_PIN_NUMBER 0
|
||||
#define HWFC false
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Adafruit Industries"
|
||||
#define BLEDIS_MODEL "Feather nRF52832"
|
||||
|
||||
#define UF2_PRODUCT_NAME "Adafruit Feather nRF52832"
|
||||
#define UF2_INDEX_URL "https://www.adafruit.com/product/3406"
|
||||
|
||||
#endif // _FEATHER_NRF52832_H
|
||||
@@ -1,2 +0,0 @@
|
||||
# nrf52 is nrf52832
|
||||
MCU_SUB_VARIANT = nrf52
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _FEATHER_NRF52833_H
|
||||
#define _FEATHER_NRF52833_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 15)
|
||||
#define LED_SECONDARY_PIN _PINNUM(1, 10)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(0, 16)
|
||||
#define NEOPIXELS_NUMBER 1
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(1, 02)
|
||||
#define BUTTON_2 _PINNUM(0, 10)
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Adafruit Industries"
|
||||
#define BLEDIS_MODEL "Feather nRF52833 Express"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0029 // TODO change later
|
||||
#define USB_DESC_CDC_ONLY_PID 0x002A // TODO change later
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "Adafruit Feather nRF52833 Express"
|
||||
#define UF2_VOLUME_LABEL "FTHR833BOOT"
|
||||
#define UF2_BOARD_ID "nRF52833-Feather-revD"
|
||||
#define UF2_INDEX_URL "https://www.adafruit.com/product/4062" // TODO change later
|
||||
|
||||
#endif
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52833
|
||||
@@ -1,19 +0,0 @@
|
||||
#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, 0x80000, // FLASH_BYTES
|
||||
205, 0x20000, // RAM_BYTES
|
||||
208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2
|
||||
209, 0x621e937a, // UF2_FAMILY
|
||||
210, 0x20, // PINS_PORT_SIZE = PA_32
|
||||
|
||||
0, 0, 0, 0, 0, 0, 0, 0
|
||||
/* CF2 END */
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
set(MCU_VARIANT nrf52840)
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _FEATHER_NRF52840_SENSE_H
|
||||
#define _FEATHER_NRF52840_SENSE_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 9)
|
||||
#define LED_SECONDARY_PIN _PINNUM(1, 10)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(0, 16)
|
||||
#define NEOPIXELS_NUMBER 1
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(1, 02)
|
||||
#define BUTTON_2 _PINNUM(0, 10)
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Adafruit Industries"
|
||||
#define BLEDIS_MODEL "Feather nRF52840 Sense"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0087
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0088
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Sense"
|
||||
#define UF2_VOLUME_LABEL "FTHRSNSBOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-Feather-Sense"
|
||||
#define UF2_INDEX_URL "https://www.adafruit.com/product/4516"
|
||||
|
||||
#endif // _FEATHER_NRF52840_SENSE_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
set(MCU_VARIANT nrf52840)
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
File renamed without changes.
@@ -22,8 +22,8 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _FEATHER_NRF52840_SENSE_TFT_H
|
||||
#define _FEATHER_NRF52840_SENSE_TFT_H
|
||||
#ifndef _HELTEC_T114_H
|
||||
#define _HELTEC_T114_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
@@ -31,20 +31,20 @@
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 11)
|
||||
#define LED_STATE_ON 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 3) // Green
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(1, 8)
|
||||
#define NEOPIXEL_POWER_PIN _PINNUM(1, 2)
|
||||
#define NEOPIXELS_NUMBER 1
|
||||
#define LED_NEOPIXEL _PINNUM(0, 14)
|
||||
#define NEOPIXEL_POWER_PIN _PINNUM(0, 21)
|
||||
#define NEOPIXELS_NUMBER 2
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(1, 6)
|
||||
#define BUTTON_2 _PINNUM(1, 10) // DFU pin
|
||||
#define BUTTON_1 _PINNUM(1, 10)
|
||||
#define BUTTON_2 _PINNUM(1, 10)
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
@@ -52,49 +52,54 @@
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// VSensor required to power the display
|
||||
#define DISPLAY_VSENSOR_PIN _PINNUM(1, 7)
|
||||
#define DISPLAY_VSENSOR_ON 1
|
||||
#define DISPLAY_VSENSOR_PIN _PINNUM(0, 3)
|
||||
#define DISPLAY_VSENSOR_ON 0
|
||||
|
||||
#define DISPLAY_CONTROLLER_ST7789
|
||||
|
||||
#define DISPLAY_PIN_SCK _PINNUM(0, 26)
|
||||
#define DISPLAY_PIN_MOSI _PINNUM(0, 5)
|
||||
#define DISPLAY_PIN_SCK _PINNUM(1, 8)
|
||||
#define DISPLAY_PIN_MOSI _PINNUM(1, 9)
|
||||
|
||||
#define DISPLAY_PIN_CS _PINNUM(1, 5)
|
||||
#define DISPLAY_PIN_DC _PINNUM(1, 1)
|
||||
#define DISPLAY_PIN_RST _PINNUM(1, 3)
|
||||
#define DISPLAY_PIN_BL _PINNUM(0, 27)
|
||||
#define DISPLAY_BL_ON 1 // GPIO state to enable back light
|
||||
#define DISPLAY_PIN_CS _PINNUM(0, 11)
|
||||
#define DISPLAY_PIN_DC _PINNUM(0, 12)
|
||||
#define DISPLAY_PIN_RST _PINNUM(0, 2)
|
||||
#define DISPLAY_PIN_BL _PINNUM(0, 15)
|
||||
#define DISPLAY_BL_ON 0 // GPIO state to enable back light
|
||||
|
||||
#define DISPLAY_WIDTH 240
|
||||
#define DISPLAY_HEIGHT 135
|
||||
|
||||
// USB FACING LEFT
|
||||
#define DISPLAY_COL_OFFSET 53
|
||||
#define DISPLAY_ROW_OFFSET 40
|
||||
#define DISPLAY_MADCTL (TFT_MADCTL_MX | TFT_MADCTL_RGB)
|
||||
|
||||
// USB FACING RIGHT
|
||||
//#define DISPLAY_COL_OFFSET 52
|
||||
//#define DISPLAY_ROW_OFFSET 40
|
||||
//#define DISPLAY_MADCTL (TFT_MADCTL_MY | TFT_MADCTL_RGB)
|
||||
|
||||
// Memory Data Access Control & // Vertical Scroll Start Address
|
||||
#define DISPLAY_MADCTL (TFT_MADCTL_MX)
|
||||
#define DISPLAY_VSCSAD 0
|
||||
|
||||
#define DISPLAY_TITLE "Sense TFT"
|
||||
#define DISPLAY_TITLE "HT-n5262"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Adafruit Industries"
|
||||
#define BLEDIS_MODEL "Feather nRF52840 Sense TFT"
|
||||
#define BLEDIS_MANUFACTURER "Heltec AutoMation"
|
||||
#define BLEDIS_MODEL "HT-n5262"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0087
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0088
|
||||
#define USB_DESC_UF2_PID 0x0071
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0071
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Sense TFT"
|
||||
#define UF2_VOLUME_LABEL "SENSTFTBOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-FeatherSenseTFT-revA"
|
||||
#define UF2_INDEX_URL "https://www.adafruit.com/product/"
|
||||
#define UF2_PRODUCT_NAME "HT-n5262"
|
||||
#define UF2_VOLUME_LABEL "HT-n5262"
|
||||
#define UF2_BOARD_ID "HT-n5262"
|
||||
#define UF2_INDEX_URL "HT-n5262"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
CFLAGS += -DDEVICE_NAME='"T114_DFU"'
|
||||
|
||||
File renamed without changes.
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _IKIGAISENSE_VITA_NRF52840_H
|
||||
#define _IKIGAISENSE_VITA_NRF52840_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 15)
|
||||
#define LED_SECONDARY_PIN _PINNUM(1, 10)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(0, 16)
|
||||
#define NEOPIXELS_NUMBER 1
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(1, 02)
|
||||
#define BUTTON_2 _PINNUM(0, 10)
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "IkigaiSense Technologies"
|
||||
#define BLEDIS_MODEL "Vita nRF52840"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0093
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0093
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "IkigaiSense Vita nRF52840"
|
||||
#define UF2_VOLUME_LABEL "ISVITABoot"
|
||||
#define UF2_BOARD_ID "nRF52840-isVITA-revA"
|
||||
#define UF2_INDEX_URL "https://github.com/ikigaisense/vita"
|
||||
|
||||
#endif // _IKIGAISENSE_VITA_NRF52840_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _ITSYBITSY_NRF52840_H
|
||||
#define _ITSYBITSY_NRF52840_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 6)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(0, 8)
|
||||
#define NEOPIXELS_NUMBER 1
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(0, 29) // user switch
|
||||
#define BUTTON_2 _PINNUM(1, 02) // D2 breakout
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Adafruit Industries"
|
||||
#define BLEDIS_MODEL "ItsyBitsy nRF52840 Express"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0051
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0052
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "Adafruit ItsyBitsy nRF52840 Express"
|
||||
#define UF2_VOLUME_LABEL "ITSY840BOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-ItsyBitsy-revA"
|
||||
#define UF2_INDEX_URL "https://www.adafruit.com/"
|
||||
|
||||
#endif // _ITSY_NRF52840_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,47 +0,0 @@
|
||||
#include "boards.h"
|
||||
#include "uf2/configkeys.h"
|
||||
|
||||
__attribute__((used, section(".bootloaderConfig")))
|
||||
const uint32_t bootloaderConfig[] =
|
||||
{
|
||||
/* CF2 START */
|
||||
CFG_MAGIC0, CFG_MAGIC1, // magic
|
||||
31, 100, // used entries, total entries
|
||||
4, 0x1d, // PIN_BTN_A = PA29
|
||||
7, 0x29, // PIN_DOTSTAR_CLOCK = PB09
|
||||
8, 0x8, // PIN_DOTSTAR_DATA = PA08
|
||||
13, 0x6, // PIN_LED = PA06
|
||||
18, 0x14, // PIN_MISO = PA20
|
||||
19, 0xf, // PIN_MOSI = PA15
|
||||
21, 0x19, // PIN_RX = PA25
|
||||
23, 0xd, // PIN_SCK = PA13
|
||||
24, 0xe, // PIN_SCL = PA14
|
||||
25, 0x10, // PIN_SDA = PA16
|
||||
28, 0x18, // PIN_TX = PA24
|
||||
100, 0x4, // PIN_A0 = PA04
|
||||
101, 0x1e, // PIN_A1 = PA30
|
||||
102, 0x1c, // PIN_A2 = PA28
|
||||
103, 0x1f, // PIN_A3 = PA31
|
||||
104, 0x2, // PIN_A4 = PA02
|
||||
105, 0x3, // PIN_A5 = PA03
|
||||
152, 0x22, // PIN_D2 = PB02
|
||||
155, 0x1b, // PIN_D5 = PA27
|
||||
157, 0x28, // PIN_D7 = PB08
|
||||
159, 0x7, // PIN_D9 = PA07
|
||||
160, 0x5, // PIN_D10 = PA05
|
||||
161, 0x1a, // PIN_D11 = PA26
|
||||
162, 0xb, // PIN_D12 = PA11
|
||||
163, 0xc, // PIN_D13 = PA12
|
||||
201, 0x1, // NUM_DOTSTARS = 1
|
||||
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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* CF2 END */
|
||||
};
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _LEDGLASSES_NRF52840_H
|
||||
#define _LEDGLASSES_NRF52840_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 31)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(1, 15)
|
||||
#define NEOPIXELS_NUMBER 1
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(0, 30) // user switch
|
||||
#define BUTTON_2 _PINNUM(0, 28) // NC
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Adafruit Industries"
|
||||
#define BLEDIS_MODEL "LED Glasses Driver nRF52840"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x010D
|
||||
#define USB_DESC_CDC_ONLY_PID 0x010E
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "Adafruit LED Glasses Driver nRF52840"
|
||||
#define UF2_VOLUME_LABEL "GLASSESBOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-LedGlasses-revA"
|
||||
#define UF2_INDEX_URL "https://www.adafruit.com/product/5217"
|
||||
|
||||
#endif // _LEDGLASSES_NRF52840_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Yihui Xiong for Makerdiary
|
||||
*
|
||||
* 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 _MAKERDIARY_M60_KEYBOARD_H_
|
||||
#define _MAKERDIARY_M60_KEYBOARD_H_
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 30) // Red
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
#define LED_RGB_RED_PIN _PINNUM(0, 30)
|
||||
#define LED_RGB_GREEN_PIN _PINNUM(0, 29)
|
||||
#define LED_RGB_BLUE_PIN _PINNUM(0, 31)
|
||||
#define BOARD_RGB_BRIGHTNESS 0x404040
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(0, 27)
|
||||
#define BUTTON_2 _PINNUM(0, 19) // ESC
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* On board regulator control
|
||||
*------------------------------------------------------------------*/
|
||||
#define LDO_CONTROL_PIN _PINNUM(0, 28) // Enables external pwr
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Makerdiary"
|
||||
#define BLEDIS_MODEL "M60 Mechanical Keyboard"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x2886
|
||||
#define USB_DESC_UF2_PID 0xF00F
|
||||
#define USB_DESC_CDC_ONLY_PID 0xF00F
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// UF2
|
||||
//--------------------------------------------------------------------+
|
||||
#define UF2_PRODUCT_NAME "MakerDiary M60 Mechanical Keyboard"
|
||||
#define UF2_VOLUME_LABEL "M60KEYBOARD"
|
||||
#define UF2_BOARD_ID "M60KEYBOARD"
|
||||
#define UF2_INDEX_URL "https://wiki.makerdiary.com/m60/"
|
||||
|
||||
|
||||
#endif /* _MAKERDIARY_M60_KEYBOARD_H_ */
|
||||
@@ -1,2 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
USE_NFCT = yes
|
||||
@@ -1,57 +0,0 @@
|
||||
#include "boards.h"
|
||||
#include "board.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 */
|
||||
};
|
||||
|
||||
static void power_on(void)
|
||||
{
|
||||
// Turn on the regulator
|
||||
nrf_gpio_cfg_output(LDO_CONTROL_PIN);
|
||||
nrf_gpio_pin_write(LDO_CONTROL_PIN, 1);
|
||||
}
|
||||
|
||||
void board_init2(void)
|
||||
{
|
||||
power_on();
|
||||
|
||||
// configure P0.05 for ESC/BUTTON_2
|
||||
// P0.05 --- |<- --- / --- P0.19
|
||||
// diode sw(esc)
|
||||
// mode: output, push-pull, low
|
||||
nrf_gpio_cfg(
|
||||
_PINNUM(0, 5),
|
||||
NRF_GPIO_PIN_DIR_OUTPUT,
|
||||
NRF_GPIO_PIN_INPUT_DISCONNECT,
|
||||
NRF_GPIO_PIN_NOPULL,
|
||||
NRF_GPIO_PIN_H0D1,
|
||||
NRF_GPIO_PIN_NOSENSE
|
||||
);
|
||||
nrf_gpio_pin_write(_PINNUM(0, 5), 0);
|
||||
|
||||
// Wait the buttons stable.
|
||||
// This is mandatory, or the keyboard will enter bootloader whenever
|
||||
// booted by pressing the button at back (same with BUTTON_1)
|
||||
NRFX_DELAY_MS(300);
|
||||
}
|
||||
|
||||
void board_teardown2(void)
|
||||
{
|
||||
// re-enable the battery
|
||||
power_on();
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 gpshead (krypto.org) for Adafruit Industries
|
||||
*
|
||||
* 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 _MDK_NRF52840_DONGLE_H_
|
||||
#define _MDK_NRF52840_DONGLE_H_
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2 // TODO(gpshead): support 0.
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 23) // Red
|
||||
#define LED_SECONDARY_PIN _PINNUM(0, 24) // Blue
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
//#define LED_RGB_RED_PIN _PINNUM(0, 23)
|
||||
//#define LED_RGB_GREEN_PIN _PINNUM(0, 22)
|
||||
//#define LED_RGB_BLUE_PIN _PINNUM(0, 24)
|
||||
#define BOARD_RGB_BRIGHTNESS 0x404040
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
// TODO(gpshead): simplify, have code support 0. double reset only.
|
||||
#define BUTTONS_NUMBER 2 // none connected at all
|
||||
#define BUTTON_1 _PINNUM(0, 18) // unusable: RESET
|
||||
#define BUTTON_2 _PINNUM(0, 19) // no connection
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "MakerDiary"
|
||||
#define BLEDIS_MODEL "nRF52840 Micro Dev Kit USB Dongle"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Shared VID/PID with Feather nRF52840, will be disabled for building in the future
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0029
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0029
|
||||
|
||||
#define UF2_PRODUCT_NAME "MDK nRF52840 USB Dongle"
|
||||
#define UF2_VOLUME_LABEL "MDK840DONGL"
|
||||
#define UF2_BOARD_ID "nRF52840-Dongle-v1"
|
||||
#define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/"
|
||||
|
||||
#endif /* _MDK_NRF52840_DONGLE_H_ */
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Ha Thach for Adafruit Industries
|
||||
*
|
||||
* 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 _METRO_NRF52840_H_
|
||||
#define _METRO_NRF52840_H_
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 13)
|
||||
#define LED_SECONDARY_PIN _PINNUM(1, 15)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define LED_NEOPIXEL _PINNUM(0, 13)
|
||||
#define NEOPIXELS_NUMBER 1
|
||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(1, 0)
|
||||
#define BUTTON_2 _PINNUM(2, 2)
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Adafruit Industries"
|
||||
#define BLEDIS_MODEL "Metro nRF52840 Express"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x003F
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0040
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "Adafruit Metro nRF52840 Express"
|
||||
#define UF2_VOLUME_LABEL "METR840BOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-Metro-revA"
|
||||
|
||||
#define UF2_INDEX_URL "https://www.adafruit.com/"
|
||||
|
||||
#endif /* _METRO_NRF52840_H_ */
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2021 Hai-Ninh Dang
|
||||
*
|
||||
* 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 _MIKOTO_H
|
||||
#define _MIKOTO_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
#define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 15) // Blue
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2 // none connected at all
|
||||
#define BUTTON_1 _PINNUM(0, 18) // unusable: RESET
|
||||
#define BUTTON_2 _PINNUM(0, 19) // no connection
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "zhiayang"
|
||||
#define BLEDIS_MODEL "mikoto"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x1209
|
||||
#define USB_DESC_UF2_PID 0x7A01
|
||||
#define USB_DESC_CDC_ONLY_PID 0x7A01
|
||||
|
||||
#define UF2_PRODUCT_NAME "Mikoto nRF52840"
|
||||
#define UF2_VOLUME_LABEL "MIKOTO-BOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-mikoto-rev520"
|
||||
#define UF2_INDEX_URL "https://github.com/zhiayang/mikoto"
|
||||
|
||||
#endif // _MIKOTO_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Yihui Xiong for Makerdiary
|
||||
*
|
||||
* 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 _MAKERDIARY_NRF82540_CONNECT_KIT_H_
|
||||
#define _MAKERDIARY_NRF82540_CONNECT_KIT_H_
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(1, 15) // Green
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
#define LED_RGB_RED_PIN _PINNUM(1, 10)
|
||||
#define LED_RGB_GREEN_PIN _PINNUM(1, 11)
|
||||
#define LED_RGB_BLUE_PIN _PINNUM(1, 12)
|
||||
#define BOARD_RGB_BRIGHTNESS 0x404040
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(1, 0) // P1.00: User Button
|
||||
#define BUTTON_2 _PINNUM(1, 7) // P1.07: NC
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Makerdiary"
|
||||
#define BLEDIS_MODEL "nRF52840 Connect Kit"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x2886
|
||||
#define USB_DESC_UF2_PID 0xF00F
|
||||
#define USB_DESC_CDC_ONLY_PID 0xF00F
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// UF2
|
||||
//--------------------------------------------------------------------+
|
||||
#define UF2_PRODUCT_NAME "nRF52840 Connect Kit"
|
||||
#define UF2_VOLUME_LABEL "CONNECTKIT"
|
||||
#define UF2_BOARD_ID "nRF52840-Connect-Kit"
|
||||
#define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-connectkit/"
|
||||
|
||||
|
||||
#endif /* _MAKERDIARY_NRF82540_CONNECT_KIT_H_ */
|
||||
@@ -1,2 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
USE_NFCT = yes
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2021 ddB0515(Dario Budimir)
|
||||
*
|
||||
* 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 _NRF52840_BBOARD_H
|
||||
#define _NRF52840_BBOARD_H
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 7)
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
// NOTE: USB UF2 bootloader can be triggered by double pressing RESET
|
||||
// App can trigger OTA bootloader by writing DFU_MAGIC_OTA_APPJUM to
|
||||
// GPREGRET register if softdevice is not initialized; or by
|
||||
// writing DFU_MAGIC_OTA_RESET in case softdevice is initialized.
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 18 // RESET also by default
|
||||
#define BUTTON_2 1 // P0.1 not exposed anywhere, FRST n/a
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "ddB0515"
|
||||
#define BLEDIS_MODEL "nRF52840 BBoard"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x1d50
|
||||
#define USB_DESC_UF2_PID 0x6157
|
||||
#define USB_DESC_CDC_ONLY_PID 0x6157
|
||||
|
||||
//------------- UF2 -------------//
|
||||
#define UF2_PRODUCT_NAME "nRF52840 BBoard"
|
||||
#define UF2_VOLUME_LABEL "BBOARDBOOT"
|
||||
#define UF2_BOARD_ID "nRF52840-BBoard-rev2"
|
||||
#define UF2_INDEX_URL "https://github.com/ddB0515/nRF52840-BBoard"
|
||||
|
||||
#endif // _NRF52840_BBOARD_H
|
||||
@@ -1 +0,0 @@
|
||||
MCU_SUB_VARIANT = nrf52840
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
};
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Yihui Xiong for Makerdiary
|
||||
*
|
||||
* 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 _MAKERDIARY_NRF52840_M2_H_
|
||||
#define _MAKERDIARY_NRF52840_M2_H_
|
||||
|
||||
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 1
|
||||
#define LED_PRIMARY_PIN _PINNUM(0, 30) // Red
|
||||
#define LED_DOCK_GREEN_PIN _PINNUM(1, 7) // Only available on the M.2 Dock
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
#define LED_RGB_RED_PIN _PINNUM(0, 30)
|
||||
#define LED_RGB_GREEN_PIN _PINNUM(0, 29)
|
||||
#define LED_RGB_BLUE_PIN _PINNUM(0, 31)
|
||||
#define BOARD_RGB_BRIGHTNESS 0x404040
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
#define BUTTON_1 _PINNUM(0, 19)
|
||||
#define BUTTON_2 _PINNUM(1, 7)
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLE OTA
|
||||
//--------------------------------------------------------------------+
|
||||
#define BLEDIS_MANUFACTURER "Makerdiary"
|
||||
#define BLEDIS_MODEL "nRF52840 M.2"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x2886
|
||||
#define USB_DESC_UF2_PID 0xF00F
|
||||
#define USB_DESC_CDC_ONLY_PID 0xF00F
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// UF2
|
||||
//--------------------------------------------------------------------+
|
||||
#define UF2_PRODUCT_NAME "MakerDiary nRF52840 M.2 Module"
|
||||
#define UF2_VOLUME_LABEL "nRF52840M2"
|
||||
#define UF2_BOARD_ID "nRF52840M2"
|
||||
#define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-m2"
|
||||
|
||||
|
||||
#endif /* _MAKERDIARY_NRF52840_M2_H_ */
|
||||
Loaded 100 of 163 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user