nrst_pulse toggle in rtl8196e_uart_bridge_main.c #121
|
Hi @jnilo1, since #119 has overloaded information, I am starting a new thread dedicated to uart bridge. It seems to me that
Thanks |
Replies: 3 comments
|
Hi @hlyi — you were right on all three counts. I took this through the bench today; here is what came out, and what changed. What the bench saysThe three bits {7,10,13} the driver flipped are the high bits of three distinct 2-bit pin-mux fields in PIN_MUX_SEL_2 (0xb8000044): [7:6] = pad B4 (GPIO line 12), [10:9] = B5 (line 13), [13:12] = B6 (line 14). The 0x2480 mask was copied wholesale from the chip's reset-default value back when we root-caused the "radio held in reset" problem — it had never been isolated per field. Pulsing each bit individually on a live gateway (NCP firmware, watching TCP:8888 for the spontaneous reset frame the EFR32 emits when it boots):
So on the Lidl board nRST is wired to pad B4 = line 12 of the gpio-rtl819x chip, and the other two fields were just being re-routed for 100 ms on every pulse — exactly as you suspected. New implementation (bridge driver v1.1)
The pad mux to GPIO mode (field value 0b11) is applied automatically by the gpio-rtl819x The knob you asked forThe line number is a new runtime-writable parameter: cat /sys/module/rtl8196e_uart_bridge/parameters/nrst_gpio # 12 (Lidl default)
echo <line> > /sys/module/rtl8196e_uart_bridge/parameters/nrst_gpio
echo 1 > /sys/module/rtl8196e_uart_bridge/parameters/nrst_pulseIt takes effect on the next pulse, so you can probe candidate lines from a shell without rebuilding anything. Errors come back through the write: One caveat for your port: gpio-rtl819x only auto-muxes pads B2–B6 (lines 10–14, the LED_PORT fields of PIN_MUX_SEL_2). If the G4's nRST pad sits outside that range, the pad mux has to be established separately — extending VerificationOn the bench (v3.9.0 WIP kernel): same reset signature as the old mechanism; invalid parameter values rejected; a pulse on a wrong-but-free line runs without resetting the radio; two concurrent pulses serialize cleanly; the TCP client stays connected across the pulse; The change ships in v3.9.0, just released (kernel-only reflash). Thanks for the push — this knob had been carrying its empirical scaffolding since v3.1. |
|
@jnilo1 Thanks for your super fast change! Since Also, I have an additional request that needs your help: for a different platform, it has a different way to enter bootloader mode: addition pin, say Thanks again. |
|
This request has been fulfilled with the latest v3.11.0-pre branch. Closing. |
Hi @hlyi — you were right on all three counts. I took this through the bench today; here is what came out, and what changed.
What the bench says
The three bits {7,10,13} the driver flipped are the high bits of three distinct 2-bit pin-mux fields in PIN_MUX_SEL_2 (0xb8000044): [7:6] = pad B4 (GPIO line 12), [10:9] = B5 (line 13), [13:12] = B6 (line 14). The 0x2480 mask was copied wholesale from the chip's reset-default value back when we root-caused the "radio held in reset" problem — it had never been isolated per field.
Pulsing each bit individually on a live gateway (NCP firmware, watching TCP:8888 for the spontaneous reset frame the EFR32 emits when it boots):