Port to different hub #119
Replies: 7 comments 1 reply
-
|
Hi @hlyi — great find, that board is almost a twin of the Lidl/Silvercrest unit, so a port is very realistic. 🙂 Caveat first (the fun one): I don't own your hardware, so everything below is "works on paper / works on my board" guidance. If you brick your device, that's on you, not me — please make a full flash backup before you touch anything, and ideally keep a SWD/serial path open so you can always recover. With that said, I'm very happy to help you bring it up — you test on the metal, I'll point at the exact files to change. 0. Before anything — back up and keep a recovery path
1. DRAM size / DDR2 (Winbond W9751G6KB, 64 MiB)Do this on your original firmware first — do not flash my firmware yet. This is the single most important step, and here's why: the DRAM type and clock come from the SoC's hardware strap pins, which are the same physical register no matter which firmware runs. If your box already runs its stock Linux with 64 MiB DDR2, then the straps are already correct, and my bootloader will read exactly the same values. So the stock firmware is your ground truth — reading it first is non-destructive, it tells you in advance whether auto-detection will just work or whether you'll need a software override, and it's also when you take your full-flash backup (your way out). Flashing blind is the one thing that can brick the box. On the original firmware, capture:
If that log shows 64 MiB DDR2 with a clock that exists in our table, you very likely won't need to touch any code at all — my bootloader will reproduce the same detection. Only if it differs do you fall through to the override below. Now the mechanics: nothing about the DRAM size is hard-coded — the bootloader sizes the DRAM at runtime, and it already knows DDR2. But which type and clock it uses comes from your SoC's hardware strap pins, not from software, so the first job is just to read what it detects. In
So the bring-up procedure is:
Build with 2. EFR32MG13P732HI firmware + flow controlThe MG13 is still Series 1, so it builds from the same Gecko SDK 4.5.0 / EmberZNet 7.5.1 line this repo already uses — no SDK jump needed. To retarget:
On "the chip doesn't support hardware flow control" — that's not right, and it matters. Every EFR32 Series 1 USART, the MG13 included, natively supports RTS/CTS hardware flow control: you allocate the pins with So if HW flow control looks unavailable on your board, it's almost certainly not a silicon limitation but one of:
The key question back to you: are the RTS and CTS lines actually routed EFR32↔RTL8196E on your board? If yes → use hardware flow control, full stop — it's the well-trodden path here and what the project mandates. If they're genuinely not wired, then and only then software (XON/XOFF) flow control becomes a fallback — and it's a fallback I'd discourage: this project deliberately requires hardware RTS/CTS, because without working flow control the EFR32's 16-byte RX FIFO overruns under burst at high baud and the link decoheres. If you're forced down the XON/XOFF route, set the flow-control type in the Which firmware are you targeting — NCP (direct EZSP to Z2M/ZHA) or RCP (cpcd+zigbeed)? That changes the flow-control story (RCP/CPC is more sensitive), and it would also help to see the EFR32↔RTL8196E UART wiring from your schematic. 3. Ethernet PHY on port 0 instead of port 4This one is clean — it's a device-tree edit, not driver surgery.
Rebuild with 4. LEDs and reset button GPIOs
Suggested order of attack
Please share as much about the device as you canThe more I know about your exact hardware, the more specific (and safer) the guidance gets. If you can, please post:
Start with the serial console log from the first DDR bring-up and we'll take it from there. Happy to iterate with you on each step. 👍 |
Beta Was this translation helpful? Give feedback.
-
|
@jnilo1 Thanks for detailed feedback. The device is Sengled smart hub G4. It doesn't think it run similar FW has lidl gateway, it has its own with minimum output from console. I could not log into the linux box itself to provide the information you asked.
Does it impact size detection?
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks @hlyi — this is excellent, concrete debugging, and a couple of your findings actually correct something I told you earlier, so let me set the record straight first. 0. Important correction to my DRAM explanationIn my first reply I said "nothing about the DRAM size is hard-coded, the bootloader probes it at runtime." That was misleading, and your
This is the answer to your follow-up email ("I changed 1. So where you change it — and what to read firstThe authoritative code is unsigned char dramtype = dram_type_remap[dramtype_sel]; // <- force DRAM_DDR2 if strap is wrong
unsigned int m2xclk = m2x_clksel_table[m2x_freq_sel]; // <- force your clock if strap is wrong
...
unsigned int dramsize = Calc_Dram_Size(dramtype); // <- runtime probe writes final DCR
LookUp_MemTimingTable(dramtype, dramsize, m2xclk); // <- writes final DTRBefore you touch that code, read one register — it decides everything and needs no flash, because the strap is hardware and reads the same under any firmware. From whatever Linux is on the box right now (stock or ours): Decode it the way
That tells you whether your SoC strapped itself as DDR1 or DDR2 and at what clock. If it says DDR2 but our build is running it as DDR1/32 MiB, then the strap path in Two data points you already have in hand, no flashing required:
2. Your numbered questionsQ1 — " Q2 — Q3 — Ethernet works, but the LAN LED doesn't (status LED does after your pin change).
So two things to check on your board:
Q4 — reset button still dead after changing
If you set If bit 14 doesn't move, the button is on a different pin than NetStart with the one read that needs no flashing: |
Beta Was this translation helpful? Give feedback.
-
|
@jnilo1 Thanks for the suggestion. Here are what I found:
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you, @hlyi — and I owe you a straight correction. You were right and I was wrong, twice, on the DRAM, and your reading of the tree is spot-on. Let me set the record straight and answer all five points from the code. The root cause — and your "AI-generated / dead code" questionYou found the real problem, so let me start there. The So that file is dead code. It doesn't run (no console output — exactly as you observed), and whatever looks off in 1 & 2 — DRAM:
|
Beta Was this translation helpful? Give feedback.
-
|
@jnilo1 Thanks for confirming. Can we enhance build system to support multiple hubs? Current setup is good for building single configuration. Any other configuration requires manually changing quite a few files, making sync between configurations error prone. Thx |
Beta Was this translation helpful? Give feedback.
-
|
This request has been tracked with multiple subtasks. Closing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@jnilo1 Thanks for your great work! I found that a smart hub that also uses RTL8196E. Could you please help me to port your work to the hub? Besides RTL8196E, it also has 16MiB NOR-flash ( 25Q127). It has the following differences:
it uses 64MiB DDR2 SDRAM (winbond W9751G6KB) ( how to modify bootloader to increase DDR size and using DDR2?)
It has EFR32MG13P732HI soldered on the main PCB board instead of using TYZS4 module. It doesn't support hw flow control, needs rebuild silab firmware to enable XON/XOFF support and otbr-agent need to rebuild to support SW flow control ( is it possible?)
the ethernet PHY is connected to port 0 instead of port 4 of RTL8196E ( which files to modify?)
LED pins/Reset button may mapped to different GPIOs.
Thanks a lot in advance!
Beta Was this translation helpful? Give feedback.
All reactions