logo elektroda
logo elektroda
X
logo elektroda

T34 datasheet, pinout, flashing and common mistakes - soldering to QFN pins, LSPA9 clone smart plug

p.kaczmarek2 1638 3
ADVERTISEMENT
  • T34 module with soldered thin wires
    T34 a Wi-Fi and BT combo chip integrating BK7231N core along with crystal, RF matching component, and most other peripheral components within a tiny SMD case. The T34 dimensions are 6±0.1 mm (W) × 6±0.1 mm (L) × 0.85±0.1 mm (H). This reduces the size required on the board and saves manufacturing cost.
    Diagram of T34 LGA36 chip with dimensions and pin descriptions
    Internally, T34 is compatible with BK7231N firmware, so it can be flashed with OpenBeken.
    But first, let's consider T34 pins:
    Pin No.SymbolI/O typeDescription
    1, 3, 32, 33, 34, 35, and 36GNDPGround pins. 33, 34, 35, and 36 are the ground pads at the back of the chip.
    2ANTI/OExternal antenna with 2.4 GHz RF input and output.
    4 and 5VCCPAPRF PA power input. Voltage range: 3.0V to 3.6V. And 3.3V power supply is recommended.
    6VDDDIGODigital power output. The voltage is about 1.2V.
    7VDDAONONormally open power output. The voltage is about 1.2V.
    8VBATIChip main-power input. Voltage range: 3.0V to 3.6V. And 3.3V power supply is recommended.
    9CENIThe CEN pin of the chip, without a reset function. This pin is floating inside the chip.
    10P28/ADC4/RXENI/OGPIO or ADC4 or set high during RF reception.
    11P14/SD_CLK/SCK/ANT0I/OGPIO, or CLK of SD, or SCK of SPI, or Bluetooth LE antenna control ANT0.
    12P16/SD_CMD/MOSI/ANT2I/OGPIO, or CMD of SD, or MOSI of SPI, or Bluetooth LE antenna control ANT2.
    13P15/CSN/ANT1I/OGPIO, or CSN of SPI, or Bluetooth LE antenna control ANT1.
    14P17/SD_D0/MISO/ANT3I/OGPIO, or D0 of SD, or MISO of SPI, or Bluetooth LE antenna control ANT3.
    15P26/ADC1/IRDA/PWM5I/OGPIO, or ADC1, or IR receiver or PWM5.
    16P24/ADC2/LPO_CLK/PWM4I/OGPIO, or ADC2, or low power clock 32.768K output, or PWM4.
    17P23/ADC3/TDO/F_SOI/OGPIO, or ADC3, or JTAG TDO, or flash data output when downloading with SPI.
    18P22/ADC5/CLK_26M/TDI/TXEN/F_SII/OGPIO, or ADC5, or crystal frequency output, or JTAG TDI, or set high during RF transmission, or flash data input when downloading with SPI.
    19P21/ADC6/I2C1_SDA/TMS/F_CSNI/OMode selection pin for selecting RF test firmware or app firmware. Pulling down this pin will enter the RF test mode.
    20P20/I2C1_SCL/TCK/F_SCKI/OGPIO, or SCL of I2C1, or TCK of JTAG, or the clock when flash is downloaded by SPI.
    21P6/CLK13M/PWM0I/OGPIO, or 1, 2, 4, and 8 frequency division output of crystal clock, or PWM0.
    22P7/WIFI_ACTIVE/PWM1I/OGPIO, or WIFI_ACTIVE control when Wi-Fi and Bluetooth coexist, or PWM1.
    23P8/BT_ACTIVE/PWM2I/OGPIO, or BT_ACTIVE control when Wi-Fi and Bluetooth coexist, or PWM2.
    24P9/BT_PRIORITY/PWM3I/OGPIO, or BT_PRIORITY control when Wi-Fi and Bluetooth coexist, or PWM3.
    25P10/DL_RX/UART1_RXDI/OGPIO, or RXD when downloading flash with UART, or RXD of serial port UART1.
    26P11/DL_TX/UART1_TXDI/OGPIO, or TXD when downloading flash with UART, or TXD of serial port UART1.
    27P1/UART2_RXD/I2C2_SDAI/OGPIO, or RXD of serial port UART2, or SDA of I2C2. P1 is used for self-calibration and cannot be used for other functions.
    28P0/UART2_TXD/I2C2_SCLI/OGPIO, or TXD of serial port UART2, or SCL of I2C2.
    29XIIT34 has a built-in crystal, and no external crystal is required.
    30XOOT34 has a built-in crystal, and no external crystal is required.
    31VSYSOSystem power output. Voltage range: 2.7V to 3.0V.

    For flashing, you just need TX1, RX1 and power (GND and 3.3V).

    T34 datasheet:
    T34 Module...atform.pdf Download (741.56 kB)
    In the next section, I'll present and flash a sample T34 device, so it can run free from the cloud and be paired with Home Assistant.

    LSPA9 plug with T34
    I've bought a very common plug on Aliexpress, which is sold for about 5$:
    Advertisement for Tuya WiFi smart plug with power monitoring, available for $5.55.
    Plug is branded as QNCX.
    It arrived fairly quickly:
    Box for a smart plug with printed product information and barcode.
    Box of a smart plug with the label Smart plug and Electricity statistics.
    White box with Smart Life app and QR code.
    WiFi smart plug with user manual and packaging.
    The device can be opened with vice or by prying, it may be sometimes hard or easy, it depends on how much glue manufacturer used.
    Electrical plug with partially removed casing.
    Disassembled electrical plug with visible internal components.
    There is a single board inside, it can be removed by unscrewing one screw:
    View of the interior of an electronic device with visible circuit board and components.
    Close-up of a disassembled electrical plug with visible wires and internal parts.
    The device is using T34 chip along with BL0937 for power metering. Futhermore, there is a step down power supply based on BP2525 and a 3.3V LDO to get 3.3V for the WiFi chip.
    Close-up of a green printed circuit board with small electronic components.
    Electronic circuit board with capacitors and sockets.
    Close-up of a circuit board with electronic components, including capacitors and sockets.
    Close-up of a printed circuit board with various electronic components.
    Circuit board with visible electronic components, including capacitors and transistors.
    Close-up of a circuit board with electronic components.
    Close-up of a green printed circuit board with various electronic components such as capacitors and coils.
    Close-up of a circuit board with mounted electrolytic capacitors.
    Close-up of a small printed circuit board with electronic components, held in hand.
    Close-up of a green printed circuit board held in hand with electronic components such as capacitors and microchips.
    Close-up of a green circuit board with electronic components.
    Printed circuit board with electronic components and a jack socket.




    Flashing attempt - how not to flash
    There are no RX/TX pads, but one of UART signals is routed to small SMD resistor pad. I've wanted to use this, as shown on image below:
    Circuit board of a T34 module with pinout for OpenBeken programming.
    However, I've made a small mistake and used too large wires:
    Close-up of a circuit board with mounted electronic components and attached wires.
    Ultimately, one of the pads fell off and I had to take a different approach.
    So, if you are attempting this, use thinner wires! Like this:
    Exposed copper wire with thin, bare strands.


    Second flashing method
    And so, I had to remove the T34 from the board with hot air. I added some extra flux and lowered the air flow to avoid affecting nearby components.
    Close-up of a circuit board with electronic components.
    Here you can see the pad that I damaged (not the resistor pad, but the tiny pad of the other UART pin):
    Close-up of a green printed circuit board with exposed metal contacts and traces.
    Then I decided to solder directly to QFN pads, but this time I used thin wires:
    Exposed copper wire with thin, bare strands.
    It is also recommended to secure them in place with some hot glue or sticky tape, because it's still very easy to tear the pad.
    Here's UART soldered:
    Small electronic chip with four metallic squares on a brown background.
    And then ground (large pad) and power (3.3V):
    Square electronic component with soldered copper wires on a wooden surface.
    Full circuit:
    Breadboard with electronic components and wires.
    For flashing, I've used our GUI tool:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    This is how I performed the power on/off cycle:



    Sadly it's not possible to check if WiFi access point is available after flashing. That's why I decided to solder it back in place without doing extra checks.
    I cleared up the T34 pads with flux and solder wick. Then I added flux on the PCB and decided to reuse the solder that was already there.
    After a brief heating, with a small air flow, the module has slightly moved itself in place and seated itself correctly. I had no corrections to do myself.
    Close-up of a green circuit board with visible integrated circuits and electronic components.
    Close-up of a green printed circuit board with integrated circuits and electronic components.
    Close-up of a green circuit board with a chip and metal components.
    Close-up of a circuit board with visible electronic components.
    Luckily the soldering turned out to be very easy and device worked at the first try.
    I've used template from here: https://www.elektroda.com/rtvforum/topic4042412.html#21030449
    Everything is working correctly.



    Factory flash backup:
    https://github.com/openshwprojects/FlashDumps/commit/9b564848c33a9622df7f94ed19855831ec574040

    Summary
    New devices with T34 devices are still certainly flashable, you can do that just like you'd flash BK7231N.
    This particular plug can be still flashed without desoldering T34, you don't even need hot air, just a cheap soldering iron, but don't repeat my mistake and use a very thin wires to access UART TX and RX. Then you can just feed either 5V to the input of AMS1117-3.3V or 3.3V to the output and it will flash just fine.
    Otherwise you'll need to desolder T34 chip with hot air. It's still possible and in my opinion it's actually way more easy than it seems. Soldering to T34 pads is also relatively easily, as long as you use flux and a correct type of wire. Just don't apply force or you'll rip them too. It may be safer to secure T34 wires in place with some hot glue to avoid pulling them accidentally.
    Soldering T34 back is also easy, I just cleared T34 pads with soldering wick and added flux to the board, I didn't even clean the old solder. Old solder melted just fine. I will try to make a video with it soon, but that's for another topic.
    So, summing up, T34 devices are still flashable and it's still possible to do it in most cases even without hot air.
    Did you encounter any T34 devices so far? Let us know! We can help you with running your devices 100% local, without the cloud and with Home Assistant.

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 11822 posts with rating 9927, helped 564 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #3 21487548
    p.kaczmarek2
    Moderator Smart Home
    Thanks, this makes me now wonder, when did we see the first occurence of T34, either on Elektroda or in general?

    i also saw recently mentions of BK7231NL
    Helpful post? Buy me a coffee.
  • #4 21487566
    divadiow
    Level 34  
    p.kaczmarek2 wrote:
    i also saw recently mentions of BK7231NL

    isn't NL some power-optimised version of the N SDK? We see it on battery-powered devices mainly I thought?

    Added after 10 [minutes]:

    Code: Text
    Log in, to see the code


    Added after 36 [minutes]:

    p.kaczmarek2 wrote:
    when did we see the first occurence of T34, either on Elektroda or in general?

    here is your first encounter I think https://github.com/openshwprojects/OpenBK7231T_App/issues/90
ADVERTISEMENT