NCP flashed via SWD — RESET_UNKNOWN_REASON loop, cannot establish ASH #85
Replies: 11 comments 5 replies
|
Thanks for the detailed write-up — the flash itself looks fine (Stage 1 BSL from the original 2-stage Tuya bootloader is intact, our Stage 2 2.4.2 landed at Why NVM3 matters hereNVM3 lives at the top of flash and survives application updates by design. When you flashed the NCP That also explains the HW-flow-control silence: the NCP never reaches the point where it deasserts Fix: mass-erase, then re-flash# 1. Wipe everything — clears NVM3, lock bits, the lot.
commander device masserase --device EFR32MG1B232F256GM48
# 2. Stage 1 + Stage 2 in one shot (so you don't rely on the old Tuya BSL).
commander flash 2-Zigbee-Radio-Silabs-EFR32/23-Bootloader-UART-Xmodem/firmware/bootloader-uart-xmodem-2.4.2-combined.s37 \
--device EFR32MG1B232F256GM48
# 3. Application.
commander flash 2-Zigbee-Radio-Silabs-EFR32/24-NCP-UART-HW/firmware/ncp-uart-hw-7.5.1.s37 \
--device EFR32MG1B232F256GM48
# 4. Sanity check — should print a valid EUI-64.
commander device info --device EFR32MG1B232F256GM48A few notes on the above:
After re-flashPut If the loop persists after a clean masserase + re-flash, check Let me know how it goes. |
|
Thanks for the detailed explanation. serialgateway (HW flow control): waits for RSTACK indefinitely, times out Hardware info: Gateway firmware: Lidl Zigbee Gateway RTL8196E v2.1.6 My suspicion is that RTS/CTS lines may not be physically connected between RTL8196E and EFR32 on this specific PCB revision. Is there a way to confirm this, or a version of the NCP firmware compiled without hardware flow control that I could test? |
|
Good — the masserase clearing the crash loop confirms the NVM3 hypothesis, so we can put that part to bed. The new symptom is different: the NCP is no longer crashing, it's just silent in both directions ( RTS/CTS is almost certainly not the issueA few reasons your "RTS/CTS not connected" hypothesis is unlikely on this board:
So Diagnostic ladder — please run these in order1. Confirm UART1 is muxed on the SoC side# On the gateway, as root:
devmem 0x18000040 32Bits 1 ( 2. Force the EFR32 into a known-good UART stateThis is the cleanest test — it replaces the NCP with the Gecko bootloader's own menu, which is also at 115200 baud, no flow control, and is not affected by NVM3 or stack init. If the gateway can read its menu, we've proven the entire UART path end-to-end. Over your J-Link, erase only the application region: commander flash --erase --range 0x4000:0x3DFFF --device EFR32MG1B232F256GM48
# (NVM3 is at 0x3E000–0x3FFFF — leaving it alone)Reset the EFR32. With no valid application, Stage 2 sits in its menu and prints a banner. On the gateway: serialgateway -f # 115200, SW flow control
# Hit Enter or send a serial break — you should see the bootloader menu:
# Gecko Bootloader v2.4.2
# 1. upload gbl
# 2. run
# ...
When you're done, re-flash NCP: commander flash 2-Zigbee-Radio-Silabs-EFR32/24-NCP-UART-HW/firmware/ncp-uart-hw-7.5.1.s37 \
--device EFR32MG1B232F256GM483. If step 2 succeeds — inspect the running NCP via SWDYou already have a J-Link attached, which is the strongest tool here. Two cheap checks: # Halt and read the program counter — is the NCP in its main loop or in HardFault_Handler?
commander dumpasm --device EFR32MG1B232F256GM48 --address $(commander device readmem --address 0xE000ED14 --length 4 --device EFR32MG1B232F256GM48)
# Or just open a JLinkGDBServer + arm-none-eabi-gdb session and `info reg`, `bt`.If the PC is parked in commander tokendump --device EFR32MG1B232F256GM48
On a HW-flow-control-disabled NCPWe don't ship one in the repo, and I'd hold off on building one before we've ruled the path issue out — if RTS/CTS truly were the problem you'd at least see the boot banner with Please post the output of step 1 ( |
|
Those three tests together (PIN_MUX_SEL = On v3.1.1It won't help here, sorry. The kernel UART bridge in v3.0+ improves the SoC side, but your Gecko Bootloader test already proved the SoC side is fine. If the EFR32 isn't transmitting, no SoC-side change will conjure data out of it. I'd hold the upgrade until after this is sorted. The likely cause — and the one test that nails itThe NCP we ship has hardware flow control hard-wired (CTS on PA5, RTS on PA4). The EFR32 gates every TX byte on its CTS input — until PA5 reads "asserted", nothing goes out. The Gecko Bootloader and the Tuya firmware don't use HW FC, which is why those streamed for you. The NCP is the only firmware here that requires it, and it's the only one that's silent. That's a strong hint. Quickest definitive test: rebuild the NCP without flow control and re-flash. cd 2-Zigbee-Radio-Silabs-EFR32/24-NCP-UART-HW
# In patches/sl_iostream_usart_vcom_config.h, change:
# SL_IOSTREAM_USART_VCOM_FLOW_CONTROL_TYPE → usartHwFlowControlNone
./build_ncp.sh
commander flash firmware/ncp-uart-hw-7.5.1.s37 --device EFR32MG1B232F256GM48Then on the gateway with
Run (a) first. Easy 10-minute test, and given everything you've already proven I'd put real money on it succeeding. |
|
The no-FC build streaming confirms what we suspected: on your unit PA4/PA5 aren't wired to the SoC's RTS/CTS, so the HW-FC build was permanently CTS-blocked. You're actually the first to report a board variant where these pins differ from ours (and I find that a bit strange), so before we go further could you share as much detail as possible on your gateway? Specifically:
This will let me document the variant properly in On the token dumpI dumped a known-good gateway here for comparison: it also has The reason Which means we need to find what's actually triggering the reset on your chip rather than guessing at it. Since you have a J-Link attached this is straightforward. SWD halt — read the real cause with the tools you already haveEverything below uses Let the no-FC NCP run for a few seconds (so you're sure it has hit at least one of those commander device halt --device EFR32MG1B232F256GM48
# System Control Block fault registers
commander device readmem --address 0xE000ED04 --length 4 --device EFR32MG1B232F256GM48 # ICSR — which exception is active
commander device readmem --address 0xE000ED28 --length 4 --device EFR32MG1B232F256GM48 # CFSR — UsageFault / BusFault / MemManage sub-cause
commander device readmem --address 0xE000ED2C --length 4 --device EFR32MG1B232F256GM48 # HFSR — was it a HardFault, and was it escalated
commander device readmem --address 0xE000ED34 --length 4 --device EFR32MG1B232F256GM48 # MMFAR — faulting address for MemManage faults
commander device readmem --address 0xE000ED38 --length 4 --device EFR32MG1B232F256GM48 # BFAR — faulting address for BusFaultJust paste the five values raw — I'll decode them. What we'll learn from those alone:
That's enough information to tell whether your chip is faulting during stack init, during radio bring-up, or during something more exotic — without us guessing. If those values come back inconclusive (e.g. ICSR = 0, no fault active, just a soft reset loop), the next step would be a backtrace — program counter + stack walk + register dump. Quick question for that: do you already have OpenOCD set up against your J-Link OB on this chip? It's the easiest path I know of ( |
|
Hi @lornys, quick check-in — any chance you've had time to run the three No rush at all, just making sure the thread didn't get lost. If you hit a snag with the OpenOCD |
|
Hi! First of all, sincere apologies for the very long delay. 0x40010078 (ROUTEPEN): 0x00000000 — always zero when halted (Tuya may enable/disable USART dynamically) ROUTELOC0 and ROUTELOC1 were stable across all reads. Hope this is enough to decode the pin mapping — happy to run any additional reads if needed. |
|
Here are the corrected register reads: 0x40010074 (ROUTEPEN): 0x00000033 — TX+RX+CTS+RTS all enabled* |
|
That's the confirmation we needed — and
So the EFR32 side is now fully cleared: correct pins (TX=PA0, RX=PA1, CTS=PA5, RTS=PA4), all four signals routed to them, receiver enabled. The chip is listening for RX on PA1 and there is nothing left to change in the firmware. That puts the break upstream of PA1: the byte stream from the RTL8196E's UART1 TX isn't reaching the EFR32's RX pin. And on this exact SoC we have a documented failure mode for precisely that. The RTL8196E routes UART1 TX/RX to physical pins through the
So the first thing to read, on the gateway shell: devmem 0x18000040 32Bits 1, 3, 6 together are mask Paste the value and we'll take it from there.
|
|
Good news — we already ran that check earlier in this thread. The result was: |











Uh oh!
There was an error while loading. Please reload this page.
Gateway: Lidl Silvercrest, Linux v2.1.6 running correctly, SSH/network all good.
Problem: EFR32MG1B232F256GM48 had original Tuya firmware that didn't respond to any known protocol (EZSP, CPC, SPINEL, Gecko Bootloader).
universal-silabs-flasheralways failed at probe stage.What I did: Flashed via J-Link OB clone (2€ Ali) over SWD:
bootloader-uart-xmodem-2.4.2.gbl→ verified OKncp-uart-hw-7.5.1.gbl→ verified OK (208896 bytes at 0x00004000)Result with
serialgateway -f(SW flow control):NCP responds but sends
RESET_UNKNOWN_REASONin an infinite loop. Z2M never gets past ASH init.Result with
serialgateway(HW flow control):No response at all. Z2M waits for RSTACK indefinitely and times out.
Serial port status:
RTS/CTS lines appear active. tx is non-zero but rx was 0 during HW flow control tests.
Z2M config:
Question: Is this expected behavior after a first SWD flash? Does the NCP need any additional initialization step (e.g. token erase, specific reset sequence) before it can communicate via ASH? The RESET_UNKNOWN_REASON loop suggests the NCP is alive but stuck in a crash loop.
Thank you for this amazing project!
All reactions