Compare commits
53 commits
tft_power_
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a9a6a3e6d | ||
|
|
31c3081668 | ||
|
|
d475f25154 | ||
|
|
4bce0cc1f2 | ||
|
|
b1e088396a | ||
|
|
df983b53c7 | ||
|
|
0e98348d96 | ||
|
|
70da7d88f4 | ||
|
|
3182f6036d | ||
|
|
de9a9b79f4 | ||
|
|
b8544f5c8c | ||
|
|
00b5e72496 | ||
|
|
389e5b004d | ||
|
|
ddcb2dba8c | ||
|
|
73020f3567 | ||
|
|
a48e944f0b | ||
|
|
c83fa9fc2b | ||
|
|
8970125e51 | ||
|
|
22224cef7b | ||
|
|
4329614a8f | ||
|
|
bd12455029 | ||
|
|
3a2708b30a | ||
|
|
fb557b2af9 | ||
|
|
7f2b127506 | ||
|
|
5a96435322 | ||
|
|
f3b3a0de40 | ||
|
|
6940c5b73e | ||
|
|
4786a4a251 | ||
|
|
9027359cec | ||
|
|
eefbe6bda9 | ||
|
|
ab74be4811 | ||
|
|
488711a9b3 | ||
|
|
91fc6735e9 | ||
|
|
6b62aacdc9 | ||
|
|
4f747e416b | ||
|
|
155dedb048 | ||
|
|
29ca3ebfab | ||
|
|
4e700d4904 | ||
|
|
8473ff6f35 | ||
|
|
5f99d530ff | ||
|
|
c5150ccf02 | ||
|
|
438a08e0ac | ||
|
|
2d68ec56e3 | ||
|
|
836c8dcc76 | ||
|
|
9e25f4ac0a | ||
|
|
a73fe207a8 | ||
|
|
ea3bb737de | ||
|
|
0bc8a8993f | ||
|
|
78b39b4347 | ||
|
|
e7450022a8 | ||
|
|
4f8c2afabf | ||
|
|
2e6c877d1b | ||
|
|
59df4f9e8c |
39 changed files with 749 additions and 225 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*
|
*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 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
|
- [ ] If you are adding an new boards, please make sure
|
||||||
- [ ] Provide link to your allocated VID/PID if applicable
|
- [ ] 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)
|
- [ ] `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.*
|
*This checklist items that are not applicable to your PR can be deleted.*
|
||||||
|
|
|
||||||
85
.github/workflows/githubci.yml
vendored
85
.github/workflows/githubci.yml
vendored
|
|
@ -9,96 +9,51 @@ on:
|
||||||
- created
|
- created
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
set-matrix:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set matrix
|
||||||
|
id: set-matrix
|
||||||
|
working-directory: src/boards
|
||||||
|
run: |
|
||||||
|
MATRIX_JSON=$(ls -d */ | sed 's/\/$//' | jq -R -s -c 'split("\n")[:-1]')
|
||||||
|
echo "matrix=$MATRIX_JSON"
|
||||||
|
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
needs: set-matrix
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
board:
|
board: ${{ fromJSON(needs.set-matrix.outputs.matrix) }}
|
||||||
# Adafruit Boards
|
|
||||||
- 'circuitplayground_nrf52840'
|
|
||||||
- 'clue_nrf52840'
|
|
||||||
- 'feather_nrf52832'
|
|
||||||
- 'feather_nrf52833_express'
|
|
||||||
- 'feather_nrf52840_express'
|
|
||||||
- 'feather_nrf52840_sense'
|
|
||||||
- 'feather_nrf52840_sense_tft'
|
|
||||||
- 'itsybitsy_nrf52840_express'
|
|
||||||
- 'metro_nrf52840_express'
|
|
||||||
- 'ledglasses_nrf52840'
|
|
||||||
# Other Makers (Alphabetical order)
|
|
||||||
- 'adm_b_nrf52840_1'
|
|
||||||
- 'ae_bl652_bo'
|
|
||||||
- 'aramcon_badge_2019'
|
|
||||||
- 'aramcon2_badge'
|
|
||||||
- 'arcade_feather_nrf52840_express'
|
|
||||||
- 'arduino_nano_33_ble'
|
|
||||||
- 'bast_ble'
|
|
||||||
- 'bluemicro_nrf52833'
|
|
||||||
- 'bluemicro_nrf52840'
|
|
||||||
- 'challenger_840_ble'
|
|
||||||
- 'ebyte_e104_bt5032a'
|
|
||||||
- 'ebyte_e73_tbb'
|
|
||||||
- 'electronut_labs_papyr'
|
|
||||||
- 'ikigaisense_vita'
|
|
||||||
- 'm60_keyboard'
|
|
||||||
- 'mdk_nrf52840_dongle'
|
|
||||||
- 'mikoto'
|
|
||||||
- 'nice_nano'
|
|
||||||
- 'nrf52840_bboard'
|
|
||||||
- 'nRF52840_connect_kit'
|
|
||||||
- 'nrf52840_m2'
|
|
||||||
- 'ohs2020_badge'
|
|
||||||
- 'particle_argon'
|
|
||||||
- 'particle_boron'
|
|
||||||
- 'particle_xenon'
|
|
||||||
- 'pca10056'
|
|
||||||
- 'pca10059'
|
|
||||||
- 'pca10100'
|
|
||||||
- 'pitaya_go'
|
|
||||||
- 'raytac_mdbt50q_db_40'
|
|
||||||
- 'raytac_mdbt50q_rx'
|
|
||||||
- 'sparkfun_nrf52840_micromod'
|
|
||||||
- 'waveshare_nrf52840_eval'
|
|
||||||
- 'xiao_nrf52840_ble'
|
|
||||||
- 'xiao_nrf52840_ble_sense'
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v3
|
|
||||||
|
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Checkout linkermap
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: hathach/linkermap
|
|
||||||
path: linkermap
|
|
||||||
|
|
||||||
- name: Install ARM GCC
|
- name: Install ARM GCC
|
||||||
uses: carlosperate/arm-none-eabi-gcc-action@v1
|
uses: carlosperate/arm-none-eabi-gcc-action@v1
|
||||||
with:
|
with:
|
||||||
release: '10-2020-q4'
|
release: '12.3.Rel1'
|
||||||
|
|
||||||
- name: Install Tools
|
- name: Install Tools
|
||||||
run: |
|
run: |
|
||||||
pip3 install adafruit-nrfutil uritemplate requests intelhex setuptools
|
pip3 install adafruit-nrfutil uritemplate requests intelhex setuptools
|
||||||
pip3 install linkermap/
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
arm-none-eabi-gcc --version
|
|
||||||
make BOARD=${{ matrix.board }} all
|
make BOARD=${{ matrix.board }} all
|
||||||
make BOARD=${{ matrix.board }} copy-artifact
|
make BOARD=${{ matrix.board }} copy-artifact
|
||||||
|
|
||||||
- name: Linker Map
|
- uses: actions/upload-artifact@v4
|
||||||
run: make BOARD=${{ matrix.board }} linkermap
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.board }}
|
name: ${{ matrix.board }}
|
||||||
path: _bin/${{ matrix.board }}
|
path: _bin/${{ matrix.board }}
|
||||||
|
|
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -65,3 +65,7 @@ TAGS
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Makefile.user
|
Makefile.user
|
||||||
|
|
||||||
|
# Exclude all SoftDevice S340 files
|
||||||
|
lib/softdevice/s340*
|
||||||
|
|
||||||
|
|
|
||||||
190
CMakeLists.txt
190
CMakeLists.txt
|
|
@ -25,15 +25,19 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/toolchain/arm_${TOOLCHA
|
||||||
|
|
||||||
project(Adafruit_nRF52_Bootloader C ASM)
|
project(Adafruit_nRF52_Bootloader C ASM)
|
||||||
|
|
||||||
set(NRFX ${CMAKE_CURRENT_LIST_DIR}/lib/nrfx)
|
set(NRFX_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/nrfx)
|
||||||
set(SDK11 ${CMAKE_CURRENT_LIST_DIR}/lib/sdk11/components)
|
set(SDK11_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/sdk11/components)
|
||||||
set(SDK ${CMAKE_CURRENT_LIST_DIR}/lib/sdk/components)
|
set(SDK_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/sdk/components)
|
||||||
set(SOFTDEVICE ${CMAKE_CURRENT_LIST_DIR}/lib/softdevice)
|
set(SOFTDEVICE_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/softdevice)
|
||||||
set(TUSB ${CMAKE_CURRENT_LIST_DIR}/lib/tinyusb/src)
|
set(TINYUSB_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/tinyusb/src)
|
||||||
|
|
||||||
set(UF2CONV_PY ${CMAKE_CURRENT_LIST_DIR}/lib/uf2/utils/uf2conv.py)
|
set(UF2CONV_PY ${CMAKE_CURRENT_LIST_DIR}/lib/uf2/utils/uf2conv.py)
|
||||||
set(UF2_FAMILY_ID_BOOTLOADER 0xd663823c)
|
set(UF2_FAMILY_ID_BOOTLOADER 0xd663823c)
|
||||||
|
|
||||||
|
if (NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
|
||||||
|
set(CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "Build type" FORCE)
|
||||||
|
endif ()
|
||||||
|
|
||||||
#-------------------
|
#-------------------
|
||||||
# Bootloader
|
# Bootloader
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
@ -42,10 +46,14 @@ add_executable(bootloader)
|
||||||
|
|
||||||
# SD_VERSION can be overwritten by board.cmake
|
# SD_VERSION can be overwritten by board.cmake
|
||||||
if(NOT DEFINED SD_VERSION)
|
if(NOT DEFINED SD_VERSION)
|
||||||
|
if(MCU_VARIANT STREQUAL "nrf52833")
|
||||||
|
set(SD_VERSION 7.3.0)
|
||||||
|
else()
|
||||||
set(SD_VERSION 6.1.1)
|
set(SD_VERSION 6.1.1)
|
||||||
|
endif()
|
||||||
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
|
target_sources(bootloader PUBLIC
|
||||||
# src
|
# src
|
||||||
|
|
@ -57,31 +65,31 @@ target_sources(bootloader PUBLIC
|
||||||
src/images.c
|
src/images.c
|
||||||
src/boards/boards.c
|
src/boards/boards.c
|
||||||
# nrfx
|
# nrfx
|
||||||
${NRFX}/drivers/src/nrfx_power.c
|
${NRFX_DIR}/drivers/src/nrfx_power.c
|
||||||
${NRFX}/drivers/src/nrfx_nvmc.c
|
${NRFX_DIR}/drivers/src/nrfx_nvmc.c
|
||||||
${NRFX}/mdk/system_${MCU_VARIANT}.c
|
${NRFX_DIR}/mdk/system_${MCU_VARIANT}.c
|
||||||
# sdk 11
|
# sdk 11
|
||||||
${SDK11}/libraries/bootloader_dfu/bootloader.c
|
${SDK11_DIR}/libraries/bootloader_dfu/bootloader.c
|
||||||
${SDK11}/libraries/bootloader_dfu/bootloader_settings.c
|
${SDK11_DIR}/libraries/bootloader_dfu/bootloader_settings.c
|
||||||
${SDK11}/libraries/bootloader_dfu/bootloader_util.c
|
${SDK11_DIR}/libraries/bootloader_dfu/bootloader_util.c
|
||||||
${SDK11}/libraries/bootloader_dfu/dfu_transport_serial.c
|
${SDK11_DIR}/libraries/bootloader_dfu/dfu_transport_serial.c
|
||||||
${SDK11}/libraries/bootloader_dfu/dfu_transport_ble.c
|
${SDK11_DIR}/libraries/bootloader_dfu/dfu_transport_ble.c
|
||||||
${SDK11}/libraries/bootloader_dfu/dfu_single_bank.c
|
${SDK11_DIR}/libraries/bootloader_dfu/dfu_single_bank.c
|
||||||
${SDK11}/ble/ble_services/ble_dfu/ble_dfu.c
|
${SDK11_DIR}/ble/ble_services/ble_dfu/ble_dfu.c
|
||||||
${SDK11}/ble/ble_services/ble_dis/ble_dis.c
|
${SDK11_DIR}/ble/ble_services/ble_dis/ble_dis.c
|
||||||
${SDK11}/drivers_nrf/pstorage/pstorage_raw.c
|
${SDK11_DIR}/drivers_nrf/pstorage/pstorage_raw.c
|
||||||
# latest sdk
|
# latest sdk
|
||||||
${SDK}/libraries/timer/app_timer.c
|
${SDK_DIR}/libraries/timer/app_timer.c
|
||||||
${SDK}/libraries/scheduler/app_scheduler.c
|
${SDK_DIR}/libraries/scheduler/app_scheduler.c
|
||||||
${SDK}/libraries/util/app_error.c
|
${SDK_DIR}/libraries/util/app_error.c
|
||||||
${SDK}/libraries/util/app_util_platform.c
|
${SDK_DIR}/libraries/util/app_util_platform.c
|
||||||
${SDK}/libraries/crc16/crc16.c
|
${SDK_DIR}/libraries/crc16/crc16.c
|
||||||
${SDK}/libraries/hci/hci_mem_pool.c
|
${SDK_DIR}/libraries/hci/hci_mem_pool.c
|
||||||
${SDK}/libraries/hci/hci_slip.c
|
${SDK_DIR}/libraries/hci/hci_slip.c
|
||||||
${SDK}/libraries/hci/hci_transport.c
|
${SDK_DIR}/libraries/hci/hci_transport.c
|
||||||
${SDK}/libraries/util/nrf_assert.c
|
${SDK_DIR}/libraries/util/nrf_assert.c
|
||||||
# ASM
|
# ASM
|
||||||
${NRFX}/mdk/gcc_startup_${MCU_VARIANT}.S
|
${NRFX_DIR}/mdk/gcc_startup_${MCU_VARIANT}.S
|
||||||
)
|
)
|
||||||
target_include_directories(bootloader PUBLIC
|
target_include_directories(bootloader PUBLIC
|
||||||
src
|
src
|
||||||
|
|
@ -89,31 +97,31 @@ target_include_directories(bootloader PUBLIC
|
||||||
src/boards/${BOARD}
|
src/boards/${BOARD}
|
||||||
src/cmsis/include
|
src/cmsis/include
|
||||||
src/usb
|
src/usb
|
||||||
${TUSB}
|
${TINYUSB_DIR}
|
||||||
# nrfx
|
# nrfx
|
||||||
${NRFX}
|
${NRFX_DIR}
|
||||||
${NRFX}/mdk
|
${NRFX_DIR}/mdk
|
||||||
${NRFX}/hal
|
${NRFX_DIR}/hal
|
||||||
${NRFX}/drivers/include
|
${NRFX_DIR}/drivers/include
|
||||||
${NRFX}/drivers/src
|
${NRFX_DIR}/drivers/src
|
||||||
# sdk 11 for cdc/ble dfu
|
# sdk 11 for cdc/ble dfu
|
||||||
${SDK11}/libraries/bootloader_dfu
|
${SDK11_DIR}/libraries/bootloader_dfu
|
||||||
${SDK11}/libraries/bootloader_dfu/hci_transport
|
${SDK11_DIR}/libraries/bootloader_dfu/hci_transport
|
||||||
${SDK11}/drivers_nrf/pstorage
|
${SDK11_DIR}/drivers_nrf/pstorage
|
||||||
${SDK11}/ble/common
|
${SDK11_DIR}/ble/common
|
||||||
${SDK11}/ble/ble_services/ble_dfu
|
${SDK11_DIR}/ble/ble_services/ble_dfu
|
||||||
${SDK11}/ble/ble_services/ble_dis
|
${SDK11_DIR}/ble/ble_services/ble_dis
|
||||||
# later sdk with updated drivers
|
# later sdk with updated drivers
|
||||||
${SDK}/libraries/timer
|
${SDK_DIR}/libraries/timer
|
||||||
${SDK}/libraries/scheduler
|
${SDK_DIR}/libraries/scheduler
|
||||||
${SDK}/libraries/crc16
|
${SDK_DIR}/libraries/crc16
|
||||||
${SDK}/libraries/util
|
${SDK_DIR}/libraries/util
|
||||||
${SDK}/libraries/hci/config
|
${SDK_DIR}/libraries/hci/config
|
||||||
${SDK}/libraries/hci
|
${SDK_DIR}/libraries/hci
|
||||||
${SDK}/libraries/uart
|
${SDK_DIR}/libraries/uart
|
||||||
${SDK}/drivers_nrf/delay
|
${SDK_DIR}/drivers_nrf/delay
|
||||||
# Softdevice
|
# Softdevice
|
||||||
${SOFTDEVICE}/mbr/headers
|
${SOFTDEVICE_DIR}/mbr/headers
|
||||||
)
|
)
|
||||||
|
|
||||||
# Debug option
|
# Debug option
|
||||||
|
|
@ -127,7 +135,6 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
target_include_directories(bootloader PUBLIC
|
target_include_directories(bootloader PUBLIC
|
||||||
lib/SEGGER_RTT/RTT
|
lib/SEGGER_RTT/RTT
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_definitions(bootloader PUBLIC
|
target_compile_definitions(bootloader PUBLIC
|
||||||
CFG_DEBUG
|
CFG_DEBUG
|
||||||
SEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
|
SEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
|
||||||
|
|
@ -145,7 +152,7 @@ endif ()
|
||||||
|
|
||||||
target_link_options(bootloader PUBLIC
|
target_link_options(bootloader PUBLIC
|
||||||
"LINKER:--script=${LD_FILE}"
|
"LINKER:--script=${LD_FILE}"
|
||||||
-L${NRFX}/mdk
|
-L${NRFX_DIR}/mdk
|
||||||
--specs=nosys.specs --specs=nano.specs
|
--specs=nosys.specs --specs=nano.specs
|
||||||
)
|
)
|
||||||
target_compile_options(bootloader PUBLIC
|
target_compile_options(bootloader PUBLIC
|
||||||
|
|
@ -167,10 +174,11 @@ target_compile_options(bootloader PUBLIC
|
||||||
-Wno-endif-labels
|
-Wno-endif-labels
|
||||||
-Wunreachable-code
|
-Wunreachable-code
|
||||||
# Suppress warning caused by SDK
|
# Suppress warning caused by SDK
|
||||||
-Wno-unused-parameter -Wno-expansion-to-defined
|
-Wno-unused-parameter -Wno-expansion-to-defined -Wno-array-bounds
|
||||||
)
|
)
|
||||||
target_compile_definitions(bootloader PUBLIC
|
target_compile_definitions(bootloader PUBLIC
|
||||||
SOFTDEVICE_PRESENT
|
SOFTDEVICE_PRESENT
|
||||||
|
CONFIG_GPIO_AS_PINRESET
|
||||||
)
|
)
|
||||||
|
|
||||||
if (TRACE_ETM STREQUAL "1")
|
if (TRACE_ETM STREQUAL "1")
|
||||||
|
|
@ -181,14 +189,14 @@ endif ()
|
||||||
if (MCU_VARIANT STREQUAL "nrf52")
|
if (MCU_VARIANT STREQUAL "nrf52")
|
||||||
# UART transport
|
# UART transport
|
||||||
target_sources(bootloader PUBLIC
|
target_sources(bootloader PUBLIC
|
||||||
${SDK}/libraries/uart/app_uart.c
|
${SDK_DIR}/libraries/uart/app_uart.c
|
||||||
${SDK}/drivers_nrf/uart/nrf_drv_uart.c
|
${SDK_DIR}/drivers_nrf/uart/nrf_drv_uart.c
|
||||||
${SDK}/drivers_nrf/common/nrf_drv_common.c
|
${SDK_DIR}/drivers_nrf/common/nrf_drv_common.c
|
||||||
)
|
)
|
||||||
target_include_directories(bootloader PUBLIC
|
target_include_directories(bootloader PUBLIC
|
||||||
${SDK11}/libraries/util
|
${SDK11_DIR}/libraries/util
|
||||||
${SDK}/drivers_nrf/common
|
${SDK_DIR}/drivers_nrf/common
|
||||||
${SDK}/drivers_nrf/uart
|
${SDK_DIR}/drivers_nrf/uart
|
||||||
)
|
)
|
||||||
else ()
|
else ()
|
||||||
# USB transport
|
# USB transport
|
||||||
|
|
@ -199,13 +207,13 @@ else ()
|
||||||
src/usb/usb_desc.c
|
src/usb/usb_desc.c
|
||||||
src/usb/uf2/ghostfat.c
|
src/usb/uf2/ghostfat.c
|
||||||
# TinyUSB
|
# TinyUSB
|
||||||
${TUSB}/portable/nordic/nrf5x/dcd_nrf5x.c
|
${TINYUSB_DIR}/portable/nordic/nrf5x/dcd_nrf5x.c
|
||||||
${TUSB}/common/tusb_fifo.c
|
${TINYUSB_DIR}/common/tusb_fifo.c
|
||||||
${TUSB}/device/usbd.c
|
${TINYUSB_DIR}/device/usbd.c
|
||||||
${TUSB}/device/usbd_control.c
|
${TINYUSB_DIR}/device/usbd_control.c
|
||||||
${TUSB}/class/cdc/cdc_device.c
|
${TINYUSB_DIR}/class/cdc/cdc_device.c
|
||||||
${TUSB}/class/msc/msc_device.c
|
${TINYUSB_DIR}/class/msc/msc_device.c
|
||||||
${TUSB}/tusb.c
|
${TINYUSB_DIR}/tusb.c
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
@ -217,46 +225,35 @@ if (MCU_VARIANT STREQUAL "nrf52")
|
||||||
set(SD_NAME s132)
|
set(SD_NAME s132)
|
||||||
set(DFU_DEV_REV 0xADAF)
|
set(DFU_DEV_REV 0xADAF)
|
||||||
set(DFU_APP_DATA_RESERVED 7*4096)
|
set(DFU_APP_DATA_RESERVED 7*4096)
|
||||||
target_compile_definitions(bootloader PUBLIC
|
target_compile_definitions(bootloader PUBLIC NRF52 NRF52832_XXAA)
|
||||||
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")
|
elseif (MCU_VARIANT STREQUAL "nrf52833")
|
||||||
set(SD_NAME s140)
|
|
||||||
set(DFU_DEV_REV 52833)
|
set(DFU_DEV_REV 52833)
|
||||||
set(DFU_APP_DATA_RESERVED 7*4096)
|
set(DFU_APP_DATA_RESERVED 7*4096)
|
||||||
target_compile_definitions(bootloader PUBLIC
|
target_compile_definitions(bootloader PUBLIC NRF52833_XXAA)
|
||||||
NRF52833_XXAA
|
if (NOT DEFINED SD_NAME)
|
||||||
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(SD_NAME s140)
|
||||||
|
endif ()
|
||||||
|
elseif (MCU_VARIANT STREQUAL "nrf52840")
|
||||||
set(DFU_DEV_REV 52840)
|
set(DFU_DEV_REV 52840)
|
||||||
# App reserved 40KB (8+32) to match circuitpython for 840
|
# App reserved 40KB (8+32) to match circuitpython for 840
|
||||||
set(DFU_APP_DATA_RESERVED 10*4096)
|
set(DFU_APP_DATA_RESERVED 10*4096)
|
||||||
target_compile_definitions(bootloader PUBLIC
|
target_compile_definitions(bootloader PUBLIC NRF52840_XXAA)
|
||||||
NRF52840_XXAA
|
if (NOT DEFINED SD_NAME)
|
||||||
S140
|
set(SD_NAME s140)
|
||||||
)
|
endif ()
|
||||||
target_include_directories(bootloader PUBLIC
|
|
||||||
${SOFTDEVICE}/s140_nrf52_6.1.1/s140_nrf52_6.1.1_API/include
|
|
||||||
)
|
|
||||||
|
|
||||||
else ()
|
else ()
|
||||||
message(FATAL_ERROR "MCU_VARIANT ${MCU_VARIANT} is unknown")
|
message(FATAL_ERROR "MCU_VARIANT ${MCU_VARIANT} is unknown")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
string(TOUPPER ${SD_NAME} SD_NAME_UPPER)
|
||||||
|
target_compile_definitions(bootloader PUBLIC ${SD_NAME_UPPER})
|
||||||
|
|
||||||
set(SD_FILENAME ${SD_NAME}_nrf52_${SD_VERSION})
|
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")
|
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
target_compile_definitions(bootloader PUBLIC DFU_APP_DATA_RESERVED=${DFU_APP_DATA_RESERVED})
|
target_compile_definitions(bootloader PUBLIC DFU_APP_DATA_RESERVED=${DFU_APP_DATA_RESERVED})
|
||||||
|
|
@ -338,3 +335,10 @@ add_custom_target(flash-mbr
|
||||||
add_custom_target(flash-erase
|
add_custom_target(flash-erase
|
||||||
COMMAND ${NRFJPROG} -f nrf52 --eraseall
|
COMMAND ${NRFJPROG} -f nrf52 --eraseall
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# flash skip crc magic ( app valid = 0x0001, crc = 0x0000 )
|
||||||
|
#add_custom_target(flash-skip-crc
|
||||||
|
# #COMMAND ${NRFJPROG} --memwr $(BOOT_SETTING_ADDR) --val 0x00000001 -f nrf52
|
||||||
|
# COMMAND ${NRFJPROG} --memwr 0xFF000 --val 0x00000001 -f nrf52
|
||||||
|
# #COMMAND ${NRFJPROG} --memwr 0x7F000 --val 0x00000001 -f nrf52
|
||||||
|
# )
|
||||||
|
|
|
||||||
53
Makefile
53
Makefile
|
|
@ -10,6 +10,9 @@
|
||||||
# local customization
|
# local customization
|
||||||
-include Makefile.user
|
-include Makefile.user
|
||||||
|
|
||||||
|
# Board specific
|
||||||
|
-include src/boards/$(BOARD)/board.mk
|
||||||
|
|
||||||
SDK_PATH = lib/sdk/components
|
SDK_PATH = lib/sdk/components
|
||||||
SDK11_PATH = lib/sdk11/components
|
SDK11_PATH = lib/sdk11/components
|
||||||
TUSB_PATH = lib/tinyusb/src
|
TUSB_PATH = lib/tinyusb/src
|
||||||
|
|
@ -18,7 +21,11 @@ SD_PATH = lib/softdevice/$(SD_FILENAME)
|
||||||
|
|
||||||
# SD_VERSION can be overwritten by board.mk
|
# SD_VERSION can be overwritten by board.mk
|
||||||
ifndef SD_VERSION
|
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
|
endif
|
||||||
|
|
||||||
SD_FILENAME = $(SD_NAME)_nrf52_$(SD_VERSION)
|
SD_FILENAME = $(SD_NAME)_nrf52_$(SD_VERSION)
|
||||||
|
|
@ -42,6 +49,8 @@ OUT_NAME = $(BOARD)_bootloader-$(GIT_VERSION)
|
||||||
# merged file = compiled + sd
|
# merged file = compiled + sd
|
||||||
MERGED_FILE = $(OUT_NAME)_$(SD_NAME)_$(SD_VERSION)
|
MERGED_FILE = $(OUT_NAME)_$(SD_NAME)_$(SD_VERSION)
|
||||||
|
|
||||||
|
UF2_FAMILY_ID_BOOTLOADER = 0xd663823c
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Tool Configure
|
# Tool Configure
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
@ -89,46 +98,38 @@ endif
|
||||||
BMP_PORT ?= $(shell ls -1 /dev/cu.usbmodem????????1 | head -1)
|
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'
|
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 directory
|
||||||
BUILD = _build/build-$(BOARD)
|
BUILD = _build/build-$(BOARD)
|
||||||
BIN = _bin/$(BOARD)
|
BIN = _bin/$(BOARD)
|
||||||
|
|
||||||
# Board specific
|
|
||||||
-include src/boards/$(BOARD)/board.mk
|
|
||||||
|
|
||||||
# MCU_SUB_VARIANT can be nrf52 (nrf52832), nrf52833, nrf52840
|
# MCU_SUB_VARIANT can be nrf52 (nrf52832), nrf52833, nrf52840
|
||||||
ifeq ($(MCU_SUB_VARIANT),nrf52)
|
ifeq ($(MCU_SUB_VARIANT),nrf52)
|
||||||
|
CFLAGS += -DNRF52 -DNRF52832_XXAA
|
||||||
SD_NAME = s132
|
SD_NAME = s132
|
||||||
DFU_DEV_REV = 0xADAF
|
DFU_DEV_REV = 0xADAF
|
||||||
CFLAGS += -DNRF52 -DNRF52832_XXAA -DS132
|
|
||||||
DFU_APP_DATA_RESERVED=7*4096
|
DFU_APP_DATA_RESERVED=7*4096
|
||||||
else ifeq ($(MCU_SUB_VARIANT),nrf52833)
|
else ifeq ($(MCU_SUB_VARIANT),nrf52833)
|
||||||
SD_NAME = s140
|
CFLAGS += -DNRF52833_XXAA
|
||||||
DFU_DEV_REV = 52833
|
DFU_DEV_REV = 52833
|
||||||
CFLAGS += -DNRF52833_XXAA -DS140
|
|
||||||
DFU_APP_DATA_RESERVED=7*4096
|
DFU_APP_DATA_RESERVED=7*4096
|
||||||
else ifeq ($(MCU_SUB_VARIANT),nrf52840)
|
ifndef SD_NAME
|
||||||
SD_NAME = s140
|
SD_NAME = s140
|
||||||
|
endif
|
||||||
|
else ifeq ($(MCU_SUB_VARIANT),nrf52840)
|
||||||
|
CFLAGS += -DNRF52840_XXAA
|
||||||
DFU_DEV_REV = 52840
|
DFU_DEV_REV = 52840
|
||||||
CFLAGS += -DNRF52840_XXAA -DS140
|
|
||||||
# App reserved 40KB (8+32) to match circuitpython for 840
|
# App reserved 40KB (8+32) to match circuitpython for 840
|
||||||
DFU_APP_DATA_RESERVED=10*4096
|
DFU_APP_DATA_RESERVED=10*4096
|
||||||
|
ifndef SD_NAME
|
||||||
|
SD_NAME = s140
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
$(error Sub Variant $(MCU_SUB_VARIANT) is unknown)
|
$(error Sub Variant $(MCU_SUB_VARIANT) is unknown)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
SD_NAME_UPPER = $(subst s,S,${SD_NAME})
|
||||||
|
CFLAGS += -D$(SD_NAME_UPPER)
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# SOURCE FILES
|
# SOURCE FILES
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
@ -342,7 +343,8 @@ endif
|
||||||
CFLAGS += -DDFU_APP_DATA_RESERVED=$(DFU_APP_DATA_RESERVED)
|
CFLAGS += -DDFU_APP_DATA_RESERVED=$(DFU_APP_DATA_RESERVED)
|
||||||
|
|
||||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
|
||||||
ifneq ($(findstring 12.,$(shell $(CC) --version 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
|
CFLAGS += --param=min-pagesize=0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
@ -442,7 +444,7 @@ $(BUILD)/$(OUT_NAME)_nosd.hex: $(BUILD)/$(OUT_NAME).hex
|
||||||
# Bootolader self-update uf2
|
# Bootolader self-update uf2
|
||||||
$(BUILD)/update-$(OUT_NAME)_nosd.uf2: $(BUILD)/$(OUT_NAME)_nosd.hex
|
$(BUILD)/update-$(OUT_NAME)_nosd.uf2: $(BUILD)/$(OUT_NAME)_nosd.hex
|
||||||
@echo Create $(notdir $@)
|
@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
|
# merge bootloader and sd hex together
|
||||||
$(BUILD)/$(MERGED_FILE).hex: $(BUILD)/$(OUT_NAME).hex
|
$(BUILD)/$(MERGED_FILE).hex: $(BUILD)/$(OUT_NAME).hex
|
||||||
|
|
@ -495,6 +497,11 @@ flash-mbr:
|
||||||
@echo Flashing: $(MBR_HEX)
|
@echo Flashing: $(MBR_HEX)
|
||||||
$(call FLASH_NOUICR_CMD,$(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 with adafruit-nrfutil using CDC interface
|
||||||
dfu-flash: flash-dfu
|
dfu-flash: flash-dfu
|
||||||
flash-dfu: $(BUILD)/$(MERGED_FILE).zip
|
flash-dfu: $(BUILD)/$(MERGED_FILE).zip
|
||||||
|
|
|
||||||
39
README.md
39
README.md
|
|
@ -114,14 +114,20 @@ You must have have a J-Link available to "unbrick" your device.
|
||||||
|
|
||||||
### Build:
|
### Build:
|
||||||
|
|
||||||
Firstly clone this repo with following commands
|
Firstly clone this repo including its submodules with following command:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone --recurse-submodules https://github.com/adafruit/Adafruit_nRF52_Bootloader
|
||||||
|
```
|
||||||
|
|
||||||
|
For git versions before `2.13.0` you have to do that manually:
|
||||||
```
|
```
|
||||||
git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader
|
git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader
|
||||||
cd Adafruit_nRF52_Bootloader
|
cd Adafruit_nRF52_Bootloader
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Build using `make`
|
||||||
Then build it with `make BOARD={board} all`, for example:
|
Then build it with `make BOARD={board} all`, for example:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
@ -137,6 +143,37 @@ Supported boards are: feather_nrf52840_express feather_nrf52840_express pca10056
|
||||||
Makefile:90: *** BOARD not defined. Stop
|
Makefile:90: *** BOARD not defined. Stop
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Build using `cmake`
|
||||||
|
|
||||||
|
Firstly initialize your build environment by passing your board to `cmake` via `-DBOARD={board}`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. -DBOARD=feather_nrf52840_express
|
||||||
|
```
|
||||||
|
|
||||||
|
And then build it with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use the generator of your choice. For example adding the `-GNinja` and then you can invoke `ninja build` instead of `make`.
|
||||||
|
|
||||||
|
To list all supported targets, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cmake --build . --target help
|
||||||
|
```
|
||||||
|
|
||||||
|
To build individual targets, you can specify it directly with `make` or using `cmake --build`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make bootloader
|
||||||
|
cmake --build . --target bootloader
|
||||||
|
```
|
||||||
|
|
||||||
### Flash
|
### Flash
|
||||||
|
|
||||||
To flash the bootloader (without softdevice/mbr) using JLink:
|
To flash the bootloader (without softdevice/mbr) using JLink:
|
||||||
|
|
|
||||||
18
lib/softdevice/s340_nrf52_7.0.1/readme.md
Normal file
18
lib/softdevice/s340_nrf52_7.0.1/readme.md
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
## Working with SoftDevice S340
|
||||||
|
|
||||||
|
The SoftDevice S340 is closed-source, not publicly available and is only distributed by Garmin Canada Inc.
|
||||||
|
|
||||||
|
In order to be able to download the required ANT+ capable SoftDevice and place SoftDevice S340 v7.0.1 files here. You need to register an 'ANT+ Adopter' account at [thisisant.com](https://www.thisisant.com/register/). After around one business day you will receive access to the resources there. Then do the following steps:
|
||||||
|
- Download the SoftDevice S340 v7.0.1 [(here)](https://www.thisisant.com/developer/components/nrf52832#tab_protocol_stacks_tab) and extract its contents
|
||||||
|
- Under `lib/softdevice` in this repository there is a folder called `s340_nrf52_7.0.1`
|
||||||
|
- Copy the API folder `ANT_s340_nrf52_7.0.1.API`, the license agreement `License_Agreement_ANT_Softdevice_rev3_3.pdf` and the hex file `ANT_s340_nrf52_7.0.1.hex` from the extracted contents to it.
|
||||||
|
- Rename the API folder to `s340_nrf52_7.0.1_API`
|
||||||
|
- Rename the hex file to `s340_nrf52_7.0.1_softdevice.hex`
|
||||||
|
- Modify `lib/softdevice/s340_nrf52_7.0.1_API/include/nrf_sdm.h` on line 191 and remove the two slashes at the beginning of `//#define...` to use the *evaluation key* for the ANT SoftDevice.
|
||||||
|
- **VERY IMPORTANT:** You MUST obtain a valid commercial license key BEFORE releasing a product to market that uses the ANT SoftDevice!
|
||||||
|
|
||||||
|
To add or modify a board with an ANT+ capable SoftDevice S340 the `SD_VERSION` and `SD_NAME` parameters in the corresponding `board.mk` file have to be set:
|
||||||
|
```
|
||||||
|
SD_VERSION = 7.0.1
|
||||||
|
SD_NAME = s340
|
||||||
|
```
|
||||||
2
lib/uf2
2
lib/uf2
|
|
@ -1 +1 @@
|
||||||
Subproject commit adbb8c7260f938e810eb37f2287f8e1a055ff402
|
Subproject commit b19ac9ad613e11a062e4d00845e2b80e6b0ad29f
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/* Linker script to configure memory regions. */
|
/* Linker script to configure memory regions. */
|
||||||
|
|
||||||
SEARCH_DIR(.)
|
SEARCH_DIR(.)
|
||||||
GROUP(-lgcc -lc -lnosys)
|
GROUP(-lgcc -lc)
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/* Linker script to configure memory regions. */
|
/* Linker script to configure memory regions. */
|
||||||
|
|
||||||
SEARCH_DIR(.)
|
SEARCH_DIR(.)
|
||||||
GROUP(-lgcc -lc -lnosys)
|
GROUP(-lgcc -lc)
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/* Linker script to configure memory regions. */
|
/* Linker script to configure memory regions. */
|
||||||
|
|
||||||
SEARCH_DIR(.)
|
SEARCH_DIR(.)
|
||||||
GROUP(-lgcc -lc -lnosys)
|
GROUP(-lgcc -lc)
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -27,14 +27,14 @@
|
||||||
#include "app_scheduler.h"
|
#include "app_scheduler.h"
|
||||||
#include "app_timer.h"
|
#include "app_timer.h"
|
||||||
|
|
||||||
#ifdef LED_APA102
|
#ifdef LED_APA102_CLK
|
||||||
#include "nrf_spim.h"
|
#include "nrf_spim.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SCHED_MAX_EVENT_DATA_SIZE sizeof(app_timer_event_t) /**< Maximum size of scheduler events. */
|
#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. */
|
#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_init(void);
|
||||||
void neopixel_write(uint8_t* pixels);
|
void neopixel_write(uint8_t* pixels);
|
||||||
void neopixel_teardown(void);
|
void neopixel_teardown(void);
|
||||||
|
|
@ -86,7 +86,7 @@ void board_init(void) {
|
||||||
#endif
|
#endif
|
||||||
#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
|
// use neopixel for use enumeration
|
||||||
#ifdef NEOPIXEL_POWER_PIN
|
#ifdef NEOPIXEL_POWER_PIN
|
||||||
nrf_gpio_cfg_output(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
|
// #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3
|
||||||
// in board.h when using that power configuration.
|
// in board.h when using that power configuration.
|
||||||
#ifdef UICR_REGOUT0_VALUE
|
#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;
|
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
|
||||||
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
|
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
|
||||||
NRF_UICR->REGOUT0 = (NRF_UICR->REGOUT0 & ~((uint32_t)UICR_REGOUT0_VOUT_Msk)) |
|
NRF_UICR->REGOUT0 = (NRF_UICR->REGOUT0 & ~((uint32_t)UICR_REGOUT0_VOUT_Msk)) |
|
||||||
|
|
@ -147,7 +147,7 @@ void board_teardown(void) {
|
||||||
led_pwm_teardown();
|
led_pwm_teardown();
|
||||||
#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)
|
||||||
neopixel_teardown();
|
neopixel_teardown();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -250,6 +250,11 @@ void board_display_init(void) {
|
||||||
//------------- Display Init -------------//
|
//------------- Display Init -------------//
|
||||||
nrf_gpio_cfg_output(DISPLAY_PIN_DC);
|
nrf_gpio_cfg_output(DISPLAY_PIN_DC);
|
||||||
|
|
||||||
|
#if defined(DISPLAY_VSENSOR_PIN) && DISPLAY_VSENSOR_PIN >= 0
|
||||||
|
nrf_gpio_cfg_output(DISPLAY_VSENSOR_PIN);
|
||||||
|
nrf_gpio_pin_write(DISPLAY_VSENSOR_PIN, DISPLAY_VSENSOR_ON);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(DISPLAY_PIN_RST) && DISPLAY_PIN_RST >= 0
|
#if defined(DISPLAY_PIN_RST) && DISPLAY_PIN_RST >= 0
|
||||||
nrf_gpio_cfg_output(DISPLAY_PIN_RST);
|
nrf_gpio_cfg_output(DISPLAY_PIN_RST);
|
||||||
nrf_gpio_pin_clear(DISPLAY_PIN_RST);
|
nrf_gpio_pin_clear(DISPLAY_PIN_RST);
|
||||||
|
|
@ -357,7 +362,7 @@ static uint32_t primary_cycle_length;
|
||||||
static uint32_t secondary_cycle_length;
|
static uint32_t secondary_cycle_length;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void led_tick() {
|
void led_tick(void) {
|
||||||
uint32_t millis = _systick_count;
|
uint32_t millis = _systick_count;
|
||||||
|
|
||||||
uint32_t cycle = millis % primary_cycle_length;
|
uint32_t cycle = millis % primary_cycle_length;
|
||||||
|
|
@ -447,7 +452,7 @@ void led_state(uint32_t state) {
|
||||||
final_color = (uint8_t*) &rgb_color;
|
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) {
|
if (final_color != NULL) {
|
||||||
neopixel_write(final_color);
|
neopixel_write(final_color);
|
||||||
}
|
}
|
||||||
|
|
@ -555,7 +560,7 @@ void neopixel_write(uint8_t* pixels) {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LED_APA102
|
#ifdef LED_APA102_CLK
|
||||||
#define BYTE_PER_PIXEL 4
|
#define BYTE_PER_PIXEL 4
|
||||||
|
|
||||||
// 4 zero bytes are required to initiate update
|
// 4 zero bytes are required to initiate update
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
MCU_SUB_VARIANT = nrf52833
|
MCU_SUB_VARIANT = nrf52833
|
||||||
SD_VERSION = 7.3.0
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
#define LED_STATE_ON 1
|
#define LED_STATE_ON 1
|
||||||
|
|
||||||
#define LED_NEOPIXEL _PINNUM(0, 16)
|
#define LED_NEOPIXEL _PINNUM(0, 16)
|
||||||
|
#define NEOPIXEL_POWER_PIN _PINNUM(1, 14)
|
||||||
#define NEOPIXELS_NUMBER 1
|
#define NEOPIXELS_NUMBER 1
|
||||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
#define BOARD_RGB_BRIGHTNESS 0x040404
|
||||||
|
|
||||||
|
|
@ -63,7 +64,7 @@
|
||||||
//------------- UF2 -------------//
|
//------------- UF2 -------------//
|
||||||
#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express"
|
#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express"
|
||||||
#define UF2_VOLUME_LABEL "FTHR840BOOT"
|
#define UF2_VOLUME_LABEL "FTHR840BOOT"
|
||||||
#define UF2_BOARD_ID "nRF52840-Feather-revD"
|
#define UF2_BOARD_ID "nRF52840-Feather-revE"
|
||||||
#define UF2_INDEX_URL "https://www.adafruit.com/product/4062"
|
#define UF2_INDEX_URL "https://www.adafruit.com/product/4062"
|
||||||
|
|
||||||
#endif // _FEATHER_NRF52840_H
|
#endif // _FEATHER_NRF52840_H
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,11 @@
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Display
|
// Display
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
|
// VSensor required to power the display
|
||||||
|
#define DISPLAY_VSENSOR_PIN _PINNUM(1, 7)
|
||||||
|
#define DISPLAY_VSENSOR_ON 1
|
||||||
|
|
||||||
#define DISPLAY_CONTROLLER_ST7789
|
#define DISPLAY_CONTROLLER_ST7789
|
||||||
|
|
||||||
#define DISPLAY_PIN_SCK _PINNUM(0, 26)
|
#define DISPLAY_PIN_SCK _PINNUM(0, 26)
|
||||||
|
|
|
||||||
1
src/boards/itsybitsy_nrf52840_express/board.cmake
Normal file
1
src/boards/itsybitsy_nrf52840_express/board.cmake
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
set(MCU_VARIANT nrf52840)
|
||||||
|
|
@ -34,9 +34,14 @@
|
||||||
#define LED_PRIMARY_PIN _PINNUM(0, 6)
|
#define LED_PRIMARY_PIN _PINNUM(0, 6)
|
||||||
#define LED_STATE_ON 1
|
#define LED_STATE_ON 1
|
||||||
|
|
||||||
#define LED_NEOPIXEL _PINNUM(0, 8)
|
#define LED_APA102_CLK _PINNUM(1, 9)
|
||||||
#define NEOPIXELS_NUMBER 1
|
#define LED_APA102_DATA _PINNUM(0, 8)
|
||||||
#define BOARD_RGB_BRIGHTNESS 0x040404
|
#define LED_APA102_BRIGHTNESS 0x1
|
||||||
|
#define APA102_NUMBER 1
|
||||||
|
|
||||||
|
// For dotstart set to max for colour information is not masked off
|
||||||
|
#define BOARD_RGB_BRIGHTNESS 0xffffffff
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
/* BUTTON
|
/* BUTTON
|
||||||
|
|
|
||||||
63
src/boards/mbn52832dk/board.h
Normal file
63
src/boards/mbn52832dk/board.h
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
* 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 _MBN52832DK_H
|
||||||
|
#define _MBN52832DK_H
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------*/
|
||||||
|
/* LED
|
||||||
|
*------------------------------------------------------------------*/
|
||||||
|
#define LEDS_NUMBER 2
|
||||||
|
#define LED_PRIMARY_PIN 17 // LED1
|
||||||
|
#define LED_SECONDARY_PIN 18 // LED2
|
||||||
|
#define LED_STATE_ON 1
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------*/
|
||||||
|
/* BUTTON
|
||||||
|
*------------------------------------------------------------------*/
|
||||||
|
#define BUTTONS_NUMBER 2
|
||||||
|
#define BUTTON_1 13
|
||||||
|
#define BUTTON_2 14
|
||||||
|
#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 "Murata"
|
||||||
|
#define BLEDIS_MODEL "MBN52832DK"
|
||||||
|
|
||||||
|
#define UF2_BOARD_ID "nRF52832-MBN52832DK-v1"
|
||||||
|
#define UF2_PRODUCT_NAME "Murata MBN52832DK"
|
||||||
|
#define UF2_INDEX_URL "https://www.murata.com/ja-jp/products/connectivitymodule/bluetooth/overview/lineup/mbn52832"
|
||||||
|
|
||||||
|
#endif // _MBN52832DK_H
|
||||||
2
src/boards/mbn52832dk/board.mk
Normal file
2
src/boards/mbn52832dk/board.mk
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# nrf52 is nrf52832
|
||||||
|
MCU_SUB_VARIANT = nrf52
|
||||||
66
src/boards/nrfmicro/board.h
Normal file
66
src/boards/nrfmicro/board.h
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
/*
|
||||||
|
* 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 _NRFMICRO_NRF52840
|
||||||
|
#define _NRFMICRO_NRF52840
|
||||||
|
|
||||||
|
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------*/
|
||||||
|
/* LED
|
||||||
|
*------------------------------------------------------------------*/
|
||||||
|
#define LEDS_NUMBER 1
|
||||||
|
#define LED_PRIMARY_PIN _PINNUM(1, 10)
|
||||||
|
#define LED_STATE_ON 1 // State when LED is lit (active HIGH)
|
||||||
|
|
||||||
|
#define NEOPIXELS_NUMBER 0
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------*/
|
||||||
|
/* BUTTON
|
||||||
|
*------------------------------------------------------------------*/
|
||||||
|
#define BUTTONS_NUMBER 2
|
||||||
|
#define BUTTON_1 _PINNUM(1, 2) // DFU
|
||||||
|
#define BUTTON_2 _PINNUM(0, 12) // FRST
|
||||||
|
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// BLE OTA
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
#define BLEDIS_MANUFACTURER "nRFMicro"
|
||||||
|
#define BLEDIS_MODEL "nRFMicro nRF52840"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// USB
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
#define USB_DESC_VID 0x1209
|
||||||
|
#define USB_DESC_UF2_PID 0x5284
|
||||||
|
#define USB_DESC_CDC_ONLY_PID 0x5284
|
||||||
|
|
||||||
|
//------------- UF2 -------------//
|
||||||
|
#define UF2_PRODUCT_NAME "nRFMicro"
|
||||||
|
#define UF2_VOLUME_LABEL "NRFMICRO"
|
||||||
|
#define UF2_BOARD_ID "nRF52840-nRFMicro-v0"
|
||||||
|
#define UF2_INDEX_URL "https://github.com/joric/nrfmicro/wiki"
|
||||||
|
|
||||||
|
#endif // _NRFMICRO_NRF52840
|
||||||
2
src/boards/nrfmicro/board.mk
Normal file
2
src/boards/nrfmicro/board.mk
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
MCU_SUB_VARIANT = nrf52840
|
||||||
|
SD_VERSION = 7.3.0
|
||||||
19
src/boards/nrfmicro/pinconfig.c
Normal file
19
src/boards/nrfmicro/pinconfig.c
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#include "boards.h"
|
||||||
|
#include "uf2/configkeys.h"
|
||||||
|
|
||||||
|
__attribute__((used, section(".bootloaderConfig")))
|
||||||
|
const uint32_t bootloaderConfig[] =
|
||||||
|
{
|
||||||
|
/* CF2 START */
|
||||||
|
CFG_MAGIC0, CFG_MAGIC1, // magic
|
||||||
|
5, 100, // used entries, total entries
|
||||||
|
|
||||||
|
204, 0x100000, // FLASH_BYTES = 0x100000
|
||||||
|
205, 0x40000, // RAM_BYTES = 0x40000
|
||||||
|
208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2
|
||||||
|
209, 0xada52840, // UF2_FAMILY = 0xada52840
|
||||||
|
210, 0x20, // PINS_PORT_SIZE = PA_32
|
||||||
|
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
/* CF2 END */
|
||||||
|
};
|
||||||
1
src/boards/omnimo_nrf52840/board.cmake
Normal file
1
src/boards/omnimo_nrf52840/board.cmake
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
set(MCU_VARIANT nrf52840)
|
||||||
72
src/boards/omnimo_nrf52840/board.h
Normal file
72
src/boards/omnimo_nrf52840/board.h
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
/*
|
||||||
|
* 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 _OMNIMO_NRF52840_H
|
||||||
|
#define _OMNIMO_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(1, 07)
|
||||||
|
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// BLE OTA
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
#define BLEDIS_MANUFACTURER "eAFAQ"
|
||||||
|
#define BLEDIS_MODEL "OMNIMO nRF52840"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// USB
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
|
//Shared VID/PID with pca10056
|
||||||
|
#define USB_DESC_VID 0x1209
|
||||||
|
#define USB_DESC_UF2_PID 0xCECE
|
||||||
|
#define USB_DESC_CDC_ONLY_PID 0xCECE
|
||||||
|
|
||||||
|
//------------- UF2 -------------//
|
||||||
|
#define UF2_PRODUCT_NAME "Omnimo nRF52840"
|
||||||
|
#define UF2_VOLUME_LABEL "OMNIn52BOOT"
|
||||||
|
#define UF2_BOARD_ID "nRF52840-Omnimo"
|
||||||
|
#define UF2_INDEX_URL "https://www.crowdsupply.com/eafaq/omnimo-nrf52840"
|
||||||
|
|
||||||
|
#endif // _OMNIMO_NRF52840_H
|
||||||
1
src/boards/omnimo_nrf52840/board.mk
Normal file
1
src/boards/omnimo_nrf52840/board.mk
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
MCU_SUB_VARIANT = nrf52840
|
||||||
19
src/boards/omnimo_nrf52840/pinconfig.c
Normal file
19
src/boards/omnimo_nrf52840/pinconfig.c
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#include "boards.h"
|
||||||
|
#include "uf2/configkeys.h"
|
||||||
|
|
||||||
|
__attribute__((used, section(".bootloaderConfig")))
|
||||||
|
const uint32_t bootloaderConfig[] =
|
||||||
|
{
|
||||||
|
/* CF2 START */
|
||||||
|
CFG_MAGIC0, CFG_MAGIC1, // magic
|
||||||
|
5, 100, // used entries, total entries
|
||||||
|
|
||||||
|
204, 0x100000, // FLASH_BYTES = 0x100000
|
||||||
|
205, 0x40000, // RAM_BYTES = 0x40000
|
||||||
|
208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2
|
||||||
|
209, 0xada52840, // UF2_FAMILY = 0xada52840
|
||||||
|
210, 0x20, // PINS_PORT_SIZE = PA_32
|
||||||
|
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
/* CF2 END */
|
||||||
|
};
|
||||||
|
|
@ -57,10 +57,10 @@
|
||||||
// USB
|
// 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_VID 0x239A
|
||||||
#define USB_DESC_UF2_PID 0x0029
|
#define USB_DESC_UF2_PID 0x00DA
|
||||||
#define USB_DESC_CDC_ONLY_PID 0x0029
|
#define USB_DESC_CDC_ONLY_PID 0x00DA
|
||||||
|
|
||||||
#define UF2_PRODUCT_NAME "Particle Argon"
|
#define UF2_PRODUCT_NAME "Particle Argon"
|
||||||
#define UF2_VOLUME_LABEL "ARGONBOOT "
|
#define UF2_VOLUME_LABEL "ARGONBOOT "
|
||||||
|
|
|
||||||
|
|
@ -57,10 +57,10 @@
|
||||||
// USB
|
// 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_VID 0x239A
|
||||||
#define USB_DESC_UF2_PID 0x0029
|
#define USB_DESC_UF2_PID 0x00DA
|
||||||
#define USB_DESC_CDC_ONLY_PID 0x0029
|
#define USB_DESC_CDC_ONLY_PID 0x00DA
|
||||||
|
|
||||||
#define UF2_PRODUCT_NAME "Particle Boron"
|
#define UF2_PRODUCT_NAME "Particle Boron"
|
||||||
#define UF2_VOLUME_LABEL "BORONBOOT "
|
#define UF2_VOLUME_LABEL "BORONBOOT "
|
||||||
|
|
|
||||||
|
|
@ -57,10 +57,10 @@
|
||||||
// USB
|
// 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_VID 0x239A
|
||||||
#define USB_DESC_UF2_PID 0x0029
|
#define USB_DESC_UF2_PID 0x00DA
|
||||||
#define USB_DESC_CDC_ONLY_PID 0x0029
|
#define USB_DESC_CDC_ONLY_PID 0x00DA
|
||||||
|
|
||||||
#define UF2_PRODUCT_NAME "Particle Xenon"
|
#define UF2_PRODUCT_NAME "Particle Xenon"
|
||||||
#define UF2_VOLUME_LABEL "XENONBOOT "
|
#define UF2_VOLUME_LABEL "XENONBOOT "
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,8 @@
|
||||||
|
|
||||||
// Shared VID/PID with Feather nRF52840, will be disabled for building in the future
|
// Shared VID/PID with Feather nRF52840, will be disabled for building in the future
|
||||||
#define USB_DESC_VID 0x239A
|
#define USB_DESC_VID 0x239A
|
||||||
#define USB_DESC_UF2_PID 0x0029
|
#define USB_DESC_UF2_PID 0x00DA
|
||||||
#define USB_DESC_CDC_ONLY_PID 0x0029
|
#define USB_DESC_CDC_ONLY_PID 0x00DA
|
||||||
|
|
||||||
#define UF2_PRODUCT_NAME "Nordic nRF52840 DK"
|
#define UF2_PRODUCT_NAME "Nordic nRF52840 DK"
|
||||||
#define UF2_BOARD_ID "nRF52840-pca10056-v1"
|
#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
|
// USB
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
#define USB_DESC_VID 0x1915
|
#define USB_DESC_VID 0x239A
|
||||||
#define USB_DESC_UF2_PID 0x521F
|
#define USB_DESC_UF2_PID 0x00D8
|
||||||
#define USB_DESC_CDC_ONLY_PID 0x521F
|
#define USB_DESC_CDC_ONLY_PID 0x00D8
|
||||||
|
|
||||||
#define UF2_PRODUCT_NAME "Nordic nRF52833 DK"
|
#define UF2_PRODUCT_NAME "Nordic nRF52833 DK"
|
||||||
|
#define UF2_VOLUME_LABEL "NRF833BOOT"
|
||||||
#define UF2_BOARD_ID "nRF52833-pca10100-v1"
|
#define UF2_BOARD_ID "nRF52833-pca10100-v1"
|
||||||
#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52833-DK"
|
#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52833-DK"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
MCU_SUB_VARIANT = nrf52833
|
MCU_SUB_VARIANT = nrf52833
|
||||||
SD_VERSION=7.2.0
|
|
||||||
67
src/boards/t1000_e/board.h
Normal file
67
src/boards/t1000_e/board.h
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
/*
|
||||||
|
* 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 _T1000_E_H
|
||||||
|
#define _T1000_E_H
|
||||||
|
|
||||||
|
#define _PINNUM(port, pin) ((port)*32 + (pin))
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------*/
|
||||||
|
/* LED
|
||||||
|
*------------------------------------------------------------------*/
|
||||||
|
#define LEDS_NUMBER 1
|
||||||
|
#define LED_PRIMARY_PIN _PINNUM(0, 24) // Green
|
||||||
|
#define LED_STATE_ON 0
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------*/
|
||||||
|
/* BUTTON
|
||||||
|
*------------------------------------------------------------------*/
|
||||||
|
#define BUTTONS_NUMBER 2
|
||||||
|
#define BUTTON_1 _PINNUM(0, 6) // Primary Button
|
||||||
|
#define BUTTON_2 _PINNUM(0, 18) // unusable: RESET
|
||||||
|
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// BLE OTA
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
#define BLEDIS_MANUFACTURER "Seeed Studio"
|
||||||
|
#define BLEDIS_MODEL "T1000-E"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// USB
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
#define USB_DESC_VID 0x2886
|
||||||
|
#define USB_DESC_UF2_PID 0x0057
|
||||||
|
#define USB_DESC_CDC_ONLY_PID 0x0057
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// UF2
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
#define UF2_PRODUCT_NAME "Seeed T1000-E for Meshtastic"
|
||||||
|
#define UF2_VOLUME_LABEL "T1000-E"
|
||||||
|
#define UF2_BOARD_ID "nRF52840-T1000-E-v1"
|
||||||
|
#define UF2_INDEX_URL "https://www.seeedstudio.com/SenseCAP-Card-Tracker-T1000-E-for-Meshtastic-p-5913.html"
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _T1000_E_H */
|
||||||
3
src/boards/t1000_e/board.mk
Normal file
3
src/boards/t1000_e/board.mk
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
MCU_SUB_VARIANT = nrf52840
|
||||||
|
SD_VERSION = 7.3.0
|
||||||
|
|
||||||
19
src/boards/t1000_e/pinconfig.c
Normal file
19
src/boards/t1000_e/pinconfig.c
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#include "boards.h"
|
||||||
|
#include "uf2/configkeys.h"
|
||||||
|
|
||||||
|
__attribute__((used, section(".bootloaderConfig")))
|
||||||
|
const uint32_t bootloaderConfig[] =
|
||||||
|
{
|
||||||
|
/* CF2 START */
|
||||||
|
CFG_MAGIC0, CFG_MAGIC1, // magic
|
||||||
|
5, 100, // used entries, total entries
|
||||||
|
|
||||||
|
204, 0x100000, // FLASH_BYTES = 0x100000
|
||||||
|
205, 0x40000, // RAM_BYTES = 0x40000
|
||||||
|
208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2
|
||||||
|
209, 0xada52840, // UF2_FAMILY = 0xada52840
|
||||||
|
210, 0x20, // PINS_PORT_SIZE = PA_32
|
||||||
|
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
/* CF2 END */
|
||||||
|
};
|
||||||
20
src/main.c
20
src/main.c
|
|
@ -157,6 +157,15 @@ static void mbr_init_sd(void) {
|
||||||
sd_mbr_command(&com);
|
sd_mbr_command(&com);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable the SoftDevice if it is enabled.
|
||||||
|
static void disable_softdevice(void) {
|
||||||
|
uint8_t sd_enabled = 0;
|
||||||
|
sd_softdevice_is_enabled(&sd_enabled);
|
||||||
|
if (sd_enabled == 1) {
|
||||||
|
sd_softdevice_disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
//
|
//
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
@ -206,13 +215,14 @@ int main(void) {
|
||||||
if (!_sd_inited) mbr_init_sd();
|
if (!_sd_inited) mbr_init_sd();
|
||||||
|
|
||||||
// Make sure SD is disabled
|
// Make sure SD is disabled
|
||||||
sd_softdevice_disable();
|
disable_softdevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear in case we kept DFU_DBL_RESET_APP there
|
// clear in case we kept DFU_DBL_RESET_APP there
|
||||||
(*dbl_reset_mem) = 0;
|
(*dbl_reset_mem) = 0;
|
||||||
|
|
||||||
// start application
|
// start application
|
||||||
|
PRINTF("Starting app...\r\n");
|
||||||
bootloader_app_start();
|
bootloader_app_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -306,14 +316,14 @@ static void check_dfu_mode(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_ota_dfu) {
|
if (_ota_dfu) {
|
||||||
sd_softdevice_disable();
|
disable_softdevice();
|
||||||
} else {
|
} else {
|
||||||
usb_teardown();
|
usb_teardown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initializes the SotdDevice by following SD specs section
|
// Initializes the SoftDevice by following SD specs section
|
||||||
// "Master Boot Record and SoftDevice initializaton procedure"
|
// "Master Boot Record and SoftDevice initializaton procedure"
|
||||||
static uint32_t ble_stack_init(void) {
|
static uint32_t ble_stack_init(void) {
|
||||||
// Forward vector table to bootloader address so that we can handle BLE events
|
// Forward vector table to bootloader address so that we can handle BLE events
|
||||||
|
|
@ -326,7 +336,11 @@ static uint32_t ble_stack_init(void) {
|
||||||
.rc_temp_ctiv = 2,
|
.rc_temp_ctiv = 2,
|
||||||
.accuracy = NRF_CLOCK_LF_ACCURACY_250_PPM
|
.accuracy = NRF_CLOCK_LF_ACCURACY_250_PPM
|
||||||
};
|
};
|
||||||
|
#ifdef ANT_LICENSE_KEY
|
||||||
|
sd_softdevice_enable(&clock_cfg, app_error_fault_handler, ANT_LICENSE_KEY);
|
||||||
|
#else
|
||||||
sd_softdevice_enable(&clock_cfg, app_error_fault_handler);
|
sd_softdevice_enable(&clock_cfg, app_error_fault_handler);
|
||||||
|
#endif
|
||||||
sd_nvic_EnableIRQ(SD_EVT_IRQn);
|
sd_nvic_EnableIRQ(SD_EVT_IRQn);
|
||||||
|
|
||||||
/*------------- Configure BLE params -------------*/
|
/*------------- Configure BLE params -------------*/
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#define NRFX_PRS_ENABLED 0
|
#define NRFX_PRS_ENABLED 0
|
||||||
|
|
||||||
|
// PWM
|
||||||
#define NRFX_PWM_ENABLED 0
|
#define NRFX_PWM_ENABLED 0
|
||||||
#define NRFX_PWM0_ENABLED 0
|
#define NRFX_PWM0_ENABLED 0
|
||||||
#define NRFX_PWM1_ENABLED 0
|
#define NRFX_PWM1_ENABLED 0
|
||||||
|
|
|
||||||
135
src/nrfx_log.h
Normal file
135
src/nrfx_log.h
Normal file
|
|
@ -0,0 +1,135 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* 3. Neither the name of the copyright holder nor the names of its
|
||||||
|
* contributors may be used to endorse or promote products derived from this
|
||||||
|
* software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NRFX_LOG_H__
|
||||||
|
#define NRFX_LOG_H__
|
||||||
|
|
||||||
|
// THIS IS A TEMPLATE FILE.
|
||||||
|
// It should be copied to a suitable location within the host environment into
|
||||||
|
// which nrfx is integrated, and the following macros should be provided with
|
||||||
|
// appropriate implementations.
|
||||||
|
// And this comment should be removed from the customized file.
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup nrfx_log nrfx_log.h
|
||||||
|
* @{
|
||||||
|
* @ingroup nrfx
|
||||||
|
*
|
||||||
|
* @brief This file contains macros that should be implemented according to
|
||||||
|
* the needs of the host environment into which @em nrfx is integrated.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro for logging a message with the severity level ERROR.
|
||||||
|
*
|
||||||
|
* @param format printf-style format string, optionally followed by arguments
|
||||||
|
* to be formatted and inserted in the resulting string.
|
||||||
|
*/
|
||||||
|
#define NRFX_LOG_ERROR(format, ...)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro for logging a message with the severity level WARNING.
|
||||||
|
*
|
||||||
|
* @param format printf-style format string, optionally followed by arguments
|
||||||
|
* to be formatted and inserted in the resulting string.
|
||||||
|
*/
|
||||||
|
#define NRFX_LOG_WARNING(format, ...)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro for logging a message with the severity level INFO.
|
||||||
|
*
|
||||||
|
* @param format printf-style format string, optionally followed by arguments
|
||||||
|
* to be formatted and inserted in the resulting string.
|
||||||
|
*/
|
||||||
|
#define NRFX_LOG_INFO(format, ...)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro for logging a message with the severity level DEBUG.
|
||||||
|
*
|
||||||
|
* @param format printf-style format string, optionally followed by arguments
|
||||||
|
* to be formatted and inserted in the resulting string.
|
||||||
|
*/
|
||||||
|
#define NRFX_LOG_DEBUG(format, ...)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro for logging a memory dump with the severity level ERROR.
|
||||||
|
*
|
||||||
|
* @param[in] p_memory Pointer to the memory region to be dumped.
|
||||||
|
* @param[in] length Length of the memory region in bytes.
|
||||||
|
*/
|
||||||
|
#define NRFX_LOG_HEXDUMP_ERROR(p_memory, length)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro for logging a memory dump with the severity level WARNING.
|
||||||
|
*
|
||||||
|
* @param[in] p_memory Pointer to the memory region to be dumped.
|
||||||
|
* @param[in] length Length of the memory region in bytes.
|
||||||
|
*/
|
||||||
|
#define NRFX_LOG_HEXDUMP_WARNING(p_memory, length)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro for logging a memory dump with the severity level INFO.
|
||||||
|
*
|
||||||
|
* @param[in] p_memory Pointer to the memory region to be dumped.
|
||||||
|
* @param[in] length Length of the memory region in bytes.
|
||||||
|
*/
|
||||||
|
#define NRFX_LOG_HEXDUMP_INFO(p_memory, length)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro for logging a memory dump with the severity level DEBUG.
|
||||||
|
*
|
||||||
|
* @param[in] p_memory Pointer to the memory region to be dumped.
|
||||||
|
* @param[in] length Length of the memory region in bytes.
|
||||||
|
*/
|
||||||
|
#define NRFX_LOG_HEXDUMP_DEBUG(p_memory, length)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro for getting the textual representation of a given error code.
|
||||||
|
*
|
||||||
|
* @param[in] error_code Error code.
|
||||||
|
*
|
||||||
|
* @return String containing the textual representation of the error code.
|
||||||
|
*/
|
||||||
|
#define NRFX_LOG_ERROR_STRING_GET(error_code)
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // NRFX_LOG_H__
|
||||||
Loading…
Reference in a new issue