Skip to content

Radio configuration register interface#1648

Merged
mossmann merged 8 commits intomainfrom
radio-config
Feb 23, 2026
Merged

Radio configuration register interface#1648
mossmann merged 8 commits intomainfrom
radio-config

Conversation

@mossmann
Copy link
Copy Markdown
Member

@mossmann mossmann commented Jan 20, 2026

This implements a new firmware API for unified control of the radio section with a register interface. Requested configuration changes are written to the active register bank. Settings in the active bank are periodically applied and written to the applied bank. Additional banks for specific operating modes store settings that will be copied to the active bank and then applied when switching to that operating mode. For example, settings in the RX bank are copied and applied when starting RX. This effectively implements most of #906.

This initial implementation replaces the underlying structure without changing function from the perspective of host software. It aims to enable future work:

  • Make all radio settings retrievable by the host. (Some of this is already done, but additional work will enable, for example, retrieval of the precise tuned frequency instead of the requested frequency.)
  • Consolidate radio elements under radio.c, moving them out of hackrf_core.c.
  • Update libhackrf and documentation to make the register interface useful to host software.
  • Implement additional radio configuration modes that use alternative FPGA bitstreams on HackRF Pro.

Additionally, by moving the application of radio configuration changes outside of interrupt handlers, this eliminates a class of concurrency bug that can cause tuning failure or other configuration errors.

Fix #1681
Fix #1683

@mossmann mossmann force-pushed the radio-config branch 3 times, most recently from 406cee5 to 35e7051 Compare January 25, 2026 20:17
@mossmann mossmann force-pushed the radio-config branch 2 times, most recently from d24f105 to 8c249a1 Compare February 4, 2026 20:33
@mossmann mossmann marked this pull request as ready for review February 4, 2026 20:48
@mossmann mossmann marked this pull request as draft February 5, 2026 16:23
@mossmann mossmann force-pushed the radio-config branch 3 times, most recently from f86c2f0 to 300a89e Compare February 11, 2026 16:27
@mossmann mossmann changed the title Refactor radio configuration Radio configuration register interface Feb 11, 2026
@mossmann mossmann marked this pull request as ready for review February 11, 2026 17:23
Copy link
Copy Markdown
Member

@antoinevg antoinevg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌 I think this is the elegant solution.

Tested:

  • hackrf_debug --selftest
  • hackrf_debug read/write registers
  • hackrf_transfer tx/rx, verify all settings function
  • SDRAngel tx/rx, all settings, verify all settings function

On:

  • HackRF One r4
  • Praline r1.0
  • HackRF Pro 1.2

Comment thread firmware/common/radio.c Outdated
@mossmann mossmann merged commit 849ce28 into main Feb 23, 2026
80 checks passed
@mossmann mossmann deleted the radio-config branch February 23, 2026 17:51
mossmann added a commit that referenced this pull request Apr 1, 2026
This was intended to be removed in #1648. Registers are typically
written from within USB ISRs. Updates are meant to happen outside of
ISRs.
@martinling
Copy link
Copy Markdown
Member

martinling commented Apr 14, 2026

I was just doing some testing with the rad1o badge, and found that sweep mode has been broken there since commit b1bfc24. I don't know the cause yet.

pull Bot pushed a commit to bahdahshin/hackrf that referenced this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mixer PLL fails to lock Praline tuning error on sample rate change

3 participants