logo elektroda
logo elektroda
X
logo elektroda

Inside a Tuya Doorbell: BK7252 Exploration and SPI Programming with Python/NeoProgrammer

divadiow 6618 36
ADVERTISEMENT
  • #31 21717022
    divadiow
    Level 37  
    yes. more GPIOs could be done probably but it's OK for now. it looks a bit messy inside. Hoping the enamel holds on these wires. there are no shorts (at the moment)
    PCB with jumper wires connected and visible electronic components Close-up of a PCB with thin soldered wires and various connectors
  • ADVERTISEMENT
  • #32 21738029
    akeilox
    Level 2  
    Stumbled on this thread during search, and delighted with the amount of tinkering.
    These doorbells are sold in two types: Kement or Tuya app compatible. Kement one being widely available and cheaper.
    My question is: can I change firmware from Kement to Tuya by OTA update?
  • ADVERTISEMENT
  • #34 21738175
    akeilox
    Level 2  
    >>21738166

    Thanks for the link! I did not expect they'd gone with different chip and board for the same product.
    I did not yet order it; I came across a listing of Kement type which was dramatically cheaper than Tuya version and thought firmware might be the only difference.
    It's also interesting how much detail can be found inside the APK file, like the JSON object used.
    I have a bunch of Tuya sensors, recently added Cat Feeder and plan to eventually go with ESPHome/HomeKit automation and thought this doorbell was cheap and hackable. It seems in very early stages now, as chips/board differ and extracting firmware has nuances between XR872 and BK725U.
  • ADVERTISEMENT
  • #35 21753146
    divadiow
    Level 37  
    divadiow wrote:
    14: CMP/TB seems to be the one


    This may relate to OpenBeken booting. I've been flashing BK7252U with bootloader only quite a few times this weekend, power cycles in between and SREG2:14 isn't becoming ticked, so no need to clear it. Only when OpenBeken boots did it become enabled for the next SPI flash
  • ADVERTISEMENT
  • #36 21759739
    divadiow
    Level 37  
    Hello @insmod. Before I forget why/what, should I try to fix the Tuya BK7252U BL for working OTA (as worked on in DMs) or were you going to?

    There's also the fact that the Tuya variant is missing in release asset list at the moment...
  • Helpful post
    #37 21760281
    insmod
    Level 29  
    >>21759739
    Sure, but it needs to be decrc'ed and with normal, non-N partitions.

Topic summary

The discussion centers on reverse engineering a low-cost Tuya doorbell featuring the BK7252 SoC. The device was physically inspected, revealing a QFN68 BK7252 chip and multiple test pads including UART interfaces for logging and firmware flashing. UART boot logs were captured, showing RT-Thread OS messages and missing partition tables on flash. SPI flash access was achieved using an LC Technology CH341A programmer in I2C mode, with test pads mapped to CH341A pins, and a Python script was used to enter SPI mode before employing NeoProgrammer for flash operations. The Tuya bootloader uses a dual partition (ping-pong) OTA scheme with a 4MB flash size and a 0x11000 offset for the bootloader. OpenBK7252 firmware support is partial, with some success reported using BK7231GUIFlashTool adapted for BK7252, though full cloud-free firmware replacements are not yet available. Firmware backups are recommended before experimentation. Additional resources include BK7252 SDKs, community projects, and detailed partition and bootloader information. Challenges remain in UART flashing reliability on this device, and efuse reading was queried but not resolved. The discussion includes links to firmware, SDKs, and flashing tools, as well as references to similar devices and ongoing development efforts.
Summary generated by the language model.
ADVERTISEMENT