logo elektroda
logo elektroda
X
logo elektroda

Exploring Tuya WT-SPI LED Controller With TuyaMCU: 1-4 Data Lines, 1000 LEDs, 8A, 5-24V Input, CBU

divadiow 4203 13
ADVERTISEMENT
  • #1 21147889
    divadiow
    Level 38  
    Posts: 4835
    Help: 420
    Rate: 852
    I have another device to play with!

    This is Tuya SPI LED controller with up to 4 data lines (LED strip controller depending) supporting up to 1000 LEDs @ 8 amps. Its model is WT-SPI and a quick Google shows a few vendors for it.

    https://www.aliexpress.com/item/1005005335498067.html

    Tuya SPI LED controller WT-SPI with technical description and price on AliExpress.

    The product manual is quite good and is also available as a PDF, which I attach. The number of supported LED controller types seems quite extensive

    Table of LED chip types and compatible chips for SPI LED controller.

    I didn't know some LED types come with separate data and clock lines, which is why there is C01/D01 & C02/D02

    Connection diagram of the Tuya SPI LED controller to various types of LED strips.

    Despite having a CBU/BK7231N module the device also comes with an MCU. The accepted input voltage is 5-24v with barrel or bare-wire connector options. With my 12V DC barrel adaptor the output is 12v, so natively good for LED strips that require 12v, like WS2811.

    White Tuya SPI LED controller on a light background. Tuya WT-SPI LED controller with visible ports and labels. WT-SPI RGB/RGBW controller with manual and box.
    Close-up of a circuit board with CBU module, buttons, and capacitors. Close-up of a printed circuit board with electronic components of a Tuya SPI LED controller. Close-up of a circuit board with electronic components Close-up of a printed circuit board with visible integrated circuits and wire connections. Close-up of a circuit board with integrated circuits and a Topazcon 16V capacitor. Close-up view of the underside of a circuit board with a removed copper trace. Bottom view of a green printed circuit board with solder marks. Tuya SPI LED controller WT-SPI with visible components and connectors

    I think I have identified these components correctly

    Image of Tuya SPI LED controller with marked components on the board.

    Along with their respective product pages:
    https://www.xlsemi.com/datasheet/XL1509-EN.pdf
    http://www.microne.com.cn/en/product/246.html
    https://www.mcu.com.cn/en/Products/112
    https://www.nexperia.com/products/analog-logi...ers/transceivers/series/74HC245-74HCT245.html

    Because the MCU is connected to the CBU using RX and TX communication at 115200 baud, I was not able to take a dump of the CBU firmware without severing the TX trace to the MCU. Unfortunately I severed the RX too, I think I've usually only needed to do one before. No matter, it can be repaired.

    Damaged traces on a printed circuit board.

    And with the MCU out of the way I can take a backup, attached. Also, boot log:

    Code: Text
    Log in, to see the code


    Being v2.1.6 it is not patched and so Cloudcutter can be used to flash to Openbeken. My next steps are to repair the RX/TX and begin MCU communication capture using TuyaMCU Analyser. I have not been able to get a full API response from Tuya for this device so I'll have to use tuyaMcu_sendQueryState as explained here https://www.elektroda.com/rtvforum/topic4049908.html

    I am curious to find out if the MOSI pin on the CBU is doing anything. Is the MCU doing everything and does it contain the full program of supported LED controller types and animation seen in the Tuya app? If so, can all these things be set by MCU command alone from within Openbeken? If so, it could mean a long autoexec and many GUI options to set in OBK. Sadly that would mean no OBK PixelAnim opportunities I fear.

    Tuya app interface for the WT-SPI LED controller with a red color setting for the LED strip. Tuya LED controller app screen displaying various light effects. LED controller settings menu in the app. Chip type selection screen in the app. Device update screen in the app showing no updates available for modules V2.1.6 and V1.0.0.
    Attachments:
    • readResult_BK7231N_QIO_2024-07-7-22-45-28.bin (2 MB) You must be logged in to download this attachment.
    • WT-SPI.pdf (13.59 MB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • #2 21147912
    divadiow
    Level 38  
    Posts: 4835
    Help: 420
    Rate: 852
    ha. I guess I didn't look at the Cloudcutter profile hard enough. The dpIDs are listed, but not named.

    Code: Text
    Log in, to see the code
  • #3 21149178
    divadiow
    Level 38  
    Posts: 4835
    Help: 420
    Rate: 852
    hmm. and this is just the chip type selection
    Table showing chip types, their compatible chips, and WiFi module commands.

    Added after 10 [hours] 3 [minutes]:

    not sure I have the energy for getting every function mirrored in OBK, if that's even possible. The LED strip length calculation and free-style colour picker could be interesting to work out. :/

    half the predefined animations:

    Screenshot of a list of predefined LED animations with codes and names.
  • #4 21155942
    divadiow
    Level 38  
    Posts: 4835
    Help: 420
    Rate: 852
    The test pads on the PCB trace to these legs of the Cmsemicon 32-pin package BAT32G137GH32FP. I hoped they would include SWDIO and SWCLK so there's potential to dump the MCU flash using Jlink.

    Printed circuit board with labeled test points for SWDIO, SWCLK, VSS/GND, RESETB, and a pinout diagram for the 32-pin BAT32G137GH32FP package.

    and I probably didn't need to cut the RX/TX on the underside as the reset pad pulled to ground could disable the MCU, freeing access to the CBU.
    Attachments:
    • BAT32G137_Datasheet_V2.5.5.pdf (1.72 MB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • #5 21156008
    divadiow
    Level 38  
    Posts: 4835
    Help: 420
    Rate: 852
    divadiow wrote:
    and I probably didn't need to cut the RX/TX on the underside as the reset pad pulled to ground could disable the MCU, freeing access to the CBU.


    maybe not. disabling the MCU with RESETB grounded means no CBU powering/booting

    Added after 53 [minutes]:

    with SWDIO and SWCLK connected to a J-Link SWD USB device and this custom device added to C:\Program Files\SEGGER\JLink_V796t\JLinkDevices.xml we can choose the correct MCU from the target device list. The FLM file for BAT32G137GH can be downloaded from https://www.mcu.com.cn/en/Products/112/pids/8

    Screenshot showing the CMS.BAT32G137.pack file, version 3.0.8, labeled as BAT32G137 Pack.

    unzipped. file placed in C:\Program Files\SEGGER\JLink_V796t\JLinkDevices\Cmsemicon\BAT32G137GH.FLM

    SEGGER J-Flash software interface with selected configuration for MCU Cmsemicon BAT32G137GH.

    Code: Text
    Log in, to see the code


    connected OK and entire chip read, seemingly successfully. 0x00000000 - 0x0001FFF. Attached.

    Not sure what use this is, looks like gibberish. encrypted?

    J-Flash message indicating successful memory read.

    Screenshot of SEGGER J-Flash program with a memory view of the chip.
    Attachments:
    • BAT32G137_mcu_fw.zip (57.83 KB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • #6 21345704
    divadiow
    Level 38  
    Posts: 4835
    Help: 420
    Rate: 852
    >>21147912

    full dpID

    Code: JSON
    Log in, to see the code
  • #7 21855682
    Bejziczek
    Level 13  
    Posts: 249
    Rate: 43
    Board Language: polish
    I have this controller hooked up to a 24v power supply, and from the controller to a 24v rgb cob ic tape and it doesn't work. I'm struggling for the third month now, I've bought more digital cob tapes and nothing, still the same
    I bought another such controller yesterday and will see how it arrives.
    What could I possibly check?
  • #8 21870896
    Bejziczek
    Level 13  
    Posts: 249
    Rate: 43
    Board Language: polish
    Another controller worked on dams with chipstem sk6812, and as I could not get the colours correct I was told that sk6812 would only set correctly via remote control, not an app so I bought a remote control and since then another controller seems dead, i.e. the tape works in the last selected program as it was still controllable, and now the flesh diode lights up constantly, does not blink, even after connecting voltage and the match key even held down for a few minutes does not respond.
    Please help.
  • #9 21870944
    divadiow
    Level 38  
    Posts: 4835
    Help: 420
    Rate: 852
    do you have pictures of your power supply and how you've connected it, and the LED strips, to the controller?
  • ADVERTISEMENT
  • #10 21871072
    Bejziczek
    Level 13  
    Posts: 249
    Rate: 43
    Board Language: polish
    A 200w power supply, and connected to the controller with a wire with a round end (forgot the name), and the led strip is on 3pin, spi, red V+, white GND, and green is data or clock
    Now I have 2 wz-spi controllers, the first one that responds to match key presses, pairs with the app and remote control, and the voltages are such that between V+ and GND or CO1 or DO1 is as input ie 24v, and between V+ and CO2 or DO2 about 13v. The controller can be controlled normally from the app or the remote, but the tape does not light up at all, and on the second controller the tape lights up, but there is no control over it, the led does not blink when power is applied, it cannot be reset or put into pairing mode and the voltage between V+ and the other contacts is that of the input approx 24v
  • #11 21871624
    divadiow
    Level 38  
    Posts: 4835
    Help: 420
    Rate: 852
    I can't really think what the issue is. So your LED strip is a SK6812? for sure? Have you tried cycling through the chip types in the app to see if any make the LED strip work?
  • #12 21871716
    Bejziczek
    Level 13  
    Posts: 249
    Rate: 43
    Board Language: polish
    divadiow wrote:
    I don't really know what this is about. Your LED strip is definitely an SK6812? Have you tried switching between chip types in the application to see if any of them make the LED strip work?

    Obviously I've tried all sorts of combinations, but since even you can't help me there's nothing left for me to do but buy another driver because these two are definitely broken and I'm currently trying to return them under warranty.
  • #13 21871742
    divadiow
    Level 38  
    Posts: 4835
    Help: 420
    Rate: 852
    also, aren't SK6812 strips typically 5v? Youre feeding it 24v?

    What is your LED strip exactly? Make/model/pictures/purchase link?
  • #14 21871759
    Bejziczek
    Level 13  
    Posts: 249
    Rate: 43
    Board Language: polish
    divadiow wrote:
    also, aren't SK6812 strips normally powered by 5 volts? Are you supplying them with 24 volts?

    What exactly is your LED strip? Make/model/photos/link to purchase?

    The strips are 24v, it is clearly written on them and I know what I am buying.
    I bought my first set in December with 2x5m RGBIC tapes with the WSS8211 chipset and I don't want to describe everything one by one, but I ended up buying colloquial tapes these:
    https://pl.aliexpress.com/item/10050072998586...in.93.410a1c24B8xPVm&gatewayAdapt=glo2pol
    and they also did not want to work and only when I bought another such controller WZ-SPI it worked, but I could not get the correct colours and also here on the forum someone told me that to get the mode on WS8214 I need to buy a remote control which I did and when I tried to connect the remote to the controller it stopped responding. The flash LED on it doesn't blink and it doesn't respond to the match key

Topic summary

✨ The discussion centers on the Tuya WT-SPI LED controller, which supports up to four data lines and can drive up to 1000 LEDs at 8A with a 5-24V input voltage. The device integrates a CBU/BK7231N module alongside an additional MCU (Cmsemicon BAT32G137GH), enabling complex LED control including separate data and clock lines for certain LED types. The controller supports multiple LED chip types and extensive LED strip configurations. Detailed device parameters (dpIDs) were identified, including ON/OFF, mode selection (white, colour, scene, music), brightness, color temperature, color string, timer, music, and adjustment controls. Efforts to access the MCU flash via SWDIO and SWCLK using a J-Link debugger were described, including custom device configuration for the BAT32G137GH MCU. The product manual and vendor links were referenced, and challenges in fully replicating all device functions in OpenBK firmware were noted, particularly for LED strip length calculation and animation features.
Generated by the language model.
ADVERTISEMENT