logo elektroda
logo elektroda
X
logo elektroda

Hi-Link HLK-B30 Development Board with C-Chip CC8000 and OpenBK7231U Firmware

divadiow 549 21
ADVERTISEMENT
  • Helpful post
    #1 21586747
    divadiow
    Level 34  
    There are a few posts around that reference the C-Chip CC8000/BK7231U chip and that it can be found on the Hi-Link HLK-B30 development board, but experiments with it appear mixed in with several other threads, so here's a thread dedicated to the HLK-B30 and now with OpenBK7231U.


    Hi-Link HLK-B30 Development Board with C-Chip CC8000 and OpenBK7231U Firmware
    Hi-Link HLK-B30 Development Board with C-Chip CC8000 and OpenBK7231U Firmware

    Hi-Link HLK-B30 Development Board with C-Chip CC8000 and OpenBK7231U Firmware

    Photo of the Hi-Link HLK-B30 development board with a C-Chip CC8000/BK7231U and visible EN25QH16 flash chip. Screenshot showing startup and configuration logs of a BK7231U microcontroller on an HLK-B30 development board. Screenshot showing boot log output of HLK-B30 module with BK7231U chip, including pin mapping and debug data.

    PinPin NameTypeDescriptions
    1CENIChip enabled, highly effective
    2P26_PWM5I/OP26,PWM5
    3P24_PWM4I/OP24,PWM4
    4P23_TDO_F_S0I/OP23,ADC3
    5P22_TDI_F_SII/OES0, enter at command mode / restore factorysettings, please pull up if not used, same as P28
    6P21_TMS_F_CSI/OP21
    7P20_TCK_F_SCI/OP20
    8VBATP3.3V power supply
    9P28I/OEnter at command mode / restore factory settings, please pull up if not in use, same as P22
    10P16I/OP16
    11P17I/OP17
    12P14I/OP14
    13P15I/OP15
    14P6_PWM0I/OP6,PWM0
    15GNDPGND
    16P7_PWM1I/OP7,PWM1
    17P8_PWM2I/OWiFi indicator light
    18P9_PWM3I/OP9,PWM3
    19P1_URAT2_RXDI/OP1,UART2
    20P0_UART2_TXDI/OP0,UART2
    21P10_UART1_RXDI/OP10,UART1, For upgrading, command settingand transparent transmission
    22P11_UART1_TXDI/OP11,UART1, For upgrading, command setting and transparent transmission


    Pin mapping for SPI flashing with CH341A/Python method - needed if writing bootloader from 0x0. BK7231U is like BK7231T - no rom. Note that on v2.1 of the board D16 is incorrectly labelled as "ESO". In v3.0 (pictured above) D16 is labelled correctly.

    HLK-B30CH341A
    RSTD2
    D17SCK
    ESO/D16 (between D17 and D15)CS0
    ESO (between GND and D1)MOSI
    D15MISO
    GNDGND


    2mb EN25QH16 flash detected in NeoProgrammer when in SPI mode
    Photo of the Hi-Link HLK-B30 development board featuring the C-Chip CC8000/BK7231U and labeled pins.



    OpenBK7231U_QIO_1680_merge_55ebe0a12aba.bin from https://github.com/openshwprojects/OpenBK7231T_App/pull/1680 flashed in its entirety from 0

    Photo of Hi-Link HLK-B30 development board featuring BK7231U microcontroller, flash memory, and labeled GPIO pins.

    Code: Text
    Log in, to see the code


    Hi-Link HLK-B30 development board with visible C-Chip CC8000/BK7231U chip and pin labels on the PCB.

    Hi-Link HLK-B30 Development Board with C-Chip CC8000 and OpenBK7231U Firmware
  • ADVERTISEMENT
  • #2 21586752
    divadiow
    Level 34  
    OTA test success. this was with quick GUI page
    Code: Text
    Log in, to see the code

    web app OTA filtering for .img not .rbl currently

    Screenshot showing detailed log of a successful OTA firmware update process, including progress bar and confirmation messages.

    Added after 7 [hours] 42 [minutes]:

    akosschneemaier wrote:
    hey @divadiow , Yes I was able to backup the fimrware. I already uploaded it to github: https://github.com/libretiny-eu/ltchiptool/issues/28#issuecomment-2054045065

    I am still wating for my HLK-B30 to arrive so I can try flashing it.


    @akosschneemaier this fw should work on your AiDot Leedarson module bulb if you still have it
  • Helpful post
    #3 21586895
    insmod
    Level 24  
    To make sure that MAC and calibration data is correct TLV must be moved from 0x1FE000 to 0x1E0000 on BK7231U.
  • ADVERTISEMENT
  • #5 21588692
    jmkrzyszt
    Level 5  
    Hi, I can see BK7231U images officially included in 1.18.125. Is it safe to flash the BK7231U image with uartprogram to a CC8000 device?
  • #6 21588807
    divadiow
    Level 34  
    >>21588692

    what is your device, module etc?
  • #7 21589157
    jmkrzyszt
    Level 5  
    >>21588807
    That's a Winees WS010078261 RGBW bulb, with this module: >>21025914 (the one made by Leedarson).
  • #8 21589202
    divadiow
    Level 34  
    could give it a go? Maybe start by taking a full backup from 0x0 and I test your bootloader with the BK7231U release, make sure it boots and see if OTA works?

    insmod wrote:
    To make sure that MAC and calibration data is correct TLV must be moved from 0x1FE000 to 0x1E0000 on BK7231U.

    also, not sure if this would be an issue for a full freeing from cloud for your device.

    Added after 1 [minutes]:

    that assumes you'll only be able to flash over UART though so cannot replace bootloader. Do you have CH341A?
  • #9 21589360
    jmkrzyszt
    Level 5  
    >>21589202 I'm attaching backups of factory firmware taken already before, one with uartprogram (.img), another one with bk7231tool (.bin). Does any of them contain the bootloader you'd like to examine?

    I don't have a CH341A, I've been flashing with an FTDI based USB-serial adapter.
  • #10 21589558
    divadiow
    Level 34  
    ah yes, I remember now. The other Leedarson dump we have is just as chatty on log out.

    Well, your 2mb backup boots just fine.

    Code: Text
    Log in, to see the code


    with OpenBK7231U_UA_1.18.125.bin renamed to OpenBK7231T_UA_1.18.125.bin and flashed with EF in T mode
    Hi-Link HLK-B30 Development Board with C-Chip CC8000 and OpenBK7231U Firmware

    then OpenBK7231U boots. BL still silent. It is BK7231U_1.0.6, however.

    Code: Text
    Log in, to see the code


    Device has the same generic mac as my QIO flashed example on HLK-B30 - C8:47:8C:42:88:48 - not the mac your factory fw is seen with - 1c:d6:bd:d4:57:83

    Looks like TLV is at 0x10000 in your fw - your original mac can be seen in there:
    Hi-Link HLK-B30 Development Board with C-Chip CC8000 and OpenBK7231U Firmware

    regarding TLV location, the same is true of the other AiDot Leedarson dump:
    Hi-Link HLK-B30 Development Board with C-Chip CC8000 and OpenBK7231U Firmware

    So I guess if these types prove popular they may justify a release build to cater for the odd TLV location, with ref to:
    insmod wrote:
    To make sure that MAC and calibration data is correct TLV must be moved from 0x1FE000 to 0x1E0000 on BK7231U.


    factory OTA is at 132000, as it is with OpenBK7231U.
    here shows OBK OTA in progress with your bootloader

    Code: Text
    Log in, to see the code


    silent as the BL OTA process may be, it is still successful. I flashed down to PR build 1680_merge_55ebe0a12aba from 1.18.125 and it came back up as that. (I did get malloc failed with both OTA gui/app methods quite a bit).

    So, I guess it's TLV that's the most obvious issue

    Added after 12 [minutes]:

    manually setting mac in OBK does not seem to be supported at present. Comes back up as original
    Hi-Link HLK-B30 Development Board with C-Chip CC8000 and OpenBK7231U Firmware
  • ADVERTISEMENT
  • #11 21589577
    insmod
    Level 24  
    Is TLV header where it is now gets overwritten?
    We can't simply change where it is located, since OBK config and flash vars are dependent on its location.

    And perhaps bootloader log is on UART0?
  • #13 21589586
    insmod
    Level 24  
    >>21589584
    Then it means we need some function on OBK (web app?) to read it and then write it at needed offset.
  • #14 21589591
    divadiow
    Level 34  
    insmod wrote:
    And perhaps bootloader log is on UART0?

    nothing on USB/CP210x P11 only D12/P0
  • ADVERTISEMENT
  • #15 21589880
    jmkrzyszt
    Level 5  
    >>21589591 Hi, thanks for your efforts. AFAICU, the answer to my question is: yes, it's safe to flash my device with OpenBK7231U UART image, renamed to T, using BK7231 Easy UART Flasher. However, OBK is not yet able to detect and use device's MAC address from TLV and replaces it with its own, always the same, so only one device can be connected to a network (broadcast domain). Does that describe current status correctly?
  • Helpful post
    #17 21589904
    insmod
    Level 24  
    In ESPHome it is not important where TLV is located, it can be adjusted at build.
    
    esphome:
      name: Your Name
      friendly_name: Your Name
      platformio_options:
        board_flash.tlv: "0x10000+0x1000",

    Change 0x10000 to wherever it is located.
    For BK7231U those are also appliable
    
        board_build.bkcrypt_coeffs: 00000000000000000000000000000000
        board_build.bkboot_version: "0.1.4-bk7231u"
        board_build.mcu: "bk7231u"

    With bkcrypt_coeffs zeroed, you could flash it via uart.
  • #18 21589989
    jmkrzyszt
    Level 5  
    >>21589202 >>21589904 >>21589904 Perfect, thank you! I'll give it a try tonight and report.
    BTW, is that "0.1.4-bk7231u" a dummy placeholder just to avoid pulling a conflicting T bootloader (and using the one from flash instead), or does it point to an existing U bootloader version?
    Is there anything else I can do for you and your project about my device?
  • #19 21589997
    insmod
    Level 24  
    >>21589989
    It is a placeholder, but not for pulling T bootloader.
    If a default bkboot_version (for T) is detected, it sets a specific variable, that changes how it boots.
    It is a specific Tuya change, without it BK7231T bootloader doesn't fully boot. And if it is enabled on non-Tuya bootloader - it won't boot too.

    Extra: if you have the ability to flash via SPI (bootloader can't be flashed via UART on BK7231U/T/S), you can flash BK7231T bootloader and use normal T firmware (albeit built with zero keys). Though since it is now possible to flash U devices, it is not needed.
  • #20 21590030
    divadiow
    Level 34  
    insmod wrote:
    Then it means we need some function on OBK (web app?) to read it and then write it at needed offset.

    is this a possible/likely work-around?
  • #21 21590069
    insmod
    Level 24  
    >>21590030
    There is a read command.
    This is a choice of either adding separate write and erase commands and adding a script in web-app, or just adding a read TLV, erase destination and write what we've read, directly on device in one function.
  • Helpful post
    #22 21590739
    jmkrzyszt
    Level 5  
    >>21589904I've followed ESPHome instructions provided by @insmod (thank you!) and I've been able to flash my BK7231U ESPHome image (.rbl) to CC8000 over UART. However, original MAC address was not detected and got overwritten with C8:47:8C:42:00:48 (similar to C8:47:8C:42:88:48 with OBK).

    I've examined platformio documentation for BK7231T and compared a BK7231T factory image vs the BK7231U factory image. Based on that, I've managed to resolve the MAC issue by replacing
    Code: YAML
    Log in, to see the code
    entry with
    Code: YAML
    Log in, to see the code
    and re-flashing (OTA).

    Thank you @insmod and @divadiow for your support.

    Additional note: in the board_build.bkcrypt_coeffs entry, the string of zeros must be quoted, otherwise the build fails.

Topic summary

The discussion focuses on the Hi-Link HLK-B30 development board featuring the C-Chip CC8000/BK7231U SoC and its compatibility with OpenBK7231U firmware. Users report successful OTA updates and UART flashing of OpenBK7231U images to CC8000 devices using tools like BK7231 Easy UART Flasher and FTDI adapters. A critical issue is the handling of the MAC address and calibration data stored in the TLV (Type-Length-Value) section of flash memory, originally located at 0x1FE000 but needing relocation to 0x1E0000 for BK7231U compatibility. OpenBK7231U firmware currently does not automatically detect or preserve the device's original MAC address from TLV, causing network conflicts when multiple devices use the same default MAC. Workarounds include modifying firmware build parameters (e.g., board_flash.tlv or board_flash.calibration offsets) and using ESPHome platformio options to specify TLV location and zero out encryption keys (bkcrypt_coeffs) for UART flashing. The bootloader cannot be flashed via UART and requires SPI flashing; however, flashing BK7231T bootloader on BK7231U devices is possible but generally unnecessary due to improved U device support. Suggestions for firmware enhancements include adding functions to read, erase, and write TLV data via the web app to preserve MAC and calibration data. The thread also references related devices such as the Leedarson-made Winees WS010078261 RGBW bulb and discusses nuances in bootloader versions and their impact on device boot behavior.
Summary generated by the language model.
ADVERTISEMENT