{"id":19374503,"url":"https://github.com/rosvall/cc2531_bootloader","last_synced_at":"2025-10-08T18:16:08.223Z","repository":{"id":176446068,"uuid":"658056060","full_name":"rosvall/cc2531_bootloader","owner":"rosvall","description":"Simple USB DFU bootloader for CC2531","archived":false,"fork":false,"pushed_at":"2024-02-24T09:39:12.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T02:59:21.777Z","etag":null,"topics":["8051","bootloader","cc2531","dfu","dfu-bootloader","usb"],"latest_commit_sha":null,"homepage":"http://rosvall.github.io/","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rosvall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/GPL-3.0-or-later.txt","code_of_conduct":null,"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":"2023-06-24T16:17:50.000Z","updated_at":"2023-07-02T13:01:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"2463be79-f706-4eed-91de-3edf0dfcd6c9","html_url":"https://github.com/rosvall/cc2531_bootloader","commit_stats":null,"previous_names":["rosvall/cc2531_bootloader"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosvall%2Fcc2531_bootloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosvall%2Fcc2531_bootloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosvall%2Fcc2531_bootloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosvall%2Fcc2531_bootloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rosvall","download_url":"https://codeload.github.com/rosvall/cc2531_bootloader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240501585,"owners_count":19811638,"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":["8051","bootloader","cc2531","dfu","dfu-bootloader","usb"],"created_at":"2024-11-10T08:35:21.179Z","updated_at":"2025-10-08T18:16:08.217Z","avatar_url":"https://github.com/rosvall.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!NOTE]\n\u003e Moved to [codeberg.org/rosvall/cc2531_bootloader](https://codeberg.org/rosvall/cc2531_bootloader)\n\u003e\n\u003e For reasons given [here](https://github.com/rosvall/goodbye-github)\n\n# Simple USB DFU bootloader for TI CC2531\n\n*See [this hack](https://github.com/rosvall/cc2531_oem_flasher) for how to flash a stock CC2531USB-RD dongle*\n\nFits in the first flash page (2 kB).\n\nIf either\n\n - watchdog is triggered,\n - clockloss is detected,\n - or a button is held while booting\n\nit enters DFU (USB device firmware upgrade) mode. Otherwise it jumps to code address 0x800 to boot your actual application firmware.\n\nAs the bootloader resides in the first 2 kB of the code address space, any firmware used with this bootloader must be compiled with code addresses offset by +0x800.\n\nTo compile firmware for use with this bootloader with SDCC, just add `--code-loc 0x800` to your CFLAGS.\n\nThe interrupt table in the bootloader is filled with jumps to the corresponding offset address, so apart from the extra delay of a `ljmp` instruction, interrupts will work normally for application firmware.\n\nNote that the bootloader enables the watchdog with a timeout of 250 ms! This means your firmware must periodically feed the watchdog (it can't be disabled), or the device will reboot to DFU mode.\n\nIn DFU mode, it presents itself af a USB DFU 1.1 device to the USB host and allows both download (flashing) and upload (reading) for all flash from 0x800 and up. It will not overwrite itself though.\n\nTo read or write flash, use a program like [dfu-util](https://sourceforge.net/projects/dfu-util/).\n\n## Requirements\n- [SDCC](https://sourceforge.net/projects/sdcc/)\n- [binutils](https://www.gnu.org/software/binutils/)\n- [make](https://www.gnu.org/software/make/)\n\n## How to build\nJust run `make` to build the raw binary image bootloader.bin\n\n## Known issues\n\n - It is not completely conformant to either USB 1.1 or DFU 1.1, and is only tested on Linux using dfu-utils.\n - It's currently using USB vendor id 0x1608 (Inside Out Networks), which is listed as \"obsolete\" by USB IF. This can be changed in `config.inc`. I'd like ideas for a better solution.\n - It's written in 8051 assembler. This is on purpose, though. It started out written in C (using SDCC), but i quickly grew tired of trying to get SDCC to generate sensible code.\n\n*Feel free to submit a bug or pull request.*\n\n## References\n - [CC253x/4x User's Guide (Rev. D)](https://www.ti.com/lit/pdf/swru191)\n - [8051 Instruction Set](https://www.win.tue.nl/~aeb/comp/8051/set8051.html)\n - [Universal Serial Bus Device Class Specification for Device Firmware Upgrade](https://www.usb.org/sites/default/files/DFU_1.1.pdf)\n - [USB 2.0 Specification](https://www.usb.org/sites/default/files/usb_20_20230224.zip)\n\n## See also\n - [Flash a stock Texas Instruments CC2531USB-RD dongle, no tools required](https://github.com/rosvall/cc2531_oem_flasher)\n - [WPAN Adapter firmware for CC2531 USB Dongle](https://github.com/rosvall/cc2531_usb_wpan_adapter)\n - [Linux kernel driver for CC2531 WPAN Adapter firmware](https://github.com/rosvall/cc2531_linux)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosvall%2Fcc2531_bootloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frosvall%2Fcc2531_bootloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosvall%2Fcc2531_bootloader/lists"}