logo elektroda
logo elektroda
X
logo elektroda

SurpLife (Zengge) Symphony Controller USB SPI: BK7238 Firmware Details

divadiow 2370 13
ADVERTISEMENT
  • Helpful post
    #1 21329884
    divadiow
    Level 38  
    Posts: 5031
    Help: 438
    Rate: 891
    SurpLife (Zengge) Symphony Controller USB SPI. Very small.

    WiFi SPI LED Controller with USB cable on a wooden table Photo of an electronic board with several components and a connected white wire. SurpLife (Zengge) USB SPI controller module on a white background.

    BKFIL and Easy Flasher firmware backup attached. The coeff on this device is 84f37800 84f37800 84f37800 84f37800.

    boot at 115200 baud

    Code: Text
    Log in, to see the code


    app boot is at 2000000 baud
    Code: Text
    Log in, to see the code


    attempting OTA with mhflasher to see what it says:

    Code: Text
    Log in, to see the code


    detected by the Magic Home and SurpLife apps but SL has all the SPI LED scenes and features

    Device information screen from an app showing device name and firmware version. Symphony Controller app screen with hexagonal menu items. App screen for connecting the device to Wi-Fi. App screen showing connection to Wi-Fi network LEDnet007788A8A9.

    @insmod's Arduino SDK build boots:
    Screenshot of OpenBK7238 control panel.
    Attachments:
    • x1_0_dump_20241202_185540_0x0_0x200000.bin (2 MB) You must be logged in to download this attachment.
    • readResult_BK7238_QIO_2024-02-12-18-52-28.bin (2 MB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • #2 21330584
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14584
    Help: 654
    Rate: 12607
    A BK7238 device, not BK7231? Very interesting, how did you get one?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 21521547
    divadiow
    Level 38  
    Posts: 5031
    Help: 438
    Rate: 891
    hooked this back up to see what was on it. Early OpenBK7238.

    OpenBK7238 control panel with configuration, restart, and web application launch buttons.

    OTA I guess wasn't working at this point so flashed with EF
    BK7231 Easy UART Flasher window with Write success! message indicating successful firmware writing.

    I notice the OpenBK7238 log out must have switched UART too.

    1.18.84 OTA- > 1.18.84 log:

    Code: Text
    Log in, to see the code


    flashed factory back from 0x0 and tested OpenBK7238 flash and OTA was still OK as if new user converting from factory.

    OTA still behaves as it should ✅

    Main interface of the OpenBK7238 web panel with device information and configuration options.

    Added after 52 [minutes]:

    although SPI isn't yet implemented yet on BK7238, here are the pin assignments discovered by trial-and-error and educated guesses after marking pins with traces

    Code: Text
    Log in, to see the code


    P1 is the microphone, not supported in OBK

    PCB with electronic components and a microcontroller pinout diagram in the upper left corner.

    ZJ-BWCUCS-HC-1K-43 V1.0
  • #5 21521657
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14584
    Help: 654
    Rate: 12607
    Do we have access to any Tuya ADC samples to see how they use mic?
    Helpful post? Buy me a coffee.
  • #6 21521690
    divadiow
    Level 38  
    Posts: 5031
    Help: 438
    Rate: 891
    hmm. unsure. I'll trawl a selection of these SDKs
    A list of folders with names of electronic module chips visible in a file explorer window.
    There's this in XR806, but that's audio, not necessarily mic I guess
    Screenshot of a project folder containing C source and header files for an audio demo.

    Added after 1 [hours] 2 [minutes]:

    a ton of stuff in the attached, but don't see anything super relevant.
    other things maybe interesting?
    A list of C source and header files in a pixel driver project folder. ZIP archive window with a list of folders in the os_kv directory. Screenshot of a folder containing directories and files from a software project. Screenshot of a folder window with several C source files and a README file. Screenshot of a file explorer window displaying C source and header files from the tuyaos_dimmer_driver_demo project.
    Attachments:
    • TUYA.zip (7.97 MB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • #7 21521775
    divadiow
    Level 38  
    Posts: 5031
    Help: 438
    Rate: 891



    A list of project folders with the driver_mic folder highlighted.
    ?
    Attachments:
    • tuyaos_demo_examples_2.1.5.tar.gz (1.11 MB) You must be logged in to download this attachment.
  • Helpful post
    #8 21540520
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14584
    Help: 654
    Rate: 12607
    That's lot of interesting samples, but let's focus on mic for now.
    driver_mic readme translated to english by GPT:
    Quote:

    Microphone
    Introduction
    The Microphone is a common input device used to convert sound signals into electrical signals. This demo shows how to capture audio data from a microphone and save it to internal flash or an SD card.

    Features
    This sample code demonstrates how to initialize the microphone, collect audio data, and save it to a specified storage medium. The main features include:

    Initializing the microphone and audio system.

    Configuring the audio sampling rate (to allow the speaker to directly play back audio from the MIC, only 8kHz or 16kHz is supported), sample bit depth (16-bit), and channels (mono).

    Detecting audio trigger signals through a GPIO pin.

    Using a ring buffer to store audio data.

    Saving audio data to internal flash or an SD card.

    Reading audio data from the storage medium and playing it back.

    File Structure
    example_recorder.c: The main source file containing the implementation of microphone initialization, audio recording, and storage.

    Usage
    Ensure the hardware is properly connected, and both the microphone and SD card are connected to the development board.

    Configure the config file in the project and enable CONFIG_FATFS to support the SD card file system.

    Compile and flash the code to the development board.

    Run the program, press the audio trigger button to start recording, and release the button to stop recording and begin playback.

    About PCM and WAV
    To convert PCM to WAV format, simply add a WAV header in front of the PCM data. Refer to the diagram below for the WAV header format:



    Notes
    Ensure the SD card is properly formatted and has sufficient storage space.

    Adjust the GPIO pins and audio parameters according to your actual hardware configuration.

    The recording duration is limited by the size of the ring buffer and the available storage space.

    It is creating wav file... it's not using ADC directly, it seems to be using TKL system:
    Code: C / C++
    Log in, to see the code
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #10 21623733
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14584
    Help: 654
    Rate: 12607
    So I can now drive WS2812 from BK7238 NiceMCU? I can give it a try today

    Quote:

    SPIDMA LEDs for BK7238, BK7252N and BK7231N_ALT.
    Tested 12 WS2812B leds on BK7238, animations work fine.
    Fixed Powersave on BK7238.
    Implemented SPI with new sdk, not tested. (N/7238/7252N use SPI DMA, everything else SPI)

    I see,
    Helpful post? Buy me a coffee.
  • #11 21624400
    divadiow
    Level 38  
    Posts: 5031
    Help: 438
    Rate: 891
    insmod wrote:
    The only untested thing is spi on BK7231U/T_ALT and BK7238/N_ALT.


    My 'test' as of now hasn't been very methodical, but in the few moments I had yesterday to try it, it worked. OTA to SPI PR on this SurpLufe device was OK, 2m 120 LED ws2812 connected up, PixelAnim running. However, it was quite hit-and-miss getting the animations going. GUI was oddly unresponsive/slow

    Added after 6 [hours] 30 [minutes]:

    bad test. seems fine.





    Added after 3 [hours] 34 [minutes]:

    OTA 1.18.145->1.18.145 wipes LFS
  • #12 21715277
    Andy41
    Level 5  
    Posts: 10
    Help: 1
    Rate: 1
    Thank you for the coding for this part. Good work.

    There are two questions/ remarks:
    - sometimes the firmware crashed, if I set more than 20 Pixels at startup. Sometimes the last pixel set a wrong color,
    (startDriver SM16703P | SM16703P_Init 32 | startDriver PixelAnim) -> Comet with white color let the last pixel be yellow.
    I think, it could
    Lit LED strip with white and one yellow LED on a wooden surface be a problem of PixelAnim !?

    - Where can I find the command-set for SM16703P?
    I want to set brightness at startup. i.e.

    Thanks
    Andreas

    Added after 4 [hours] 36 [minutes]:

    Now I have found the command-set at github in /scripts/commands.md. Sorry.

    The crash, I have had, is at startup - if you use "Change Startup Command Text". Not by autoexec.bat!. I think, there is a timing problem. If I start with "delay_ms 100" the problems are gone.
    Andreas
  • #13 21715786
    divadiow
    Level 38  
    Posts: 5031
    Help: 438
    Rate: 891
    ah yes. a delay needed on BK7238 sounds familiar for something, but I could be mis-remembering. If you do use autoexec be sure to keep a note of the content elsewhere, OTA updates currently wipe LFS on BK7238 iirc.
  • #14 21913160
    divadiow
    Level 38  
    Posts: 5031
    Help: 438
    Rate: 891
    divadiow wrote:
    OTA 1.18.145->1.18.145 wipes LFS


    so this is still happening.

    our_lfs.h has explicit LittleFS placement blocks for BK7231T and BK7231N, but there is no PLATFORM_BK7238 placement block before the fallback case.
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/littlefs/our_lfs.h#L41-L53

    Because there is no PLATFORM_BK7238 LittleFS block, BK7238 uses the generic fallback range:
    LFS_BLOCKS_START = 0x12B000
    LFS_BLOCKS_START_MIN = 0x12B000
    LFS_BLOCKS_END = 0x1AB000
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/littlefs/our_lfs.h#L166-L172

    The default LittleFS size is 0x8000 bytes, and the runtime start address is calculated as:
    newstart = LFS_BLOCKS_END - newsize
    Therefore the default live BK7238 LittleFS range is:
    0x1AB000 - 0x8000 = 0x1A3000
    default live LFS = 0x1A3000 .. 0x1AB000
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/littlefs/our_lfs.h#L184-L189

    The permitted fallback LittleFS range straddles the app/OTA boundary:
    fallback LFS allowed range = 0x12B000 .. 0x1AB000
    app partition tail = 0x12B000 .. 0x132000
    OTA partition overlap = 0x132000 .. 0x1AB000

    The default live LittleFS range does not straddle the boundary:
    default live LFS = 0x1A3000 .. 0x1AB000
    this is entirely inside OTA = 0x132000 .. 0x1E0000

    Proposed BK7238 LFS window:
    LFS_BLOCKS_START 0x133000
    LFS_BLOCKS_START_MIN 0x133000
    LFS_BLOCKS_END 0x1E0000

    Default live LFS:
    0x1E0000 - 0x8000 = 0x1D8000
    0x1D8000 .. 0x1E0000

    OTA space to play with:
    BK7231T current: ~484 KiB
    BK7231N current: ~632 KiB
    BK7238 proposed: ~664 KiB

    or maybe a dedicated LFS somewhere else that won't clash, if there is anywhere. Either option is better than LFS always getting wiped, which is kinda bad considering BK7238 is so popular now.

    @DeDaMrAz @insmod @p.kaczmarek2

    Added after 1 [hours] 8 [minutes]:

    https://github.com/openshwprojects/OpenBK7231...are/main...divadiow:OpenBK7231T_App:bk7238lfs

    this dump is that code change build with autoexec.bat created and an rbl staged in ota slot ready

    The staged OTA image is at:
    0x132000 .. 0x1AD25F

    The default live LittleFS area is at:
    0x1D8000 .. 0x1E0000

    autoexec.bat is present inside that new LFS area:
    metadata/name at 0x1D903C
    content at 0x1DA000

    this particular staged OTA image leaves about 171 KiB of headroom before it would touch default LFS
    Attachments:
    • readResult_BK7238_QIO_2026-31-5-17-56-49.bin (2 MB) You must be logged in to download this attachment.

Topic summary

✨ The discussion centers on the SurpLife (Zengge) Symphony Controller USB SPI device featuring the BK7238 chip, with firmware details including BKFIL and Easy Flasher backups. The device boots at 115200 baud and switches to 2000000 baud for application boot. Firmware version BK7238_1.0.14 is noted, running RT-Thread OTA package V0.2.8. The device identification includes MID AK001-ZJ21413 and firmware version 77_24_2. Early OpenBK7238 firmware was tested, revealing UART switching behavior during OTA updates. The device is available on AliExpress with various power and IR remote options. The discussion also explores access to Tuya ADC samples for microphone usage, with SDK trawling revealing XR806 audio components but no direct mic samples. A translated readme for a driver_mic indicates WAV file creation via the TKL system rather than direct ADC usage, involving TKL audio, GPIO, memory, and filesystem modules.
Generated by the language model.

FAQ

TL;DR: OTA image size observed was 743,313 bytes; “OTA still behaves as it should.” Works on SurpLife (Zengge) Symphony Controller with BK7238, with SPI/WS2812 now supported and EF/OTA paths verified. [Elektroda, divadiow, post #21521547]

Why it matters:** This FAQ helps makers and integrators flash, wire, and stabilize BK7238-based SPI LED controllers fast, with field-tested settings.

Quick Facts

What exactly is the SurpLife (Zengge) Symphony Controller and which chip does it use?

It’s a very small USB SPI LED controller used by SurpLife/Zengge. The unit documented here runs the Beken BK7238 SoC and exposes Wi‑Fi, BLE, and SPI LED driving features. Factory firmware advertises as LEDnet… in AP mode, and logs reveal BLE advertising and TCP/UDP services. [Elektroda, divadiow, post #21329884]

How do I capture serial logs—what baud rates are used?

Connect to the boot ROM at 115200 baud to see the RT‑Thread/Beken boot. After the app hands over, switch to 2,000,000 baud for runtime logs. This transition appears consistently on this BK7238 sample, so adjust your terminal after the “go os_addr(0x10000)” line. [Elektroda, divadiow, post #21329884]

Can I flash OpenBeken on this BK7238, and does OTA work?

Yes. Users restored factory firmware, then flashed OpenBK7238 with Easy Flasher (EF), and confirmed OTA upgrades proceed to 100%. Quote: “OTA still behaves as it should.” If OTA was broken on early builds, EF direct flashing resolved it. [Elektroda, divadiow, post #21521547]

Is SPI/WS2812 support available on BK7238 now?

Yes—“SPI is now implemented,” and SPIDMA LEDs were tested working on BK7238. This unlocks direct driving of addressable strips from the controller with current OpenBeken builds that include the SPI DMA path. [Elektroda, insmod, post #21623725]

How many LEDs were field‑tested with BK7238 SPI output?

Twelve WS2812B LEDs were tested on BK7238 with animations running fine. This confirms timing and DMA correctness for short strips; longer runs may also work but were not detailed in that post. [Elektroda, p.kaczmarek2, post #21623733]

Why did earlier OTA attempts fail with mhflasher URLs?

Logs show the device/flash IDs didn’t match the OTA payload (device type 33 vs flash 77), so the updater pushed an “event: ota fail.” Align OTA device type and vendor strings, or use EF for a clean base before OTA. [Elektroda, divadiow, post #21329884]

Which pins did the community map on this board?

Discovered mappings: Pin 6 = IRRecv;0, Pin 8 = Btn;1, Pin 16 = SM16703P_DIN;0. Header P1 is a microphone input and not supported yet in OpenBeken on BK7238. [Elektroda, divadiow, post #21521547]

Does the SurpLife controller show up in popular apps?

Yes. It was detected by both Magic Home and SurpLife apps; SurpLife exposed more SPI LED scenes and features. This helps during first‑time setup before migrating to OpenBeken. [Elektroda, divadiow, post #21329884]

What is OpenBeken?

OpenBeken is a community firmware for Beken Wi‑Fi MCUs that brings local control, drivers, and OTA. On this unit, OpenBK7238 builds flashed with EF and updated to 1.18.84 via OTA as demonstrated. [Elektroda, divadiow, post #21521547]

Can OTA updates erase my files or scripts?

Yes, an observed case shows OTA 1.18.145→1.18.145 wiped the LittleFS (LFS). Keep a copy of autoexec/startup scripts elsewhere and re‑upload after updating. “OTA… wipes LFS” was reported on BK7238. [Elektroda, divadiow, post #21624400]

My startup commands crash or the last pixel shows wrong color—how do I fix it?

A timing race at startup caused crashes above ~20 pixels and a wrong last pixel color. Prefix your “Change Startup Command Text” with delay_ms 100. Quote: “If I start with ‘delay_ms 100’ the problems are gone.” [Elektroda, Andy41, post #21715277]

Where is the SM16703P command set for scripting brightness and effects?

Community notes point to the OpenBeken commands reference at scripts/commands.md. Use it to issue SM16703P_Init, PixelAnim, and brightness commands. Add a small startup delay on BK7238 before sending driver commands. [Elektroda, Andy41, post #21715277]

Does the microphone work under OpenBeken on this board?

Not yet. The board’s P1 header feeds a mic, but OpenBeken for BK7238 currently lacks a mic driver. You can wire LEDs and IR now; audio‑reactive features await support. [Elektroda, divadiow, post #21521547]

How does Tuya’s SDK handle microphones on similar hardware?

A shared sample uses TKL (tkl_audio, tkl_fs, tkl_gpio) to record 8/16 kHz mono PCM and write a WAV file, rather than exposing raw ADC within the app. It demonstrates GPIO‑triggered capture with ring buffers. [Elektroda, p.kaczmarek2, post #21540520]

What network services and BLE details appeared in logs?

Observed: TCP port 50763, TCP ‘tcps’ on 5577, UDP server on 48899, BLE name IOTWF8A9, and active advertising. Use these to verify connectivity during bring‑up and discovery. [Elektroda, divadiow, post #21329884]

Where can I buy this SurpLife/Zengge USB SPI controller?

A matching listing was shared on AliExpress, including variants with power and IR remote options. Confirm BK7238 in photos/spec before ordering. [Elektroda, divadiow, post #21330605]

How do I convert from factory firmware to OpenBeken (quick steps)?

  1. Back up current firmware; note Wi‑Fi SSID/password and any scenes.
  2. Flash OpenBK7238 with Easy Flasher via UART; reboot and join its AP.
  3. Configure Wi‑Fi, then use OTA for future updates. Keep a backup of LFS scripts. [Elektroda, divadiow, post #21521547]
Generated by the language model.
ADVERTISEMENT