{"id":21823217,"url":"https://github.com/pix/heystack-nrf5x","last_synced_at":"2025-06-17T06:38:19.166Z","repository":{"id":254755239,"uuid":"847447373","full_name":"pix/heystack-nrf5x","owner":"pix","description":"A openhaystack compatible firmware for NRF51 and NRF52 devices","archived":false,"fork":false,"pushed_at":"2024-11-02T18:57:17.000Z","size":187,"stargazers_count":47,"open_issues_count":13,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-21T04:32:48.126Z","etag":null,"topics":["beacon","findmy","nrf51","nrf52","openhaystack"],"latest_commit_sha":null,"homepage":"","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/pix.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,"zenodo":null}},"created_at":"2024-08-25T21:01:35.000Z","updated_at":"2025-04-17T07:10:41.000Z","dependencies_parsed_at":"2024-08-25T22:43:43.860Z","dependency_job_id":"551d28b8-8dae-4238-b5ea-4bc15dd78a86","html_url":"https://github.com/pix/heystack-nrf5x","commit_stats":null,"previous_names":["pix/heystack-nrf5x"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pix/heystack-nrf5x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pix%2Fheystack-nrf5x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pix%2Fheystack-nrf5x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pix%2Fheystack-nrf5x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pix%2Fheystack-nrf5x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pix","download_url":"https://codeload.github.com/pix/heystack-nrf5x/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pix%2Fheystack-nrf5x/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260308396,"owners_count":22989811,"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":["beacon","findmy","nrf51","nrf52","openhaystack"],"created_at":"2024-11-27T17:20:51.722Z","updated_at":"2025-06-17T06:38:19.132Z","avatar_url":"https://github.com/pix.png","language":"C","readme":"# HeyStack-NRF5X - OpenHaystack Compatible Low Power Firmware\n\nThis repository contains an alternative OpenHaystack firmware. It is based on the SoftDevice from Nordic Semiconductor. This approach could potentially extend battery life, with some estimates suggesting up to three years on a CR2032 battery! (See [this comment](https://github.com/seemoo-lab/openhaystack/issues/57#issuecomment-841642356)).\n\nIt's based on [acalatrava's](https://raw.githubusercontent.com/acalatrava/openhaystack-firmware/main/README.md) firmware with fixes\nand support for newer nRF5x devices and SDKs.\n\n## Supported Devices\n\n- **nRF52810**: Tested on an original Tile Tag.\n- **nRF51822**: Tested on an aliexpress tag.\n- **nRF52832**: Tested with the YJ-17024 board (see link below).\n\nOther nRF devices might be supported, but untested.\n\nThese aliexpress tags should work with the nRF52810 firmware:\n\n- [Holyiot NRF52810](https://s.click.aliexpress.com/e/_DdDyDp9)\n\nThese aliexpress tags works with the nRF51822 firmware:\n\n- [1: NRF51822](https://s.click.aliexpress.com/e/_De2JHyL)\n- [2: NRF51822](https://s.click.aliexpress.com/e/_DdkWkyJ)\n- [3: NRF51822](https://s.click.aliexpress.com/e/_DBp4icn)\n\nThis AliExpress tag works with the nRF52832 firmware:\n\n- [HolyIOT YJ-17024-NRF52832 Amplified Module](https://s.click.aliexpress.com/e/_DlpmE0n): [Manufacturer's documentation](http://www.holyiot.com/eacp_view.asp?id=299).\n- [HolyIOT YJ-17095-NRF52832](https://s.click.aliexpress.com/e/_DCkw8LV)\n\nThese are affiliate links, so if you buy something using them, I get a small commission, and you help me to keep working on this project.\n\n### Available make targets\n\n- `nrf51822/armgcc`: `nrf51822_xxac` `nrf51822_xxac-dcdc`\n- `nrf52810/armgcc`: `nrf52810_xxaa` `nrf52810_xxaa-dcdc`\n- `nrf52832/armgcc`: `nrf52832_xxaa` `nrf52832_xxaa-dcdc` `nrf52832_yj17024`\n\n## Setup Instructions\n\nUnzip the relevant Nordic SDK and a compiler and place it in the `nrf-sdk` folder:\n\n```bash\ngcc-arm-none-eabi-6-2017-q2-update/ # Migth work with newer versions\nnRF5_SDK_12.3.0_d7731ad/\nnRF5_SDK_15.3.0_59ac345/\n```\n\n### Compile the Firmware\n\n```\nmake all # Compile all the supported devices and place them in the release folder\n```\n\n### Flash the Firmware\n\nThe device can be flashed using a STLink V2 programmer. The programmer should be connected to the SWD pins on the device. The following command can be used to flash the firmware:\n\n```bash\ncd nrf51822/armgcc\nmake clean\nmake stflash-nrf51822_xxac-patched ADV_KEYS_FILE=./50_NRF_keyfile\n```\n\n```bash\n```\n\nTo compile the firmware for the nRF52832 with the YJ-17024 board configuration, use the following command:\n\n```bash\ncd nrf52832/armgcc\nmake clean\nmake stflash-nrf52832_yj17024-patched ADV_KEYS_FILE=./50_NRF_keyfile\n```\n\n### Flashing with Raspberry Pi\n\nIf you're using a Raspberry Pi for flashing instead of a STLink V2 programmer, you can change the OpenOCD configuration file. Toggle between the configuration for the STLink V2 and Raspberry Pi by modifying the OpenOCD script.\n\nLocate the configuration line in your `openocd.cfg` file:\n\n```bash\nsource [find interface/stlink.cfg]\n```\n\nTo use a Raspberry Pi for flashing, comment out the STLink line and uncomment the Raspberry Pi configuration line:\n\n```bash\n# source [find interface/stlink.cfg]\nsource [find interface/raspberrypi2-native.cfg]\n```\n\nThis change allows you to use the Raspberry Pi GPIO pins for flashing your device instead of the STLink programmer.\n\n### Makefile Variables Summary\n\nThis section describes key Makefile variables you can adjust to customize the firmware:\n\n\n- **HAS_DEBUG**: Controls debug logging; set to `1` to enable or `0` to disable (default).\n- **MAX_KEYS**: Defines the maximum number of keys supported;\n- **HAS_BATTERY**: Enables battery level reporting; set to `1` to enable or `0` to disable (default);\n- **HAS_DCDC**: Enables DCDC mode; set to `1` to enable or `0` to for automatic selection (default);\n- **KEY_ROTATION_INTERVAL**: Sets the key rotation interval in seconds (default is 3600 * 3 seconds);\n- **ADVERTISING_INTERVAL**: Adjusts Bluetooth advertising interval; `0` (default) uses the standard interval (1000ms, down to 20ms);\n- **BOARD**: Specifies the custom board configuration; defaults to `custom_board` (see `custom_board.h`), but can be overridden with your board's configuration. For example, set `BOARD=yj17024` for the nRF52832 device.\n- **ADV_KEYS_FILE**: Specifies the file containing the keys to be flashed to the device.\n- **GNU_INSTALL_ROOT**: Path to the GNU toolchain; eg: ../../nrf-sdk/gcc-arm-none-eabi-6-2017-q2-update/bin/\n\n### Debugging with strtt\n\nThe firmware supports using strtt for displaying debug logs. To enable this feature, compile the firmware with `HAS_DEBUG=1`:\n\n```bash\ncd nrf51822/armgcc\nmake clean\nmake stflash-nrf51822_xxac-patched MAX_KEYS=500 HAS_DEBUG=1 ADV_KEYS_FILE=./50_NRF_keyfile\n```\n\nThis will activate debug logging, which can be viewed using `strtt`.\n\n### Using Black Magic Probe\n\nThe firmware can also be flashed using a Black Magic Probe. The programmer should be connected to the SWD pins on the device. The following command can be used to flash the firmware:\n\n```bash\ncd nrf52832/armgcc\nmake clean\nmake bmpflash-nrf52832_yj17024-patched ADV_KEYS_FILE=./50_NRF_keyfileZ\n```\n\n### Using RTT monitor\n\nYou can use the RTT monitor to see the debug logs. The following command can be used to monitor the logs:\n\n```bash\nmake bmpflash-monitor\n  BMP /dev/serial/by-id/usb-Black_Magic_Debug_Black_Magic_Probe__ST-Link_v2__v1.10.0-1151-g3fe0bc5a-XXXXXXXX-if00 (monitor)\n  minicom -c on -D /dev/serial/by-id/usb-Black_Magic_Debug_Black_Magic_Probe__ST-Link_v2__v1.10.0-1151-g3fe0bc5a-XXXXXXXX-if02\nTarget voltage: 3.35V\n....\n```\n\nIn another terminal, you can monitor the logs:\n\n```bash\nminicom -c on -D /dev/serial/by-id/usb-Black_Magic_Debug_Black_Magic_Probe__ST-Link_v2__v1.10.0-1151-g3fe0bc5a-XXXXXXXX-if02\n\u003cinfo\u003e app: last_filled_index: 249\n\u003cinfo\u003e app: Starting advertising\n\u003cinfo\u003e app: ble_set_mac_address: D3:7F:6F:DA:64:78\n\u003cinfo\u003e app: ble_set_max_tx_power: 8 dB failed\n\u003cinfo\u003e app: ble_set_max_tx_power: 7 dBm failed\n\u003cinfo\u003e app: ble_set_max_tx_power: 6 dBm failed\n\u003cinfo\u003e app: ble_set_max_tx_power: 5 dBm failed\n\u003cinfo\u003e app: ble_set_max_tx_power: 4 dBm\n\u003cinfo\u003e app: Rotating key: 59\n\u003cinfo\u003e app: last_filled_index: 249\n[0.000] \u003cinfo\u003e app: Starting advertising\n[0.000] \u003cinfo\u003e app: ble_set_mac_address: XX:XX:XX:XX:XX:XX\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpix%2Fheystack-nrf5x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpix%2Fheystack-nrf5x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpix%2Fheystack-nrf5x/lists"}