├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── githubci.yml ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── LICENSE ├── Makefile ├── README.md ├── changelog.md ├── cmake ├── cpu │ ├── cortex-m33.cmake │ └── cortex-m4.cmake └── toolchain │ ├── arm_gcc.cmake │ └── set_flags.cmake ├── lib ├── SEGGER_RTT │ ├── License.txt │ ├── README.txt │ ├── RTT │ │ ├── SEGGER_RTT.c │ │ ├── SEGGER_RTT.h │ │ ├── SEGGER_RTT_ASM_ARMv7M.S │ │ ├── SEGGER_RTT_Conf.h │ │ └── SEGGER_RTT_printf.c │ └── Syscalls │ │ ├── SEGGER_RTT_Syscalls_GCC.c │ │ ├── SEGGER_RTT_Syscalls_IAR.c │ │ ├── SEGGER_RTT_Syscalls_KEIL.c │ │ └── SEGGER_RTT_Syscalls_SES.c ├── sdk │ ├── components │ │ ├── drivers_nrf │ │ │ ├── common │ │ │ │ ├── nrf_drv_common.c │ │ │ │ └── nrf_drv_common.h │ │ │ ├── delay │ │ │ │ └── nrf_delay.h │ │ │ └── uart │ │ │ │ ├── nrf_drv_uart.c │ │ │ │ └── nrf_drv_uart.h │ │ └── libraries │ │ │ ├── crc16 │ │ │ ├── crc16.c │ │ │ └── crc16.h │ │ │ ├── hci │ │ │ ├── hci_mem_pool.c │ │ │ ├── hci_mem_pool.h │ │ │ ├── hci_slip.c │ │ │ ├── hci_slip.h │ │ │ ├── hci_transport.c │ │ │ └── hci_transport.h │ │ │ ├── scheduler │ │ │ ├── app_scheduler.c │ │ │ └── app_scheduler.h │ │ │ ├── timer │ │ │ ├── app_timer.c │ │ │ └── app_timer.h │ │ │ ├── uart │ │ │ ├── app_uart.c │ │ │ └── app_uart.h │ │ │ └── util │ │ │ ├── app_error.c │ │ │ ├── app_error.h │ │ │ ├── app_error_weak.h │ │ │ ├── app_util.h │ │ │ ├── app_util_bds.h │ │ │ ├── app_util_platform.c │ │ │ ├── app_util_platform.h │ │ │ ├── nordic_common.h │ │ │ ├── nrf_assert.c │ │ │ ├── nrf_assert.h │ │ │ ├── nrf_bitmask.h │ │ │ ├── sdk_common.h │ │ │ ├── sdk_errors.h │ │ │ ├── sdk_macros.h │ │ │ ├── sdk_mapped_flags.c │ │ │ ├── sdk_mapped_flags.h │ │ │ ├── sdk_os.h │ │ │ └── sdk_resources.h │ └── readme.md ├── sdk11 │ ├── components │ │ ├── ble │ │ │ ├── ble_services │ │ │ │ ├── ble_dfu │ │ │ │ │ ├── ble_dfu.c │ │ │ │ │ └── ble_dfu.h │ │ │ │ └── ble_dis │ │ │ │ │ ├── ble_dis.c │ │ │ │ │ └── ble_dis.h │ │ │ └── common │ │ │ │ └── ble_srv_common.h │ │ ├── drivers_nrf │ │ │ └── pstorage │ │ │ │ ├── pstorage.h │ │ │ │ └── pstorage_raw.c │ │ └── libraries │ │ │ ├── bootloader_dfu │ │ │ ├── ble_transport │ │ │ │ └── hci_mem_pool_internal.h │ │ │ ├── bootloader.c │ │ │ ├── bootloader.h │ │ │ ├── bootloader_settings.c │ │ │ ├── bootloader_settings.h │ │ │ ├── bootloader_types.h │ │ │ ├── bootloader_util.c │ │ │ ├── bootloader_util.h │ │ │ ├── dfu.h │ │ │ ├── dfu_bank_internal.h │ │ │ ├── dfu_ble_svc.h │ │ │ ├── dfu_ble_svc_internal.h │ │ │ ├── dfu_init.h │ │ │ ├── dfu_single_bank.c │ │ │ ├── dfu_transport.h │ │ │ ├── dfu_transport_ble.c │ │ │ ├── dfu_transport_serial.c │ │ │ ├── dfu_types.h │ │ │ └── hci_transport │ │ │ │ ├── hci_mem_pool_internal.h │ │ │ │ └── hci_transport_config.h │ │ │ └── util │ │ │ └── nrf_log.h │ └── readme.md └── softdevice │ ├── mbr │ ├── headers │ │ ├── nrf_mbr.h │ │ └── nrf_svc.h │ └── hex │ │ ├── mbr_nrf52_2.4.1_licence-agreement.txt │ │ └── mbr_nrf52_2.4.1_mbr.hex │ ├── s132_nrf52_6.1.1 │ ├── s132_nrf52_6.1.1_API │ │ └── include │ │ │ ├── ble.h │ │ │ ├── ble_err.h │ │ │ ├── ble_gap.h │ │ │ ├── ble_gatt.h │ │ │ ├── ble_gattc.h │ │ │ ├── ble_gatts.h │ │ │ ├── ble_hci.h │ │ │ ├── ble_l2cap.h │ │ │ ├── ble_ranges.h │ │ │ ├── ble_types.h │ │ │ ├── nrf52 │ │ │ └── nrf_mbr.h │ │ │ ├── nrf_error.h │ │ │ ├── nrf_error_sdm.h │ │ │ ├── nrf_error_soc.h │ │ │ ├── nrf_nvic.h │ │ │ ├── nrf_sdm.h │ │ │ ├── nrf_soc.h │ │ │ └── nrf_svc.h │ ├── s132_nrf52_6.1.1_license-agreement.txt │ └── s132_nrf52_6.1.1_softdevice.hex │ ├── s140_nrf52_6.1.1 │ ├── s140_nrf52_6.1.1_API │ │ └── include │ │ │ ├── ble.h │ │ │ ├── ble_err.h │ │ │ ├── ble_gap.h │ │ │ ├── ble_gatt.h │ │ │ ├── ble_gattc.h │ │ │ ├── ble_gatts.h │ │ │ ├── ble_hci.h │ │ │ ├── ble_l2cap.h │ │ │ ├── ble_ranges.h │ │ │ ├── ble_types.h │ │ │ ├── nrf52 │ │ │ └── nrf_mbr.h │ │ │ ├── nrf_error.h │ │ │ ├── nrf_error_sdm.h │ │ │ ├── nrf_error_soc.h │ │ │ ├── nrf_nvic.h │ │ │ ├── nrf_sdm.h │ │ │ ├── nrf_soc.h │ │ │ └── nrf_svc.h │ ├── s140_nrf52_6.1.1_license-agreement.txt │ ├── s140_nrf52_6.1.1_softdevice.hex │ └── s140_nrf52_6.1.1_softdevice.uf2 │ ├── s140_nrf52_7.2.0 │ ├── s140_nrf52_7.2.0_API │ │ └── include │ │ │ ├── ble.h │ │ │ ├── ble_err.h │ │ │ ├── ble_gap.h │ │ │ ├── ble_gatt.h │ │ │ ├── ble_gattc.h │ │ │ ├── ble_gatts.h │ │ │ ├── ble_hci.h │ │ │ ├── ble_l2cap.h │ │ │ ├── ble_ranges.h │ │ │ ├── ble_types.h │ │ │ ├── nrf52 │ │ │ └── nrf_mbr.h │ │ │ ├── nrf_error.h │ │ │ ├── nrf_error_sdm.h │ │ │ ├── nrf_error_soc.h │ │ │ ├── nrf_nvic.h │ │ │ ├── nrf_sdm.h │ │ │ ├── nrf_soc.h │ │ │ └── nrf_svc.h │ ├── s140_nrf52_7.2.0_licence-agreement.txt │ └── s140_nrf52_7.2.0_softdevice.hex │ └── s140_nrf52_7.3.0 │ ├── s140_nrf52_7.3.0_API │ └── include │ │ ├── ble.h │ │ ├── ble_err.h │ │ ├── ble_gap.h │ │ ├── ble_gatt.h │ │ ├── ble_gattc.h │ │ ├── ble_gatts.h │ │ ├── ble_hci.h │ │ ├── ble_l2cap.h │ │ ├── ble_ranges.h │ │ ├── ble_types.h │ │ ├── nrf52 │ │ └── nrf_mbr.h │ │ ├── nrf_error.h │ │ ├── nrf_error_sdm.h │ │ ├── nrf_error_soc.h │ │ ├── nrf_nvic.h │ │ ├── nrf_sdm.h │ │ ├── nrf_soc.h │ │ └── nrf_svc.h │ ├── s140_nrf52_7.3.0_license-agreement.txt │ └── s140_nrf52_7.3.0_softdevice.hex ├── linker ├── nrf52.ld ├── nrf52833.ld ├── nrf52833_debug.ld ├── nrf52840.ld ├── nrf52840_debug.ld ├── nrf52_debug.ld └── nrf_common.ld ├── segger ├── Adafruit_nRF52_Bootloader.emProject ├── SEGGER_RTT.c ├── SEGGER_RTT.h ├── SEGGER_RTT_Conf.h ├── SEGGER_RTT_SES.c ├── flash_placement.xml ├── nRF52832_xxAA_MemoryMap.xml ├── nRF52840_xxAA_MemoryMap.xml ├── nRF_Target.js ├── nrf52840_Registers.xml └── thumb_crt0.s ├── src ├── boards │ ├── adm_b_nrf52840_1 │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── ae_bl652_bo │ │ ├── board.h │ │ └── board.mk │ ├── aramcon2_badge │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── aramcon_badge_2019 │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── arcade_feather_nrf52840_express │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── arduino_nano_33_ble │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── bast_ble │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── bluemicro_nrf52833 │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── bluemicro_nrf52840 │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── boards.c │ ├── boards.h │ ├── challenger_840_ble │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── circuitplayground_nrf52840 │ │ ├── board.cmake │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── clue_nrf52840 │ │ ├── board.cmake │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── ebyte_e104_bt5032a │ │ ├── board.h │ │ └── board.mk │ ├── ebyte_e73_tbb │ │ ├── board.h │ │ └── board.mk │ ├── electronut_labs_papyr │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── feather_nrf52832 │ │ ├── board.h │ │ └── board.mk │ ├── feather_nrf52833_express │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── feather_nrf52840_express │ │ ├── board.cmake │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── feather_nrf52840_sense │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── feather_nrf52840_sense_tft │ │ ├── board.cmake │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── ikigaisense_vita │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── itsybitsy_nrf52840_express │ │ ├── board.cmake │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── ledglasses_nrf52840 │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── m60_keyboard │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── mbn52832dk │ │ ├── board.h │ │ └── board.mk │ ├── mdk_nrf52840_dongle │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── metro_nrf52840_express │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── mikoto │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── nRF52840_connect_kit │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── nice_nano │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── nrf52840_bboard │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── nrf52840_m2 │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── nrfmicro │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── ohs2020_badge │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── particle_argon │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── particle_boron │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── particle_xenon │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── pca10056 │ │ ├── board.cmake │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── pca10059 │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── pca10100 │ │ ├── board.cmake │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── pillbug │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── pitaya_go │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── raytac_mdbt50q_db_40 │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── raytac_mdbt50q_rx │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── sparkfun_nrf52840_micromod │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── t1000_e │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── waveshare_nrf52840_eval │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ ├── xiao_nrf52840_ble │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c │ └── xiao_nrf52840_ble_sense │ │ ├── board.h │ │ ├── board.mk │ │ └── pinconfig.c ├── cmsis │ └── include │ │ ├── arm_common_tables.h │ │ ├── arm_const_structs.h │ │ ├── arm_math.h │ │ ├── cmsis_armcc.h │ │ ├── cmsis_armcc_V6.h │ │ ├── cmsis_gcc.h │ │ ├── core_cm0.h │ │ ├── core_cm0plus.h │ │ ├── core_cm3.h │ │ ├── core_cm4.h │ │ ├── core_cm7.h │ │ ├── core_cmFunc.h │ │ ├── core_cmInstr.h │ │ ├── core_cmSimd.h │ │ ├── core_sc000.h │ │ └── core_sc300.h ├── dfu_ble_svc.c ├── dfu_init.c ├── flash_nrf5x.c ├── flash_nrf5x.h ├── images.c ├── main.c ├── nrfx_config.h ├── nrfx_glue.h ├── nrfx_log.h ├── pstorage_platform.h ├── screen.c ├── sdk_config.h └── usb │ ├── msc_uf2.c │ ├── tusb_config.h │ ├── uf2 │ ├── LICENSE │ ├── compile_date.h │ ├── configkeys.h │ ├── ghostfat.c │ ├── uf2.h │ └── uf2cfg.h │ ├── usb.c │ ├── usb_desc.c │ └── usb_desc.h └── tools ├── build_all.py └── hexmerge.py /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Report a problem 3 | labels: 'Bug' 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thanks for taking the time to fill out this bug report! 9 | It's okay to leave some blank if it doesn't apply to your problem. 10 | 11 | - type: dropdown 12 | attributes: 13 | label: Operating System 14 | options: 15 | - Linux 16 | - MacOS 17 | - RaspberryPi OS 18 | - Windows 7 19 | - Windows 10 20 | - Windows 11 21 | - Others 22 | validations: 23 | required: true 24 | 25 | - type: textarea 26 | attributes: 27 | label: INFO_UF2.TXT 28 | placeholder: Paste your INFO_UF2.TXT contents here 29 | validations: 30 | required: true 31 | 32 | - type: textarea 33 | attributes: 34 | label: What happened ? 35 | placeholder: A clear and concise description of what the bug is. 36 | validations: 37 | required: true 38 | 39 | - type: textarea 40 | attributes: 41 | label: How to reproduce ? 42 | placeholder: | 43 | 1. Go to '...' 44 | 2. Click on '....' 45 | 3. See error 46 | validations: 47 | required: true 48 | 49 | - type: textarea 50 | attributes: 51 | label: Debug Log 52 | placeholder: Debug log attached txt file. 53 | validations: 54 | required: false 55 | 56 | - type: textarea 57 | attributes: 58 | label: Screenshots 59 | description: If applicable, add screenshots to help explain your problem. 60 | validations: 61 | required: false 62 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Adafruit Support Forum 3 | url: https://forums.adafruit.com 4 | about: If you have other questions or need help, post it here. 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Checklist 2 | 3 | *By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes* 4 | 5 | - [ ] Please provide specific title of the PR describing the change 6 | - [ ] If you are adding an new boards, please make sure 7 | - [ ] Provide link to your allocated VID/PID if applicable 8 | - [ ] `UF2_BOARD_ID` in your board.h follow correct format from [uf2 specs](https://github.com/microsoft/uf2#files-exposed-by-bootloaders) 9 | 10 | *This checklist items that are not applicable to your PR can be deleted.* 11 | 12 | ----------- 13 | 14 | ## Description of Change 15 | 16 | Please describe your proposed Pull Request and it's impact. 17 | -------------------------------------------------------------------------------- /.github/workflows/githubci.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | pull_request: 5 | push: 6 | repository_dispatch: 7 | release: 8 | types: 9 | - created 10 | 11 | jobs: 12 | set-matrix: 13 | runs-on: ubuntu-latest 14 | outputs: 15 | matrix: ${{ steps.set-matrix.outputs.matrix }} 16 | steps: 17 | - name: Checkout Code 18 | uses: actions/checkout@v4 19 | 20 | - name: Set matrix 21 | id: set-matrix 22 | working-directory: src/boards 23 | run: | 24 | MATRIX_JSON=$(ls -d */ | sed 's/\/$//' | jq -R -s -c 'split("\n")[:-1]') 25 | echo "matrix=$MATRIX_JSON" 26 | echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT 27 | 28 | build: 29 | needs: set-matrix 30 | runs-on: ubuntu-latest 31 | strategy: 32 | fail-fast: false 33 | matrix: 34 | board: ${{ fromJSON(needs.set-matrix.outputs.matrix) }} 35 | steps: 36 | - name: Checkout Code 37 | uses: actions/checkout@v4 38 | with: 39 | fetch-depth: 0 40 | submodules: true 41 | 42 | - name: Install ARM GCC 43 | uses: carlosperate/arm-none-eabi-gcc-action@v1 44 | with: 45 | release: '12.3.Rel1' 46 | 47 | - name: Install Tools 48 | run: | 49 | pip3 install adafruit-nrfutil uritemplate requests intelhex setuptools 50 | 51 | - name: Build 52 | run: | 53 | make BOARD=${{ matrix.board }} all 54 | make BOARD=${{ matrix.board }} copy-artifact 55 | 56 | - uses: actions/upload-artifact@v4 57 | with: 58 | name: ${{ matrix.board }} 59 | path: _bin/${{ matrix.board }} 60 | 61 | - name: Upload Release Asset 62 | uses: softprops/action-gh-release@v1 63 | if: ${{ github.event_name == 'release' }} 64 | with: 65 | files: | 66 | _bin/${{ matrix.board }}/${{ matrix.board }}_bootloader-*.zip 67 | _bin/${{ matrix.board }}/${{ matrix.board }}_bootloader-*.hex 68 | _bin/${{ matrix.board }}/update-${{ matrix.board }}_bootloader-*.uf2 69 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | #*.hex 38 | 39 | # VSCode files 40 | .vscode/ 41 | 42 | # Debug files 43 | *.dSYM/ 44 | *.su 45 | *.idb 46 | *.pdb 47 | 48 | # Kernel Module Compile Results 49 | *.mod* 50 | *.cmd 51 | .tmp_versions/ 52 | modules.order 53 | Module.symvers 54 | Mkfile.old 55 | dkms.conf 56 | 57 | segger/Output 58 | _build/ 59 | bin/ 60 | *.emSession 61 | *.jlink 62 | .idea/ 63 | 64 | TAGS 65 | 66 | .DS_Store 67 | Makefile.user 68 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/tinyusb"] 2 | path = lib/tinyusb 3 | url = https://github.com/hathach/tinyusb.git 4 | [submodule "lib/nrfx"] 5 | path = lib/nrfx 6 | url = https://github.com/NordicSemiconductor/nrfx.git 7 | [submodule "lib/uf2"] 8 | path = lib/uf2 9 | url = https://github.com/microsoft/uf2.git 10 | 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Adafruit Industries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cmake/cpu/cortex-m33.cmake: -------------------------------------------------------------------------------- 1 | if (TOOLCHAIN STREQUAL "gcc") 2 | set(TOOLCHAIN_COMMON_FLAGS 3 | -mthumb 4 | -mcpu=cortex-m33 5 | -mfloat-abi=hard 6 | -mfpu=fpv5-sp-d16 7 | ) 8 | 9 | set(FREERTOS_PORT GCC_ARM_CM33_NTZ_NONSECURE CACHE INTERNAL "") 10 | 11 | elseif (TOOLCHAIN STREQUAL "iar") 12 | set(TOOLCHAIN_COMMON_FLAGS 13 | --cpu cortex-m33 14 | --fpu VFPv5-SP 15 | ) 16 | 17 | set(FREERTOS_PORT IAR_ARM_CM4F CACHE INTERNAL "") 18 | 19 | endif () 20 | -------------------------------------------------------------------------------- /cmake/cpu/cortex-m4.cmake: -------------------------------------------------------------------------------- 1 | if (TOOLCHAIN STREQUAL "gcc") 2 | set(TOOLCHAIN_COMMON_FLAGS 3 | -mthumb 4 | -mcpu=cortex-m4 5 | -mfloat-abi=hard 6 | -mfpu=fpv4-sp-d16 7 | ) 8 | 9 | if (NOT DEFINED FREERTOS_PORT) 10 | set(FREERTOS_PORT GCC_ARM_CM4F CACHE INTERNAL "") 11 | endif () 12 | 13 | elseif (TOOLCHAIN STREQUAL "iar") 14 | set(TOOLCHAIN_COMMON_FLAGS 15 | --cpu cortex-m4 16 | --fpu VFPv4 17 | ) 18 | 19 | if (NOT DEFINED FREERTOS_PORT) 20 | set(FREERTOS_PORT IAR_ARM_CM4F CACHE INTERNAL "") 21 | endif () 22 | 23 | endif () 24 | -------------------------------------------------------------------------------- /cmake/toolchain/arm_gcc.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Generic) 2 | 3 | set(CMAKE_C_COMPILER "arm-none-eabi-gcc") 4 | set(CMAKE_CXX_COMPILER "arm-none-eabi-g++") 5 | set(CMAKE_ASM_COMPILER "arm-none-eabi-gcc") 6 | 7 | set(CMAKE_SIZE "arm-none-eabi-size" CACHE FILEPATH "") 8 | set(CMAKE_OBJCOPY "arm-none-eabi-objcopy" CACHE FILEPATH "") 9 | set(CMAKE_OBJDUMP "arm-none-eabi-objdump" CACHE FILEPATH "") 10 | 11 | set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) 12 | 13 | # Look for includes and libraries only in the target system prefix. 14 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 15 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 16 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 17 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 18 | 19 | # pass TOOLCHAIN_CPU to 20 | set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_SYSTEM_PROCESSOR) 21 | 22 | include(${CMAKE_CURRENT_LIST_DIR}/../cpu/${CMAKE_SYSTEM_PROCESSOR}.cmake) 23 | 24 | # enable all possible warnings for building examples 25 | list(APPEND TOOLCHAIN_COMMON_FLAGS 26 | -fdata-sections 27 | -ffunction-sections 28 | -fsingle-precision-constant 29 | -fno-strict-aliasing 30 | ) 31 | 32 | set(TOOLCHAIN_EXE_LINKER_FLAGS 33 | -Wl,--print-memory-usage 34 | -Wl,--gc-sections 35 | #-Wl,--cref 36 | ) 37 | 38 | include(${CMAKE_CURRENT_LIST_DIR}/set_flags.cmake) 39 | 40 | # try_compile is cmake test compiling its own example, 41 | # pass -nostdlib to skip stdlib linking 42 | get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE) 43 | if (IS_IN_TRY_COMPILE) 44 | set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -nostdlib") 45 | set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -nostdlib") 46 | endif () 47 | -------------------------------------------------------------------------------- /cmake/toolchain/set_flags.cmake: -------------------------------------------------------------------------------- 1 | include(CMakePrintHelpers) 2 | 3 | # join the toolchain flags into a single string 4 | list(JOIN TOOLCHAIN_COMMON_FLAGS " " TOOLCHAIN_COMMON_FLAGS) 5 | 6 | foreach (LANG IN ITEMS C CXX ASM) 7 | set(CMAKE_${LANG}_FLAGS_INIT ${TOOLCHAIN_COMMON_FLAGS}) 8 | 9 | #cmake_print_variables(CMAKE_${LANG}_FLAGS_INIT) 10 | 11 | # optimization flags for LOG, LOGGER ? 12 | #set(CMAKE_${LANG}_FLAGS_RELEASE_INIT "-Os") 13 | #set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-O0") 14 | endforeach () 15 | 16 | # Linker 17 | list(JOIN TOOLCHAIN_EXE_LINKER_FLAGS " " CMAKE_EXE_LINKER_FLAGS_INIT) 18 | -------------------------------------------------------------------------------- /lib/SEGGER_RTT/License.txt: -------------------------------------------------------------------------------- 1 | Important - Read carefully: 2 | 3 | SEGGER RTT - Real Time Transfer for embedded targets 4 | 5 | All rights reserved. 6 | 7 | SEGGER strongly recommends to not make any changes 8 | to or modify the source code of this software in order to stay 9 | compatible with the RTT protocol and J-Link. 10 | 11 | Redistribution and use in source and binary forms, with or 12 | without modification, are permitted provided that the following 13 | condition is met: 14 | 15 | o Redistributions of source code must retain the above copyright 16 | notice, this condition and the following disclaimer. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 19 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 20 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR 23 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 29 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 30 | DAMAGE. 31 | 32 | 33 | (c) 2014 - 2016 SEGGER Microcontroller GmbH 34 | www.segger.com 35 | -------------------------------------------------------------------------------- /lib/SEGGER_RTT/README.txt: -------------------------------------------------------------------------------- 1 | README.txt for the SEGGER RTT Implementation Pack. 2 | 3 | Included files: 4 | =============== 5 | Root Directory 6 | - Examples 7 | - Main_RTT_InputEchoApp.c - Sample application which echoes input on Channel 0. 8 | - Main_RTT_MenuApp.c - Sample application to demonstrate RTT bi-directional functionality. 9 | - Main_RTT_PrintfTest.c - Sample application to test RTT small printf implementation. 10 | - Main_RTT_SpeedTestApp.c - Sample application for measuring RTT performance. embOS needed. 11 | - RTT 12 | - SEGGER_RTT.c - The RTT implementation. 13 | - SEGGER_RTT.h - Header for RTT implementation. 14 | - SEGGER_RTT_Conf.h - Pre-processor configuration for the RTT implementation. 15 | - SEGGER_RTT_Printf.c - Simple implementation of printf to write formatted strings via RTT. 16 | - Syscalls 17 | - RTT_Syscalls_GCC.c - Low-level syscalls to retarget printf() to RTT with GCC / Newlib. 18 | - RTT_Syscalls_IAR.c - Low-level syscalls to retarget printf() to RTT with IAR compiler. 19 | - RTT_Syscalls_KEIL.c - Low-level syscalls to retarget printf() to RTT with KEIL/uVision compiler. 20 | - RTT_Syscalls_SES.c - Low-level syscalls to retarget printf() to RTT with SEGGER Embedded Studio. 21 | -------------------------------------------------------------------------------- /lib/sdk/components/libraries/crc16/crc16.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013 - 2017, Nordic Semiconductor ASA 3 | * 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, 7 | * are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form, except as embedded into a Nordic 13 | * Semiconductor ASA integrated circuit in a product or a software update for 14 | * such product, must reproduce the above copyright notice, this list of 15 | * conditions and the following disclaimer in the documentation and/or other 16 | * materials provided with the distribution. 17 | * 18 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of its 19 | * contributors may be used to endorse or promote products derived from this 20 | * software without specific prior written permission. 21 | * 22 | * 4. This software, with or without modification, must only be used with a 23 | * Nordic Semiconductor ASA integrated circuit. 24 | * 25 | * 5. Any software provided in binary form under this license must not be reverse 26 | * engineered, decompiled, modified and/or disassembled. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS 29 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 30 | * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 32 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 33 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 37 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | * 39 | */ 40 | #include "sdk_common.h" 41 | #if NRF_MODULE_ENABLED(CRC16) 42 | #include "crc16.h" 43 | 44 | #include 45 | 46 | uint16_t crc16_compute(uint8_t const * p_data, uint32_t size, uint16_t const * p_crc) 47 | { 48 | uint16_t crc = (p_crc == NULL) ? 0xFFFF : *p_crc; 49 | 50 | for (uint32_t i = 0; i < size; i++) 51 | { 52 | crc = (uint8_t)(crc >> 8) | (crc << 8); 53 | crc ^= p_data[i]; 54 | crc ^= (uint8_t)(crc & 0xFF) >> 4; 55 | crc ^= (crc << 8) << 4; 56 | crc ^= ((crc & 0xFF) << 4) << 1; 57 | } 58 | 59 | return crc; 60 | } 61 | #endif //NRF_MODULE_ENABLED(CRC16) 62 | -------------------------------------------------------------------------------- /lib/sdk/components/libraries/util/nrf_assert.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2006 - 2017, Nordic Semiconductor ASA 3 | * 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, 7 | * are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form, except as embedded into a Nordic 13 | * Semiconductor ASA integrated circuit in a product or a software update for 14 | * such product, must reproduce the above copyright notice, this list of 15 | * conditions and the following disclaimer in the documentation and/or other 16 | * materials provided with the distribution. 17 | * 18 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of its 19 | * contributors may be used to endorse or promote products derived from this 20 | * software without specific prior written permission. 21 | * 22 | * 4. This software, with or without modification, must only be used with a 23 | * Nordic Semiconductor ASA integrated circuit. 24 | * 25 | * 5. Any software provided in binary form under this license must not be reverse 26 | * engineered, decompiled, modified and/or disassembled. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS 29 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 30 | * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 32 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 33 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 37 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | * 39 | */ 40 | #include "nrf_assert.h" 41 | #include "app_error.h" 42 | #include "nordic_common.h" 43 | 44 | __WEAK void assert_nrf_callback(uint16_t line_num, const uint8_t * file_name) 45 | { 46 | assert_info_t assert_info = 47 | { 48 | .line_num = line_num, 49 | .p_file_name = file_name, 50 | }; 51 | app_error_fault_handler(NRF_FAULT_ID_SDK_ASSERT, 0, (uint32_t)(&assert_info)); 52 | 53 | UNUSED_VARIABLE(assert_info); 54 | } 55 | -------------------------------------------------------------------------------- /lib/sdk/components/libraries/util/sdk_common.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013 - 2017, Nordic Semiconductor ASA 3 | * 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, 7 | * are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form, except as embedded into a Nordic 13 | * Semiconductor ASA integrated circuit in a product or a software update for 14 | * such product, must reproduce the above copyright notice, this list of 15 | * conditions and the following disclaimer in the documentation and/or other 16 | * materials provided with the distribution. 17 | * 18 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of its 19 | * contributors may be used to endorse or promote products derived from this 20 | * software without specific prior written permission. 21 | * 22 | * 4. This software, with or without modification, must only be used with a 23 | * Nordic Semiconductor ASA integrated circuit. 24 | * 25 | * 5. Any software provided in binary form under this license must not be reverse 26 | * engineered, decompiled, modified and/or disassembled. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS 29 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 30 | * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 32 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 33 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 37 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | * 39 | */ 40 | /** @cond */ 41 | /**@file 42 | * 43 | * @ingroup experimental_api 44 | * @defgroup sdk_common SDK Common Header 45 | * @brief All common headers needed for SDK examples will be included here so that application 46 | * developer does not have to include headers on him/herself. 47 | * @{ 48 | */ 49 | 50 | #ifndef SDK_COMMON_H__ 51 | #define SDK_COMMON_H__ 52 | 53 | #include 54 | #include 55 | #include 56 | #include "sdk_config.h" 57 | #include "nordic_common.h" 58 | #include "compiler_abstraction.h" 59 | #include "sdk_os.h" 60 | #include "sdk_errors.h" 61 | #include "app_util.h" 62 | #include "sdk_macros.h" 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | 69 | /** @} */ 70 | /** @endcond */ 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif // SDK_COMMON_H__ 77 | 78 | -------------------------------------------------------------------------------- /lib/sdk/components/libraries/util/sdk_os.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013 - 2017, Nordic Semiconductor ASA 3 | * 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, 7 | * are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form, except as embedded into a Nordic 13 | * Semiconductor ASA integrated circuit in a product or a software update for 14 | * such product, must reproduce the above copyright notice, this list of 15 | * conditions and the following disclaimer in the documentation and/or other 16 | * materials provided with the distribution. 17 | * 18 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of its 19 | * contributors may be used to endorse or promote products derived from this 20 | * software without specific prior written permission. 21 | * 22 | * 4. This software, with or without modification, must only be used with a 23 | * Nordic Semiconductor ASA integrated circuit. 24 | * 25 | * 5. Any software provided in binary form under this license must not be reverse 26 | * engineered, decompiled, modified and/or disassembled. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS 29 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 30 | * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 32 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 33 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 37 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | * 39 | */ 40 | /** @cond */ 41 | /**@file 42 | * 43 | * @defgroup sdk_os SDK OS Abstraction 44 | * @ingroup experimental_api 45 | * @details In order to made SDK modules independent of use of an embedded OS, and permit 46 | * application with varied task architecture, SDK abstracts the OS specific 47 | * elements here in order to make all other modules agnostic to the OS or task 48 | * architecture. 49 | * @{ 50 | */ 51 | 52 | #ifndef SDK_OS_H__ 53 | #define SDK_OS_H__ 54 | 55 | #ifdef __cplusplus 56 | extern "C" { 57 | #endif 58 | 59 | #define SDK_MUTEX_DEFINE(X) 60 | #define SDK_MUTEX_INIT(X) 61 | #define SDK_MUTEX_LOCK(X) 62 | #define SDK_MUTEX_UNLOCK(X) 63 | 64 | /** 65 | * @defgroup os_data_type Data types. 66 | */ 67 | 68 | /** @} */ 69 | /** @endcond */ 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif // SDK_OS_H__ 76 | 77 | -------------------------------------------------------------------------------- /lib/sdk/readme.md: -------------------------------------------------------------------------------- 1 | SDK version is 14.2.0_17b948a 2 | -------------------------------------------------------------------------------- /lib/sdk11/components/libraries/bootloader_dfu/ble_transport/hci_mem_pool_internal.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. 2 | * 3 | * The information contained herein is property of Nordic Semiconductor ASA. 4 | * Terms and conditions of usage are described in detail in NORDIC 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 6 | * 7 | * Licensees are granted free, non-transferable use of the information. NO 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 9 | * the file. 10 | * 11 | */ 12 | 13 | /** @file 14 | * 15 | * @defgroup memory_pool_internal Memory Pool Internal 16 | * @{ 17 | * @ingroup memory_pool 18 | * 19 | * @brief Memory pool internal definitions 20 | */ 21 | 22 | #ifndef MEM_POOL_INTERNAL_H__ 23 | #define MEM_POOL_INTERNAL_H__ 24 | 25 | #define TX_BUF_SIZE 4u /**< TX buffer size in bytes. */ 26 | #define RX_BUF_SIZE 32u /**< RX buffer size in bytes. */ 27 | 28 | #define RX_BUF_QUEUE_SIZE 8u /**< RX buffer element size. */ 29 | 30 | #endif // MEM_POOL_INTERNAL_H__ 31 | 32 | /** @} */ 33 | -------------------------------------------------------------------------------- /lib/sdk11/components/libraries/bootloader_dfu/bootloader_settings.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. 2 | * 3 | * The information contained herein is property of Nordic Semiconductor ASA. 4 | * Terms and conditions of usage are described in detail in NORDIC 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 6 | * 7 | * Licensees are granted free, non-transferable use of the information. NO 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 9 | * the file. 10 | * 11 | */ 12 | 13 | #include "bootloader_settings.h" 14 | #include 15 | #include 16 | #include "nrfx_nvmc.h" 17 | 18 | /**< This variable reserves a codepage for bootloader specific settings, to ensure the compiler doesn't locate any code or variables at his location. */ 19 | __attribute__ ((section(".bootloaderSettings"))) 20 | uint8_t m_boot_settings[CODE_PAGE_SIZE]; 21 | 22 | /**< This variable ensures that the linker script will write the bootloader start address to the UICR register. This value will be written in the HEX file and thus written to UICR when the bootloader is flashed into the chip. */ 23 | __attribute__ ((section(".uicrBootStartAddress"))) 24 | volatile uint32_t m_uicr_bootloader_start_address = BOOTLOADER_REGION_START; 25 | 26 | /**< This variable reserves a codepage for mbr parameters, to ensure the compiler doesn't locate any code or variables at his location. */ 27 | __attribute__ ((section(".mbrParamsPage"))) 28 | uint8_t m_mbr_params_page[CODE_PAGE_SIZE]; 29 | 30 | /**< This variable makes the linker script write the mbr parameters page address to the UICR register. This value will be written in the HEX file and thus written to the UICR when the bootloader is flashed into the chip */ 31 | __attribute__ ((section(".uicrMbrParamsPageAddress"))) 32 | volatile uint32_t m_uicr_mbr_params_page_address = BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS; 33 | 34 | void bootloader_util_settings_get(const bootloader_settings_t ** pp_bootloader_settings) 35 | { 36 | // Read only pointer to bootloader settings in flash. 37 | bootloader_settings_t const * const p_bootloader_settings = 38 | (bootloader_settings_t *)&m_boot_settings[0]; 39 | 40 | *pp_bootloader_settings = p_bootloader_settings; 41 | } 42 | 43 | void bootloader_mbr_addrs_populate(void) 44 | { 45 | if (*(const uint32_t *)MBR_BOOTLOADER_ADDR == 0xFFFFFFFF) 46 | { 47 | nrfx_nvmc_word_write(MBR_BOOTLOADER_ADDR, BOOTLOADER_REGION_START); 48 | } 49 | 50 | if (*(const uint32_t *)MBR_PARAM_PAGE_ADDR == 0xFFFFFFFF) 51 | { 52 | nrfx_nvmc_word_write(MBR_PARAM_PAGE_ADDR, BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/sdk11/components/libraries/bootloader_dfu/bootloader_settings.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. 2 | * 3 | * The information contained herein is property of Nordic Semiconductor ASA. 4 | * Terms and conditions of usage are described in detail in NORDIC 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 6 | * 7 | * Licensees are granted free, non-transferable use of the information. NO 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 9 | * the file. 10 | * 11 | */ 12 | 13 | /**@file 14 | * 15 | * @defgroup nrf_bootloader_settings Bootloader settings API. 16 | * @{ 17 | * 18 | * @brief Bootloader settings module interface. 19 | */ 20 | 21 | #ifndef BOOTLOADER_SETTINGS_H__ 22 | #define BOOTLOADER_SETTINGS_H__ 23 | 24 | #include 25 | #include "bootloader_types.h" 26 | 27 | /**@brief Function for getting the bootloader settings. 28 | * 29 | * @param[out] pp_bootloader_settings Bootloader settings. 30 | */ 31 | void bootloader_util_settings_get(const bootloader_settings_t ** pp_bootloader_settings); 32 | 33 | #endif // BOOTLOADER_SETTINGS_H__ 34 | 35 | /**@} */ 36 | -------------------------------------------------------------------------------- /lib/sdk11/components/libraries/bootloader_dfu/bootloader_types.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. 2 | * 3 | * The information contained herein is property of Nordic Semiconductor ASA. 4 | * Terms and conditions of usage are described in detail in NORDIC 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 6 | * 7 | * Licensees are granted free, non-transferable use of the information. NO 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 9 | * the file. 10 | * 11 | */ 12 | 13 | /**@file 14 | * 15 | * @defgroup nrf_bootloader_types Types and definitions. 16 | * @{ 17 | * 18 | * @ingroup nrf_bootloader 19 | * 20 | * @brief Bootloader module type and definitions. 21 | */ 22 | 23 | #ifndef BOOTLOADER_TYPES_H__ 24 | #define BOOTLOADER_TYPES_H__ 25 | 26 | #include 27 | 28 | #define BOOTLOADER_DFU_START 0xB1 29 | 30 | #define BOOTLOADER_SVC_APP_DATA_PTR_GET 0x02 31 | 32 | /**@brief DFU Bank state code, which indicates wether the bank contains: A valid image, invalid image, or an erased flash. 33 | */ 34 | typedef enum 35 | { 36 | BANK_VALID_APP = 0x01, 37 | BANK_VALID_SD = 0xA5, 38 | BANK_VALID_BOOT = 0xAA, 39 | BANK_ERASED = 0xFE, 40 | BANK_INVALID_APP = 0xFF, 41 | } bootloader_bank_code_t; 42 | 43 | /**@brief Structure holding bootloader settings for application and bank data. 44 | */ 45 | typedef struct 46 | { 47 | uint16_t bank_0; /**< Variable to store if bank 0 contains a valid application. */ 48 | uint16_t bank_0_crc; /**< If bank is valid, this field will contain a valid CRC of the total image. */ 49 | uint16_t bank_1; /**< Variable to store if bank 1 has been erased/prepared for new image. Bank 1 is only used in Banked Update scenario. */ 50 | uint32_t bank_0_size; /**< Size of active image in bank0 if present, otherwise 0. */ 51 | uint32_t sd_image_size; /**< Size of SoftDevice image in bank0 if bank_0 code is BANK_VALID_SD. */ 52 | uint32_t bl_image_size; /**< Size of Bootloader image in bank0 if bank_0 code is BANK_VALID_SD. */ 53 | uint32_t app_image_size; /**< Size of Application image in bank0 if bank_0 code is BANK_VALID_SD. */ 54 | uint32_t sd_image_start; /**< Location in flash where SoftDevice image is stored for SoftDevice update. */ 55 | } bootloader_settings_t; 56 | 57 | #endif // BOOTLOADER_TYPES_H__ 58 | 59 | /**@} */ 60 | -------------------------------------------------------------------------------- /lib/sdk11/components/libraries/bootloader_dfu/bootloader_util.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. 2 | * 3 | * The information contained herein is property of Nordic Semiconductor ASA. 4 | * Terms and conditions of usage are described in detail in NORDIC 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 6 | * 7 | * Licensees are granted free, non-transferable use of the information. NO 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 9 | * the file. 10 | * 11 | */ 12 | 13 | /**@file 14 | * 15 | * @defgroup nrf_bootloader_util Bootloader util API. 16 | * @{ 17 | * 18 | * @brief Bootloader util module interface. 19 | */ 20 | 21 | #ifndef BOOTLOADER_UTIL_H__ 22 | #define BOOTLOADER_UTIL_H__ 23 | 24 | #include 25 | #include "bootloader_types.h" 26 | 27 | /**@brief Function for starting the application (or bootloader) at the provided address. 28 | * 29 | * @param[in] start_addr Start address. 30 | * 31 | * @note This function will never retrun. Instead it will reset into the application of the 32 | * provided address. 33 | */ 34 | void bootloader_util_app_start(uint32_t start_addr); 35 | 36 | #endif // BOOTLOADER_UTIL_H__ 37 | 38 | /**@} */ 39 | -------------------------------------------------------------------------------- /lib/sdk11/components/libraries/bootloader_dfu/dfu_ble_svc_internal.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. 2 | * 3 | * The information contained herein is property of Nordic Semiconductor ASA. 4 | * Terms and conditions of usage are described in detail in NORDIC 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 6 | * 7 | * Licensees are granted free, non-transferable use of the information. NO 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 9 | * the file. 10 | * 11 | */ 12 | 13 | /** @file 14 | * 15 | * @defgroup nrf_dfu_ble_svc_internal DFU BLE SVC internal 16 | * @{ 17 | * 18 | * @brief DFU BLE SVC internal functions in bootloader. The DFU BLE SuperVisor Calls allow an 19 | * application to execute functions in the installed bootloader. This interface provides 20 | * internal Bootloader DFU functions for retrieving data exchanged through SuperVisor Calls. 21 | * 22 | */ 23 | 24 | #ifndef DFU_BLE_SVC_INTERNAL_H__ 25 | #define DFU_BLE_SVC_INTERNAL_H__ 26 | 27 | #include 28 | #include "dfu_ble_svc.h" 29 | #include "ble_gap.h" 30 | 31 | /**@brief Internal bootloader/DFU function for retrieving peer data provided from application. 32 | * 33 | * @param[out] p_peer_data Peer data set by application to be used for DFU connection. 34 | * 35 | * @retval NRF_SUCCESS If peer data is valid and can be used for connection. 36 | * @retval NRF_ERROR_NULL If p_peer_data is a NULL pointer. 37 | * @retval NRF_ERROR_INVALID_DATA If peer data is not available or invalid. 38 | */ 39 | uint32_t dfu_ble_peer_data_get(dfu_ble_peer_data_t * p_peer_data); 40 | 41 | #endif // DFU_BLE_SVC_INTERNAL_H__ 42 | 43 | /** @} */ 44 | -------------------------------------------------------------------------------- /lib/sdk11/components/libraries/bootloader_dfu/dfu_transport.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. 2 | * 3 | * The information contained herein is property of Nordic Semiconductor ASA. 4 | * Terms and conditions of usage are described in detail in NORDIC 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 6 | * 7 | * Licensees are granted free, non-transferable use of the information. NO 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 9 | * the file. 10 | * 11 | */ 12 | 13 | /**@file 14 | * 15 | * @defgroup nrf_dfu_transport DFU transport API. 16 | * @{ 17 | * 18 | * @brief DFU transport module interface. 19 | */ 20 | 21 | #ifndef DFU_TRANSPORT_H__ 22 | #define DFU_TRANSPORT_H__ 23 | 24 | #include 25 | 26 | /**@brief Function for starting the update of Device Firmware. 27 | * 28 | * @retval NRF_SUCCESS Operation success. 29 | */ 30 | uint32_t dfu_transport_serial_update_start(void); 31 | 32 | /**@brief Function for closing the transport layer. 33 | * 34 | * @retval NRF_SUCCESS Operation success. 35 | */ 36 | uint32_t dfu_transport_serial_close(void); 37 | 38 | 39 | uint32_t dfu_transport_ble_update_start(void); 40 | uint32_t dfu_transport_ble_close(); 41 | 42 | #endif // DFU_TRANSPORT_H__ 43 | 44 | /**@} */ 45 | -------------------------------------------------------------------------------- /lib/sdk11/components/libraries/bootloader_dfu/hci_transport/hci_mem_pool_internal.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. 2 | * 3 | * The information contained herein is property of Nordic Semiconductor ASA. 4 | * Terms and conditions of usage are described in detail in NORDIC 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 6 | * 7 | * Licensees are granted free, non-transferable use of the information. NO 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 9 | * the file. 10 | * 11 | */ 12 | 13 | /** @file 14 | * 15 | * @defgroup memory_pool_internal Memory Pool Internal 16 | * @{ 17 | * @ingroup memory_pool 18 | * 19 | * @brief Memory pool internal definitions 20 | */ 21 | 22 | #ifndef MEM_POOL_INTERNAL_H__ 23 | #define MEM_POOL_INTERNAL_H__ 24 | 25 | #define TX_BUF_SIZE 32u /**< TX buffer size in bytes. */ 26 | #define RX_BUF_SIZE 600u /**< RX buffer size in bytes. */ 27 | 28 | #define RX_BUF_QUEUE_SIZE 2u /**< RX buffer element size. */ 29 | 30 | #endif // MEM_POOL_INTERNAL_H__ 31 | 32 | /** @} */ 33 | -------------------------------------------------------------------------------- /lib/sdk11/components/libraries/bootloader_dfu/hci_transport/hci_transport_config.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. 2 | * 3 | * The information contained herein is property of Nordic Semiconductor ASA. 4 | * Terms and conditions of usage are described in detail in NORDIC 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 6 | * 7 | * Licensees are granted free, non-transferable use of the information. NO 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 9 | * the file. 10 | * 11 | */ 12 | 13 | /**@file 14 | * 15 | * @defgroup ble_sdk_bootloader_hci_congfig HCI Transport Layer Configuration 16 | * @{ 17 | * @ingroup dfu_bootloader_api 18 | * @brief Definition of HCI Transport Layer configurable parameters 19 | */ 20 | 21 | #ifndef HCI_TRANSPORT_CONFIG_H__ 22 | #define HCI_TRANSPORT_CONFIG_H__ 23 | 24 | #include "boards.h" /**< Default include for boards.h which means that default pin numbers will be used for RX, TX, CTS, and RTS on the UART. Other pin number can be used if desired. */ 25 | 26 | /** This section covers configurable parameters for the HCI Transport SLIP layer. */ 27 | #define HCI_SLIP_UART_RX_PIN_NUMBER RX_PIN_NUMBER /**< Defines the UART RX pin number. The default pin for the board is chosen, but can be overwritten. */ 28 | 29 | #define HCI_SLIP_UART_TX_PIN_NUMBER TX_PIN_NUMBER /**< Defines the UART TX pin number. The default pin for the board is chosen, but can be overwritten. */ 30 | 31 | #define HCI_SLIP_UART_RTS_PIN_NUMBER RTS_PIN_NUMBER /**< Defines the UART RTS pin number. The default pin for the board is chosen, but can be overwritten. */ 32 | 33 | #define HCI_SLIP_UART_CTS_PIN_NUMBER CTS_PIN_NUMBER /**< Defines the UART CTS pin number. The default pin for the board is chosen, but can be overwritten. */ 34 | 35 | #define HCI_SLIP_UART_MODE HWFC /**< Defines the UART mode to be used. Use UART Low Power with Flow Control - Valid values are defined in \ref app_uart_flow_control_t. For further information on the UART Low Power mode, please refer to: \ref app_uart . */ 36 | 37 | #define HCI_SLIP_UART_BAUDRATE UART_BAUDRATE_BAUDRATE_Baud115200 // UART_BAUDRATE_BAUDRATE_Baud38400 /**< Defines the UART Baud rate. Default is 38400 baud. */ 38 | 39 | /** This section covers configurable parameters for the HCI Transport layer that are used for calculating correct value for the retransmission timer timeout. */ 40 | #define MAX_PACKET_SIZE_IN_BITS 8000u /**< Maximum size of a single application packet in bits. */ 41 | #define USED_BAUD_RATE 115200u /**< The used uart baudrate. */ 42 | 43 | #endif // HCI_TRANSPORT_CONFIG_H__ 44 | 45 | /** @} */ 46 | -------------------------------------------------------------------------------- /lib/sdk11/readme.md: -------------------------------------------------------------------------------- 1 | This bootloader is based on the non-secure one in the SDK version 11.0.0_89a8197. It still has some dependency/code that is dropped in the later sdk 2 | -------------------------------------------------------------------------------- /lib/softdevice/mbr/hex/mbr_nrf52_2.4.1_licence-agreement.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007 - 2019, Nordic Semiconductor ASA 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form, except as embedded into a Nordic 11 | Semiconductor ASA integrated circuit in a product or a software update for 12 | such product, must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or other 14 | materials provided with the distribution. 15 | 16 | 3. Neither the name of Nordic Semiconductor ASA nor the names of its 17 | contributors may be used to endorse or promote products derived from this 18 | software without specific prior written permission. 19 | 20 | 4. This software, with or without modification, must only be used with a 21 | Nordic Semiconductor ASA integrated circuit. 22 | 23 | 5. Any software provided in binary form under this license must not be reverse 24 | engineered, decompiled, modified and/or disassembled. 25 | 26 | THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS 27 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 28 | OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 32 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 35 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | -------------------------------------------------------------------------------- /lib/softdevice/s132_nrf52_6.1.1/s132_nrf52_6.1.1_license-agreement.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007 - 2018, Nordic Semiconductor ASA 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form, except as embedded into a Nordic 11 | Semiconductor ASA integrated circuit in a product or a software update for 12 | such product, must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or other 14 | materials provided with the distribution. 15 | 16 | 3. Neither the name of Nordic Semiconductor ASA nor the names of its 17 | contributors may be used to endorse or promote products derived from this 18 | software without specific prior written permission. 19 | 20 | 4. This software, with or without modification, must only be used with a 21 | Nordic Semiconductor ASA integrated circuit. 22 | 23 | 5. Any software provided in binary form under this license must not be reverse 24 | engineered, decompiled, modified and/or disassembled. 25 | 26 | THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS 27 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 28 | OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 32 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 35 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | -------------------------------------------------------------------------------- /lib/softdevice/s140_nrf52_6.1.1/s140_nrf52_6.1.1_license-agreement.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007 - 2018, Nordic Semiconductor ASA 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form, except as embedded into a Nordic 11 | Semiconductor ASA integrated circuit in a product or a software update for 12 | such product, must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or other 14 | materials provided with the distribution. 15 | 16 | 3. Neither the name of Nordic Semiconductor ASA nor the names of its 17 | contributors may be used to endorse or promote products derived from this 18 | software without specific prior written permission. 19 | 20 | 4. This software, with or without modification, must only be used with a 21 | Nordic Semiconductor ASA integrated circuit. 22 | 23 | 5. Any software provided in binary form under this license must not be reverse 24 | engineered, decompiled, modified and/or disassembled. 25 | 26 | THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS 27 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 28 | OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 32 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 35 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | -------------------------------------------------------------------------------- /lib/softdevice/s140_nrf52_6.1.1/s140_nrf52_6.1.1_softdevice.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Bootloader/a48e944f0bca1776bdb7eaa96bf6d8fd36a2158e/lib/softdevice/s140_nrf52_6.1.1/s140_nrf52_6.1.1_softdevice.uf2 -------------------------------------------------------------------------------- /lib/softdevice/s140_nrf52_7.2.0/s140_nrf52_7.2.0_licence-agreement.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007 - 2020, Nordic Semiconductor ASA 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form, except as embedded into a Nordic 11 | Semiconductor ASA integrated circuit in a product or a software update for 12 | such product, must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or other 14 | materials provided with the distribution. 15 | 16 | 3. Neither the name of Nordic Semiconductor ASA nor the names of its 17 | contributors may be used to endorse or promote products derived from this 18 | software without specific prior written permission. 19 | 20 | 4. This software, with or without modification, must only be used with a 21 | Nordic Semiconductor ASA integrated circuit. 22 | 23 | 5. Any software provided in binary form under this license must not be reverse 24 | engineered, decompiled, modified and/or disassembled. 25 | 26 | THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS 27 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 28 | OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 32 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 35 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | -------------------------------------------------------------------------------- /lib/softdevice/s140_nrf52_7.3.0/s140_nrf52_7.3.0_license-agreement.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007 - 2020, Nordic Semiconductor ASA 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form, except as embedded into a Nordic 11 | Semiconductor ASA integrated circuit in a product or a software update for 12 | such product, must reproduce the above copyright notice, this list of 13 | conditions and the following disclaimer in the documentation and/or other 14 | materials provided with the distribution. 15 | 16 | 3. Neither the name of Nordic Semiconductor ASA nor the names of its 17 | contributors may be used to endorse or promote products derived from this 18 | software without specific prior written permission. 19 | 20 | 4. This software, with or without modification, must only be used with a 21 | Nordic Semiconductor ASA integrated circuit. 22 | 23 | 5. Any software provided in binary form under this license must not be reverse 24 | engineered, decompiled, modified and/or disassembled. 25 | 26 | THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS 27 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 28 | OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 32 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 35 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | -------------------------------------------------------------------------------- /linker/nrf52.ld: -------------------------------------------------------------------------------- 1 | /* Linker script to configure memory regions. */ 2 | 3 | SEARCH_DIR(.) 4 | GROUP(-lgcc -lc -lnosys) 5 | 6 | MEMORY 7 | { 8 | /** Flash start address for the bootloader. This setting will also be stored in UICR to allow the 9 | * MBR to init the bootloader when starting the system. This value must correspond to 10 | * BOOTLOADER_REGION_START found in dfu_types.h. The system is prevented from starting up if 11 | * those values do not match. The check is performed in main.c, see 12 | * APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START); 13 | */ 14 | FLASH (rx) : ORIGIN = 0x74000, LENGTH = 0x7E000-0x74000 /* 40 KB */ 15 | 16 | /** Location of mbr params page in flash. */ 17 | MBR_PARAMS_PAGE (rw) : ORIGIN = 0x7E000, LENGTH = 0x1000 18 | 19 | /** Location of bootloader setting in flash. */ 20 | BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x7F000, LENGTH = 0x1000 21 | 22 | 23 | 24 | /** RAM Region for bootloader. */ 25 | RAM (rwx) : ORIGIN = 0x20008000, LENGTH = 0x20010000-0x20008000 26 | 27 | /* Location for double reset detection, no init */ 28 | DBL_RESET (rwx) : ORIGIN = 0x20007F7C, LENGTH = 0x04 29 | 30 | /** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information 31 | * from application to bootloader when using buttonless DFU OTA. */ 32 | NOINIT (rwx) : ORIGIN = 0x20007F80, LENGTH = 0x80 33 | 34 | 35 | 36 | /** Location in UICR where bootloader start address is stored. */ 37 | UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04 38 | 39 | /** Location in UICR where mbr params page address is stored. */ 40 | UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04 41 | } 42 | 43 | SECTIONS 44 | { 45 | .fs_data_out ALIGN(4): 46 | { 47 | PROVIDE( __start_fs_data = .); 48 | KEEP(*(fs_data)) 49 | PROVIDE( __stop_fs_data = .); 50 | } = 0 51 | 52 | /* Place the bootloader settings page in flash. */ 53 | .bootloaderSettings(NOLOAD) : 54 | { 55 | 56 | } > BOOTLOADER_SETTINGS 57 | 58 | /* Write the bootloader address in UICR. */ 59 | .uicrBootStartAddress : 60 | { 61 | KEEP(*(.uicrBootStartAddress)) 62 | } > UICR_BOOTLOADER 63 | 64 | /* Place the mbr params page in flash. */ 65 | .mbrParamsPage(NOLOAD) : 66 | { 67 | 68 | } > MBR_PARAMS_PAGE 69 | 70 | /* Write the bootloader address in UICR. */ 71 | .uicrMbrParamsPageAddress : 72 | { 73 | KEEP(*(.uicrMbrParamsPageAddress)) 74 | } > UICR_MBR_PARAM_PAGE 75 | 76 | .dbl_reset(NOLOAD) : 77 | { 78 | 79 | } > DBL_RESET 80 | 81 | /* No init RAM section in bootloader. Used for bond information exchange. */ 82 | .noinit(NOLOAD) : 83 | { 84 | 85 | } > NOINIT 86 | /* other placements follow here... */ 87 | } 88 | 89 | INCLUDE "nrf_common.ld" 90 | -------------------------------------------------------------------------------- /linker/nrf52_debug.ld: -------------------------------------------------------------------------------- 1 | /* Linker script to configure memory regions. */ 2 | 3 | SEARCH_DIR(.) 4 | GROUP(-lgcc -lc -lnosys) 5 | 6 | MEMORY 7 | { 8 | /** Flash start address for the bootloader. This setting will also be stored in UICR to allow the 9 | * MBR to init the bootloader when starting the system. This value must correspond to 10 | * BOOTLOADER_REGION_START found in dfu_types.h. The system is prevented from starting up if 11 | * those values do not match. The check is performed in main.c, see 12 | * APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START); 13 | */ 14 | FLASH (rx) : ORIGIN = 0x74000-28K, LENGTH = 0x7E000-0x74000+28K /* 40 KB */ 15 | 16 | /** Location of mbr params page in flash. */ 17 | MBR_PARAMS_PAGE (rw) : ORIGIN = 0x7E000, LENGTH = 0x1000 18 | 19 | /** Location of bootloader setting in flash. */ 20 | BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x7F000, LENGTH = 0x1000 21 | 22 | 23 | 24 | /** RAM Region for bootloader. */ 25 | RAM (rwx) : ORIGIN = 0x20008000, LENGTH = 0x20010000-0x20008000 26 | 27 | /* Location for double reset detection, no init */ 28 | DBL_RESET (rwx) : ORIGIN = 0x20007F7C, LENGTH = 0x04 29 | 30 | /** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information 31 | * from application to bootloader when using buttonless DFU OTA. */ 32 | NOINIT (rwx) : ORIGIN = 0x20007F80, LENGTH = 0x80 33 | 34 | 35 | 36 | /** Location in UICR where bootloader start address is stored. */ 37 | UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04 38 | 39 | /** Location in UICR where mbr params page address is stored. */ 40 | UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04 41 | } 42 | 43 | SECTIONS 44 | { 45 | .fs_data_out ALIGN(4): 46 | { 47 | PROVIDE( __start_fs_data = .); 48 | KEEP(*(fs_data)) 49 | PROVIDE( __stop_fs_data = .); 50 | } = 0 51 | 52 | /* Place the bootloader settings page in flash. */ 53 | .bootloaderSettings(NOLOAD) : 54 | { 55 | 56 | } > BOOTLOADER_SETTINGS 57 | 58 | /* Write the bootloader address in UICR. */ 59 | .uicrBootStartAddress : 60 | { 61 | KEEP(*(.uicrBootStartAddress)) 62 | } > UICR_BOOTLOADER 63 | 64 | /* Place the mbr params page in flash. */ 65 | .mbrParamsPage(NOLOAD) : 66 | { 67 | 68 | } > MBR_PARAMS_PAGE 69 | 70 | /* Write the bootloader address in UICR. */ 71 | .uicrMbrParamsPageAddress : 72 | { 73 | KEEP(*(.uicrMbrParamsPageAddress)) 74 | } > UICR_MBR_PARAM_PAGE 75 | 76 | .dbl_reset(NOLOAD) : 77 | { 78 | 79 | } > DBL_RESET 80 | 81 | /* No init RAM section in bootloader. Used for bond information exchange. */ 82 | .noinit(NOLOAD) : 83 | { 84 | 85 | } > NOINIT 86 | /* other placements follow here... */ 87 | } 88 | 89 | INCLUDE "nrf_common.ld" 90 | -------------------------------------------------------------------------------- /segger/flash_placement.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /segger/nRF52832_xxAA_MemoryMap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /segger/nRF52840_xxAA_MemoryMap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /segger/nRF_Target.js: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * SEGGER Microcontroller GmbH & Co. KG * 3 | * Solutions for real time microcontroller applications * 4 | ***************************************************************************** 5 | * * 6 | * (c) 2017 SEGGER Microcontroller GmbH & Co. KG * 7 | * * 8 | * Internet: www.segger.com Support: support@segger.com * 9 | * * 10 | *****************************************************************************/ 11 | 12 | function Reset() { 13 | TargetInterface.resetAndStop(); 14 | } 15 | 16 | function EnableTrace(traceInterfaceType) { 17 | // TODO: Enable trace 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/boards/adm_b_nrf52840_1/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef ADM_B_NRF52840_1_H 26 | #define ADM_B_NRF52840_1_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 1 34 | #define LED_PRIMARY_PIN _PINNUM(0, 19) // Red 35 | //#define LED_SECONDARY_PIN 12 // Blue 36 | #define LED_STATE_ON 0 37 | 38 | /*------------------------------------------------------------------*/ 39 | /* BUTTON 40 | *------------------------------------------------------------------*/ 41 | #define BUTTONS_NUMBER 2 42 | 43 | #define BUTTON_1 _PINNUM(0, 11) 44 | #define BUTTON_2 _PINNUM(0, 12) 45 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 46 | 47 | //--------------------------------------------------------------------+ 48 | // BLE OTA 49 | //--------------------------------------------------------------------+ 50 | #define BLEDIS_MANUFACTURER "Atelier-Du-Maker" 51 | #define BLEDIS_MODEL "ADM_B_NRF52840_1" 52 | 53 | //--------------------------------------------------------------------+ 54 | // USB 55 | //--------------------------------------------------------------------+ 56 | 57 | #define USB_DESC_VID 0x239A 58 | #define USB_DESC_UF2_PID 0x009F 59 | #define USB_DESC_CDC_ONLY_PID 0x009F 60 | 61 | //------------- UF2 -------------// 62 | #define UF2_PRODUCT_NAME "AtelierDuMaker NRF52840 Breakout" 63 | #define UF2_VOLUME_LABEL "ADM840BOOT" 64 | #define UF2_BOARD_ID "ADM_B_NRF52840_1" 65 | #define UF2_INDEX_URL "https://github.com/Atelier-Du-Maker/HolyIoT_NRF52840" 66 | 67 | #endif // ADM_B_NRF52840_1_H 68 | -------------------------------------------------------------------------------- /src/boards/adm_b_nrf52840_1/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/adm_b_nrf52840_1/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/ae_bl652_bo/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _AE_BL652_BO_H 26 | #define _AE_BL652_BO_H 27 | 28 | /*------------------------------------------------------------------*/ 29 | /* LED 30 | *------------------------------------------------------------------*/ 31 | #define LEDS_NUMBER 2 32 | #define LED_PRIMARY_PIN 17 // LED1 33 | #define LED_SECONDARY_PIN 19 // LED2 34 | #define LED_STATE_ON 1 35 | 36 | /*------------------------------------------------------------------*/ 37 | /* BUTTON 38 | *------------------------------------------------------------------*/ 39 | #define BUTTONS_NUMBER 2 40 | #define BUTTON_1 11 // BTN1 41 | #define BUTTON_2 15 // BTN2 42 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 43 | 44 | /*------------------------------------------------------------------*/ 45 | /* UART (only used by nRF52832) 46 | *------------------------------------------------------------------*/ 47 | #define RX_PIN_NUMBER 8 48 | #define TX_PIN_NUMBER 6 49 | #define CTS_PIN_NUMBER 0 50 | #define RTS_PIN_NUMBER 0 51 | #define HWFC false 52 | 53 | //--------------------------------------------------------------------+ 54 | // BLE OTA 55 | //--------------------------------------------------------------------+ 56 | #define BLEDIS_MANUFACTURER "Akizuki Denshi Tsusho" 57 | #define BLEDIS_MODEL "AE-BL652-BO" 58 | 59 | #endif // _AE_BL652_BO_H 60 | -------------------------------------------------------------------------------- /src/boards/ae_bl652_bo/board.mk: -------------------------------------------------------------------------------- 1 | # nrf52 is nrf52832 2 | MCU_SUB_VARIANT = nrf52 3 | -------------------------------------------------------------------------------- /src/boards/aramcon2_badge/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2021 Benjamin Meisels 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _ARAMCON2_BADGE_H 26 | #define _ARAMCON2_BADGE_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 1 34 | #define LED_PRIMARY_PIN _PINNUM(1, 11) // Red 35 | 36 | #define LED_NEOPIXEL _PINNUM(0, 8) 37 | #define NEOPIXELS_NUMBER 2 38 | #define BOARD_RGB_BRIGHTNESS 0x040404 39 | 40 | /*------------------------------------------------------------------*/ 41 | /* BUTTON 42 | *------------------------------------------------------------------*/ 43 | #define BUTTONS_NUMBER 2 44 | #define BUTTON_1 _PINNUM(0, 2) // left Button 45 | #define BUTTON_2 _PINNUM(0, 29) // middle button 46 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 47 | 48 | // Used as model string in OTA mode 49 | #define BLEDIS_MANUFACTURER "ARAMCON Badge Team" 50 | #define BLEDIS_MODEL "ARAMCON2 Badge" 51 | 52 | //--------------------------------------------------------------------+ 53 | // USB 54 | //--------------------------------------------------------------------+ 55 | #define USB_DESC_VID 0x239A 56 | #define USB_DESC_UF2_PID 0x007B 57 | #define USB_DESC_CDC_ONLY_PID 0x007B 58 | 59 | //------------- UF2 -------------// 60 | #define UF2_PRODUCT_NAME "ARAMCON2 Badge" 61 | #define UF2_VOLUME_LABEL "ARAMBOOT" 62 | #define UF2_BOARD_ID "nrf52840-ARAMCON2-Badge" 63 | #define UF2_INDEX_URL "https://github.com/aramcon-badge" 64 | 65 | #endif // _ARAMCON2_BADGE_H 66 | -------------------------------------------------------------------------------- /src/boards/aramcon2_badge/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/aramcon2_badge/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/aramcon_badge_2019/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Uri Shaked 5 | * Copyright (c) 2019 Benjamin Meisels 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | #ifndef _ARAMCON_BADGE_2019_H 27 | #define _ARAMCON_BADGE_2019_H 28 | 29 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 30 | 31 | /*------------------------------------------------------------------*/ 32 | /* LED 33 | *------------------------------------------------------------------*/ 34 | #define LEDS_NUMBER 1 35 | #define LED_PRIMARY_PIN _PINNUM(1, 11) // Red 36 | 37 | #define LED_NEOPIXEL _PINNUM(0, 8) 38 | #define NEOPIXELS_NUMBER 4 39 | #define BOARD_RGB_BRIGHTNESS 0x040404 40 | 41 | /*------------------------------------------------------------------*/ 42 | /* BUTTON 43 | *------------------------------------------------------------------*/ 44 | #define BUTTONS_NUMBER 2 45 | #define BUTTON_1 _PINNUM(0, 2) // left Button 46 | #define BUTTON_2 _PINNUM(0, 29) // middle button 47 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 48 | 49 | //--------------------------------------------------------------------+ 50 | // BLE OTA 51 | //--------------------------------------------------------------------+ 52 | #define BLEDIS_MANUFACTURER "ARAMCON Badge Team" 53 | #define BLEDIS_MODEL "ARAMCON Badge 2019" 54 | 55 | //--------------------------------------------------------------------+ 56 | // USB 57 | //--------------------------------------------------------------------+ 58 | #define USB_DESC_VID 0x239A 59 | #define USB_DESC_UF2_PID 0x0079 60 | #define USB_DESC_CDC_ONLY_PID 0x0079 61 | 62 | //------------- UF2 -------------// 63 | #define UF2_PRODUCT_NAME "ARAMCON Badge 2019" 64 | #define UF2_VOLUME_LABEL "ARAMBOOT" 65 | #define UF2_BOARD_ID "nrf52840-ARAMCON-Badge-2019" 66 | #define UF2_INDEX_URL "https://github.com/aramcon-badge" 67 | 68 | #endif // _ARAMCON_BADGE_2019_H 69 | -------------------------------------------------------------------------------- /src/boards/aramcon_badge_2019/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/aramcon_badge_2019/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/arcade_feather_nrf52840_express/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/arcade_feather_nrf52840_express/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | 3 | __attribute__((used, section(".bootloaderConfig"))) 4 | const uint32_t bootloaderConfig[] = { 5 | /* CF2 START */ 6 | 513675505, 539130489, // magic 7 | 49, 100, // used entries, total entries 8 | 4, 0x18, // PIN_BTN_A = PIN_RX 9 | 5, 0xa, // PIN_BTN_B = PIN_D2 10 | 13, 0x29, // PIN_LED = PIN_D13 11 | 18, 0xf, // PIN_MISO = PA15 12 | 19, 0xd, // PIN_MOSI = PA13 13 | 20, 0x23, // PIN_NEOPIXEL = PB03 14 | 21, 0x18, // PIN_RX = PA24 15 | 23, 0xe, // PIN_SCK = PA14 16 | 24, 0xb, // PIN_SCL = PA11 17 | 25, 0xc, // PIN_SDA = PA12 18 | 28, 0x19, // PIN_TX = PA25 19 | 32, 0xe, // PIN_DISPLAY_SCK = PIN_SCK 20 | 34, 0xd, // PIN_DISPLAY_MOSI = PIN_MOSI 21 | 35, 0x1e, // PIN_DISPLAY_CS = PIN_A2 22 | 36, 0x1c, // PIN_DISPLAY_DC = PIN_A3 23 | 37, 0xa0, // DISPLAY_WIDTH = 160 24 | 38, 0x80, // DISPLAY_HEIGHT = 128 25 | 39, 0x80, // DISPLAY_CFG0 = 0x80 26 | 40, 0x603, // DISPLAY_CFG1 = 0x603 27 | 41, 0x20, // DISPLAY_CFG2 = 0x20 28 | 43, 0x2, // PIN_DISPLAY_RST = PIN_A4 29 | 44, 0x3, // PIN_DISPLAY_BL = PIN_A5 30 | 47, 0x6, // PIN_BTN_LEFT = PIN_D11 31 | 48, 0x1a, // PIN_BTN_RIGHT = PIN_D9 32 | 49, 0x1b, // PIN_BTN_UP = PIN_D10 33 | 50, 0x7, // PIN_BTN_DOWN = PIN_D6 34 | 51, 0x8, // PIN_BTN_MENU = PIN_D12 35 | 56, 0x2a, // PIN_LED2 = PB10 36 | 60, 0x19, // PIN_JACK_TX = PIN_TX 37 | 100, 0x4, // PIN_A0 = PA04 38 | 101, 0x5, // PIN_A1 = PA05 39 | 102, 0x1e, // PIN_A2 = PA30 40 | 103, 0x1c, // PIN_A3 = PA28 41 | 104, 0x2, // PIN_A4 = PA02 42 | 105, 0x3, // PIN_A5 = PA03 43 | 152, 0xa, // PIN_D2 = PA10 44 | 155, 0x28, // PIN_D5 = PB08 45 | 156, 0x7, // PIN_D6 = PA07 46 | 159, 0x1a, // PIN_D9 = PA26 47 | 160, 0x1b, // PIN_D10 = PA27 48 | 161, 0x6, // PIN_D11 = PA06 49 | 162, 0x8, // PIN_D12 = PA08 50 | 163, 0x29, // PIN_D13 = PB09 51 | 200, 0x1, // NUM_NEOPIXELS = 1 52 | 204, 0x100000, // FLASH_BYTES = 0x100000 53 | 205, 0x40000, // RAM_BYTES = 0x40000 54 | 208, 0xd7688ea1, // BOOTLOADER_BOARD_ID = 0xd7688ea1 55 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 56 | 210, 0x20, // PINS_PORT_SIZE = PA_32 57 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60 | 0, 0, 0, 0, 0, 0, 61 | /* CF2 END */ 62 | }; 63 | -------------------------------------------------------------------------------- /src/boards/arduino_nano_33_ble/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _ARDUINOBLE33_NRF52840_H 26 | #define _ARDUINOBLE33_NRF52840_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 1 // red LED 34 | #define LED_PRIMARY_PIN _PINNUM(0, 24) 35 | #define LED_STATE_ON 0 36 | 37 | /*------------------------------------------------------------------*/ 38 | /* BUTTON 39 | *------------------------------------------------------------------*/ 40 | #define BUTTONS_NUMBER 2 41 | #define BUTTON_1 _PINNUM(1, 11) // D2 switch 42 | #define BUTTON_2 _PINNUM(1, 12) // D3 switch 43 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 44 | 45 | //--------------------------------------------------------------------+ 46 | // BLE OTA 47 | //--------------------------------------------------------------------+ 48 | #define BLEDIS_MANUFACTURER "Arduino" 49 | #define BLEDIS_MODEL "Nano 33 BLE" 50 | 51 | //--------------------------------------------------------------------+ 52 | // USB 53 | //--------------------------------------------------------------------+ 54 | #define USB_DESC_VID 0x239A 55 | #define USB_DESC_UF2_PID 0x0063 56 | #define USB_DESC_CDC_ONLY_PID 0x0064 57 | 58 | //------------- UF2 -------------// 59 | #define UF2_PRODUCT_NAME "Arduino Nano 33 BLE" 60 | #define UF2_VOLUME_LABEL "NANO33BOOT" 61 | #define UF2_BOARD_ID "nRF52840-Nano-33" 62 | #define UF2_INDEX_URL "https://www.arduino.cc/" 63 | 64 | #endif // _ITSY_NRF52840_H 65 | -------------------------------------------------------------------------------- /src/boards/arduino_nano_33_ble/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/arduino_nano_33_ble/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/bast_ble/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _BASTBLE_NRF52840_H 26 | #define _BASTBLE_NRF52840_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | /*------------------------------------------------------------------*/ 30 | /* LED 31 | *------------------------------------------------------------------*/ 32 | #define LEDS_NUMBER 1 // red LED 33 | #define LED_PRIMARY_PIN _PINNUM(0, 24) 34 | #define LED_STATE_ON 0 35 | 36 | /*------------------------------------------------------------------*/ 37 | /* BUTTON 38 | *------------------------------------------------------------------*/ 39 | #define BUTTONS_NUMBER 2 40 | #define BUTTON_1 _PINNUM(0, 05) 41 | #define BUTTON_2 _PINNUM(0, 10) 42 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 43 | 44 | //--------------------------------------------------------------------+ 45 | // BLE OTA 46 | //--------------------------------------------------------------------+ 47 | #define BLEDIS_MANUFACTURER "ElectronicCats" 48 | #define BLEDIS_MODEL "BastBLE" 49 | 50 | //--------------------------------------------------------------------+ 51 | // USB 52 | //--------------------------------------------------------------------+ 53 | 54 | // Shared VID/PID with Feather nRF52840, will be disabled for building in the future 55 | #define USB_DESC_VID 0x1209 56 | #define USB_DESC_UF2_PID 0x805A 57 | #define USB_DESC_CDC_ONLY_PID 0x805A 58 | 59 | #define UF2_PRODUCT_NAME "Bast BLE" 60 | #define UF2_VOLUME_LABEL "BASTBLE" 61 | #define UF2_BOARD_ID "Bast-ble-v1" 62 | #define UF2_INDEX_URL "https://www.electroniccats.com" 63 | 64 | #endif // _BASTBLE_NRF52840_H 65 | -------------------------------------------------------------------------------- /src/boards/bast_ble/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/bast_ble/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/bluemicro_nrf52833/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52833 2 | SD_VERSION=7.2.0 3 | -------------------------------------------------------------------------------- /src/boards/bluemicro_nrf52833/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x80000, // FLASH_BYTES 12 | 205, 0x20000, // RAM_BYTES 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0x621e937a, // UF2_FAMILY = 0x621e937a 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/bluemicro_nrf52840/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Pierre Constantineau 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _BLUEMICRO_NRF52840_H 26 | #define _BLUEMICRO_NRF52840_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 2 34 | #define LED_PRIMARY_PIN _PINNUM(1, 4) 35 | #define LED_SECONDARY_PIN _PINNUM(1, 10) 36 | #define LED_STATE_ON 1 37 | 38 | /*------------------------------------------------------------------*/ 39 | /* BUTTON 40 | *------------------------------------------------------------------*/ 41 | #define BUTTONS_NUMBER 2 // none connected at all 42 | #define BUTTON_1 _PINNUM(0, 18) // unusable: RESET 43 | #define BUTTON_2 _PINNUM(1, 1) // no connection on E73-2G4M08S1C Module 44 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 45 | 46 | //--------------------------------------------------------------------+ 47 | // BLE OTA 48 | //--------------------------------------------------------------------+ 49 | #define BLEDIS_MANUFACTURER "BlueMicro" 50 | #define BLEDIS_MODEL "BlueMicro 840" 51 | 52 | //--------------------------------------------------------------------+ 53 | // USB PID from openmoko: 54 | // Approved PR https://github.com/openmoko/openmoko-usb-oui/pull/20 55 | //--------------------------------------------------------------------+ 56 | #define USB_DESC_VID 0x1d50 57 | #define USB_DESC_UF2_PID 0x6160 58 | #define USB_DESC_CDC_ONLY_PID 0x6160 59 | 60 | #define UF2_PRODUCT_NAME "BlueMicro" 61 | #define UF2_VOLUME_LABEL "BLUEMICRO" 62 | #define UF2_BOARD_ID "nRF52840-BlueMicro-v1" 63 | #define UF2_INDEX_URL "http://bluemicro.jpconstantineau.com/" 64 | 65 | #endif // _BLUEMICRO_H 66 | -------------------------------------------------------------------------------- /src/boards/bluemicro_nrf52840/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/bluemicro_nrf52840/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/challenger_840_ble/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/challenger_840_ble/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "board.h" 3 | #include "uf2/configkeys.h" 4 | 5 | __attribute__((used, section(".bootloaderConfig"))) 6 | const uint32_t bootloaderConfig[] = 7 | { 8 | /* CF2 START */ 9 | CFG_MAGIC0, CFG_MAGIC1, // magic 10 | 5, 100, // used entries, total entries 11 | 12 | 204, 0x100000, // FLASH_BYTES = 0x100000 13 | 205, 0x40000, // RAM_BYTES = 0x40000 14 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 15 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 16 | 210, 0x20, // PINS_PORT_SIZE = PA_32 17 | 18 | 0, 0, 0, 0, 0, 0, 0, 0 19 | /* CF2 END */ 20 | }; 21 | 22 | void board_init2(void) 23 | { 24 | // Turn LDO on 25 | nrf_gpio_cfg_output(LDO_CONTROL_PIN); 26 | nrf_gpio_pin_write(LDO_CONTROL_PIN, 1); 27 | } 28 | -------------------------------------------------------------------------------- /src/boards/circuitplayground_nrf52840/board.cmake: -------------------------------------------------------------------------------- 1 | set(MCU_VARIANT nrf52840) 2 | -------------------------------------------------------------------------------- /src/boards/circuitplayground_nrf52840/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _CPLAY_NRF52840_H 26 | #define _CPLAY_NRF52840_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 1 34 | #define LED_PRIMARY_PIN _PINNUM(1, 14) 35 | #define LED_STATE_ON 1 36 | 37 | #define LED_NEOPIXEL _PINNUM(0, 13) 38 | #define NEOPIXELS_NUMBER 10 39 | #define BOARD_RGB_BRIGHTNESS 0x040404 40 | 41 | /*------------------------------------------------------------------*/ 42 | /* BUTTON 43 | *------------------------------------------------------------------*/ 44 | #define BUTTONS_NUMBER 2 45 | #define BUTTON_1 _PINNUM(1, 02) // left button 46 | #define BUTTON_2 _PINNUM(1, 15) // right button 47 | #define BUTTON_PULL NRF_GPIO_PIN_PULLDOWN 48 | 49 | //--------------------------------------------------------------------+ 50 | // BLE OTA 51 | //--------------------------------------------------------------------+ 52 | #define BLEDIS_MANUFACTURER "Adafruit Industries" 53 | #define BLEDIS_MODEL "Circuit Playground nRF52840" 54 | 55 | //--------------------------------------------------------------------+ 56 | // USB 57 | //--------------------------------------------------------------------+ 58 | #define USB_DESC_VID 0x239A 59 | #define USB_DESC_UF2_PID 0x0045 60 | #define USB_DESC_CDC_ONLY_PID 0x0045 61 | 62 | //------------- UF2 -------------// 63 | #define UF2_PRODUCT_NAME "Adafruit Circuit Playground nRF52840" 64 | #define UF2_VOLUME_LABEL "CPLAYBTBOOT" 65 | #define UF2_BOARD_ID "nRF52840-CircuitPlayground-revD" 66 | #define UF2_INDEX_URL "https://www.adafruit.com/product/4333" 67 | 68 | #endif // _CPLAY_NRF52840_H 69 | -------------------------------------------------------------------------------- /src/boards/circuitplayground_nrf52840/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/circuitplayground_nrf52840/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/clue_nrf52840/board.cmake: -------------------------------------------------------------------------------- 1 | set(MCU_VARIANT nrf52840) 2 | -------------------------------------------------------------------------------- /src/boards/clue_nrf52840/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/clue_nrf52840/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/ebyte_e104_bt5032a/board.mk: -------------------------------------------------------------------------------- 1 | # nrf52 is nrf52832 2 | MCU_SUB_VARIANT = nrf52 3 | -------------------------------------------------------------------------------- /src/boards/ebyte_e73_tbb/board.mk: -------------------------------------------------------------------------------- 1 | # nrf52 is nrf52832 2 | MCU_SUB_VARIANT = nrf52 3 | -------------------------------------------------------------------------------- /src/boards/electronut_labs_papyr/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * @author Tavish Naruka 5 | * 6 | * Copyright (c) 2018 Adafruit Industries 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in 16 | * all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | * THE SOFTWARE. 25 | */ 26 | 27 | #ifndef PAPYR_H 28 | #define PAPYR_H 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 2 34 | #define LED_PRIMARY_PIN 13 35 | #define LED_SECONDARY_PIN 14 36 | #define LED_STATE_ON 0 37 | 38 | /*------------------------------------------------------------------*/ 39 | /* BUTTON 40 | *------------------------------------------------------------------*/ 41 | // NOTE: USB UF2 bootloader can be triggered by double pressing RESET 42 | // App can trigger OTA bootloader by writing DFU_MAGIC_OTA_APPJUM to 43 | // GPREGRET register if softdevice is not initialized; or by 44 | // writing DFU_MAGIC_OTA_RESET in case softdevice is initialized. 45 | #define BUTTONS_NUMBER 2 46 | #define BUTTON_1 18 // RESET also by default 47 | #define BUTTON_2 1 // P0.1 not exposed anywhere, FRST n/a 48 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 49 | 50 | //--------------------------------------------------------------------+ 51 | // BLE OTA 52 | //--------------------------------------------------------------------+ 53 | #define BLEDIS_MANUFACTURER "Electronut Labs" 54 | #define BLEDIS_MODEL "Papyr" 55 | 56 | //--------------------------------------------------------------------+ 57 | // USB 58 | //--------------------------------------------------------------------+ 59 | #define UF2_PRODUCT_NAME "Electronut Labs Papyr" 60 | #define UF2_BOARD_ID "nRF52840-Papyr-v1" 61 | #define UF2_INDEX_URL "https://docs.electronut.in/papyr" 62 | 63 | #define USB_DESC_VID 0x239A 64 | #define USB_DESC_UF2_PID 0x003B 65 | #define USB_DESC_CDC_ONLY_PID 0x003B 66 | 67 | #endif // PPAPYR_H 68 | -------------------------------------------------------------------------------- /src/boards/electronut_labs_papyr/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/electronut_labs_papyr/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52832/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _FEATHER_NRF52832_H 26 | #define _FEATHER_NRF52832_H 27 | 28 | /*------------------------------------------------------------------*/ 29 | /* LED 30 | *------------------------------------------------------------------*/ 31 | #define LEDS_NUMBER 2 32 | #define LED_PRIMARY_PIN 17 // Red 33 | #define LED_SECONDARY_PIN 19 // Blue 34 | #define LED_STATE_ON 1 35 | 36 | /*------------------------------------------------------------------*/ 37 | /* BUTTON 38 | *------------------------------------------------------------------*/ 39 | #define BUTTONS_NUMBER 2 40 | #define BUTTON_1 20 41 | #define BUTTON_2 22 42 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 43 | 44 | /*------------------------------------------------------------------*/ 45 | /* UART (only used by nRF52832) 46 | *------------------------------------------------------------------*/ 47 | #define RX_PIN_NUMBER 8 48 | #define TX_PIN_NUMBER 6 49 | #define CTS_PIN_NUMBER 0 50 | #define RTS_PIN_NUMBER 0 51 | #define HWFC false 52 | 53 | //--------------------------------------------------------------------+ 54 | // BLE OTA 55 | //--------------------------------------------------------------------+ 56 | #define BLEDIS_MANUFACTURER "Adafruit Industries" 57 | #define BLEDIS_MODEL "Feather nRF52832" 58 | 59 | #define UF2_PRODUCT_NAME "Adafruit Feather nRF52832" 60 | #define UF2_INDEX_URL "https://www.adafruit.com/product/3406" 61 | 62 | #endif // _FEATHER_NRF52832_H 63 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52832/board.mk: -------------------------------------------------------------------------------- 1 | # nrf52 is nrf52832 2 | MCU_SUB_VARIANT = nrf52 3 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52833_express/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52833 2 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52833_express/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x80000, // FLASH_BYTES 12 | 205, 0x20000, // RAM_BYTES 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0x621e937a, // UF2_FAMILY 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52840_express/board.cmake: -------------------------------------------------------------------------------- 1 | set(MCU_VARIANT nrf52840) 2 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52840_express/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52840_express/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52840_sense/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52840_sense/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52840_sense_tft/board.cmake: -------------------------------------------------------------------------------- 1 | set(MCU_VARIANT nrf52840) 2 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52840_sense_tft/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/feather_nrf52840_sense_tft/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/ikigaisense_vita/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/ikigaisense_vita/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/itsybitsy_nrf52840_express/board.cmake: -------------------------------------------------------------------------------- 1 | set(MCU_VARIANT nrf52840) 2 | -------------------------------------------------------------------------------- /src/boards/itsybitsy_nrf52840_express/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/itsybitsy_nrf52840_express/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 31, 100, // used entries, total entries 10 | 4, 0x1d, // PIN_BTN_A = PA29 11 | 7, 0x29, // PIN_DOTSTAR_CLOCK = PB09 12 | 8, 0x8, // PIN_DOTSTAR_DATA = PA08 13 | 13, 0x6, // PIN_LED = PA06 14 | 18, 0x14, // PIN_MISO = PA20 15 | 19, 0xf, // PIN_MOSI = PA15 16 | 21, 0x19, // PIN_RX = PA25 17 | 23, 0xd, // PIN_SCK = PA13 18 | 24, 0xe, // PIN_SCL = PA14 19 | 25, 0x10, // PIN_SDA = PA16 20 | 28, 0x18, // PIN_TX = PA24 21 | 100, 0x4, // PIN_A0 = PA04 22 | 101, 0x1e, // PIN_A1 = PA30 23 | 102, 0x1c, // PIN_A2 = PA28 24 | 103, 0x1f, // PIN_A3 = PA31 25 | 104, 0x2, // PIN_A4 = PA02 26 | 105, 0x3, // PIN_A5 = PA03 27 | 152, 0x22, // PIN_D2 = PB02 28 | 155, 0x1b, // PIN_D5 = PA27 29 | 157, 0x28, // PIN_D7 = PB08 30 | 159, 0x7, // PIN_D9 = PA07 31 | 160, 0x5, // PIN_D10 = PA05 32 | 161, 0x1a, // PIN_D11 = PA26 33 | 162, 0xb, // PIN_D12 = PA11 34 | 163, 0xc, // PIN_D13 = PA12 35 | 201, 0x1, // NUM_DOTSTARS = 1 36 | 204, 0x100000, // FLASH_BYTES = 0x100000 37 | 205, 0x40000, // RAM_BYTES = 0x40000 38 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 39 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 40 | 210, 0x20, // PINS_PORT_SIZE = PA_32 41 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46 | /* CF2 END */ 47 | }; 48 | -------------------------------------------------------------------------------- /src/boards/ledglasses_nrf52840/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _LEDGLASSES_NRF52840_H 26 | #define _LEDGLASSES_NRF52840_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 1 34 | #define LED_PRIMARY_PIN _PINNUM(0, 31) 35 | #define LED_STATE_ON 1 36 | 37 | #define LED_NEOPIXEL _PINNUM(1, 15) 38 | #define NEOPIXELS_NUMBER 1 39 | #define BOARD_RGB_BRIGHTNESS 0x040404 40 | 41 | /*------------------------------------------------------------------*/ 42 | /* BUTTON 43 | *------------------------------------------------------------------*/ 44 | #define BUTTONS_NUMBER 2 45 | #define BUTTON_1 _PINNUM(0, 30) // user switch 46 | #define BUTTON_2 _PINNUM(0, 28) // NC 47 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 48 | 49 | //--------------------------------------------------------------------+ 50 | // BLE OTA 51 | //--------------------------------------------------------------------+ 52 | #define BLEDIS_MANUFACTURER "Adafruit Industries" 53 | #define BLEDIS_MODEL "LED Glasses Driver nRF52840" 54 | 55 | //--------------------------------------------------------------------+ 56 | // USB 57 | //--------------------------------------------------------------------+ 58 | #define USB_DESC_VID 0x239A 59 | #define USB_DESC_UF2_PID 0x010D 60 | #define USB_DESC_CDC_ONLY_PID 0x010E 61 | 62 | //------------- UF2 -------------// 63 | #define UF2_PRODUCT_NAME "Adafruit LED Glasses Driver nRF52840" 64 | #define UF2_VOLUME_LABEL "GLASSESBOOT" 65 | #define UF2_BOARD_ID "nRF52840-LedGlasses-revA" 66 | #define UF2_INDEX_URL "https://www.adafruit.com/product/5217" 67 | 68 | #endif // _LEDGLASSES_NRF52840_H 69 | -------------------------------------------------------------------------------- /src/boards/ledglasses_nrf52840/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/ledglasses_nrf52840/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/m60_keyboard/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | USE_NFCT = yes 3 | -------------------------------------------------------------------------------- /src/boards/m60_keyboard/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "board.h" 3 | #include "uf2/configkeys.h" 4 | 5 | __attribute__((used, section(".bootloaderConfig"))) 6 | const uint32_t bootloaderConfig[] = 7 | { 8 | /* CF2 START */ 9 | CFG_MAGIC0, CFG_MAGIC1, // magic 10 | 5, 100, // used entries, total entries 11 | 12 | 204, 0x100000, // FLASH_BYTES = 0x100000 13 | 205, 0x40000, // RAM_BYTES = 0x40000 14 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 15 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 16 | 210, 0x20, // PINS_PORT_SIZE = PA_32 17 | 18 | 0, 0, 0, 0, 0, 0, 0, 0 19 | /* CF2 END */ 20 | }; 21 | 22 | static void power_on(void) 23 | { 24 | // Turn on the regulator 25 | nrf_gpio_cfg_output(LDO_CONTROL_PIN); 26 | nrf_gpio_pin_write(LDO_CONTROL_PIN, 1); 27 | } 28 | 29 | void board_init2(void) 30 | { 31 | power_on(); 32 | 33 | // configure P0.05 for ESC/BUTTON_2 34 | // P0.05 --- |<- --- / --- P0.19 35 | // diode sw(esc) 36 | // mode: output, push-pull, low 37 | nrf_gpio_cfg( 38 | _PINNUM(0, 5), 39 | NRF_GPIO_PIN_DIR_OUTPUT, 40 | NRF_GPIO_PIN_INPUT_DISCONNECT, 41 | NRF_GPIO_PIN_NOPULL, 42 | NRF_GPIO_PIN_H0D1, 43 | NRF_GPIO_PIN_NOSENSE 44 | ); 45 | nrf_gpio_pin_write(_PINNUM(0, 5), 0); 46 | 47 | // Wait the buttons stable. 48 | // This is mandatory, or the keyboard will enter bootloader whenever 49 | // booted by pressing the button at back (same with BUTTON_1) 50 | NRFX_DELAY_MS(300); 51 | } 52 | 53 | void board_teardown2(void) 54 | { 55 | // re-enable the battery 56 | power_on(); 57 | } -------------------------------------------------------------------------------- /src/boards/mbn52832dk/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _MBN52832DK_H 26 | #define _MBN52832DK_H 27 | 28 | /*------------------------------------------------------------------*/ 29 | /* LED 30 | *------------------------------------------------------------------*/ 31 | #define LEDS_NUMBER 2 32 | #define LED_PRIMARY_PIN 17 // LED1 33 | #define LED_SECONDARY_PIN 18 // LED2 34 | #define LED_STATE_ON 1 35 | 36 | /*------------------------------------------------------------------*/ 37 | /* BUTTON 38 | *------------------------------------------------------------------*/ 39 | #define BUTTONS_NUMBER 2 40 | #define BUTTON_1 13 41 | #define BUTTON_2 14 42 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 43 | 44 | /*------------------------------------------------------------------*/ 45 | /* UART (only used by nRF52832) 46 | *------------------------------------------------------------------*/ 47 | #define RX_PIN_NUMBER 8 48 | #define TX_PIN_NUMBER 6 49 | #define CTS_PIN_NUMBER 0 50 | #define RTS_PIN_NUMBER 0 51 | #define HWFC false 52 | 53 | //--------------------------------------------------------------------+ 54 | // BLE OTA 55 | //--------------------------------------------------------------------+ 56 | #define BLEDIS_MANUFACTURER "Murata" 57 | #define BLEDIS_MODEL "MBN52832DK" 58 | 59 | #define UF2_BOARD_ID "nRF52832-MBN52832DK-v1" 60 | #define UF2_PRODUCT_NAME "Murata MBN52832DK" 61 | #define UF2_INDEX_URL "https://www.murata.com/ja-jp/products/connectivitymodule/bluetooth/overview/lineup/mbn52832" 62 | 63 | #endif // _MBN52832DK_H 64 | -------------------------------------------------------------------------------- /src/boards/mbn52832dk/board.mk: -------------------------------------------------------------------------------- 1 | # nrf52 is nrf52832 2 | MCU_SUB_VARIANT = nrf52 3 | -------------------------------------------------------------------------------- /src/boards/mdk_nrf52840_dongle/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/mdk_nrf52840_dongle/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/metro_nrf52840_express/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _METRO_NRF52840_H_ 26 | #define _METRO_NRF52840_H_ 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 2 34 | #define LED_PRIMARY_PIN _PINNUM(1, 13) 35 | #define LED_SECONDARY_PIN _PINNUM(1, 15) 36 | #define LED_STATE_ON 1 37 | 38 | #define LED_NEOPIXEL _PINNUM(0, 13) 39 | #define NEOPIXELS_NUMBER 1 40 | #define BOARD_RGB_BRIGHTNESS 0x040404 41 | 42 | /*------------------------------------------------------------------*/ 43 | /* BUTTON 44 | *------------------------------------------------------------------*/ 45 | #define BUTTONS_NUMBER 2 46 | #define BUTTON_1 _PINNUM(1, 0) 47 | #define BUTTON_2 _PINNUM(2, 2) 48 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 49 | 50 | //--------------------------------------------------------------------+ 51 | // BLE OTA 52 | //--------------------------------------------------------------------+ 53 | #define BLEDIS_MANUFACTURER "Adafruit Industries" 54 | #define BLEDIS_MODEL "Metro nRF52840 Express" 55 | 56 | //--------------------------------------------------------------------+ 57 | // USB 58 | //--------------------------------------------------------------------+ 59 | #define USB_DESC_VID 0x239A 60 | #define USB_DESC_UF2_PID 0x003F 61 | #define USB_DESC_CDC_ONLY_PID 0x0040 62 | 63 | //------------- UF2 -------------// 64 | #define UF2_PRODUCT_NAME "Adafruit Metro nRF52840 Express" 65 | #define UF2_VOLUME_LABEL "METR840BOOT" 66 | #define UF2_BOARD_ID "nRF52840-Metro-revA" 67 | 68 | #define UF2_INDEX_URL "https://www.adafruit.com/" 69 | 70 | #endif /* _METRO_NRF52840_H_ */ 71 | -------------------------------------------------------------------------------- /src/boards/metro_nrf52840_express/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/metro_nrf52840_express/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/mikoto/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2021 Hai-Ninh Dang 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _MIKOTO_H 26 | #define _MIKOTO_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3 31 | 32 | /*------------------------------------------------------------------*/ 33 | /* LED 34 | *------------------------------------------------------------------*/ 35 | #define LEDS_NUMBER 1 36 | #define LED_PRIMARY_PIN _PINNUM(0, 15) // Blue 37 | #define LED_STATE_ON 1 38 | 39 | /*------------------------------------------------------------------*/ 40 | /* BUTTON 41 | *------------------------------------------------------------------*/ 42 | #define BUTTONS_NUMBER 2 // none connected at all 43 | #define BUTTON_1 _PINNUM(0, 18) // unusable: RESET 44 | #define BUTTON_2 _PINNUM(0, 19) // no connection 45 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 46 | 47 | //--------------------------------------------------------------------+ 48 | // BLE OTA 49 | //--------------------------------------------------------------------+ 50 | #define BLEDIS_MANUFACTURER "zhiayang" 51 | #define BLEDIS_MODEL "mikoto" 52 | 53 | //--------------------------------------------------------------------+ 54 | // USB 55 | //--------------------------------------------------------------------+ 56 | #define USB_DESC_VID 0x1209 57 | #define USB_DESC_UF2_PID 0x7A01 58 | #define USB_DESC_CDC_ONLY_PID 0x7A01 59 | 60 | #define UF2_PRODUCT_NAME "Mikoto nRF52840" 61 | #define UF2_VOLUME_LABEL "MIKOTO-BOOT" 62 | #define UF2_BOARD_ID "nRF52840-mikoto-rev520" 63 | #define UF2_INDEX_URL "https://github.com/zhiayang/mikoto" 64 | 65 | #endif // _MIKOTO_H 66 | -------------------------------------------------------------------------------- /src/boards/mikoto/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/mikoto/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/nRF52840_connect_kit/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | USE_NFCT = yes 3 | -------------------------------------------------------------------------------- /src/boards/nRF52840_connect_kit/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/nice_nano/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Nick Winans 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _NICENANO_H 26 | #define _NICENANO_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3 31 | 32 | /*------------------------------------------------------------------*/ 33 | /* LED 34 | *------------------------------------------------------------------*/ 35 | #define LEDS_NUMBER 1 36 | #define LED_PRIMARY_PIN _PINNUM(0, 15) // Blue 37 | #define LED_STATE_ON 1 38 | 39 | /*------------------------------------------------------------------*/ 40 | /* BUTTON 41 | *------------------------------------------------------------------*/ 42 | #define BUTTONS_NUMBER 2 // none connected at all 43 | #define BUTTON_1 _PINNUM(0, 18) // unusable: RESET 44 | #define BUTTON_2 _PINNUM(0, 19) // no connection 45 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 46 | 47 | //--------------------------------------------------------------------+ 48 | // BLE OTA 49 | //--------------------------------------------------------------------+ 50 | #define BLEDIS_MANUFACTURER "Nice Keyboards" 51 | #define BLEDIS_MODEL "nice!nano" 52 | 53 | //--------------------------------------------------------------------+ 54 | // USB 55 | //--------------------------------------------------------------------+ 56 | #define USB_DESC_VID 0x239A 57 | #define USB_DESC_UF2_PID 0x00B3 58 | #define USB_DESC_CDC_ONLY_PID 0x00B3 59 | 60 | #define UF2_PRODUCT_NAME "nice!nano" 61 | #define UF2_VOLUME_LABEL "NICENANO" 62 | #define UF2_BOARD_ID "nRF52840-nicenano" 63 | #define UF2_INDEX_URL "https://nicekeyboards.com/docs/nice-nano" 64 | 65 | #endif // _NICENANO_H 66 | -------------------------------------------------------------------------------- /src/boards/nice_nano/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/nice_nano/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/nrf52840_bboard/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/nrf52840_bboard/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; -------------------------------------------------------------------------------- /src/boards/nrf52840_m2/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | USE_NFCT = yes 3 | -------------------------------------------------------------------------------- /src/boards/nrf52840_m2/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/nrfmicro/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _NRFMICRO_NRF52840 26 | #define _NRFMICRO_NRF52840 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 1 34 | #define LED_PRIMARY_PIN _PINNUM(1, 10) 35 | #define LED_STATE_ON 1 // State when LED is lit (active HIGH) 36 | 37 | #define NEOPIXELS_NUMBER 0 38 | 39 | /*------------------------------------------------------------------*/ 40 | /* BUTTON 41 | *------------------------------------------------------------------*/ 42 | #define BUTTONS_NUMBER 2 43 | #define BUTTON_1 _PINNUM(1, 2) // DFU 44 | #define BUTTON_2 _PINNUM(0, 12) // FRST 45 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 46 | 47 | //--------------------------------------------------------------------+ 48 | // BLE OTA 49 | //--------------------------------------------------------------------+ 50 | #define BLEDIS_MANUFACTURER "nRFMicro" 51 | #define BLEDIS_MODEL "nRFMicro nRF52840" 52 | 53 | //--------------------------------------------------------------------+ 54 | // USB 55 | //--------------------------------------------------------------------+ 56 | #define USB_DESC_VID 0x1209 57 | #define USB_DESC_UF2_PID 0x5284 58 | #define USB_DESC_CDC_ONLY_PID 0x5284 59 | 60 | //------------- UF2 -------------// 61 | #define UF2_PRODUCT_NAME "nRFMicro" 62 | #define UF2_VOLUME_LABEL "NRFMICRO" 63 | #define UF2_BOARD_ID "nRF52840-nRFMicro-v0" 64 | #define UF2_INDEX_URL "https://github.com/joric/nrfmicro/wiki" 65 | 66 | #endif // _NRFMICRO_NRF52840 67 | -------------------------------------------------------------------------------- /src/boards/nrfmicro/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | SD_VERSION = 7.3.0 -------------------------------------------------------------------------------- /src/boards/nrfmicro/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; -------------------------------------------------------------------------------- /src/boards/ohs2020_badge/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * Copyright (c) 2020 Michael Welling 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | #ifndef _OHS2020_BADGE_H 27 | #define _OHS2020_BADGE_H 28 | 29 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 30 | 31 | /*------------------------------------------------------------------*/ 32 | /* LED 33 | *------------------------------------------------------------------*/ 34 | #define LEDS_NUMBER 1 35 | #define LED_PRIMARY_PIN _PINNUM(0, 04) // fake LED since we have none 36 | #define LED_STATE_ON 1 37 | 38 | /*------------------------------------------------------------------*/ 39 | /* BUTTON 40 | *------------------------------------------------------------------*/ 41 | #define BUTTONS_NUMBER 2 42 | #define BUTTON_1 _PINNUM(0, 29) // SW2 43 | #define BUTTON_2 _PINNUM(0, 03) // SW1 44 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 45 | 46 | //--------------------------------------------------------------------+ 47 | // BLE OTA 48 | //--------------------------------------------------------------------+ 49 | #define BLEDIS_MANUFACTURER "OSHWA" 50 | #define BLEDIS_MODEL "OHS2020 Badge" 51 | 52 | //--------------------------------------------------------------------+ 53 | // USB 54 | //--------------------------------------------------------------------+ 55 | #define USB_DESC_VID 0x239A 56 | #define USB_DESC_UF2_PID 0x007F 57 | #define USB_DESC_CDC_ONLY_PID 0x007F 58 | 59 | //------------- UF2 -------------// 60 | #define UF2_PRODUCT_NAME "OHS2020 Badge" 61 | #define UF2_VOLUME_LABEL "BADGEBOOT" 62 | #define UF2_BOARD_ID "OHS2020-Badge-revA" 63 | #define UF2_INDEX_URL "https://2020.oshwa.org/" 64 | 65 | #endif // _OHS2020_BADGE_H 66 | -------------------------------------------------------------------------------- /src/boards/ohs2020_badge/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/ohs2020_badge/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/particle_argon/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _PARTICLE_ARGON_H 26 | #define _PARTICLE_ARGON_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 1 34 | #define LED_PRIMARY_PIN _PINNUM(1, 12) 35 | #define LED_STATE_ON 1 36 | 37 | #define LED_RGB_RED_PIN _PINNUM(0, 13) 38 | #define LED_RGB_GREEN_PIN _PINNUM(0, 14) 39 | #define LED_RGB_BLUE_PIN _PINNUM(0, 15) 40 | #define BOARD_RGB_BRIGHTNESS 0x202020 41 | 42 | /*------------------------------------------------------------------*/ 43 | /* BUTTON 44 | *------------------------------------------------------------------*/ 45 | #define BUTTONS_NUMBER 2 46 | #define BUTTON_DFU _PINNUM(0, 11) 47 | #define BUTTON_FRESET _PINNUM(0, 03) // A0 48 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 49 | 50 | //--------------------------------------------------------------------+ 51 | // BLE OTA 52 | //--------------------------------------------------------------------+ 53 | #define BLEDIS_MANUFACTURER "Particle Industries" 54 | #define BLEDIS_MODEL "Argon" 55 | 56 | //--------------------------------------------------------------------+ 57 | // USB 58 | //--------------------------------------------------------------------+ 59 | 60 | // Shared VID/PID with pca10056 61 | #define USB_DESC_VID 0x239A 62 | #define USB_DESC_UF2_PID 0x00DA 63 | #define USB_DESC_CDC_ONLY_PID 0x00DA 64 | 65 | #define UF2_PRODUCT_NAME "Particle Argon" 66 | #define UF2_VOLUME_LABEL "ARGONBOOT " 67 | #define UF2_BOARD_ID "nRF52840-Argon-v1" 68 | #define UF2_INDEX_URL "https://www.particle.io/mesh/" 69 | 70 | #endif // _PARTICLE_ARGON_H 71 | -------------------------------------------------------------------------------- /src/boards/particle_argon/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/particle_argon/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/particle_boron/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _PARTICLE_BORON_H 26 | #define _PARTICLE_BORON_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 1 34 | #define LED_PRIMARY_PIN _PINNUM(1, 12) 35 | #define LED_STATE_ON 1 36 | 37 | #define LED_RGB_RED_PIN _PINNUM(0, 13) 38 | #define LED_RGB_GREEN_PIN _PINNUM(0, 14) 39 | #define LED_RGB_BLUE_PIN _PINNUM(0, 15) 40 | #define BOARD_RGB_BRIGHTNESS 0x202020 41 | 42 | /*------------------------------------------------------------------*/ 43 | /* BUTTON 44 | *------------------------------------------------------------------*/ 45 | #define BUTTONS_NUMBER 2 46 | #define BUTTON_DFU _PINNUM(0, 11) 47 | #define BUTTON_FRESET _PINNUM(0, 03) // A0 48 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 49 | 50 | //--------------------------------------------------------------------+ 51 | // BLE OTA 52 | //--------------------------------------------------------------------+ 53 | #define BLEDIS_MANUFACTURER "Particle Industries" 54 | #define BLEDIS_MODEL "Boron" 55 | 56 | //--------------------------------------------------------------------+ 57 | // USB 58 | //--------------------------------------------------------------------+ 59 | 60 | // Shared VID/PID with pca10056 61 | #define USB_DESC_VID 0x239A 62 | #define USB_DESC_UF2_PID 0x00DA 63 | #define USB_DESC_CDC_ONLY_PID 0x00DA 64 | 65 | #define UF2_PRODUCT_NAME "Particle Boron" 66 | #define UF2_VOLUME_LABEL "BORONBOOT " 67 | #define UF2_BOARD_ID "nRF52840-Boron-v1" 68 | #define UF2_INDEX_URL "https://www.particle.io/mesh/" 69 | 70 | #endif // _PARTICLE_BORON_H 71 | -------------------------------------------------------------------------------- /src/boards/particle_boron/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/particle_boron/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/particle_xenon/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/particle_xenon/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/pca10056/board.cmake: -------------------------------------------------------------------------------- 1 | set(MCU_VARIANT nrf52840) 2 | -------------------------------------------------------------------------------- /src/boards/pca10056/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef PCA10056_H 26 | #define PCA10056_H 27 | 28 | /*------------------------------------------------------------------*/ 29 | /* LED 30 | *------------------------------------------------------------------*/ 31 | #define LEDS_NUMBER 2 32 | #define LED_PRIMARY_PIN 13 33 | #define LED_SECONDARY_PIN 14 34 | #define LED_STATE_ON 0 35 | 36 | /*------------------------------------------------------------------*/ 37 | /* BUTTON 38 | *------------------------------------------------------------------*/ 39 | #define BUTTONS_NUMBER 2 40 | #define BUTTON_1 11 41 | #define BUTTON_2 12 42 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 43 | 44 | //--------------------------------------------------------------------+ 45 | // BLE OTA 46 | //--------------------------------------------------------------------+ 47 | #define BLEDIS_MANUFACTURER "Nordic" 48 | #define BLEDIS_MODEL "PCA10056" 49 | 50 | //--------------------------------------------------------------------+ 51 | // USB 52 | //--------------------------------------------------------------------+ 53 | 54 | // Shared VID/PID with Feather nRF52840, will be disabled for building in the future 55 | #define USB_DESC_VID 0x239A 56 | #define USB_DESC_UF2_PID 0x00DA 57 | #define USB_DESC_CDC_ONLY_PID 0x00DA 58 | 59 | #define UF2_PRODUCT_NAME "Nordic nRF52840 DK" 60 | #define UF2_BOARD_ID "nRF52840-pca10056-v1" 61 | #define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK" 62 | 63 | #endif // PCA10056_H 64 | -------------------------------------------------------------------------------- /src/boards/pca10056/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/pca10056/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/pca10059/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef PCA10059_H 26 | #define PCA10059_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 2 34 | #define LED_PRIMARY_PIN 6 // Red 35 | #define LED_SECONDARY_PIN 12 // Blue 36 | #define LED_STATE_ON 0 37 | 38 | /*------------------------------------------------------------------*/ 39 | /* BUTTON 40 | *------------------------------------------------------------------*/ 41 | #define BUTTONS_NUMBER 2 42 | 43 | #define BUTTON_1 _PINNUM(1, 6) 44 | #define BUTTON_2 _PINNUM(1, 10) 45 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 46 | 47 | //--------------------------------------------------------------------+ 48 | // BLE OTA 49 | //--------------------------------------------------------------------+ 50 | #define BLEDIS_MANUFACTURER "Nordic" 51 | #define BLEDIS_MODEL "PCA10059" 52 | 53 | //--------------------------------------------------------------------+ 54 | // USB 55 | //--------------------------------------------------------------------+ 56 | 57 | // Shared VID/PID with Feather nRF52840, will be disabled for building in the future 58 | #define USB_DESC_VID 0x239A 59 | #define USB_DESC_UF2_PID 0x0029 60 | #define USB_DESC_CDC_ONLY_PID 0x0029 61 | 62 | #define UF2_PRODUCT_NAME "Nordic nRF52840 Dongle" 63 | #define UF2_BOARD_ID "nRF52840-pca10059-v1" 64 | #define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-Dongle" 65 | 66 | #endif // PCA10059_H 67 | -------------------------------------------------------------------------------- /src/boards/pca10059/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/pca10059/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/pca10100/board.cmake: -------------------------------------------------------------------------------- 1 | set(MCU_VARIANT nrf52833) 2 | -------------------------------------------------------------------------------- /src/boards/pca10100/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef PCA10100_H 26 | #define PCA10100_H 27 | 28 | /*------------------------------------------------------------------*/ 29 | /* LED 30 | *------------------------------------------------------------------*/ 31 | #define LEDS_NUMBER 2 32 | #define LED_PRIMARY_PIN 13 33 | #define LED_SECONDARY_PIN 14 34 | #define LED_STATE_ON 0 35 | 36 | /*------------------------------------------------------------------*/ 37 | /* BUTTON 38 | *------------------------------------------------------------------*/ 39 | #define BUTTONS_NUMBER 2 40 | #define BUTTON_1 11 41 | #define BUTTON_2 12 42 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 43 | 44 | //--------------------------------------------------------------------+ 45 | // BLE OTA 46 | //--------------------------------------------------------------------+ 47 | #define BLEDIS_MANUFACTURER "Nordic" 48 | #define BLEDIS_MODEL "PCA10100" 49 | 50 | //--------------------------------------------------------------------+ 51 | // USB 52 | //--------------------------------------------------------------------+ 53 | #define USB_DESC_VID 0x239A 54 | #define USB_DESC_UF2_PID 0x00D8 55 | #define USB_DESC_CDC_ONLY_PID 0x00D8 56 | 57 | #define UF2_PRODUCT_NAME "Nordic nRF52833 DK" 58 | #define UF2_VOLUME_LABEL "NRF833BOOT" 59 | #define UF2_BOARD_ID "nRF52833-pca10100-v1" 60 | #define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52833-DK" 61 | 62 | #endif // PCA10100_H 63 | -------------------------------------------------------------------------------- /src/boards/pca10100/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52833 -------------------------------------------------------------------------------- /src/boards/pca10100/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x80000, // FLASH_BYTES 12 | 205, 0x20000, // RAM_BYTES 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0x621e937a, // UF2_FAMILY = 0x621e937a 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/pillbug/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2022 Kyle McCreery 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _PillBug_H 26 | #define _PillBug_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3 31 | 32 | /*------------------------------------------------------------------*/ 33 | /* LED 34 | *------------------------------------------------------------------*/ 35 | #define LEDS_NUMBER 1 36 | #define LED_PRIMARY_PIN _PINNUM(0, 20) // Blue 37 | #define LED_STATE_ON 1 38 | 39 | /*------------------------------------------------------------------*/ 40 | /* BUTTON 41 | *------------------------------------------------------------------*/ 42 | #define BUTTONS_NUMBER 2 // none connected at all 43 | #define BUTTON_1 _PINNUM(0, 18) // unusable: RESET 44 | #define BUTTON_2 _PINNUM(0, 21) // no connection 45 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 46 | 47 | //--------------------------------------------------------------------+ 48 | // BLE OTA 49 | //--------------------------------------------------------------------+ 50 | #define BLEDIS_MANUFACTURER "MechWild" 51 | #define BLEDIS_MODEL "PillBug" 52 | 53 | //--------------------------------------------------------------------+ 54 | // USB 55 | //--------------------------------------------------------------------+ 56 | #define USB_DESC_VID 0x16D0 57 | #define USB_DESC_UF2_PID 0x10ED 58 | #define USB_DESC_CDC_ONLY_PID 0x10ED 59 | 60 | #define UF2_PRODUCT_NAME "PillBug" 61 | #define UF2_VOLUME_LABEL "PillBug" 62 | #define UF2_BOARD_ID "nRF52840-PillBug" 63 | #define UF2_INDEX_URL "https://mechwild.com" 64 | 65 | #endif // _PillBug_H 66 | -------------------------------------------------------------------------------- /src/boards/pillbug/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/pillbug/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/pitaya_go/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | USE_NFCT = yes 3 | -------------------------------------------------------------------------------- /src/boards/pitaya_go/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/raytac_mdbt50q_db_40/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/raytac_mdbt50q_db_40/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/raytac_mdbt50q_rx/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef RAYTAC_MDBT50Q_RX_H 26 | #define RAYTAC_MDBT50Q_RX_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 1 34 | #define LED_PRIMARY_PIN _PINNUM(1, 13) 35 | #define LED_STATE_ON 0 36 | 37 | /*------------------------------------------------------------------*/ 38 | /* BUTTON 39 | *------------------------------------------------------------------*/ 40 | #define BUTTONS_NUMBER 2 41 | 42 | #define BUTTON_1 _PINNUM(0, 15) 43 | #define BUTTON_2 _PINNUM(0, 10) 44 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 45 | 46 | //--------------------------------------------------------------------+ 47 | // BLE OTA 48 | //--------------------------------------------------------------------+ 49 | #define BLEDIS_MANUFACTURER "Raytac" 50 | #define BLEDIS_MODEL "MDBT50Q-RX" 51 | 52 | //--------------------------------------------------------------------+ 53 | // USB 54 | //--------------------------------------------------------------------+ 55 | 56 | #define USB_DESC_VID 0x239A 57 | #define USB_DESC_UF2_PID 0x010B 58 | #define USB_DESC_CDC_ONLY_PID 0x010B 59 | 60 | //------------- UF2 -------------// 61 | #define UF2_PRODUCT_NAME "Raytac MDBT50Q-RX" 62 | #define UF2_VOLUME_LABEL "MDBT50QBOOT" 63 | #define UF2_BOARD_ID "nRF52840-MDBT50Q_RX-verD" 64 | #define UF2_INDEX_URL "https://www.adafruit.com/product/5199" 65 | 66 | #endif // RAYTAC_MDBT50Q_RX_H 67 | -------------------------------------------------------------------------------- /src/boards/raytac_mdbt50q_rx/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/raytac_mdbt50q_rx/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/sparkfun_nrf52840_micromod/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * Copyright (c) 2021 Chris Marc Dailey 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | #ifndef _SPARKFUN_NRF52840_MICROMOD_H_ 27 | #define _SPARKFUN_NRF52840_MICROMOD_H_ 28 | 29 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 30 | 31 | /*------------------------------------------------------------------*/ 32 | /* LED 33 | *------------------------------------------------------------------*/ 34 | #define LEDS_NUMBER 1 35 | #define LED_PRIMARY_PIN _PINNUM(0, 13) 36 | #define LED_STATE_ON 1 37 | 38 | /*------------------------------------------------------------------*/ 39 | /* BUTTON 40 | *------------------------------------------------------------------*/ 41 | #define BUTTONS_NUMBER 2 42 | #define BUTTON_1 _PINNUM(0, 7) 43 | #define BUTTON_2 _PINNUM(0, 10) 44 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 45 | 46 | //--------------------------------------------------------------------+ 47 | // BLE OTA 48 | //--------------------------------------------------------------------+ 49 | #define BLEDIS_MANUFACTURER "SparkFun" 50 | #define BLEDIS_MODEL "MicroMod nRF52840" 51 | 52 | //--------------------------------------------------------------------+ 53 | // USB 54 | //--------------------------------------------------------------------+ 55 | #define USB_DESC_VID 0x1B4F 56 | #define USB_DESC_UF2_PID 0x0022 57 | #define USB_DESC_CDC_ONLY_PID 0x0023 58 | 59 | //------------- UF2 -------------// 60 | #define UF2_PRODUCT_NAME "SparkFun MicroMod nRF52840" 61 | #define UF2_VOLUME_LABEL "SFMM852BOOT" 62 | #define UF2_BOARD_ID "nRF52840-micromod-v10" 63 | 64 | #define UF2_INDEX_URL "https://www.sparkfun.com/products/16984" 65 | 66 | #endif /* _SPARKFUN_NRF52840_MICROMOD_H_ */ 67 | -------------------------------------------------------------------------------- /src/boards/sparkfun_nrf52840_micromod/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/sparkfun_nrf52840_micromod/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/t1000_e/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Yihui Xiong for Makerdiary 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _T1000_E_H 26 | #define _T1000_E_H 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | #define LEDS_NUMBER 1 34 | #define LED_PRIMARY_PIN _PINNUM(0, 24) // Green 35 | #define LED_STATE_ON 0 36 | 37 | /*------------------------------------------------------------------*/ 38 | /* BUTTON 39 | *------------------------------------------------------------------*/ 40 | #define BUTTONS_NUMBER 2 41 | #define BUTTON_1 _PINNUM(0, 6) // Primary Button 42 | #define BUTTON_2 _PINNUM(0, 18) // unusable: RESET 43 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 44 | 45 | //--------------------------------------------------------------------+ 46 | // BLE OTA 47 | //--------------------------------------------------------------------+ 48 | #define BLEDIS_MANUFACTURER "Seeed Studio" 49 | #define BLEDIS_MODEL "T1000-E" 50 | 51 | //--------------------------------------------------------------------+ 52 | // USB 53 | //--------------------------------------------------------------------+ 54 | #define USB_DESC_VID 0x2886 55 | #define USB_DESC_UF2_PID 0x0057 56 | #define USB_DESC_CDC_ONLY_PID 0x0057 57 | 58 | //--------------------------------------------------------------------+ 59 | // UF2 60 | //--------------------------------------------------------------------+ 61 | #define UF2_PRODUCT_NAME "Seeed T1000-E for Meshtastic" 62 | #define UF2_VOLUME_LABEL "T1000-E" 63 | #define UF2_BOARD_ID "nRF52840-T1000-E-v1" 64 | #define UF2_INDEX_URL "https://www.seeedstudio.com/SenseCAP-Card-Tracker-T1000-E-for-Meshtastic-p-5913.html" 65 | 66 | 67 | #endif /* _T1000_E_H */ 68 | -------------------------------------------------------------------------------- /src/boards/t1000_e/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | SD_VERSION = 7.3.0 3 | 4 | -------------------------------------------------------------------------------- /src/boards/t1000_e/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/waveshare_nrf52840_eval/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | -------------------------------------------------------------------------------- /src/boards/waveshare_nrf52840_eval/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; 20 | -------------------------------------------------------------------------------- /src/boards/xiao_nrf52840_ble/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _XIAO_BLE 26 | #define _XIAO_BLE 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | // The board has 3 leds, but changing the number here causes OTA issues. 34 | #define LEDS_NUMBER 1 35 | #define LED_PRIMARY_PIN _PINNUM(0, 26) 36 | #define LED_STATE_ON 0 37 | 38 | #define NEOPIXELS_NUMBER 0 39 | 40 | /*------------------------------------------------------------------*/ 41 | /* BUTTON 42 | *------------------------------------------------------------------*/ 43 | #define BUTTONS_NUMBER 2 44 | #define BUTTON_1 _PINNUM(0, 18) 45 | // Button 2 is defined as D1 from expansion board. 46 | #define BUTTON_2 _PINNUM(0, 3) 47 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 48 | 49 | //--------------------------------------------------------------------+ 50 | // BLE OTA 51 | //--------------------------------------------------------------------+ 52 | #define BLEDIS_MANUFACTURER "Seeed" 53 | #define BLEDIS_MODEL "XIAO nRF52840" 54 | 55 | //--------------------------------------------------------------------+ 56 | // USB 57 | //--------------------------------------------------------------------+ 58 | #define USB_DESC_VID 0x2886 59 | #define USB_DESC_UF2_PID 0x0044 60 | #define USB_DESC_CDC_ONLY_PID 0x0044 61 | 62 | //------------- UF2 -------------// 63 | #define UF2_PRODUCT_NAME "Seeed XIAO nRF52840" 64 | #define UF2_VOLUME_LABEL "XIAO-BOOT" 65 | #define UF2_BOARD_ID "nRF52840-SeeedXiao-v1" 66 | #define UF2_INDEX_URL "https://www.seeedstudio.com/" 67 | 68 | #endif // _XIAO_BLE 69 | -------------------------------------------------------------------------------- /src/boards/xiao_nrf52840_ble/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | SD_VERSION = 7.3.0 -------------------------------------------------------------------------------- /src/boards/xiao_nrf52840_ble/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; -------------------------------------------------------------------------------- /src/boards/xiao_nrf52840_ble_sense/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef _XIAO_BLE_SENSE 26 | #define _XIAO_BLE_SENSE 27 | 28 | #define _PINNUM(port, pin) ((port)*32 + (pin)) 29 | 30 | /*------------------------------------------------------------------*/ 31 | /* LED 32 | *------------------------------------------------------------------*/ 33 | // The board has 3 leds, but changing the number here causes OTA issues. 34 | #define LEDS_NUMBER 1 35 | #define LED_PRIMARY_PIN _PINNUM(0, 26) 36 | #define LED_STATE_ON 0 37 | 38 | #define NEOPIXELS_NUMBER 0 39 | 40 | /*------------------------------------------------------------------*/ 41 | /* BUTTON 42 | *------------------------------------------------------------------*/ 43 | #define BUTTONS_NUMBER 2 44 | #define BUTTON_1 _PINNUM(0, 18) 45 | // Button 2 is defined as D1 from expansion board. 46 | #define BUTTON_2 _PINNUM(0, 3) 47 | #define BUTTON_PULL NRF_GPIO_PIN_PULLUP 48 | 49 | //--------------------------------------------------------------------+ 50 | // BLE OTA 51 | //--------------------------------------------------------------------+ 52 | #define BLEDIS_MANUFACTURER "Seeed" 53 | #define BLEDIS_MODEL "XIAO nRF52840 Sense" 54 | 55 | //--------------------------------------------------------------------+ 56 | // USB 57 | //--------------------------------------------------------------------+ 58 | #define USB_DESC_VID 0x2886 59 | #define USB_DESC_UF2_PID 0x0045 60 | #define USB_DESC_CDC_ONLY_PID 0x0045 61 | 62 | //------------- UF2 -------------// 63 | #define UF2_PRODUCT_NAME "Seeed XIAO nRF52840" 64 | #define UF2_VOLUME_LABEL "XIAO-SENSE" 65 | #define UF2_BOARD_ID "nRF52840-SeeedXiaoSense-v1" 66 | #define UF2_INDEX_URL "https://www.seeedstudio.com/" 67 | 68 | #endif // _XIAO_BLE_SENSE 69 | -------------------------------------------------------------------------------- /src/boards/xiao_nrf52840_ble_sense/board.mk: -------------------------------------------------------------------------------- 1 | MCU_SUB_VARIANT = nrf52840 2 | SD_VERSION = 7.3.0 -------------------------------------------------------------------------------- /src/boards/xiao_nrf52840_ble_sense/pinconfig.c: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "uf2/configkeys.h" 3 | 4 | __attribute__((used, section(".bootloaderConfig"))) 5 | const uint32_t bootloaderConfig[] = 6 | { 7 | /* CF2 START */ 8 | CFG_MAGIC0, CFG_MAGIC1, // magic 9 | 5, 100, // used entries, total entries 10 | 11 | 204, 0x100000, // FLASH_BYTES = 0x100000 12 | 205, 0x40000, // RAM_BYTES = 0x40000 13 | 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 14 | 209, 0xada52840, // UF2_FAMILY = 0xada52840 15 | 210, 0x20, // PINS_PORT_SIZE = PA_32 16 | 17 | 0, 0, 0, 0, 0, 0, 0, 0 18 | /* CF2 END */ 19 | }; -------------------------------------------------------------------------------- /src/flash_nrf5x.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #include 26 | #include "nrf_sdm.h" 27 | #include "flash_nrf5x.h" 28 | #include "boards.h" 29 | 30 | #define FLASH_PAGE_SIZE 4096 31 | #define FLASH_CACHE_INVALID_ADDR 0xffffffff 32 | 33 | static uint32_t _fl_addr = FLASH_CACHE_INVALID_ADDR; 34 | static uint8_t _fl_buf[FLASH_PAGE_SIZE] __attribute__((aligned(4))); 35 | 36 | void flash_nrf5x_flush (bool need_erase) 37 | { 38 | if ( _fl_addr == FLASH_CACHE_INVALID_ADDR ) return; 39 | 40 | // skip the write if contents matches 41 | if ( memcmp(_fl_buf, (void *) _fl_addr, FLASH_PAGE_SIZE) != 0 ) 42 | { 43 | // - nRF52832 dfu via uart can miss incoming byte when erasing because cpu is blocked for > 2ms. 44 | // Since dfu_prepare_func_app_erase() already erase the page for us, we can skip it here. 45 | // - nRF52840 dfu serial/uf2 are USB-based which are DMA and should have no problems. 46 | // 47 | // Note: MSC uf2 does not erase page in advance like dfu serial 48 | if ( need_erase ) 49 | { 50 | PRINTF("Erase and "); 51 | nrfx_nvmc_page_erase(_fl_addr); 52 | } 53 | 54 | PRINTF("Write 0x%08lX\r\n", _fl_addr); 55 | nrfx_nvmc_words_write(_fl_addr, (uint32_t *) _fl_buf, FLASH_PAGE_SIZE / 4); 56 | } 57 | 58 | _fl_addr = FLASH_CACHE_INVALID_ADDR; 59 | } 60 | 61 | void flash_nrf5x_write (uint32_t dst, void const *src, int len, bool need_erase) 62 | { 63 | uint32_t newAddr = dst & ~(FLASH_PAGE_SIZE - 1); 64 | 65 | if ( newAddr != _fl_addr ) 66 | { 67 | flash_nrf5x_flush(need_erase); 68 | _fl_addr = newAddr; 69 | memcpy(_fl_buf, (void *) newAddr, FLASH_PAGE_SIZE); 70 | } 71 | memcpy(_fl_buf + (dst & (FLASH_PAGE_SIZE - 1)), src, len); 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/flash_nrf5x.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef FLASH_NRF5X_H_ 26 | #define FLASH_NRF5X_H_ 27 | 28 | #include 29 | #include 30 | 31 | #include "nrfx_nvmc.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | void flash_nrf5x_write (uint32_t dst, void const *src, int len, bool need_erase); 38 | void flash_nrf5x_flush (bool need_erase); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* FLASH_NRF5X_H_ */ 45 | -------------------------------------------------------------------------------- /src/nrfx_config.h: -------------------------------------------------------------------------------- 1 | #ifndef NRFX_CONFIG_H__ 2 | #define NRFX_CONFIG_H__ 3 | 4 | // Power 5 | #define NRFX_POWER_ENABLED 1 6 | #define NRFX_POWER_DEFAULT_CONFIG_IRQ_PRIORITY 7 7 | 8 | #define NRFX_CLOCK_ENABLED 0 9 | #define NRFX_NVMC_ENABLED 1 10 | 11 | #define NRFX_PRS_ENABLED 0 12 | 13 | // PWM 14 | #define NRFX_PWM_ENABLED 0 15 | #define NRFX_PWM0_ENABLED 0 16 | #define NRFX_PWM1_ENABLED 0 17 | #define NRFX_PWM2_ENABLED 0 18 | #define NRFX_PWM3_ENABLED 0 19 | 20 | // UART 21 | #ifdef NRF52832_XXAA 22 | #define NRFX_UART_ENABLED 1 23 | #define NRFX_UART0_ENABLED 1 24 | #define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY 7 25 | #define NRFX_UART_DEFAULT_CONFIG_HWFC NRF_UART_HWFC_DISABLED 26 | #define NRFX_UART_DEFAULT_CONFIG_PARITY NRF_UART_PARITY_EXCLUDED 27 | #define NRFX_UART_DEFAULT_CONFIG_BAUDRATE NRF_UART_BAUDRATE_115200 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/usb/uf2/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /src/usb/uf2/uf2.h: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | Microsoft UF2 4 | 5 | The MIT License (MIT) 6 | 7 | Copyright (c) Microsoft Corporation 8 | 9 | All rights reserved. 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in all 19 | copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | SOFTWARE. 28 | 29 | */ 30 | #ifndef UF2FORMAT_H 31 | #define UF2FORMAT_H 1 32 | 33 | #include "uf2cfg.h" 34 | 35 | #include 36 | #include 37 | 38 | //--------------------------------------------------------------------+ 39 | // 40 | //--------------------------------------------------------------------+ 41 | 42 | // All entries are little endian. 43 | #define UF2_MAGIC_START0 0x0A324655UL // "UF2\n" 44 | #define UF2_MAGIC_START1 0x9E5D5157UL // Randomly selected 45 | #define UF2_MAGIC_END 0x0AB16F30UL // Ditto 46 | 47 | // If set, the block is "comment" and should not be flashed to the device 48 | #define UF2_FLAG_NOFLASH 0x00000001 49 | #define UF2_FLAG_FAMILYID 0x00002000 50 | 51 | #define MAX_BLOCKS (CFG_UF2_FLASH_SIZE / 256 + 100) 52 | typedef struct { 53 | uint32_t numBlocks; 54 | uint32_t numWritten; 55 | 56 | bool aborted; // aborting update and reset 57 | bool update_bootloader; // if updating bootloader (else app) 58 | bool has_uicr; // if containing uicr data 59 | bool boot_id_matches; // if bootloader id in cf2 config matches our VID/PID 60 | 61 | uint8_t writtenMask[MAX_BLOCKS / 8 + 1]; 62 | } WriteState; 63 | 64 | typedef struct { 65 | // 32 byte header 66 | uint32_t magicStart0; 67 | uint32_t magicStart1; 68 | uint32_t flags; 69 | uint32_t targetAddr; 70 | uint32_t payloadSize; 71 | uint32_t blockNo; 72 | uint32_t numBlocks; 73 | uint32_t familyID; 74 | 75 | // raw data; 76 | uint8_t data[476]; 77 | 78 | // store magic also at the end to limit damage from partial block reads 79 | uint32_t magicEnd; 80 | } UF2_Block; 81 | 82 | void uf2_init(void); 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /src/usb/uf2/uf2cfg.h: -------------------------------------------------------------------------------- 1 | #include "boards.h" 2 | #include "dfu_types.h" 3 | 4 | // Virtual disk size: just under 32MB 5 | #define CFG_UF2_NUM_BLOCKS 0x10109 6 | 7 | // Family ID for updating Bootloader 8 | #define CFG_UF2_FAMILY_BOOT_ID 0xd663823c 9 | 10 | // Board-specific ID for board-specific Application 11 | #if defined(USB_DESC_VID) && defined(USB_DESC_UF2_PID) && USB_DESC_VID && USB_DESC_UF2_PID 12 | #define CFG_UF2_BOARD_APP_ID ((USB_DESC_VID << 16) | USB_DESC_UF2_PID) 13 | #endif 14 | 15 | // Family ID and size for updating generic Application 16 | #if defined(NRF52840_XXAA) 17 | #define CFG_UF2_FAMILY_APP_ID 0xADA52840 18 | #define CFG_UF2_FLASH_SIZE (1024*1024) // 1 MB 19 | #elif defined(NRF52833_XXAA) 20 | #define CFG_UF2_FAMILY_APP_ID 0x621E937A 21 | #define CFG_UF2_FLASH_SIZE (512*1024) // 512 kB 22 | #endif 23 | 24 | // Application Address Space 25 | #define USER_FLASH_START MBR_SIZE // skip MBR included in SD hex 26 | #define USER_FLASH_END (BOOTLOADER_REGION_START - DFU_APP_DATA_RESERVED) 27 | 28 | // Bootloader start address 29 | #define BOOTLOADER_ADDR_START BOOTLOADER_REGION_START 30 | 31 | // Bootloader end address 32 | #define BOOTLOADER_ADDR_END BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS 33 | 34 | // Address where new bootloader is written before activation (skip application data) 35 | #define BOOTLOADER_ADDR_NEW_RECIEVED (USER_FLASH_END-DFU_BL_IMAGE_MAX_SIZE) 36 | -------------------------------------------------------------------------------- /src/usb/usb_desc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2018 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef USB_DESC_H_ 26 | #define USB_DESC_H_ 27 | 28 | #include "tusb.h" 29 | #include "boards.h" 30 | 31 | void usb_desc_init(bool cdc_only); 32 | 33 | #endif /* USB_DESC_H_ */ 34 | -------------------------------------------------------------------------------- /tools/build_all.py: -------------------------------------------------------------------------------- 1 | import os 2 | import glob 3 | import sys 4 | import subprocess 5 | import time 6 | from multiprocessing import Pool 7 | 8 | SUCCEEDED = "\033[32msucceeded\033[0m" 9 | FAILED = "\033[31mfailed\033[0m" 10 | 11 | build_format = '| {:32} | {:18} | {:5} | {:6} | {:6} |' 12 | build_separator = '-' * 74 13 | 14 | 15 | def build_board(board): 16 | start_time = time.monotonic() 17 | make_result = subprocess.run("make -j BOARD={} all".format(board), shell=True, stdout=subprocess.PIPE, 18 | stderr=subprocess.STDOUT) 19 | build_duration = time.monotonic() - start_time 20 | 21 | flash_size = "-" 22 | sram_size = "-" 23 | succeeded = 0 24 | 25 | if make_result.returncode == 0: 26 | succeeded = 1 27 | out_file = glob.glob('_build/build-{}/*.out'.format(board))[0] 28 | size_output = subprocess.run('size {}'.format(out_file), shell=True, stdout=subprocess.PIPE).stdout.decode( 29 | "utf-8") 30 | size_list = size_output.split('\n')[1].split('\t') 31 | flash_size = int(size_list[0]) 32 | sram_size = int(size_list[1]) + int(size_list[2]) 33 | 34 | print(build_format.format(board, SUCCEEDED if succeeded else FAILED, "{:.2f}s".format(build_duration), flash_size, 35 | sram_size)) 36 | 37 | if make_result.returncode != 0: 38 | print(make_result.stdout.decode("utf-8")) 39 | 40 | return succeeded 41 | 42 | 43 | if __name__ == '__main__': 44 | # remove build folder first 45 | subprocess.run("rm -rf _build/", shell=True) 46 | 47 | # All supported boards 48 | all_boards = [] 49 | for entry in os.scandir("src/boards"): 50 | if entry.is_dir(): 51 | all_boards.append(entry.name) 52 | all_boards.sort() 53 | 54 | print(build_separator) 55 | print(build_format.format('Board', '\033[39mResult\033[0m', 'Time', 'Flash', 'SRAM')) 56 | print(build_separator) 57 | 58 | success_count = 0 59 | total_time = time.monotonic() 60 | 61 | with Pool(processes=os.cpu_count()) as pool: 62 | success_count = sum(pool.map(build_board, all_boards)) 63 | 64 | total_time = time.monotonic() - total_time 65 | fail_count = len(all_boards) - success_count 66 | 67 | # Build Summary 68 | print(build_separator) 69 | print( 70 | "Build Summary: {} {}, {} {} and took {:.2f}s".format(success_count, SUCCEEDED, fail_count, FAILED, total_time)) 71 | print(build_separator) 72 | 73 | sys.exit(fail_count) 74 | --------------------------------------------------------------------------------