commit
8473ff6f35
11 changed files with 98 additions and 116 deletions
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
|
@ -3,10 +3,8 @@
|
|||
*By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes*
|
||||
|
||||
- [ ] Please provide specific title of the PR describing the change
|
||||
- [ ] Please provide related links (*eg. Issue which will be closed by this Pull Request*)
|
||||
- [ ] If you are adding an new boards, please make sure
|
||||
- [ ] Provide link to your allocated VID/PID if applicable
|
||||
- [ ] Add your board to [action ci](/.github/workflows) in correct workflow and alphabet order for release binary
|
||||
- [ ] `UF2_BOARD_ID` in your board.h follow correct format from [uf2 specs](https://github.com/microsoft/uf2#files-exposed-by-bootloaders)
|
||||
|
||||
*This checklist items that are not applicable to your PR can be deleted.*
|
||||
|
|
|
|||
5
.github/workflows/githubci.yml
vendored
5
.github/workflows/githubci.yml
vendored
|
|
@ -33,11 +33,6 @@ jobs:
|
|||
matrix:
|
||||
board: ${{ fromJSON(needs.set-matrix.outputs.matrix) }}
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
|
|
|
|||
150
CMakeLists.txt
150
CMakeLists.txt
|
|
@ -25,11 +25,11 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/toolchain/arm_${TOOLCHA
|
|||
|
||||
project(Adafruit_nRF52_Bootloader C ASM)
|
||||
|
||||
set(NRFX ${CMAKE_CURRENT_LIST_DIR}/lib/nrfx)
|
||||
set(SDK11 ${CMAKE_CURRENT_LIST_DIR}/lib/sdk11/components)
|
||||
set(SDK ${CMAKE_CURRENT_LIST_DIR}/lib/sdk/components)
|
||||
set(SOFTDEVICE ${CMAKE_CURRENT_LIST_DIR}/lib/softdevice)
|
||||
set(TUSB ${CMAKE_CURRENT_LIST_DIR}/lib/tinyusb/src)
|
||||
set(NRFX_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/nrfx)
|
||||
set(SDK11_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/sdk11/components)
|
||||
set(SDK_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/sdk/components)
|
||||
set(SOFTDEVICE_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/softdevice)
|
||||
set(TINYUSB_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/tinyusb/src)
|
||||
|
||||
set(UF2CONV_PY ${CMAKE_CURRENT_LIST_DIR}/lib/uf2/utils/uf2conv.py)
|
||||
set(UF2_FAMILY_ID_BOOTLOADER 0xd663823c)
|
||||
|
|
@ -42,10 +42,14 @@ add_executable(bootloader)
|
|||
|
||||
# SD_VERSION can be overwritten by board.cmake
|
||||
if(NOT DEFINED SD_VERSION)
|
||||
set(SD_VERSION 6.1.1)
|
||||
if(MCU_VARIANT STREQUAL "nrf52833")
|
||||
set(SD_VERSION 7.3.0)
|
||||
else()
|
||||
set(SD_VERSION 6.1.1)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
set(MBR_HEX ${SOFTDEVICE}/mbr/hex/mbr_nrf52_2.4.1_mbr.hex)
|
||||
set(MBR_HEX ${SOFTDEVICE_DIR}/mbr/hex/mbr_nrf52_2.4.1_mbr.hex)
|
||||
|
||||
target_sources(bootloader PUBLIC
|
||||
# src
|
||||
|
|
@ -57,31 +61,31 @@ target_sources(bootloader PUBLIC
|
|||
src/images.c
|
||||
src/boards/boards.c
|
||||
# nrfx
|
||||
${NRFX}/drivers/src/nrfx_power.c
|
||||
${NRFX}/drivers/src/nrfx_nvmc.c
|
||||
${NRFX}/mdk/system_${MCU_VARIANT}.c
|
||||
${NRFX_DIR}/drivers/src/nrfx_power.c
|
||||
${NRFX_DIR}/drivers/src/nrfx_nvmc.c
|
||||
${NRFX_DIR}/mdk/system_${MCU_VARIANT}.c
|
||||
# sdk 11
|
||||
${SDK11}/libraries/bootloader_dfu/bootloader.c
|
||||
${SDK11}/libraries/bootloader_dfu/bootloader_settings.c
|
||||
${SDK11}/libraries/bootloader_dfu/bootloader_util.c
|
||||
${SDK11}/libraries/bootloader_dfu/dfu_transport_serial.c
|
||||
${SDK11}/libraries/bootloader_dfu/dfu_transport_ble.c
|
||||
${SDK11}/libraries/bootloader_dfu/dfu_single_bank.c
|
||||
${SDK11}/ble/ble_services/ble_dfu/ble_dfu.c
|
||||
${SDK11}/ble/ble_services/ble_dis/ble_dis.c
|
||||
${SDK11}/drivers_nrf/pstorage/pstorage_raw.c
|
||||
${SDK11_DIR}/libraries/bootloader_dfu/bootloader.c
|
||||
${SDK11_DIR}/libraries/bootloader_dfu/bootloader_settings.c
|
||||
${SDK11_DIR}/libraries/bootloader_dfu/bootloader_util.c
|
||||
${SDK11_DIR}/libraries/bootloader_dfu/dfu_transport_serial.c
|
||||
${SDK11_DIR}/libraries/bootloader_dfu/dfu_transport_ble.c
|
||||
${SDK11_DIR}/libraries/bootloader_dfu/dfu_single_bank.c
|
||||
${SDK11_DIR}/ble/ble_services/ble_dfu/ble_dfu.c
|
||||
${SDK11_DIR}/ble/ble_services/ble_dis/ble_dis.c
|
||||
${SDK11_DIR}/drivers_nrf/pstorage/pstorage_raw.c
|
||||
# latest sdk
|
||||
${SDK}/libraries/timer/app_timer.c
|
||||
${SDK}/libraries/scheduler/app_scheduler.c
|
||||
${SDK}/libraries/util/app_error.c
|
||||
${SDK}/libraries/util/app_util_platform.c
|
||||
${SDK}/libraries/crc16/crc16.c
|
||||
${SDK}/libraries/hci/hci_mem_pool.c
|
||||
${SDK}/libraries/hci/hci_slip.c
|
||||
${SDK}/libraries/hci/hci_transport.c
|
||||
${SDK}/libraries/util/nrf_assert.c
|
||||
${SDK_DIR}/libraries/timer/app_timer.c
|
||||
${SDK_DIR}/libraries/scheduler/app_scheduler.c
|
||||
${SDK_DIR}/libraries/util/app_error.c
|
||||
${SDK_DIR}/libraries/util/app_util_platform.c
|
||||
${SDK_DIR}/libraries/crc16/crc16.c
|
||||
${SDK_DIR}/libraries/hci/hci_mem_pool.c
|
||||
${SDK_DIR}/libraries/hci/hci_slip.c
|
||||
${SDK_DIR}/libraries/hci/hci_transport.c
|
||||
${SDK_DIR}/libraries/util/nrf_assert.c
|
||||
# ASM
|
||||
${NRFX}/mdk/gcc_startup_${MCU_VARIANT}.S
|
||||
${NRFX_DIR}/mdk/gcc_startup_${MCU_VARIANT}.S
|
||||
)
|
||||
target_include_directories(bootloader PUBLIC
|
||||
src
|
||||
|
|
@ -89,31 +93,31 @@ target_include_directories(bootloader PUBLIC
|
|||
src/boards/${BOARD}
|
||||
src/cmsis/include
|
||||
src/usb
|
||||
${TUSB}
|
||||
${TINYUSB_DIR}
|
||||
# nrfx
|
||||
${NRFX}
|
||||
${NRFX}/mdk
|
||||
${NRFX}/hal
|
||||
${NRFX}/drivers/include
|
||||
${NRFX}/drivers/src
|
||||
${NRFX_DIR}
|
||||
${NRFX_DIR}/mdk
|
||||
${NRFX_DIR}/hal
|
||||
${NRFX_DIR}/drivers/include
|
||||
${NRFX_DIR}/drivers/src
|
||||
# sdk 11 for cdc/ble dfu
|
||||
${SDK11}/libraries/bootloader_dfu
|
||||
${SDK11}/libraries/bootloader_dfu/hci_transport
|
||||
${SDK11}/drivers_nrf/pstorage
|
||||
${SDK11}/ble/common
|
||||
${SDK11}/ble/ble_services/ble_dfu
|
||||
${SDK11}/ble/ble_services/ble_dis
|
||||
${SDK11_DIR}/libraries/bootloader_dfu
|
||||
${SDK11_DIR}/libraries/bootloader_dfu/hci_transport
|
||||
${SDK11_DIR}/drivers_nrf/pstorage
|
||||
${SDK11_DIR}/ble/common
|
||||
${SDK11_DIR}/ble/ble_services/ble_dfu
|
||||
${SDK11_DIR}/ble/ble_services/ble_dis
|
||||
# later sdk with updated drivers
|
||||
${SDK}/libraries/timer
|
||||
${SDK}/libraries/scheduler
|
||||
${SDK}/libraries/crc16
|
||||
${SDK}/libraries/util
|
||||
${SDK}/libraries/hci/config
|
||||
${SDK}/libraries/hci
|
||||
${SDK}/libraries/uart
|
||||
${SDK}/drivers_nrf/delay
|
||||
${SDK_DIR}/libraries/timer
|
||||
${SDK_DIR}/libraries/scheduler
|
||||
${SDK_DIR}/libraries/crc16
|
||||
${SDK_DIR}/libraries/util
|
||||
${SDK_DIR}/libraries/hci/config
|
||||
${SDK_DIR}/libraries/hci
|
||||
${SDK_DIR}/libraries/uart
|
||||
${SDK_DIR}/drivers_nrf/delay
|
||||
# Softdevice
|
||||
${SOFTDEVICE}/mbr/headers
|
||||
${SOFTDEVICE_DIR}/mbr/headers
|
||||
)
|
||||
|
||||
# Debug option
|
||||
|
|
@ -145,7 +149,7 @@ endif ()
|
|||
|
||||
target_link_options(bootloader PUBLIC
|
||||
"LINKER:--script=${LD_FILE}"
|
||||
-L${NRFX}/mdk
|
||||
-L${NRFX_DIR}/mdk
|
||||
--specs=nosys.specs --specs=nano.specs
|
||||
)
|
||||
target_compile_options(bootloader PUBLIC
|
||||
|
|
@ -181,14 +185,14 @@ endif ()
|
|||
if (MCU_VARIANT STREQUAL "nrf52")
|
||||
# UART transport
|
||||
target_sources(bootloader PUBLIC
|
||||
${SDK}/libraries/uart/app_uart.c
|
||||
${SDK}/drivers_nrf/uart/nrf_drv_uart.c
|
||||
${SDK}/drivers_nrf/common/nrf_drv_common.c
|
||||
${SDK_DIR}/libraries/uart/app_uart.c
|
||||
${SDK_DIR}/drivers_nrf/uart/nrf_drv_uart.c
|
||||
${SDK_DIR}/drivers_nrf/common/nrf_drv_common.c
|
||||
)
|
||||
target_include_directories(bootloader PUBLIC
|
||||
${SDK11}/libraries/util
|
||||
${SDK}/drivers_nrf/common
|
||||
${SDK}/drivers_nrf/uart
|
||||
${SDK11_DIR}/libraries/util
|
||||
${SDK_DIR}/drivers_nrf/common
|
||||
${SDK_DIR}/drivers_nrf/uart
|
||||
)
|
||||
else ()
|
||||
# USB transport
|
||||
|
|
@ -199,13 +203,13 @@ else ()
|
|||
src/usb/usb_desc.c
|
||||
src/usb/uf2/ghostfat.c
|
||||
# TinyUSB
|
||||
${TUSB}/portable/nordic/nrf5x/dcd_nrf5x.c
|
||||
${TUSB}/common/tusb_fifo.c
|
||||
${TUSB}/device/usbd.c
|
||||
${TUSB}/device/usbd_control.c
|
||||
${TUSB}/class/cdc/cdc_device.c
|
||||
${TUSB}/class/msc/msc_device.c
|
||||
${TUSB}/tusb.c
|
||||
${TINYUSB_DIR}/portable/nordic/nrf5x/dcd_nrf5x.c
|
||||
${TINYUSB_DIR}/common/tusb_fifo.c
|
||||
${TINYUSB_DIR}/device/usbd.c
|
||||
${TINYUSB_DIR}/device/usbd_control.c
|
||||
${TINYUSB_DIR}/class/cdc/cdc_device.c
|
||||
${TINYUSB_DIR}/class/msc/msc_device.c
|
||||
${TINYUSB_DIR}/tusb.c
|
||||
)
|
||||
endif ()
|
||||
|
||||
|
|
@ -222,10 +226,6 @@ if (MCU_VARIANT STREQUAL "nrf52")
|
|||
NRF52832_XXAA
|
||||
S132
|
||||
)
|
||||
target_include_directories(bootloader PUBLIC
|
||||
${SOFTDEVICE}/s132_nrf52_6.1.1/s132_nrf52_6.1.1_API/include
|
||||
)
|
||||
|
||||
elseif (MCU_VARIANT STREQUAL "nrf52833")
|
||||
set(SD_NAME s140)
|
||||
set(DFU_DEV_REV 52833)
|
||||
|
|
@ -234,10 +234,6 @@ elseif (MCU_VARIANT STREQUAL "nrf52833")
|
|||
NRF52833_XXAA
|
||||
S140
|
||||
)
|
||||
target_include_directories(bootloader PUBLIC
|
||||
${SOFTDEVICE}/s140_nrf52_6.1.1/s140_nrf52_6.1.1_API/include
|
||||
)
|
||||
|
||||
elseif (MCU_VARIANT STREQUAL "nrf52840")
|
||||
set(SD_NAME s140)
|
||||
set(DFU_DEV_REV 52840)
|
||||
|
|
@ -247,16 +243,16 @@ elseif (MCU_VARIANT STREQUAL "nrf52840")
|
|||
NRF52840_XXAA
|
||||
S140
|
||||
)
|
||||
target_include_directories(bootloader PUBLIC
|
||||
${SOFTDEVICE}/s140_nrf52_6.1.1/s140_nrf52_6.1.1_API/include
|
||||
)
|
||||
|
||||
else ()
|
||||
message(FATAL_ERROR "MCU_VARIANT ${MCU_VARIANT} is unknown")
|
||||
endif ()
|
||||
|
||||
set(SD_FILENAME ${SD_NAME}_nrf52_${SD_VERSION})
|
||||
set(SD_HEX ${SOFTDEVICE}/${SD_FILENAME}/${SD_FILENAME}_softdevice.hex)
|
||||
set(SD_HEX ${SOFTDEVICE_DIR}/${SD_FILENAME}/${SD_FILENAME}_softdevice.hex)
|
||||
|
||||
target_include_directories(bootloader PUBLIC
|
||||
${SOFTDEVICE_DIR}/${SD_FILENAME}/${SD_FILENAME}_API/include
|
||||
)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
target_compile_definitions(bootloader PUBLIC DFU_APP_DATA_RESERVED=${DFU_APP_DATA_RESERVED})
|
||||
|
|
|
|||
24
Makefile
24
Makefile
|
|
@ -10,6 +10,9 @@
|
|||
# local customization
|
||||
-include Makefile.user
|
||||
|
||||
# Board specific
|
||||
-include src/boards/$(BOARD)/board.mk
|
||||
|
||||
SDK_PATH = lib/sdk/components
|
||||
SDK11_PATH = lib/sdk11/components
|
||||
TUSB_PATH = lib/tinyusb/src
|
||||
|
|
@ -18,7 +21,11 @@ SD_PATH = lib/softdevice/$(SD_FILENAME)
|
|||
|
||||
# SD_VERSION can be overwritten by board.mk
|
||||
ifndef SD_VERSION
|
||||
SD_VERSION = 6.1.1
|
||||
ifeq ($(MCU_SUB_VARIANT),nrf52833)
|
||||
SD_VERSION = 7.3.0
|
||||
else
|
||||
SD_VERSION = 6.1.1
|
||||
endif
|
||||
endif
|
||||
|
||||
SD_FILENAME = $(SD_NAME)_nrf52_$(SD_VERSION)
|
||||
|
|
@ -89,25 +96,10 @@ endif
|
|||
BMP_PORT ?= $(shell ls -1 /dev/cu.usbmodem????????1 | head -1)
|
||||
GDB_BMP = $(GDB) -ex 'target extended-remote $(BMP_PORT)' -ex 'monitor swdp_scan' -ex 'attach 1'
|
||||
|
||||
#---------------------------------
|
||||
# Select the board to build
|
||||
#---------------------------------
|
||||
# Note: whitespace is not allowed in the filenames... it WILL break this part of the script
|
||||
BOARD_LIST = $(sort $(filter-out boards.h boards.c,$(notdir $(wildcard src/boards/*))))
|
||||
|
||||
ifeq ($(filter $(BOARD),$(BOARD_LIST)),)
|
||||
$(info You must provide a BOARD parameter with 'BOARD='. Supported boards are:)
|
||||
$(foreach b,$(BOARD_LIST),$(info - $(b)))
|
||||
$(error Invalid BOARD specified)
|
||||
endif
|
||||
|
||||
# Build directory
|
||||
BUILD = _build/build-$(BOARD)
|
||||
BIN = _bin/$(BOARD)
|
||||
|
||||
# Board specific
|
||||
-include src/boards/$(BOARD)/board.mk
|
||||
|
||||
# MCU_SUB_VARIANT can be nrf52 (nrf52832), nrf52833, nrf52840
|
||||
ifeq ($(MCU_SUB_VARIANT),nrf52)
|
||||
SD_NAME = s132
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@
|
|||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Shared VID/PID with Feather nRF52840, will be disabled for building in the future
|
||||
// Shared VID/PID with pca10056
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0029
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0029
|
||||
#define USB_DESC_UF2_PID 0x00DA
|
||||
#define USB_DESC_CDC_ONLY_PID 0x00DA
|
||||
|
||||
#define UF2_PRODUCT_NAME "Particle Argon"
|
||||
#define UF2_VOLUME_LABEL "ARGONBOOT "
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@
|
|||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Shared VID/PID with Feather nRF52840, will be disabled for building in the future
|
||||
// Shared VID/PID with pca10056
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0029
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0029
|
||||
#define USB_DESC_UF2_PID 0x00DA
|
||||
#define USB_DESC_CDC_ONLY_PID 0x00DA
|
||||
|
||||
#define UF2_PRODUCT_NAME "Particle Boron"
|
||||
#define UF2_VOLUME_LABEL "BORONBOOT "
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@
|
|||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Shared VID/PID with Feather nRF52840, will be disabled for building in the future
|
||||
// Shared VID/PID with pca10056
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x0029
|
||||
#define USB_DESC_CDC_ONLY_PID 0x0029
|
||||
#define USB_DESC_UF2_PID 0x00DA
|
||||
#define USB_DESC_CDC_ONLY_PID 0x00DA
|
||||
|
||||
#define UF2_PRODUCT_NAME "Particle Xenon"
|
||||
#define UF2_VOLUME_LABEL "XENONBOOT "
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@
|
|||
|
||||
// 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 USB_DESC_UF2_PID 0x00DA
|
||||
#define USB_DESC_CDC_ONLY_PID 0x00DA
|
||||
|
||||
#define UF2_PRODUCT_NAME "Nordic nRF52840 DK"
|
||||
#define UF2_BOARD_ID "nRF52840-pca10056-v1"
|
||||
|
|
|
|||
1
src/boards/pca10100/board.cmake
Normal file
1
src/boards/pca10100/board.cmake
Normal file
|
|
@ -0,0 +1 @@
|
|||
set(MCU_VARIANT nrf52833)
|
||||
|
|
@ -50,11 +50,12 @@
|
|||
//--------------------------------------------------------------------+
|
||||
// USB
|
||||
//--------------------------------------------------------------------+
|
||||
#define USB_DESC_VID 0x1915
|
||||
#define USB_DESC_UF2_PID 0x521F
|
||||
#define USB_DESC_CDC_ONLY_PID 0x521F
|
||||
#define USB_DESC_VID 0x239A
|
||||
#define USB_DESC_UF2_PID 0x00D8
|
||||
#define USB_DESC_CDC_ONLY_PID 0x00D8
|
||||
|
||||
#define UF2_PRODUCT_NAME "Nordic nRF52833 DK"
|
||||
#define UF2_VOLUME_LABEL "NRF833BOOT"
|
||||
#define UF2_BOARD_ID "nRF52833-pca10100-v1"
|
||||
#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52833-DK"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
MCU_SUB_VARIANT = nrf52833
|
||||
SD_VERSION=7.2.0
|
||||
MCU_SUB_VARIANT = nrf52833
|
||||
Loading…
Reference in a new issue