Commit Graph
225 Commits
Author SHA1 Message Date
liquidraver 09d95b727b gps: assert reset/resetb across System OFF, declare t1000_e RESETB active-low 2026-09-19 20:57:46 +02:00
Pieter ViljoenandClaude Opus 5 bb84f54191 drive every gps control line with logical gpio semantics
gps_power_control() mixed the two GPIO conventions on the same pins. It
configured lines with GPIO_OUTPUT_HIGH / GPIO_OUTPUT_LOW, which Zephyr defines
as physical levels, then drove the same lines with gpio_pin_set_dt(), which is
logical. On a line declared GPIO_ACTIVE_LOW those are opposite, so the first
call asserted the reverse of every call after it.

Two lines are actually broken by this.

gps-enable, on the boards declaring it active-low. Most of them reach the block
named for the T1000-E rather than the "simple boards" path, because
HAS_T1000_GPS_CONTROL is (HAS_GPS_VRTC || HAS_GPS_RESET || HAS_GPS_SLEEP) and a
bare gps-reset alias is enough to route a board there. That block drives the
enable physical HIGH unconditionally on every power-on, and power-off lands on
physical HIGH too, so the line is de-asserted in both states and the module is
never powered at all.

gps-reset, on the six boards declaring it active-low: heltec_t096, heltec_t1,
heltec_t114, thinknode_m1, heltec_wifi_lora32_v4 and _v43. The documented
power-on sequence is "assert reset, hold 10 ms, release", written as
GPIO_OUTPUT_HIGH then gpio_pin_set_dt(0). On an active-low line both of those
are physical HIGH, so the pulse never asserts and the module starts
uncontrolled -- the condition the power-off comment says this code prevents.
heltec_wifi_lora32_v4's overlay documented the no-op rather than fixing it;
that comment is updated here, with _v43's copy.

vrtc, sleep, rtcint and resetb are converted too. Every board declaring them is
active-high, so those change nothing today; they are converted so the root
cause does not survive in four more places.

Converting is safe by construction. gpio_pin_configure() flips the init level
only when both GPIO_OUTPUT_INIT_LOGICAL and GPIO_ACTIVE_LOW are set, then
strips INIT_LOGICAL, so on an active-high pin GPIO_OUTPUT_ACTIVE produces a
flags word byte-identical to GPIO_OUTPUT_HIGH. Behaviour changes only where a
line is declared active-low, which is only where it is currently wrong.

gps_power_off_for_shutdown() had the same inversion and it mattered most there:
on the active-low boards the old physical LOW asserted the enable, powering the
GPS on as the device entered System OFF rather than powering it down. Its
header comment also described a narrower scope than the function has, naming
only the power enable where it configures vrtc, reset, sleep, rtcint and
resetb as well; that is corrected here.

Comments that described a level this change now drives logically are reworded
to asserted/de-asserted. Comments stating genuine electrical facts, such as a
pin floating LOW without its pull-up, are left as they are, since rewording
those would make them wrong.

Verified on hardware on a Heltec V4-R8, whose gps-enable is active-low: with
this change the boot log reports "GPS power GPIO configured, set ACTIVE" and
the L76K streams NMEA (210 sentences in 35 s), where without it the log reports
"set HIGH" and the module never powers on. Also built for heltec_wifi_lora32_v4
and _v43 (active-low enable and reset), thinknode_m1 and heltec_t114
(active-low reset) and t1000_e (active-high throughout).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 10:10:30 -07:00
liquidraver edcc40a884 track zephyr main 3e8f38faf93: rebase patches, lora 0.9 api, nrf clock split, s3 heap, lr11xx/lr20xx dc preamble guard, usb kick loop fix 2026-09-19 16:46:14 +02:00
liquidraver 39b9584b20 .editorconfig and .gitattributes 2026-09-18 21:25:19 +02:00
liquidraver a78b4ae2ea lower sf fixes 2026-09-17 13:14:37 +02:00
liquidraver 1c2c942849 command reply buffer and tcp oversize fix 2026-09-17 10:59:13 +02:00
liquidraver 8c21a1609b lr2021 2.4ghz and seeed evk button fix 2026-09-12 19:46:43 +02:00
liquidraver 69cc148fbe properly reset CAD offset when needed 2026-09-10 21:56:52 +02:00
liquidraver eef6a488a2 esp flash fix 2026-09-04 12:14:05 +02:00
liquidraver 1beac007b7 documenting and error handling 2026-09-04 09:23:18 +02:00
liquidraver bdf7348208 CAD offset safety net 2026-09-03 22:47:26 +02:00
liquidraver 7ae467305a transmit airtime fix 2026-09-03 19:02:51 +02:00
liquidraver 1633274e4f leds refactor/improvement 2026-09-03 14:34:12 +02:00
liquidraver 355ce04b21 numerous more cad fixes and improvements 2026-09-02 22:39:40 +02:00
liquidraver 81a43f6dd1 west update and upstream dev sync 2026-09-02 10:01:34 +02:00
liquidraver 7d2e6ffafa fix ina voltage reading 2026-09-02 08:50:19 +02:00
liquidraver ba33cebf6a cad improvements 2026-09-01 22:05:29 +02:00
liquidraver 5bf3c577c9 tune cad detection across all chips 2026-08-29 17:31:39 +02:00
liquidraver bc208ade26 detach USB device stack before reboot (esp_restart_noos leaves the PHY attached) 2026-08-28 10:46:46 +02:00
liquidraver 5372f1d8a2 auto-enable esp32s3 USB CDC companion in CMakeLists; board.overlay first in overlay order; esp32s3 download-mode reboot 2026-08-28 10:32:49 +02:00
liquidraver 27ea7e41a5 flash cleaning improvements 2026-08-28 09:41:43 +02:00
liquidraver 2e3f5f3f59 display/input rotate 2026-08-25 15:19:11 +02:00
liquidraver ea86815c95 fix LNA/FEM control 2026-08-25 14:04:32 +02:00
liquidraver dcd0be7ded lfs improvements 2026-08-24 12:50:13 +02:00
liquidraver 0c22b4caf9 doc updates 2026-08-24 11:01:03 +02:00
liquidraver da141327d7 radio driver fixes v2 2026-08-24 10:35:49 +02:00
liquidraver dc5b5c2594 radio driver fixes v1 2026-08-23 22:49:17 +02:00
liquidraver d6a78e5d92 upstream sweep 2026-08-23 15:56:08 +02:00
liquidraver 174bce80d9 cleanup/bugfix run 2026-08-23 09:45:14 +02:00
liquidraver 6ac94a0007 wire in missing boards from build.sh 2026-08-22 22:28:11 +02:00
liquidraver 7d695872d4 implement radio.fem.rxgain 2026-08-22 17:32:41 +02:00
liquidraver 24e9392cbf a little more corruption defense 2026-08-22 11:47:53 +02:00
liquidraver 9ba23afbe2 vcontact improvements 2026-08-22 10:50:02 +02:00
liquidraver cb4863e4bd T1000e full sensors 2026-08-21 20:28:03 +02:00
liquidraver 9fc3ab7f7e PR70 fix 2026-08-20 21:13:15 +02:00
liquidraver 5c4ac21bd4 refactor patches and bump to 1.17.2 2026-08-20 17:50:48 +02:00
liquidraver 216012574e X1 barometrification 2026-08-14 14:01:18 +02:00
liquidraver 4473b261ee rx path fixes, dc.restart wired in to lr chips,
TX timeout magic number is gone
2026-08-14 13:27:54 +02:00
liquidraver c45e7ae774 second audit sweep 2026-08-14 11:05:52 +02:00
liquidraver ff0db0dcb8 lr2021 debug v2 2026-08-14 08:36:36 +02:00
liquidraver aac97f7ade vcontact and cad fixes 2026-08-12 15:36:51 +02:00
liquidraver ee90693c89 lr20xx: add freq-error summary log and get freqerr CLI 2026-08-12 15:12:43 +02:00
liquidraver 3a3ac3df2e lr20xx: expose per-packet frequency error and fix the duty-cycle wake budget 2026-08-12 14:55:16 +02:00
liquidraver b839c2c5d1 bump lr sdk and audit refactor 2026-08-12 14:40:52 +02:00
liquidraver 101e97f54a lr20xx: bump vendored SDK to v2.0.2 and load the firmware Patch RAM 2026-08-11 22:36:31 +02:00
liquidraver ab03be110e wrapup lr2021 session 2026-08-11 16:47:21 +02:00
liquidraver b27f5e0625 x1 duty cycle debug 2026-08-11 15:58:59 +02:00
liquidraver daeff6d5e6 defer qspi bringup to when we really need it 2026-08-11 13:57:49 +02:00
liquidraver 3494411f83 x1 debug 2026-08-10 19:15:26 +02:00
liquidraver 9f66e9749c x1 debug v1 2026-08-10 08:32:43 +02:00