Skip to content

Fix issue where HackRF Pro (H4M) cannot enter HackRF mode normally. - #18

Merged
gullradriel merged 1 commit into
portapack-mayhem:nextfrom
OpenSourceSDRLab:next
Feb 20, 2026
Merged

gullradriel merged 1 commit into
portapack-mayhem:nextfrom
OpenSourceSDRLab:next

Conversation

@opensourcesdr99

Copy link
Copy Markdown

LCD,RX MODE and FPGA can use normally

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request aims to fix an issue where the HackRF Pro (H4M) device cannot enter HackRF mode normally. The PR adds support for loading FPGA bitstreams from SPIFI flash in RAM_MODE, enabling the device to transition from "PP mode" to HackRF mode successfully.

Changes:

  • Modified power initialization in PRALINE builds to enable 1v2 and RF power in RAM_MODE
  • Added new FPGA image loading path for RAM_MODE that loads from SPIFI flash
  • Introduced conditional compilation logic to handle DFU_MODE, RAM_MODE, and normal HackRF mode differently

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 15 comments.

File Description
firmware/hackrf_usb/hackrf_usb.c Modified power initialization for RAM_MODE and added conditional FPGA loading based on mode (DFU/RAM/normal)
firmware/common/fpga_image.c Added new FPGA loading function and infrastructure for loading from SPIFI flash, though with several implementation issues
Comments suppressed due to low confidence (1)

firmware/hackrf_usb/hackrf_usb.c:286

  • The change removes the RAM_MODE check for enabling 1v2_power and rf_power. Previously, these were only enabled when NOT in DFU_MODE and NOT in RAM_MODE. Now they're enabled in RAM_MODE as well. The comment says "hackrf mode ram should open this" but doesn't explain why this change is safe. Please verify this doesn't cause hardware issues when booting in RAM_MODE, especially since RAM_MODE firmware may have different power requirements.
	#if !defined(DFU_MODE) 
	enable_1v2_power();
	enable_rf_power();
	clock_gen_init();
	#endif

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread firmware/common/fpga_image.c Resolved
Comment thread firmware/hackrf_usb/hackrf_usb.c Resolved
Comment thread firmware/common/fpga_image.c Resolved
Comment thread firmware/common/fpga_image.c Resolved
Comment thread firmware/common/fpga_image.c Resolved
Comment thread firmware/common/fpga_image.c Resolved
Comment thread firmware/common/fpga_image.c Resolved
Comment thread firmware/common/fpga_image.c Resolved
Comment thread firmware/common/fpga_image.c Resolved
Comment thread firmware/common/fpga_image.c Resolved
@opensourcesdr99

opensourcesdr99 commented Feb 20, 2026 via email

Copy link
Copy Markdown
Author

@jLynx

jLynx commented Feb 20, 2026

Copy link
Copy Markdown

Please fix the build issues on the GitHub actions

@jLynx

jLynx commented Feb 20, 2026

Copy link
Copy Markdown

Please also convert comments to English. Feel free to use AI to convert them

@gullradriel
gullradriel merged commit f70bdb9 into portapack-mayhem:next Feb 20, 2026
36 of 42 checks passed
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.

3 participants