{"id":42018175,"url":"https://github.com/4ms/mp1-usb-dfu","last_synced_at":"2026-01-26T03:18:37.781Z","repository":{"id":207837859,"uuid":"668844326","full_name":"4ms/mp1-usb-dfu","owner":"4ms","description":"DFU Bootloader for STM32MP15x","archived":false,"fork":false,"pushed_at":"2024-12-14T06:00:44.000Z","size":2059,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-14T07:17:03.849Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4ms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-20T18:09:48.000Z","updated_at":"2024-12-14T06:00:47.000Z","dependencies_parsed_at":"2024-12-14T07:27:08.023Z","dependency_job_id":null,"html_url":"https://github.com/4ms/mp1-usb-dfu","commit_stats":null,"previous_names":["4ms/mp1-usb-dfu"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/4ms/mp1-usb-dfu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ms%2Fmp1-usb-dfu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ms%2Fmp1-usb-dfu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ms%2Fmp1-usb-dfu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ms%2Fmp1-usb-dfu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4ms","download_url":"https://codeload.github.com/4ms/mp1-usb-dfu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ms%2Fmp1-usb-dfu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28765596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T02:25:41.078Z","status":"ssl_error","status_checked_at":"2026-01-26T02:24:28.809Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-26T03:18:37.223Z","updated_at":"2026-01-26T03:18:37.776Z","avatar_url":"https://github.com/4ms.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# USB DFU Bootloader\n\nThis project is still in early development.\n\nUSB DFU Bootloader is a second-stage bootloader (SSBL) that acts as a Device\nFirmware Update (DFU) USB device. It allows you to load application firmware\nonto an on-board Flash chip via a USB connection to a host computer. Planned\nimprovements are to support loading firmware onto an SDMMC card.\n\nThe host computer must run a DFU host such as dfu-util. The user runs a\nterminal command to transfer a uimg file from the computer to the flash chip on\na custom board. The command is something like this:\n\n``` \ndfu-util -a 0 -s 0x70080000 -D myfirmware.uimg\n```\n\nThe given address (0x70080000) is an address on the flash chip plus 0x70000000.\nSo an address of 0x70090000 means flash address 0x90000, etc. The address must\nbe aligned to 4k sectors. The flash driver assumes the chip has uniform 4k\nsectors. This can be easily changed to accomodate other chips with different\nsector layouts.\n\n## Use-cases and context\n\nA recent version of MP1-Boot allows for setting a pin to determine which\napplication to boot. If the pin is detected as pulled-down, firmware from\n0x60000 on the flash chip will be loaded and executed. Otherwise, if the pin is\ndetected as pulled-up, firmware from 0x80000 on the flash chip will be loaded\nand executed.\n\nThis was done with USB DFU in mind. A typical use would be to load the USB DFU\nbootloader firmware to address 0x60000 and the main application to 0x80000\n(using an SPI flash loader, or some other means such as J-Link or TRACE32). A\nbutton or jumper can be setup so that MP1-Boot jumps into the main application\nby default. Holding the button down will make it jump to the USB DFU\nbootloader. From there, the user can flash new application firmware.\n\n## Customization\n\nThe board configuration is currently for the MetaModule PCB version p11. If you \nneed to adapt this to your own project, edit the file in `src/board_conf/`.\n\nIf you need to change the writeable area of Flash, edit this in \n`src/usb_dfu/usbd_dfu_media.cc` by changing the `NORFLASH_DESC_STR` string. The\nvalue `3456*4Kg` means 3456 sectors of size 4kb each, which is 13.5MB.\nThe value `0x70080000` is the starting address to allow writing.\nYou also will need to change the `NORFlash` constexpr variables below that line.\n\n\n## Troubleshooting\n\nOn Linux, if you see this error:\n\n```\n$ dfu-util -l\n...\ndfu-util: Cannot open DFU device 0483:df11 found on devnum 29 (LIBUSB_ERROR_ACCESS)\n```\n\nCreate a new file inside /etc/udev/rules.d/ and give it a name like metamodule.rules. \nEnter this into the file:\n\n```\nACTION==\"add\", SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"0483\", ATTRS{idProduct}==\"df11\", MODE=\"664\", TAG+=\"uaccess\"\n```\n\nThen, unplug and replug device.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4ms%2Fmp1-usb-dfu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4ms%2Fmp1-usb-dfu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4ms%2Fmp1-usb-dfu/lists"}