logo elektroda
logo elektroda
X
logo elektroda

[Solved] Flashing Tuya WB3S in Window Controller with BekinWriterV1.60 - Fail & 16-Pin Chip Removal

richardsg307 6465 17
Best answers

Why does BekinWriterV1.60 fail to flash my Tuya WB3S board, and what can I do to get it to flash successfully?

BekinWriterV1.60 was failing because the WB3S UART pins were still tied to on-board circuitry, so RXD1/TXD1 had to be disconnected from the button/LED parts by cutting the traces or otherwise isolating them [#20542632][#20543892] A solid external 3.3 V supply is also important; a USB-to-UART adapter’s 3.3 V output may not be reliable enough, and shortening the RX/TX wires can help [#20542450][#20543122] The 16-pin chip itself was not identified as the blocker; once the UART lines were isolated, the board could be flashed successfully. In this case, BekenWriter still failed during erase, but `hid_download_py` worked with a BK7231T-style command using `-b 115200`, for example `python uartprogram .bin -d com3 -w -b 115200` [#20543594][#20543647] A command using `-u -s 0x0` failed with `Unprotect Failed` because that option set is for BK7231N, not BK7231T [#20543743]
Generated by the language model.
ADVERTISEMENT
  • #1 20542414
    richardsg307
    Level 5  
    Posts: 18
    Rate: 5
    Using the BekinWriterV1.60 to flash a Tuya WB3S board is not working - it just doesn't get going and reports Failed after the 15 seconds or so. I am disconnecting/reconnecting power, then grounding the CEN briefly (loose orange wire in pic) all within the 15 seconds. I have my USB to UART board set to 3v3 and all wires are directly soldered to the WB3S pads. I note your video on a similar board you desolder a 8 pin chip. In my case I have a 16 pin chip in that position and I'm not skilled enough to remove that! Is that the problem do you think? Is there anything else I could try? I have worked out the Button x3, LED x3 and Relay x2 outputs and was intending to add the device to your knowledge base, but little point if it cannot be flashed. Pictures below:- Flashing Tuya WB3S in Window Controller with BekinWriterV1.60 - Fail & 16-Pin Chip Removal Flashing Tuya WB3S in Window Controller with BekinWriterV1.60 - Fail & 16-Pin Chip Removal Flashing Tuya WB3S in Window Controller with BekinWriterV1.60 - Fail & 16-Pin Chip Removal Flashing Tuya WB3S in Window Controller with BekinWriterV1.60 - Fail & 16-Pin Chip Removal Any help would be great.
  • ADVERTISEMENT
  • Helpful post
    #2 20542450
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12345
    Hello, can you check the RXD1/TXD1 pads of WB3S with multimeter and check if they are connected anywhere, maybe to SOIC chip?

    How do you power that device? Getting 3.3V from USB to UART converter may not work, you need good, reliable, 3.3V LDO with good current capability.
    Helpful post? Buy me a coffee.
  • #3 20542539
    richardsg307
    Level 5  
    Posts: 18
    Rate: 5
    From what I can tell having probed it with an oscilloscope, the RXD1 is used as the input from one of the buttons, and the TXD1 is an output that drives a blue LED under one of the buttons. I'll try again with a proper 3v3 power supply on the VCC pad. Edit: - I've tried it now with a 3v3 lab supply to the VCC pad with a common ground and no difference regarding flashing. I also put a scope on the RXD1 pad and can see a repeating square ish wave while the 15s thing is going on. But the wave form is only going between 3v3 and about 2v8 (nowhere near ground). So my guess is there's some other circuitry keeping the voltage up and stopping the device receiving any input. I couldn't see a signal on the Tx but that's not surprising.
  • ADVERTISEMENT
  • #4 20542632
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12345
    richardsg307 wrote:
    the RXD1 is used as the input from one of the buttons, and the TXD1 is an output that drives a blue LED under one of the buttons.

    We had a similar situation on video:
    https://youtu.be/Yb3zXtBdSnE?list=PLzbXEc2ebpH0CZDbczAXT94BuSGrd_GoM
    You must disconnect those devices from UART lines somehow. Cut the trace (and then fix it) or desolder the chip, etc...
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20542782
    richardsg307
    Level 5  
    Posts: 18
    Rate: 5
    OK Understood and thanks for helping. I've cut the 2 tracks in the positions indicated on the pictures. Checked with a multimeter. Flashing Tuya WB3S in Window Controller with BekinWriterV1.60 - Fail & 16-Pin Chip Removal Flashing Tuya WB3S in Window Controller with BekinWriterV1.60 - Fail & 16-Pin Chip Removal Now when I try to flash, when I power back on, the 15 second timer stops immediately and I get a failed message. On 1 occasion it said something about setting baud rate but still failed. Oscilloscope is now showing a signal on the Rx pin going 3v3 to ground. Here's my settings and the failed message: Flashing Tuya WB3S in Window Controller with BekinWriterV1.60 - Fail & 16-Pin Chip Removal I also tried the python program OpenBKT uartprogram but that fails too with the message 'Unprotect failed'. Also fyi, the board uses PWM3 and 0 for the 2 relays, PWM2 and 4 and RDX1 for the 3 buttons, and TXD1, PWM5 and PI4 for the blue LEDs under the buttons. does another of those prevent flashing?
  • ADVERTISEMENT
  • #6 20542873
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12345
    how do you power that device? Where do you get 3.3V from?
    Helpful post? Buy me a coffee.
  • #7 20542932
    richardsg307
    Level 5  
    Posts: 18
    Rate: 5
    I'm getting the 3v3 from a lab switching mode power supply.
  • #8 20543044
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12345
    Do you do power cycle by disconnecting power?
    TX should connect to RX, and RX to TX.
    Helpful post? Buy me a coffee.
  • #9 20543098
    richardsg307
    Level 5  
    Posts: 18
    Rate: 5
    I can confirm Tx - Rx and vice versa.
    I power cycle by switching off/on the 3v3 to the VCC pad. I have a common ground between the USB/UART and power supply.
    I've changed the power supply to an AZDelivery breadboard power header device.

    Further, I just tried running at 115200 baud and it started to erase and got 2 blocks up on the progress bar before it failed. Tried it several times and always fails at 2 blocks. It now starts the erase without a power cycle. I think that has bricked the device as far as Tuya is concerned. I then did a 'Read Flash' at 115200 and it all went successfully taking around 90 seconds and creating a file the same size as the Open Beken firmware file. Looking at the file in Hex Edit shows the first few pages as solid FFs, probably from the erase getting somewhere before failing.

    Some progress I feel, but still need help figuring what next to try.
  • #10 20543122
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12345
    Erasing first blocks will brick Tuya firmware, but device can be still flashed with OBK.

    Please shorten your wires for RX and TX in order to reduce the interference.
    Helpful post? Buy me a coffee.
  • #11 20543316
    richardsg307
    Level 5  
    Posts: 18
    Rate: 5
    Flashing Tuya WB3S in Window Controller with BekinWriterV1.60 - Fail & 16-Pin Chip Removal
    Still no joy. 2 blocks progress on erase when at 115200 then fail. Can still read the existing at 115200.
    Same when powered by USB/UART board.
    Thanks for helping.
  • #12 20543444
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12345
    I had some reports saying that trying another USB to UART converter helped in the past.
    Helpful post? Buy me a coffee.
  • #13 20543594
    richardsg307
    Level 5  
    Posts: 18
    Rate: 5
    Success using the python loader. Changed the command from what I saw on the web a bit. The command that worked for me was:

    C:UsersGrumpsOpenbkthid_download_py>python uartprogram C:UsersGrumpsOpenbktOpenBK7231T_UA_1.15.700.bin -d com3 -w -b 115200
    

    With the response:
    UartDownloader....
    programm....
    Write Successful: ||[ 2.59k/s]
    

    The Erase was quick and the Write over a minute I guess.

    I'm now in the App first through the phone and then the PC after doing the Configure WiFi thing. Time to restore the tracks and then get configuring. I will submit my work on the forum when complete.

    Thanks for your help. Hopefully I won't need to bother you again...
  • #14 20543598
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12345
    Feel free to ask any futher questions. So, basically, bkWriter 1.60 didn't work but hid_download_py was successful?
    Helpful post? Buy me a coffee.
  • #15 20543647
    richardsg307
    Level 5  
    Posts: 18
    Rate: 5
    Yes, BekenWriterV1.60 didn't work - it never got past the 2 blocks progress when erasing.

    With hid_download_py I started with the command I saw online:
    C:\Users\Grumps\Openbkt\hid_download_py>python uartprogram C:\Users\Grumps\Openbkt\OpenBK7231T_UA_1.15.700.bin -d com3 -w -u -s 0x0

    That just returned 'Unprotect Failed'.
    But then took out the '-s 0x0' as I read that the default was '0x11000' and that matched what BekenWriter defaulted to. Then I took out the '-u' as I read that Unprotect was needed for the N (ie not the T), and finally added the '-b 115200' as that got me a little further using BekenWriter. Bingo!
    I note that the '-l' (which I didn't use) defaults to 0x1000. I don't know if that's the same variable used in BekenWriter labelled 'Operate Length' that has 0x000ef000; a very different value!
  • #16 20543743
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12345
    Well, no wonder that command with -u and -s 0x0 returns unprotect fail. It's for BK7231N, not BK7231T. As you can see, it's good to check readme before using command. You can also try our newer flasher, that has most of things automatic:
    https://github.com/openshwprojects/BK7231GUIFlashTool

    I don't think that l is set 0x1000, it should be taken automatically from source file length. The 0x1000 you saw may be a sector size in flash memory.
    Helpful post? Buy me a coffee.
  • #17 20543884
    richardsg307
    Level 5  
    Posts: 18
    Rate: 5
    Reading stuff is not my strong point!

    One track repaired easily with a blob of solder but the other... phew, needed a sliver of wire and I just hope it stays put. It's all working.

    I've started configuring and have got the 3 buttons going, the 3 LEDs and the 2 relays. I see by default they are all grouped/linked by their channel number, which is fine. But I now need to create an interlock between the relays (on Ch 1 and Ch 3) so that they are never both on at the same time. I'll read more on OpenBeken but if I hit a brick wall I'll open another thread for help.

    Thanks.
  • #18 20543892
    richardsg307
    Level 5  
    Posts: 18
    Rate: 5
    I had to disconnect the RXD1 and TXD1 pins from the onboard devices they were connected to, to stop them messing with the flashing signaling. I did it by cutting the tracks leading away from the pins. Reconnecting them afterwards was tricky!

    Also the GUI tool Beken Writer kept failing on the flash so in the end I found 'hid_download_py' worked. See thread for details of the command I had to use.

Topic summary

✨ The discussion revolves around the challenges faced while attempting to flash a Tuya WB3S board using BekenWriterV1.60. The user reports persistent failures during the flashing process, despite ensuring proper connections and power supply. Suggestions include checking RXD1/TXD1 connections, using a reliable 3.3V power source, and disconnecting onboard devices from UART lines. The user eventually finds success using the Python loader 'hid_download_py' after adjusting command parameters, indicating that BekenWriterV1.60 was ineffective. The user also shares insights on the board's functionality, including button and relay configurations, and expresses intent to create interlocks between relays.
Generated by the language model.

FAQ

TL;DR: Flash WB3S (BK7231T) with hid_download_py, avoid -u/-s 0x0, and remember the 0x1000 sector detail; “It’s for BK7231N, not BK7231T.” [Elektroda, p.kaczmarek2, post #20543743]

Why it matters: For DIYers flashing Tuya WB3S window controllers, this fixes failed writes, UART interference, and safe recovery to OpenBeken.

Quick-Facts

Quick Facts

Why does BekenWriterV1.60 fail to flash my Tuya WB3S?

On this BK7231T board, BekenWriterV1.60 stalled during erase (about two blocks) and never completed. Switching to hid_download_py with the right options fixed the issue. When BekinWriterV1.60 hangs early, move to the Python loader for reliability. [Elektroda, richardsg307, post #20543647]

Do I have to isolate RXD1/TXD1 from the board’s buttons/LEDs?

Yes. On this device, UART1 lines were tied into a button and an LED, blocking the bootloader. “You must disconnect those devices from UART lines somehow.” Cut and later repair traces, or temporarily remove the interfering chip. [Elektroda, p.kaczmarek2, post #20542632]

What power source should I use for WB3S flashing?

Use a stable external 3.3 V LDO regulator with enough current. Avoid powering the target from a USB‑UART adapter’s 3.3 V pin. That rail is often weak and causes unreliable flashing sessions. [Elektroda, p.kaczmarek2, post #20542450]

What exact hid_download_py command worked for BK7231T?

Example that succeeded: python uartprogram -d COM3 -w -b 115200. It performed a quick erase and then wrote the image, ending with “Write Successful.” This resolved the earlier BekenWriterV1.60 failures. [Elektroda, richardsg307, post #20543594]

I get “Unprotect failed” — what am I doing wrong on BK7231T?

You likely used -u and -s 0x0, which target BK7231N, not BK7231T. Remove those flags and rely on the tool’s defaults. As the maintainer put it: “It’s for BK7231N, not BK7231T.” Consider BK7231GUIFlashTool for automation. [Elektroda, p.kaczmarek2, post #20543743]

The erase stops at 2 blocks — is my device bricked?

If the first blocks were erased, the Tuya firmware is bricked, but the device is still recoverable. You can flash OpenBeken via UART afterward. Shorten RX/TX wires to reduce interference before retrying. [Elektroda, p.kaczmarek2, post #20543122]

Why does RXD1 sit around 2.8 V during the 15‑s window?

RXD1 was used as a button input on this board and never reached ground. The attached circuitry held the line high around 2.8 V, blocking UART input. TXD1 also drove a blue LED, adding load. [Elektroda, richardsg307, post #20542539]

How should I connect UART and power‑cycle during flashing?

Cross UART: adapter TX to WB3S RX, and adapter RX to WB3S TX. Power cycle by disconnecting and reconnecting 3.3 V when prompted. This sequence is required for the bootloader to start. [Elektroda, p.kaczmarek2, post #20543044]

How do I flash WB3S with hid_download_py (3 steps)?

  1. Run: python uartprogram -d COM3 -w -b 115200.
  2. Wait for the quick erase, then the write; confirm “Write Successful.”
  3. Join the OpenBeken AP and use Configure WiFi to finish setup. [Elektroda, richardsg307, post #20543594]

BekenWriterV1.60 still fails — what else can I try?

Swap the USB‑to‑UART adapter. Users reported stubborn failures resolved by using a different converter. Hardware differences can affect signal integrity and stability. [Elektroda, p.kaczmarek2, post #20543444]

Do I need to remove the 16‑pin chip, or can I cut and rejoin tracks?

You can cut the two traces from RXD1/TXD1 to isolate them, then restore afterward. One repair used a solder blob; another needed a fine wire. It is fiddly but works and avoids removing the 16‑pin IC. [Elektroda, richardsg307, post #20543884]

What GPIO mapping worked for this specific window controller?

Reported mapping: Relays on PWM3 and PWM0; Buttons on PWM2, PWM4, and RXD1; LEDs on TXD1, PWM5, and PI4. That enabled three buttons, three LEDs, and two relays in OpenBeken. [Elektroda, richardsg307, post #20542782]

Is there a GUI flasher that automates settings?

Yes. Try BK7231GUIFlashTool from the project maintainers. It automates most detection and parameter choices for BK7231 devices and simplifies flashing. [Elektroda, p.kaczmarek2, post #20543743]
Generated by the language model.
ADVERTISEMENT