1127 Commits

Author SHA1 Message Date
Michael Ossmann
b15509c2d9 h1r9: MAX2839: emulate MAX2837 RX gain configuration 2023-01-06 14:33:53 +00:00
Michael Ossmann
5693f7b193 h1r9: MAX2839: support maximum TX gain, not minimum 2023-01-06 14:33:53 +00:00
Michael Ossmann
eb8ed45f9a h1r9: adjust PLLA according to source frequency 2023-01-06 14:33:53 +00:00
Michael Ossmann
7a0aec00ef h1r9: fix usb_vendor_request_reset()
The bootloader is configured by pin straps on certain pins. We use some
of those for other purposes in r9 which causes the bootloader to
misbehave if the device is reset from software. By switching these pins
from outputs to inputs just before reset this problem is avoided.
2023-01-06 14:33:53 +00:00
Michael Ossmann
ea3b804edf h1r9: workaround platform detection problem
On the first spin of r9 one of the pins used for platform detection is
pulled up to VAA, not VCC, and VAA hasn't been switched on yet at the
time of platform detection. This results in r9 being misidentified as OG
from time to time.

As a temporary workaround until the next board spin, change the platform
from OG to r9 if it is detected as OG but has r9 pin straps.
2023-01-06 14:33:53 +00:00
Michael Ossmann
3f73290524 h1r9: configure MAX2839 HPF
Without this, the RX baseband gain amplifies a DC offset.
2023-01-06 14:33:53 +00:00
Michael Ossmann
616705b7e5 h1r9: don't write to outputs in TIMER3 ext. match register
Writing to the output bits in the TIMER3 external match register
resulted in intermittent failures that varied in likelihood from board
to board and from commit to commit for no apparent reason.
2023-01-06 14:33:53 +00:00
Michael Ossmann
4db7e8d38a h1r9: more bring-up fixes 2023-01-06 14:33:53 +00:00
Michael Ossmann
edd0a80812 h1r9: stop writing MAX2837 registers to MAX2839 2023-01-06 14:33:53 +00:00
Michael Ossmann
f4817b60a3 h1r9: MAX2839 driver updates 2023-01-06 14:33:53 +00:00
Michael Ossmann
a72f084ff0 h1r9: fix CLKOUT_EN pin setup 2023-01-06 14:33:53 +00:00
Michael Ossmann
3738270e4f h1r9: use MAX2839 2023-01-06 14:33:53 +00:00
grvvy
14183a96ea h1r9: implement additional MAX2839 functions, change some mreg definition names, fix RF gain control math 2023-01-06 14:33:53 +00:00
grvvy
cbbe94c8fe h1r9: add preliminary MAX2839 driver and accompanying header file; add some convenience macros to regs_def 2023-01-06 14:33:53 +00:00
grvvy
dcb9cd1beb h1r9: add preliminary MAX2839 register definitions 2023-01-06 14:33:53 +00:00
Michael Ossmann
b61c30a50d h1r9: bring-up wip 2023-01-06 14:33:53 +00:00
Michael Ossmann
4ffe3658be h1r9: add max2839_target.c 2023-01-06 14:33:53 +00:00
Michael Ossmann
1f73f2fd25 h1r9: add Si5351A support 2023-01-06 14:33:48 +00:00
Michael Ossmann
6d48671084 h1r9: initial GPIO definitions 2023-01-06 12:45:51 +00:00
Michael Ossmann
8aa79e9fe5 h1r9: use timer to detect external clock frequency 2023-01-06 12:45:46 +00:00
Mike Walters
060d9cbd8a Add firmware_info structure 2023-01-05 15:13:06 +00:00
Michael Ossmann
3d39660be1 Merge pull request #1237 from greatscottgadgets/tuning
restrict IF to 2170-2740 MHz
2022-12-23 11:56:38 -05:00
Michael Ossmann
3d687a20fd increase forceable IF range to 2000-3000 MHz 2022-12-23 06:06:22 -05:00
Michael Ossmann
173612ac77 add --led option to hackrf_debug
and corresponding changes to libhackrf and firmware
2022-12-18 07:22:17 -05:00
Michael Ossmann
86c1d8ce6e restrict IF to 2170-2740 MHz 2022-12-09 09:12:37 -05:00
Michael Ossmann
b106495042 Merge pull request #1235 from stevefalco/correct_register_definition
Make definition of "prev" consistent
2022-12-01 13:08:35 -05:00
Michael Ossmann
956492fb65 Merge pull request #1212 from schneider42/schneider/m0_reset
m0: reset M0 before starting it
2022-12-01 12:42:15 -05:00
Michael Ossmann
e226a416de Merge pull request #1203 from martinling/8k-transfers
Reduce firmware USB transfer size from 16KB to 8KB
2022-12-01 12:40:26 -05:00
Steven A. Falco
7dbf6d65b6 Make definition of "prev" consistent 2022-11-30 16:53:11 -05:00
schneider
d8d3dc039d m0: reset M0 before starting it
The rad1o was not starting the M0 when powered up by inserting a USB
cable. Interestingly the M0 does start when toggling the power switch.

Resetting the M0 before starting it in `main()` solves this issue.
2022-10-26 20:03:39 +02:00
Michael Ossmann
5acd0cb99e set version to 2022.09.1+ 2022-10-24 15:14:00 -04:00
Martin Ling
fefa4f0e45 Reduce firmware USB transfer size from 16KB to 8KB. 2022-10-22 13:47:06 +01:00
Michael Ossmann
b6acd66cfe set version to 2022.09.1
Starting with this release we will no longer use "unknown" as the
default software version string used in cases where the version cannot
be determined from context. Instead we commit the release version string
to git so that any software built from the tagged commit will have the
appropriate release version string. After the release we will commit a
post-release version string as the new default.

We will continue to use the commit hash as version string when the
software is built inside a git repository.
2022-09-29 05:20:39 -04:00
Michael Ossmann
7243db7d68 Merge pull request #1181 from greatscottgadgets/cleanup
pre-release clean-up and platform detection improvement
2022-09-27 13:19:52 -04:00
Martin Ling
1db39c0e61 Flush queues on control endpoint when a new SETUP is received.
On macOS 12.6 running libusb 1.0.26, the host was seen to sometimes
make an incomplete ClearFeature(ENDPOINT_HALT) request when
ClearPipeStallBothEnds was called from libusb_cancel_transfer.

The host would send the SETUP packet, and the firmware would
call usb_transfer_schedule_ack to acknowledge the upcoming IN
token. However, the host would then not send the IN token,
proceeding directly to the next SETUP.

Since an empty transfer was queued to schedule the ACK, the
firmware would leak one transfer from the free_transfers list.

After a few iterations of this, the firmware would run out of
free transfers and the next request would hang waiting for one.

Fix this by flushing the transfer queues for the control endpoint
when a new SETUP is received, since that token implicitly cancels
any previously ongoing request.
2022-09-27 09:45:43 +01:00
Michael Ossmann
1f9f597ea8 firmware: use python3 interpreter, not python 2022-09-26 16:46:04 -04:00
Michael Ossmann
f3d10dcc62 firmware: improve platform detection
Slow down the detection of pull-up and pull-down resistors to make
detection more reliable.
2022-09-26 16:44:38 -04:00
Michael Ossmann
b026c07000 firmware: fix duration of delay_us_at_mhz() 2022-09-26 16:43:43 -04:00
Michael Ossmann
04614c616a blinky: support platform detection 2022-09-23 15:08:22 -04:00
Michael Ossmann
06b9d7bee0 Clean up source code copyright notices. 2022-09-23 14:46:52 -04:00
Michael Ossmann
92b15f226e Merge pull request #1172 from martinling/amp-startup
Fix initial state of RF path GPIOs.
2022-09-21 15:19:04 -04:00
Martin Ling
3dd2e51d71 Initialise rf_path->switchctrl to SWITCHCTRL_SAFE.
This was previously never being initialised.
2022-09-21 12:22:58 +01:00
Martin Ling
cf34beebb0 Remove extra call to switchctrl_set and global switchctrl variable.
This call is not required since the GPIOs are already configured in
rf_path_pin_setup(). The global switchctrl is not used anywhere else.
2022-09-21 12:17:18 +01:00
Martin Ling
eec6963759 Initialise RF path GPIOs to safe settings.
Previously these calls were leaving the amplifiers on, since the
control settings passed were missing SWITCHCTRL_NO_TX_AMP_PWR and
SWITCHCTRL_NO_RX_AMP_PWR. Use the predefined SWITCHCTRL_SAFE here.

Also move these calls before setting the GPIO pins to output mode,
to avoid driving them to the wrong states briefly first.
2022-09-21 12:05:17 +01:00
Martin Ling
767db9f06c Don't start baseband streaming until TX buffer is first filled. 2022-09-20 11:13:25 +01:00
Michael Ossmann
e623c7aed7 Merge pull request #1103 from dizcza/master
fixed firmware manual build docs
2022-09-19 21:30:22 -04:00
Martin Ling
44511c6c3b Move RFFC5072 setup before enabling RF power. 2022-09-19 13:02:29 +01:00
Martin Ling
5d78302d97 Change default RFFC5072 register settings to disable antenna bias. 2022-09-19 13:02:01 +01:00
Martin Ling
6d57709000 Move delay after enabling RF power to rad1o-specific code. 2022-09-19 10:46:01 +01:00
Danylo Ulianych
a2c30a8896 Update firmware/README
Co-authored-by: Martin Ling <martin-github@earth.li>
2022-09-15 07:39:48 +03:00