{"id":19237180,"url":"https://github.com/moddable-opensource/adafruit_nrf52_bootloader","last_synced_at":"2025-02-23T13:50:13.979Z","repository":{"id":187772306,"uuid":"270574820","full_name":"Moddable-OpenSource/Adafruit_nRF52_Bootloader","owner":"Moddable-OpenSource","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-29T00:34:59.000Z","size":6462,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-05T01:41:52.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Moddable-OpenSource.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-08T07:36:01.000Z","updated_at":"2024-12-28T23:52:12.000Z","dependencies_parsed_at":"2023-08-12T04:38:02.502Z","dependency_job_id":"5cb96c50-b29a-4285-a086-8acd255e0123","html_url":"https://github.com/Moddable-OpenSource/Adafruit_nRF52_Bootloader","commit_stats":null,"previous_names":["moddable-opensource/adafruit_nrf52_bootloader"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moddable-OpenSource%2FAdafruit_nRF52_Bootloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moddable-OpenSource%2FAdafruit_nRF52_Bootloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moddable-OpenSource%2FAdafruit_nRF52_Bootloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moddable-OpenSource%2FAdafruit_nRF52_Bootloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Moddable-OpenSource","download_url":"https://codeload.github.com/Moddable-OpenSource/Adafruit_nRF52_Bootloader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240324060,"owners_count":19783453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T16:25:11.956Z","updated_at":"2025-02-23T13:50:13.959Z","avatar_url":"https://github.com/Moddable-OpenSource.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adafruit nRF52 Bootloader\n\n[![Build Status](https://github.com/adafruit/Adafruit_nRF52_Bootloader/workflows/Build/badge.svg)](https://github.com/adafruit/Adafruit_nRF52_Bootloader/actions)\n\nThis is a CDC/DFU/UF2 bootloader for nRF52 boards.\n\n- [Adafruit CLUE](https://www.adafruit.com/product/4500)\n- [Adafruit Circuit Playground Bluefruit](https://www.adafruit.com/product/4333)\n- [Adafruit Feather nRF52832](https://www.adafruit.com/product/3406)\n- [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)\n- [Adafruit Feather nRF52840 Sense](https://www.adafruit.com/product/4516)\n- [Adafruit ItsyBitsy nRF52840 Express](https://www.adafruit.com/product/4481)\n- Adafruit Metro nRF52840 Express\n- [Electronut Labs Papyr](https://docs.electronut.in/papyr/)\n- MakerDiary MDK nRF52840 USB Dongle\n- [Nordic nRF52840DK PCA10056](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK)\n- [Nordic nRF52840DK PCA10059 (\"Dongle\")](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-Dongle)\n- Particle Argon\n- Particle Boron\n- Particle Xenon\n\nUF2 is an easy-to-use bootloader that appears as a flash drive. You can just copy `.uf2`-format\napplication images to the flash drive to load new firmware. See https://github.com/Microsoft/uf2 and https://github.com/adafruit/uf2-samdx1 for more information.\n\n[adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil), a modified version of [Nordic nrfutil](https://github.com/NordicSemiconductor/pc-nrfutil), is required to perform DFU. Install `python3` if it is not installed already and run this command to install adafruit-nrfutil from PyPi:\n\n```\n$ pip3 install --user adafruit-nrfutil\n```\n\nClone this repo with following commands, or fork it for your own development\n\n```\ngit clone https://github.com/adafruit/Adafruit_nRF52_Bootloader\ncd Adafruit_nRF52_Bootloader\ngit submodule update --init\n```\n\n## Features\n\n- DFU over Serial and OTA ( application, Bootloader+SD )\n- Self-upgradable via Serial and OTA\n- DFU using UF2 (https://github.com/Microsoft/uf2) (application only)\n- Auto-enter DFU briefly on startup for DTR auto-reset trick (832 only)\n\n## How to use\n\nThere are two pins, `DFU` and `FRST` that bootloader will check upon reset/power:\n\n- `Double Reset` Reset twice within 500 ms will enter DFU with UF2 and CDC support (only works with nRF52840)\n- `DFU = LOW` and `FRST = HIGH`: Enter bootloader with UF2 and CDC support\n- `DFU = LOW` and `FRST = LOW`: Enter bootloader with OTA, to upgrade with a mobile application such as Nordic nrfConnect/Toolbox\n- \u003cs\u003e`DFU = HIGH` and `FRST = LOW`: Factory Reset mode: erase firmware application and its data\u003c/s\u003e\n- `DFU = HIGH` and `FRST = HIGH`: Go to application code if it is present, otherwise enter DFU with UF2\n- The `GPREGRET` register can also be set to force the bootloader can enter any of above modes (plus a CDC-only mode for Arduino).\n`GPREGRET` is set by the application before performing a soft reset.\n\nOn the Nordic PCA10056 DK board, `DFU` is connected to **Button1**, and `FRST` is connected to **Button2**.\nSo holding down **Button1** while clicking **RESET** will put the board into USB bootloader mode, with UF2 and CDC support.\nHolding down **Button2** while clicking **RESET** will put the board into OTA (over-the-air) bootloader mode.\n\nOn the Nordic PCA10059 Dongle board, `DFU` is connected to the white button.\n`FRST` is connected to pin 1.10. Ground it to pull `FRST` low, as if you had pushed an `FRST`  button.\nThere is an adjacent ground pad.\n\nFor other boards, please check the board definition for details.\n\n### Making your own UF2\n\nTo create your own UF2 DFU update image, simply use the [Python conversion script](https://github.com/Microsoft/uf2/blob/master/utils/uf2conv.py) on a .bin file or .hex file, specifying the family as **0xADA52840**. If using a .bin file with the conversion script you must specify application address with the -b switch, this address depend on the SoftDevice size/version e.g S140 v6 is 0x26000 \n\nTo create a UF2 image from a .bin file:\n```\nuf2conv.py firmware.bin -c -b 0x26000 -f 0xADA52840\n```\n\nTo create a UF2 image from a .hex file:\n```\nuf2conv.py firmware.hex -c -f 0xADA52840\n```\n\nTo create a UF2 image for bootloader from a .hex file using separated family of **0xd663823c**\n\n```\nuf2conv.py bootloader.hex -c -f 0xd663823c\n```\n\n## Burn \u0026 Upgrade with pre-built binaries\n\nYou can burn and/or upgrade the bootloader with either a J-link or DFU (serial) to a specific pre-built binary version\nwithout the hassle of installing a toolchain and compiling the code.\nThis is preferred if you are not developing/customizing the bootloader.\nPre-builtin binaries are available on GitHub [releases](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases)\n\nNote: The bootloader can be downgraded. Since the binary release is a merged version of\nboth bootloader and the Nordic SoftDevice, you can freely upgrade/downgrade to any version you like.\n\n## How to compile and build\n\nYou should only continue if you are looking to develop bootloader for your own.\nYou must have have a J-Link available to \"unbrick\" your device.\n\nPrerequisites\n\n- ARM GCC\n- Nordic's [nRF5x Command Line Tools](https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Command-Line-Tools)\n- [Python IntelHex](https://pypi.org/project/IntelHex/)\n\nTo build:\n\n```\nmake BOARD=feather_nrf52840_express all\n```\n\nTo flash the bootloader with JLink:\n\n```\nmake BOARD=feather_nrf52840_express flash\n```\n\nTo upgrade the bootloader using DFU Serial via port /dev/ttyACM0\n\n```\nmake BOARD=feather_nrf52840_express SERIAL=/dev/ttyACM0 dfu-flash\n```\n\nTo flash SoftDevice (and chip erase):\n\n```\nmake BOARD=feather_nrf52840_express sd\n```\n\nFor the list of supported boards, run `make` without `BOARD=` :\n\n```\n$ make\nYou must provide a BOARD parameter with 'BOARD='\nSupported boards are: feather_nrf52840_express feather_nrf52840_express pca10056\nMakefile:90: *** BOARD not defined.  Stop\n```\n\n### Common makefile problems\n\n#### 1. `arm-none-eabi-gcc`: No such file or directory\n\nIf you get the following error ...\n\n```\n$ make BOARD=feather_nrf52840_express all \nCompiling file: main.c\n/bin/sh: /usr/bin/arm-none-eabi-gcc: No such file or directory\nmake: *** [_build/main.o] Error 127\n```\n\n... you may need to pass the location of the GCC ARM toolchain binaries to `make` using\nthe variable `CROSS_COMPILE` as below:\n```\n$ make CROSS_COMPILE=/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi- BOARD=feather_nrf52832 all\n```\n\n#### 2. `ModuleNotFoundError: No module named 'intelhex'`\n\nInstall python-intelhex with\n\n```\npip install intelhex\n```\n\n\n\n\n\n#### 3. `make: nrfjprog: No such file or directory`\n\nMake sure that `nrfjprog` is available from the command-line. This binary is\npart of Nordic's nRF5x Command Line Tools.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoddable-opensource%2Fadafruit_nrf52_bootloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoddable-opensource%2Fadafruit_nrf52_bootloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoddable-opensource%2Fadafruit_nrf52_bootloader/lists"}