logo elektroda
logo elektroda
X
logo elektroda

BK7231N Sber Smart Relay SBDV-00050 Pin Assignment and Teardown

tehb13 1401 13
ADVERTISEMENT
  • #1 21278069
    tehb13
    Level 3  

    Packaging of the SBER smart relay with text Salut! This is a smart relay and specification 1 channel, 3.68 kW.

    SBER smart relay device with technical specifications

    Close-up of a printed circuit board featuring an AFE BPD-S104SDM relay and other electronic components on a gray background.

    Circuit board with integrated circuits and electronic components.

    Close-up of an electronic module with pin markings and an antenna.

    Blue PCB with pin labels and a logo at the top.

    AFE BPD-SS-105DM relay module with coils and capacitors.

    Electronic module on a gray background with visible components and connectors.


    PINAssignment
    ADC3
    P8Switch
    P24
    P16Button
    P7
    TX1
    GNDGND


    PINAssignment
    EN
    P9RELAY
    P6
    P14
    P26LED
    RX1
    VD0 3.3v
  • ADVERTISEMENT
  • #2 21278275
    divadiow
    Level 38  
    Cool. What are your plans for this device regarding the firmware?
  • ADVERTISEMENT
  • Helpful post
    #3 21278408
    kuba2k2
    Level 13  
    Encryption keys for ESPHome:
    Code: YAML
    Log in, to see the code
  • ADVERTISEMENT
  • #4 21278547
    divadiow
    Level 38  
    interesting module. doesn't seem these are for sale outside of Russia/Kazakhstan though :(
  • #7 21279490
    insmod
    Level 31  
    >>21279480 If erased without backup, then the original bootloader is lost - guaranteed brick. Or then separating the bootloader from backup image, and flashing just it. Alongside losing RF partition.
    >>21279094 Besides, there is no need to flash a full image, just flashing ota package is enough. Bootloader will then update the firmware. In my case on a different device - bkcrypt_coeff is probably wrong - flashing didn't work. But writing rbl at ota address, and subsequent updates from esphome works ok.
  • #8 21279522
    tehb13
    Level 3  
    I flashed the backup. The device works.
    I got this error when flashing the sbdv-00050-ota.rbl
    When flashing sbdv-00050.uf2, no errors occur, but the device does not work, as well as without adding:
    Code: YAML
    Log in, to see the code
  • #9 21279537
    divadiow
    Level 38  
    insmod wrote:
    If erased without backup, then the original bootloader is lost - guaranteed brick. Or then separating the bootloader from backup image, and flashing just it. Alongside losing RF partition.

    yes, I should have been clearer. The user has posted a backup on Github. BKFIL can be used to erase/flash specific address areas in flash.
  • #10 21280204
    insmod
    Level 31  
    >>21279522 At what address did you flash sbdv-00050-ota.rbl?
    Try to get uart1 connected, if bootloader version is something like 1.0.13, then it will print what is wrong with OTA package (like wrong enc keys).
    You can also erase main firmware (for first attempt - 0x10000 to 0x12000) after flashing OTA. Maybe it will work then.
  • #11 21284726
    tehb13
    Level 3  
    BK7231n_1.0.8
    CPSR:0x000000D3
    R0:0x00800000
    R1:0x00000000
    R2:0x005AA000
    R3:0x00000006
    R4:0x00400001
    R13:0x00401C1C
    R14(LR):0x000033AC
    ST:0x00000000
    [I/FAL] Fal(V0.4.0)success
    [I/OTA] RT-Thread OTA package(V0.2.4) initialize success.
    
    go os_addr(0x10000)..........


    the device can be pinged, but it doesn't have a web interface and doesn't connect to homeassistant.
    please write step-by-step instructions on which files to flash to which addresses

    Spoiler:

    Code: YAML
    Log in, to see the code

  • ADVERTISEMENT
  • #12 21284776
    insmod
    Level 31  
    >>21284726 If you are using ltchiptool, then choose rbl and just flash it, it should be autodetected as beken ota image with 0x132000 address.
    Btw, you are missing a "+" sign in board_flash.download, it should be "0x132000+0xCC000"
    And please add log to esphome configuration, it will be easier to debug. And maybe enable api encryption?
    Also, what esphome version are you using? In the OTA config in the latest versions you need to select the platform (just esphome for now) like that
    
    ota:
      - platform: esphome
        password: !secret ota_password
    
  • #13 21284811
    tehb13
    Level 3  
    I have not lost the plus symbol in yaml. This probably happened when publishing the post
    Screenshot of a YAML file named sbdv-00050.yaml with a configuration for esphome.

    When I try to flash sbdv-00050-ota.rbl via ltchiptool, over the factory, I get an error
    Error displayed during an attempt to flash a file using ltchiptool

    BKFIL flashes it without an error.

    logs_sbdv-..050.txt (40.54 kB)You must be logged in to download this attachment.
  • #14 21284826
    insmod
    Level 31  
    >>21284811 Considering there is no log after go os_addr(0x10000), then it probably flashed successfully. Now try reflash backup, then flash new ota image with logging enabled.
    Your esphome version is rather old, 2024.4.1. But nothing much should have changed for beken, so updating is probably unnecessary.

Topic summary

✨ The discussion revolves around the BK7231N Sber Smart Relay SBDV-00050, focusing on pin assignments and firmware flashing issues. Users share insights on encryption keys for ESPHome, methods for flashing firmware, and troubleshooting steps for successful device operation. Key points include the importance of using the correct OTA package and flashing specific address areas, as well as the potential risks of losing the bootloader. Participants also discuss the availability of the device and share links to images and resources for further assistance.

FAQ

TL;DR: OTA lives at 0x132000, and you should "choose rbl and just flash it"; this FAQ maps pins and fixes OTA/web‑UI issues for BK7231N SBDV‑00050 with ESPHome. For DIY tinkerers needing reliable flashing and recovery. [Elektroda, insmod, post #21284776]

Why it matters: It reduces brick risk and speeds up first‑boot success.

Quick Facts

What are the pin assignments for the SBDV-00050 (BK7231N)?

Fourteen pads are documented on the board. Relay: P9. LED: P26. Button: P16. Switch: P8. UART1 is available via TX1 and RX1. Power rails: VD0 3.3 V and GND. Other exposed pads include ADC3, EN, P6, P7, P14, and P24. These mappings come from a teardown with photos. [Elektroda, tehb13, post #21278069]

Which pins drive the relay and the status LED?

The relay coil is controlled by GPIO P9. The status LED is on GPIO P26. These roles are silkscreen-mapped in the teardown photos and tables. [Elektroda, tehb13, post #21278069]

How do I flash the ESPHome OTA RBL with ltchiptool?

Use ltchiptool with the OTA package. 1) Choose the .rbl and the tool should auto-detect the Beken OTA image at 0x132000. 2) Flash the RBL. 3) Enable ESPHome logging to aid any troubleshooting after first boot. “Choose rbl and just flash it.” [Elektroda, insmod, post #21284776]

ltchiptool errors when flashing the RBL—can I use BKFIL instead?

Yes. One user reported ltchiptool errors when flashing sbdv-00050-ota.rbl over factory firmware, while BKFIL flashed it without errors. Use BKFIL as a fallback to write the OTA image when the GUI tool fails. [Elektroda, tehb13, post #21284811]

Do I need to flash a full image, or just the OTA package?

Flash only the OTA package. “There is no need to flash a full image, just flashing ota package is enough.” The bootloader will then update the firmware. Writing the RBL at the OTA address enabled subsequent ESPHome updates. [Elektroda, insmod, post #21279490]

What happens if I erase the flash without a backup?

You lose the original bootloader, which guarantees a brick. The RF partition is also lost. Recovery then requires restoring the bootloader from a proper backup or extracting it from a known image before proceeding. [Elektroda, insmod, post #21279490]

Where do the encryption keys go in ESPHome for this device?

Set platformio_options with bkcrypt_coeffs, bkota.key, and bkota.iv. Also define board_flash.download as 0x132000+0xCC000. These parameters are required for building and delivering encrypted OTA for this model. [Elektroda, kuba2k2, post #21278408]

Device pings but no web UI after OTA—how do I fix it?

Connect UART1 and read the bootloader log. A bootloader like 1.0.13 prints reasons for OTA rejection, such as wrong encryption keys. After flashing the OTA image, erase 0x10000–0x12000 to clear the main firmware region and force a fresh start. [Elektroda, insmod, post #21280204]

What’s the correct board_flash.download format in ESPHome?

Use 0x132000+0xCC000 with a plus sign. Omitting the “+” prevents correct OTA placement. Add logging to your ESPHome configuration to make troubleshooting easier during first boot. [Elektroda, insmod, post #21284776]

Which ESPHome OTA schema should I use right now?

Recent ESPHome uses the multi-platform OTA format. Define ota with platform: esphome and your password. Also enable logs, and consider API encryption for debugging and security. This matches current recommendations in the thread. [Elektroda, insmod, post #21284776]

My .uf2 flashed fine but the device stayed dead—why?

A report shows .uf2 flashed without errors, yet the device didn’t run. The build lacked platformio_options for bkcrypt_coeffs, bkota.key, bkota.iv, and the download range. Add those options before generating and flashing your images. [Elektroda, tehb13, post #21279522]

How can I view boot logs to verify the bootloader is running?

Open a UART session and reboot the device. You should see lines like “BK7231n_1.0.8,” FAL init success, OTA init success, and “go os_addr(0x10000).” These confirm the bootloader hands off to the main firmware. [Elektroda, tehb13, post #21284726]

Is the SBDV-00050 sold outside Russia/Kazakhstan?

A user noted these modules do not appear to be for sale outside Russia and Kazakhstan. Availability is limited, so sourcing may require regional sellers. [Elektroda, divadiow, post #21278547]

Which ESPHome board target should I select for BK7231N here?

Use the BK72xx platform with the generic BK7231N QFN32 Tuya target. Example: bk72xx: board: generic-bk7231n-qfn32-tuya in your ESPHome config. [Elektroda, tehb13, post #21284726]

OTA flashed but no logs—what recovery sequence should I try?

Restore your known-good backup image first. Then flash the new OTA RBL again with logging enabled in ESPHome. This approach confirms baseline function and gives visibility into what happens during the bootloader handoff. [Elektroda, insmod, post #21284826]
ADVERTISEMENT