@p.kaczmarek2 I think most permutations aren't needed. Tuyamcu and power metering can be merged back into default, since they aren't winning much in terms of ota size. Especially on T, where there is more than enough space since i disabled bluetooth.
And i don't think we really need all of those binaries (QIO, UG, UA) that are not default, just having ota binaries are enough i think.
BK7238 is 'broken', only berry binaries are available.
In the future berry should be enabled on all realteks i think, except B (about 170kb is free now), since they have a lot of free space available, TR6260 (no ota - possibility of writing drivers without reflashing), ECR6600 (enough space), ESP with 4mb, and perhaps W600/W800 (never used them, so i don't know about their flash sizes/partitions).
Also, is RF partition on beken have some recognizable header? Perhaps a function in gui flasher can be created, that would search for it in a dump and flash it to device at a required offset. I noticed that my HLK-B30 mac address was a default one, instead of the one it came with. I eventually found that a partition with TLV header was at 0x1fe000, instead of 0x1e1000 like on T.
@p.kaczmarek2 I think most permutations aren't needed. Tuyamcu and power metering can be merged back into default
Well, let me ask you first, to make sure that we're on the same page - did you take in account that TuyaMCU and PowerMetering permutations are with Berry enabled, and default has no Berry?
They also have charts and stuff enabled.
The most crucial idea here is that we have a somewhat fixed channels system that is not flexible enough for TuyaMCU scripting. That's why I want to use Berry to parse TuyaMCU datapoints without worrying about adding channel types.
The endgame here is a separate Berry-enabled binary for TuyaMCU with full Berry TuyaMCU guide on forum. This binary will benefit from stripping WS2812, IR, BL0942, BL0937, bl_shared.c etc.
insmod wrote:
BK7238 is 'broken', only berry binaries are available.
Thank you for pointing that out, I will try to check it soon, however currently I'm adding XR806 to online builds, and then I need to do PIR driver for a user...
insmod wrote:
In the future berry should be enabled on all realteks i think, except B (about 170kb is free now), since they have a lot of free space available, TR6260 (no ota - possibility of writing drivers without reflashing), ECR6600 (enough space), ESP with 4mb, and perhaps W600/W800 (never used them, so i don't know about their flash sizes/partitions).
This is also a good idea, thank! I will check this or just make a PR yourself and I will accept it. Just please take care, we already had broken OTA on BL602 once due to too high binary size. The current system is building permutations only for Beken, so no problem here. I don't want to end up with hundreds of jobs on Github.
insmod wrote:
Also, is RF partition on beken have some recognizable header? Perhaps a function in gui flasher can be created, that would search for it in a dump and flash it to device at a required offset.
Well, TLV header for the start, and then, I don't know, but I know that MAC is at fixed offset in this section, because in the flasher, the "Restore RF partition" and "change MAC" just writes mac to fixed offset along with header. For more info, we would need to write script to check https://github.com/openshwprojects/FlashDumps/commits/main
insmod wrote:
I noticed that my HLK-B30 mac address was a default one, instead of the one it came with. I eventually found that a partition with TLV header was at 0x1fe000, instead of 0x1e1000 like on T.
Do we have source code for that partition read? We have a partition table in code, I remember. Could we modify it to search for RF partition in a list of predefined places so OBK works out of the box on various chip types?
As a search? Yes, that's what've been thinking about, but make sure you list all occurencies and not just first, just to be sure.
Regarding Github actions -I've been thinking about much more. Maybe on each commit we could generate some statistics or information or just check for firmware versions/flavours/etc and create a report in HTML, etc. Still, it would not be actually that useful, so it's a very low priority idea.
You can also check bins for Tuya config magic string.
Did you check uart output?
OpenBeken outputs log to UART1 by default. Connect adapter RX to P0 and see if it outputs anything.
Also try to overwrite bootloader.
Connected adapter RX to P0, opened putty on the COM port with baud rate 115200 - noting, attempted 921600 and 9600 with reboots after each - nothing.
then tried with override bootloader flash, checked P0 again and got this
✨ The discussion centers on the NiceMCU XH-WB3S development board featuring the BK7238 SoC, initially suspected to be BK7231T but confirmed as BK7238. Users share experiences with flashing, testing, and porting firmware, including challenges with encryption keys, flash IDs, and bootloader compatibility. The BK7238 uses 2MB flash with varying encryption keys per chip, complicating universal firmware flashing. Tools like BKFIL and Easy Flasher (EF) are used for backup and restore, with EF supporting full flash erase and restore including bootloader. Flash ID support was extended to include missing flash chips to avoid CRC errors. Arduino SDK and Beken FreeRTOS SDK (version 3.0.70.1 and newer 3.0.76) are referenced for development, with partial support for BK7238 and related chips (BK7231N, BK7231U, BK7252). Porting efforts include adapting delay functions for 160MHz BK7238, resolving flashvars alignment issues due to 64-bit time_t, and addressing HTTP server and TCP socket stability problems in LWIP. OTA updates are functional but require correct image types and bootloader versions. Power save modes and their impact on peripherals like BL0937 energy meter and DS18B20 sensors are discussed, with some instability noted under power save. SPI flashing and UART flashing methods are compared, with SPI preferred for some devices. BK7231U (CC8000 chip) support is emerging, with builds available but some undefined references and boot issues. BK7252 camera module support is experimental, with encrypted flash complicating firmware use. Users report issues with DS18B20 sensor timing on BK7238 due to delay_us inaccuracies, partially fixed by new SDK delay implementations. Logging and MQTT load affect system stability and sensor reading consistency. The community shares flash dumps, toolchain links, and SDK forks to aid development and testing. Overall, the thread provides detailed technical insights into BK7238-based NiceMCU boards' flashing, SDK porting, peripheral support, and firmware development challenges and progress.
TL;DR: A NiceMCU XH-WB3S board (BK7238, 2 MB flash) can run OpenBeken if you erase the whole SPI and re-flash with a CRC-fixed 7238 image; boards cost ≈ US $1.50 each and need >300 mA during Wi-Fi start-up. “Boot loops usually mean undervoltage” [Elektroda, insmod, post #21562748]
Why it matters: Correct flashing and stable power prevent endless reboots and CRC errors.
Why do I get endless CRC-mismatch errors when flashing?
The GUI flasher lacked the Puya 25Q16HB (ID 0x152085) entry, so the chip stayed write-protected and every sector verify failed. Update to BK7231GUIFlashTool ≥v1.9.21 or add the ID manually, then erase and re-flash [Elektroda, p.kaczmarek2, post #21342531]
Which firmware file should I use for the XH-WB3S board?
Use OpenBK7238_QIO_x.xx.xx.bin (or the .rbl OTA file) because the module really contains a BK7238, not a BK7231 [Elektroda, DeDaMrAz, post #21542280]
The board reboots every few seconds—why?
A reboot loop with only the RT-Thread banner usually means the 3.3 V rail dips below 3.0 V when Wi-Fi starts. Provide a stable ≥350 mA source or add a 470 µF capacitor [Elektroda, insmod, post #21562748]
How do I force the bootloader to accept my image?
Check “Overwrite bootloader” in the GUI, flash the CRC-fixed QIO image, then reset. On BK7238 the bootloader sits at 0x0 and refuses un-CRC’d binaries [Elektroda, divadiow, post #21550671]
What is the “No TLV header found in flash” message?
It comes from the SDK’s RF-calibration code; the first boot notices that the RF OTP/TLV partition is empty, writes defaults, then continues. The notice is harmless [Elektroda, p.kaczmarek2, post #21564311]
Why does my custom MAC vanish after reboot?
BK7238 stores the MAC in the RF-OTP/TLV area. Current OpenBeken writes it to config only; on the 7238 it must be written with manual_cal_write_macaddr_to_flash(). Until patched, the chip reloads the factory MAC on cold boot [Elektroda, p.kaczmarek2, post #21564311]
How can I enter Safe-Config mode if AP never appears?
Press or toggle RESET five times within 5 s; the bootloader starts OBK in SafeConfig, creating AP “OpenBK_xxxxxx” even with invalid Wi-Fi data [Elektroda, divadiow, post #21550706]
Power-meter readings jump by 20 V—bug or feature?
Voltage spikes on BL0937 driver occur when heavy logging or MQTT runs. Disable verbose logs (loglevel 0) or MQTT to stabilise readings [Elektroda, insmod, post #21520958]
Fast-Connect flag—what does it do?
FastConnect 1 skips full scan and uses stored BSSID/PSK. It cuts connect time from ≈3 s to 300 ms and saves ≈80 mA∙s per wake-up [Elektroda, insmod, post #21507260]
Edge case: What if I flashed a BK7231 image to BK7238?
The chip shows only the bootloader banner and reboots; re-flash the correct 7238 QIO binary or full 2 MB dump via SPI [Elektroda, divadiow, post #21342237]
3-step How-To: Recover a soft-bricked XH-WB3S
Erase full 0-0x1FFFFF with BKFIL (SPI needed if UART locked). 2. Flash OpenBK7238_QIO_x.bin at 0x0 with “Overwrite bootloader”. 3. Reset; join AP and finish setup—done.