Compare commits

..

10 Commits

Author SHA1 Message Date
Sojus07
c744337311 kekl
Some checks failed
Build / host (macos-latest) (push) Has been cancelled
Build / host (ubuntu-latest) (push) Has been cancelled
Build / host (windows-latest) (push) Has been cancelled
Build / firmware (HACKRF_ONE, macos-latest) (push) Has been cancelled
Build / firmware (HACKRF_ONE, ubuntu-latest) (push) Has been cancelled
Build / firmware (JAWBREAKER, macos-latest) (push) Has been cancelled
Build / firmware (JAWBREAKER, ubuntu-latest) (push) Has been cancelled
Build / firmware (RAD1O, macos-latest) (push) Has been cancelled
Build / firmware (RAD1O, ubuntu-latest) (push) Has been cancelled
Check code style / clang-format (map[check:firmware/common exclude:firmware/common/xapp058]) (push) Has been cancelled
Check code style / clang-format (map[check:firmware/hackrf_usb exclude:]) (push) Has been cancelled
Check code style / clang-format (map[check:host/hackrf-tools/src exclude:]) (push) Has been cancelled
Check code style / clang-format (map[check:host/libhackrf/src exclude:]) (push) Has been cancelled
2025-08-04 16:45:01 +02:00
Michael Ossmann
4282a3d8dc Merge pull request #1551 from philippuhl/patch-1
Update doc section about windows binaries
2025-07-03 11:16:28 -04:00
philippuhl
a757698bea Add radioconda information
I added the Information about radioconda. I would still suggest leaving the hint about the build artifacts in the documentation, as this is currently the only source of the binaries that don't require any third party.
2025-06-14 21:22:51 +02:00
Michael Ossmann
4b8dbfc308 Merge pull request #1553 from miek/fix-dfu-crc
Fix DFU CRC errors
2025-06-05 12:00:58 -04:00
Michael Ossmann
305576ed17 Merge pull request #1555 from albayenes/num-fft-bins-is-more-appropriate-name-for-fftSize
Replace fftSize with more meaningful name for num_fft_bins
2025-06-05 11:15:32 -04:00
Enes Albay
eead55af45 Replace fftSize with more meaningful name num_fft_bins 2025-05-23 19:43:22 +03:00
Mike Walters
3b5cd8f889 Fix DFU CRC errors
Previously we were calculating the dfu-suffix CRC and then modifying the
image, invalidating the check.

This re-orders the operations to apply the boot image header first and
then run dfu-suffix.
2025-05-22 10:04:40 +01:00
philippuhl
b84aab3bca Update section about windows binaries 2025-05-19 12:51:16 +02:00
antoinevg
e5cfe1ac2b Merge pull request #1540 from miek/docs-improvements
docs: Rename FAQ to troubleshooting, reorganise, and add info on troubleshooting undetected hardware
2025-03-27 16:31:06 +02:00
Mike Walters
17b641d776 docs: add troubleshooting section for no boards found 2025-03-25 13:07:11 +00:00
6 changed files with 72 additions and 51 deletions

View File

@ -62,7 +62,9 @@ OS X (10.5+): MacPorts
Windows: Binaries Windows: Binaries
+++++++++++++++++ +++++++++++++++++
Binaries are provided as part of the PothosSDR project, they can be downloaded `here <http://downloads.myriadrf.org/builds/PothosSDR/?C=M;O=D>`__. Windows users can use `radioconda <https://github.com/ryanvolz/radioconda>`__ to get the required binaries installed.
Alternatively, binaries are available as build artifacts under the 'Actions'-tab on github `here <https://github.com/greatscottgadgets/hackrf/actions>`__ (GitHub Login needed).

View File

@ -4,6 +4,26 @@
Troubleshooting Troubleshooting
================================================ ================================================
HackRF not detected / "No HackRF boards found."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the software you're using is unable to detect the HackRF hardware and/or `hackrf_info` returns "No HackRF boards found.", this can be caused by a number of different software or hardware issues.
Solution
--------
#. If you are using a PortaPack addon, make sure to select "HackRF" mode from the main menu.
#. If you are using a virtual machine or Windows Subsystem for Linux (WSL), make sure that it is configured to pass through the USB device.
#. Check whether the device appears in ``lsusb`` (Linux), Device Manager (Windows), or System Report (macOS). If it doesn't not appear, it could either be a firmware issue, an issue with the cable, or another hardware issue.
#. Try booting the HackRF in DFU mode by holding the "DFU" button when plugging in the device. It should now appear as `NXP Semiconductors LPC4330FET180 [ARM Cortex M4 + M0] (device firmware upgrade mode)` in the locations listed above. If it does appear, then it was likely a firmware issue and you can follow the instructions to :ref:`recover the SPI flash firmware <recovering_firmware>`.
#. If the device does not appear in DFU mode then it is likely to be an issue with the USB cable. Charge-only cables (which do not include the data lines) have become very common and will cause this symptom. Ideally, test the cable you're using with another device that does some sort of data transfer to be sure that it works, or just try other cables.
#. If the device still does not appear, it may be a less common issue or possibly a fault with the hardware. See :doc:`Getting Help <getting_help>` for information on where to ask for more support, and please include as much detail as you can about what you've already tried.
.. _bigspike: .. _bigspike:
There is a big spike in the center of the received spectrum There is a big spike in the center of the received spectrum

View File

@ -29,7 +29,7 @@ After writing the firmware to SPI flash, you may need to reset the HackRF device
If you get an error that mentions HACKRF_ERROR_NOT_FOUND, it is often a permissions problem on your OS. If you get an error that mentions HACKRF_ERROR_NOT_FOUND, it is often a permissions problem on your OS.
.. _recovering_firmware:
Only if Necessary: Recovering the SPI Flash Firmware Only if Necessary: Recovering the SPI Flash Firmware
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -234,12 +234,11 @@ macro(DeclareTargets)
add_custom_target( add_custom_target(
${PROJECT_NAME}.dfu ${DFU_ALL} ${PROJECT_NAME}.dfu ${DFU_ALL}
DEPENDS ${PROJECT_NAME}_dfu.bin DEPENDS ${PROJECT_NAME}_dfu.bin
COMMAND rm -f _tmp.dfu _header.bin COMMAND rm -f _header.bin
COMMAND cp ${PROJECT_NAME}_dfu.bin _tmp.dfu
COMMAND dfu-suffix --vid=0x1fc9 --pid=0x000c --did=0x0 -a _tmp.dfu
COMMAND python3 ${PATH_DFU_PY} ${PROJECT_NAME} COMMAND python3 ${PATH_DFU_PY} ${PROJECT_NAME}
COMMAND cat _header.bin _tmp.dfu >${PROJECT_NAME}.dfu COMMAND cat _header.bin ${PROJECT_NAME}_dfu.bin > ${PROJECT_NAME}.dfu
COMMAND rm -f _tmp.dfu _header.bin COMMAND dfu-suffix --vid=0x1fc9 --pid=0x000c --did=0x0 -a ${PROJECT_NAME}.dfu
COMMAND rm -f _header.bin
) )
# Program / flash targets # Program / flash targets

View File

@ -27,8 +27,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#define USB_BULK_BUFFER_SIZE 0x8000 #define USB_BULK_BUFFER_SIZE 0x10000
#define USB_BULK_BUFFER_MASK 0x7FFF #define USB_BULK_BUFFER_MASK 0xFFFF
/* Address of usb_bulk_buffer is set in ldscripts. If you change the name of this /* Address of usb_bulk_buffer is set in ldscripts. If you change the name of this
* variable, it won't be where it needs to be in the processor's address space, * variable, it won't be where it needs to be in the processor's address space,

View File

@ -192,7 +192,7 @@ bool one_shot = false;
bool finite_mode = false; bool finite_mode = false;
volatile bool sweep_started = false; volatile bool sweep_started = false;
int fftSize = 20; int num_fft_bins = 20;
double fft_bin_width; double fft_bin_width;
fftwf_complex* fftwIn = NULL; fftwf_complex* fftwIn = NULL;
fftwf_complex* fftwOut = NULL; fftwf_complex* fftwOut = NULL;
@ -242,7 +242,7 @@ int rx_callback(hackrf_transfer* transfer)
byte_count += transfer->valid_length; byte_count += transfer->valid_length;
buf = (int8_t*) transfer->buffer; buf = (int8_t*) transfer->buffer;
ifft_bins = fftSize * step_count; ifft_bins = num_fft_bins * step_count;
for (j = 0; j < BLOCKS_PER_TRANSFER; j++) { for (j = 0; j < BLOCKS_PER_TRANSFER; j++) {
ubuf = (uint8_t*) buf; ubuf = (uint8_t*) buf;
if (ubuf[0] == 0x7F && ubuf[1] == 0x7F) { if (ubuf[0] == 0x7F && ubuf[1] == 0x7F) {
@ -301,28 +301,28 @@ int rx_callback(hackrf_transfer* transfer)
continue; continue;
} }
/* copy to fftwIn as floats */ /* copy to fftwIn as floats */
buf += BYTES_PER_BLOCK - (fftSize * 2); buf += BYTES_PER_BLOCK - (num_fft_bins * 2);
for (i = 0; i < fftSize; i++) { for (i = 0; i < num_fft_bins; i++) {
fftwIn[i][0] = buf[i * 2] * window[i] * 1.0f / 128.0f; fftwIn[i][0] = buf[i * 2] * window[i] * 1.0f / 128.0f;
fftwIn[i][1] = buf[i * 2 + 1] * window[i] * 1.0f / 128.0f; fftwIn[i][1] = buf[i * 2 + 1] * window[i] * 1.0f / 128.0f;
} }
buf += fftSize * 2; buf += num_fft_bins * 2;
fftwf_execute(fftwPlan); fftwf_execute(fftwPlan);
for (i = 0; i < fftSize; i++) { for (i = 0; i < num_fft_bins; i++) {
pwr[i] = logPower(fftwOut[i], 1.0f / fftSize); pwr[i] = logPower(fftwOut[i], 1.0f / num_fft_bins);
} }
if (binary_output) { if (binary_output) {
record_length = record_length =
2 * sizeof(band_edge) + (fftSize / 4) * sizeof(float); 2 * sizeof(band_edge) + (num_fft_bins / 4) * sizeof(float);
fwrite(&record_length, sizeof(record_length), 1, outfile); fwrite(&record_length, sizeof(record_length), 1, outfile);
band_edge = frequency; band_edge = frequency;
fwrite(&band_edge, sizeof(band_edge), 1, outfile); fwrite(&band_edge, sizeof(band_edge), 1, outfile);
band_edge = frequency + DEFAULT_SAMPLE_RATE_HZ / 4; band_edge = frequency + DEFAULT_SAMPLE_RATE_HZ / 4;
fwrite(&band_edge, sizeof(band_edge), 1, outfile); fwrite(&band_edge, sizeof(band_edge), 1, outfile);
fwrite(&pwr[1 + (fftSize * 5) / 8], fwrite(&pwr[1 + (num_fft_bins * 5) / 8],
sizeof(float), sizeof(float),
fftSize / 4, num_fft_bins / 4,
outfile); outfile);
fwrite(&record_length, sizeof(record_length), 1, outfile); fwrite(&record_length, sizeof(record_length), 1, outfile);
@ -330,25 +330,25 @@ int rx_callback(hackrf_transfer* transfer)
fwrite(&band_edge, sizeof(band_edge), 1, outfile); fwrite(&band_edge, sizeof(band_edge), 1, outfile);
band_edge = frequency + (DEFAULT_SAMPLE_RATE_HZ * 3) / 4; band_edge = frequency + (DEFAULT_SAMPLE_RATE_HZ * 3) / 4;
fwrite(&band_edge, sizeof(band_edge), 1, outfile); fwrite(&band_edge, sizeof(band_edge), 1, outfile);
fwrite(&pwr[1 + fftSize / 8], sizeof(float), fftSize / 4, outfile); fwrite(&pwr[1 + num_fft_bins / 8], sizeof(float), num_fft_bins / 4, outfile);
} else if (ifft_output) { } else if (ifft_output) {
ifft_idx = (uint32_t) round( ifft_idx = (uint32_t) round(
(frequency - (uint64_t) (FREQ_ONE_MHZ * frequencies[0])) / (frequency - (uint64_t) (FREQ_ONE_MHZ * frequencies[0])) /
fft_bin_width); fft_bin_width);
ifft_idx = (ifft_idx + ifft_bins / 2) % ifft_bins; ifft_idx = (ifft_idx + ifft_bins / 2) % ifft_bins;
for (i = 0; (fftSize / 4) > i; i++) { for (i = 0; (num_fft_bins / 4) > i; i++) {
ifftwIn[ifft_idx + i][0] = ifftwIn[ifft_idx + i][0] =
fftwOut[i + 1 + (fftSize * 5) / 8][0]; fftwOut[i + 1 + (num_fft_bins * 5) / 8][0];
ifftwIn[ifft_idx + i][1] = ifftwIn[ifft_idx + i][1] =
fftwOut[i + 1 + (fftSize * 5) / 8][1]; fftwOut[i + 1 + (num_fft_bins * 5) / 8][1];
} }
ifft_idx += fftSize / 2; ifft_idx += num_fft_bins / 2;
ifft_idx %= ifft_bins; ifft_idx %= ifft_bins;
for (i = 0; (fftSize / 4) > i; i++) { for (i = 0; (num_fft_bins / 4) > i; i++) {
ifftwIn[ifft_idx + i][0] = ifftwIn[ifft_idx + i][0] =
fftwOut[i + 1 + (fftSize / 8)][0]; fftwOut[i + 1 + (num_fft_bins / 8)][0];
ifftwIn[ifft_idx + i][1] = ifftwIn[ifft_idx + i][1] =
fftwOut[i + 1 + (fftSize / 8)][1]; fftwOut[i + 1 + (num_fft_bins / 8)][1];
} }
} else { } else {
time_t time_stamp_seconds = usb_transfer_time.tv_sec; time_t time_stamp_seconds = usb_transfer_time.tv_sec;
@ -361,11 +361,11 @@ int rx_callback(hackrf_transfer* transfer)
(uint64_t) (frequency), (uint64_t) (frequency),
(uint64_t) (frequency + DEFAULT_SAMPLE_RATE_HZ / 4), (uint64_t) (frequency + DEFAULT_SAMPLE_RATE_HZ / 4),
fft_bin_width, fft_bin_width,
fftSize); num_fft_bins);
for (i = 0; (fftSize / 4) > i; i++) { for (i = 0; (num_fft_bins / 4) > i; i++) {
fprintf(outfile, fprintf(outfile,
", %.2f", ", %.2f",
pwr[i + 1 + (fftSize * 5) / 8]); pwr[i + 1 + (num_fft_bins * 5) / 8]);
} }
fprintf(outfile, "\n"); fprintf(outfile, "\n");
fprintf(outfile, fprintf(outfile,
@ -375,9 +375,9 @@ int rx_callback(hackrf_transfer* transfer)
(uint64_t) (frequency + (DEFAULT_SAMPLE_RATE_HZ / 2)), (uint64_t) (frequency + (DEFAULT_SAMPLE_RATE_HZ / 2)),
(uint64_t) (frequency + ((DEFAULT_SAMPLE_RATE_HZ * 3) / 4)), (uint64_t) (frequency + ((DEFAULT_SAMPLE_RATE_HZ * 3) / 4)),
fft_bin_width, fft_bin_width,
fftSize); num_fft_bins);
for (i = 0; (fftSize / 4) > i; i++) { for (i = 0; (num_fft_bins / 4) > i; i++) {
fprintf(outfile, ", %.2f", pwr[i + 1 + (fftSize / 8)]); fprintf(outfile, ", %.2f", pwr[i + 1 + (num_fft_bins / 8)]);
} }
fprintf(outfile, "\n"); fprintf(outfile, "\n");
} }
@ -536,7 +536,7 @@ int main(int argc, char** argv)
case 'w': case 'w':
result = parse_u32(optarg, &requested_fft_bin_width); result = parse_u32(optarg, &requested_fft_bin_width);
fftSize = DEFAULT_SAMPLE_RATE_HZ / requested_fft_bin_width; num_fft_bins = DEFAULT_SAMPLE_RATE_HZ / requested_fft_bin_width;
break; break;
case 'W': case 'W':
@ -657,7 +657,7 @@ int main(int argc, char** argv)
* for interleaved mode. With our fixed sample rate of 20 Msps, that * for interleaved mode. With our fixed sample rate of 20 Msps, that
* results in a maximum bin width of 5000000 Hz. * results in a maximum bin width of 5000000 Hz.
*/ */
if (4 > fftSize) { if (4 > num_fft_bins) {
fprintf(stderr, fprintf(stderr,
"argument error: FFT bin width (-w) must be no more than 5000000\n"); "argument error: FFT bin width (-w) must be no more than 5000000\n");
return EXIT_FAILURE; return EXIT_FAILURE;
@ -667,11 +667,11 @@ int main(int argc, char** argv)
* The maximum number of FFT bins we support is equal to the number of * The maximum number of FFT bins we support is equal to the number of
* samples in a block. Each block consists of 16384 bytes minus 10 * samples in a block. Each block consists of 16384 bytes minus 10
* bytes for the frequency header, leaving room for 8187 two-byte * bytes for the frequency header, leaving room for 8187 two-byte
* samples. As we pad fftSize up to the next odd multiple of four, this * samples. As we pad num_fft_bins up to the next odd multiple of four, this
* makes our maximum supported fftSize 8180. With our fixed sample * makes our maximum supported num_fft_bins 8180. With our fixed sample
* rate of 20 Msps, that results in a minimum bin width of 2445 Hz. * rate of 20 Msps, that results in a minimum bin width of 2445 Hz.
*/ */
if (8180 < fftSize) { if (8180 < num_fft_bins) {
fprintf(stderr, fprintf(stderr,
"argument error: FFT bin width (-w) must be no less than 2445\n"); "argument error: FFT bin width (-w) must be no less than 2445\n");
return EXIT_FAILURE; return EXIT_FAILURE;
@ -681,19 +681,19 @@ int main(int argc, char** argv)
* number of FFT bins is equal to an odd multiple of four. * number of FFT bins is equal to an odd multiple of four.
* (e.g. 4, 12, 20, 28, 36, . . .) * (e.g. 4, 12, 20, 28, 36, . . .)
*/ */
while ((fftSize + 4) % 8) { while ((num_fft_bins + 4) % 8) {
fftSize++; num_fft_bins++;
} }
fft_bin_width = (double) DEFAULT_SAMPLE_RATE_HZ / fftSize; fft_bin_width = (double) DEFAULT_SAMPLE_RATE_HZ / num_fft_bins;
fftwIn = (fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex) * fftSize); fftwIn = (fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex) * num_fft_bins);
fftwOut = (fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex) * fftSize); fftwOut = (fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex) * num_fft_bins);
fftwPlan = fftwPlan =
fftwf_plan_dft_1d(fftSize, fftwIn, fftwOut, FFTW_FORWARD, fftw_plan_type); fftwf_plan_dft_1d(num_fft_bins, fftwIn, fftwOut, FFTW_FORWARD, fftw_plan_type);
pwr = (float*) fftwf_malloc(sizeof(float) * fftSize); pwr = (float*) fftwf_malloc(sizeof(float) * num_fft_bins);
window = (float*) fftwf_malloc(sizeof(float) * fftSize); window = (float*) fftwf_malloc(sizeof(float) * num_fft_bins);
for (i = 0; i < fftSize; i++) { for (i = 0; i < num_fft_bins; i++) {
window[i] = (float) (0.5f * (1.0f - cos(2 * M_PI * i / (fftSize - 1)))); window[i] = (float) (0.5f * (1.0f - cos(2 * M_PI * i / (num_fft_bins - 1))));
} }
/* Execute the plan once to make sure it's ready to go when real /* Execute the plan once to make sure it's ready to go when real
@ -807,11 +807,11 @@ int main(int argc, char** argv)
if (ifft_output) { if (ifft_output) {
ifftwIn = (fftwf_complex*) fftwf_malloc( ifftwIn = (fftwf_complex*) fftwf_malloc(
sizeof(fftwf_complex) * fftSize * step_count); sizeof(fftwf_complex) * num_fft_bins * step_count);
ifftwOut = (fftwf_complex*) fftwf_malloc( ifftwOut = (fftwf_complex*) fftwf_malloc(
sizeof(fftwf_complex) * fftSize * step_count); sizeof(fftwf_complex) * num_fft_bins * step_count);
ifftwPlan = fftwf_plan_dft_1d( ifftwPlan = fftwf_plan_dft_1d(
fftSize * step_count, num_fft_bins * step_count,
ifftwIn, ifftwIn,
ifftwOut, ifftwOut,
FFTW_BACKWARD, FFTW_BACKWARD,