-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards: adafruit feather nrf52840 update UF2
Add support for flashing the Adafruit Feather nrf52840 Express using UF2 over USB. Also standardise on using the UF2 variant, so add a non UF2 variant of the Sense board, so it can be flashed using the SWD headers. Created flash dtsi files for both SWD and UF2. These are actually identical for many other boards and should probably be moved to common in future. Signed-off-by: Jacob Winther <[email protected]>
- Loading branch information
Showing
17 changed files
with
325 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
|
||
chosen { | ||
zephyr,sram = &sram0; | ||
zephyr,flash = &flash0; | ||
zephyr,ieee802154 = &ieee802154; | ||
}; | ||
|
||
|
48 changes: 48 additions & 0 deletions
48
boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_flash.dtsi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2024 Jacob Winther | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
chosen { | ||
zephyr,flash = &flash0; | ||
zephyr,code-partition = &slot0_partition; | ||
}; | ||
}; | ||
|
||
&flash0 { | ||
partitions { | ||
compatible = "fixed-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
boot_partition: partition@0 { | ||
label = "mcuboot"; | ||
reg = <0x00000000 0x0000C000>; | ||
}; | ||
slot0_partition: partition@c000 { | ||
label = "image-0"; | ||
reg = <0x0000C000 0x00067000>; | ||
}; | ||
slot1_partition: partition@73000 { | ||
label = "image-1"; | ||
reg = <0x00073000 0x00067000>; | ||
}; | ||
scratch_partition: partition@da000 { | ||
label = "image-scratch"; | ||
reg = <0x000da000 0x0001e000>; | ||
}; | ||
|
||
/* | ||
* The flash starting at 0x000f8000 and ending at | ||
* 0x000fffff is reserved for use by the application. | ||
*/ | ||
|
||
/* Storage partition will be used by FCB/NFFS/NVS if enabled. */ | ||
storage_partition: partition@f8000 { | ||
label = "storage"; | ||
reg = <0x000f8000 0x00008000>; | ||
}; | ||
}; | ||
}; |
52 changes: 52 additions & 0 deletions
52
boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_flash_uf2.dtsi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2024 Jacob Winther | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Default flash layout for nrf52840 using UF2 | ||
*/ | ||
|
||
/ { | ||
chosen { | ||
zephyr,flash = &flash0; | ||
zephyr,code-partition = &code_partition; | ||
}; | ||
}; | ||
|
||
&flash0 { | ||
partitions { | ||
compatible = "fixed-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
/* To enable flashing with UF2 bootloader, we | ||
* must reserve a partition for SoftDevice. | ||
* See https://learn.adafruit.com/ | ||
* introducing-the-adafruit-nrf52840-feather?view=all#hathach-memory-map | ||
*/ | ||
reserved_partition_0: partition@0 { | ||
label = "SoftDevice"; | ||
read-only; | ||
reg = <0x000000000 DT_SIZE_K(152)>; | ||
}; | ||
code_partition: partition@26000 { | ||
label = "Application"; | ||
reg = <0x00026000 DT_SIZE_K(796)>; | ||
}; | ||
|
||
/* | ||
* The flash starting at 0x000ed000 and ending at | ||
* 0x000f4000 is reserved for use by the application. | ||
*/ | ||
storage_partition: partition@ed000 { | ||
label = "storage"; | ||
reg = <0x0000ed000 DT_SIZE_K(28)>; | ||
}; | ||
|
||
boot_partition: partition@f4000 { | ||
label = "UF2"; | ||
read-only; | ||
reg = <0x000f4000 DT_SIZE_K(48)>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense_uf2.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2020 Tobias Svehagen | ||
* Copyright (c) 2024 Jacob Winther | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
#include "adafruit_feather_nrf52840_common.dtsi" | ||
#include "adafruit_feather_nrf52840_flash_uf2.dtsi" | ||
|
||
/ { | ||
model = "Adafruit Feather nRF52840 Sense"; | ||
compatible = "adafruit,feather-nrf52840-sense-uf2"; | ||
|
||
chosen { | ||
zephyr,console = &cdc_acm_uart0; | ||
zephyr,shell-uart = &cdc_acm_uart0; | ||
zephyr,uart-mcumgr = &cdc_acm_uart0; | ||
zephyr,bt-mon-uart = &cdc_acm_uart0; | ||
zephyr,bt-c2h-uart = &cdc_acm_uart0; | ||
}; | ||
|
||
leds { | ||
led0: led_0 { | ||
gpios = <&gpio1 9 0>; | ||
}; | ||
}; | ||
}; | ||
|
||
&i2c0 { | ||
SHT3XD: sht3xd@44 { | ||
compatible = "sensirion,sht3xd"; | ||
reg = <0x44>; | ||
}; | ||
}; | ||
|
||
zephyr_udc0: &usbd { | ||
cdc_acm_uart0: cdc_acm_uart0 { | ||
compatible = "zephyr,cdc-acm-uart"; | ||
}; | ||
}; |
19 changes: 19 additions & 0 deletions
19
boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense_uf2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
identifier: adafruit_feather_nrf52840/nrf52840/sense/uf2 | ||
name: Adafruit Feather nRF52840 Sense UF2 | ||
type: mcu | ||
arch: arm | ||
toolchain: | ||
- zephyr | ||
- gnuarmemb | ||
- xtools | ||
supported: | ||
- adc | ||
- usb_device | ||
- usb_cdc | ||
- ble | ||
- watchdog | ||
- counter | ||
- feather_serial | ||
- feather_i2c | ||
- feather_spi | ||
vendor: adafruit |
27 changes: 27 additions & 0 deletions
27
boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense_uf2_defconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Enable MPU | ||
CONFIG_ARM_MPU=y | ||
|
||
# Enable GPIO | ||
CONFIG_GPIO=y | ||
|
||
# Enable UART driver | ||
CONFIG_SERIAL=y | ||
|
||
# Enable console | ||
CONFIG_CONSOLE=y | ||
CONFIG_UART_CONSOLE=y | ||
|
||
# 32kHz clock source | ||
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y | ||
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y | ||
|
||
# Logger cannot use itself to log | ||
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y | ||
|
||
# Enable USB | ||
CONFIG_USB_DEVICE_STACK=y | ||
|
||
# Build UF2 by default, supported by the Adafruit nRF52 Bootloader | ||
CONFIG_BUILD_OUTPUT_UF2=y |
34 changes: 34 additions & 0 deletions
34
boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_uf2.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2024 Jacob Winther | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
#include "adafruit_feather_nrf52840_common.dtsi" | ||
#include "adafruit_feather_nrf52840_flash_uf2.dtsi" | ||
|
||
/ { | ||
model = "Adafruit Feather nRF52840 Express"; | ||
compatible = "adafruit,feather-nrf52840-uf2"; | ||
|
||
chosen { | ||
zephyr,console = &cdc_acm_uart0; | ||
zephyr,shell-uart = &cdc_acm_uart0; | ||
zephyr,uart-mcumgr = &cdc_acm_uart0; | ||
zephyr,bt-mon-uart = &cdc_acm_uart0; | ||
zephyr,bt-c2h-uart = &cdc_acm_uart0; | ||
}; | ||
|
||
leds { | ||
led0: led_0 { | ||
gpios = <&gpio1 15 0>; | ||
}; | ||
}; | ||
}; | ||
|
||
zephyr_udc0: &usbd { | ||
cdc_acm_uart0: cdc_acm_uart0 { | ||
compatible = "zephyr,cdc-acm-uart"; | ||
}; | ||
}; |
Oops, something went wrong.