logo elektroda
logo elektroda
X
logo elektroda

Cozylife DS-1211AN 3Gang Touch Switch: 1MB BL602L10 [XT-BL12][DT-BL12] - Images, Firmware & Boot

divadiow 3591 119
ADVERTISEMENT
  • #91 21471074
    divadiow
    Level 35  
    >>21470955

    unpaired boot log. both same SDK, dates, firmware version 1.1.1, product ID p93sfg
    Code: Text
    Log in, to see the code


    Added after 2 [minutes]:

    this bulb has same product ID but came with 2mb DT-BL200 module https://www.elektroda.com/rtvforum/topic4039283.html
    which you also said looks identical in your message to me

    Added after 3 [minutes]:

    what module does your have?

    Added after 3 [minutes]:

    added to flashdumps as CozyLife_RGBCWW-CFA60-18W-E27-BL602L10_p93sfg_1.1.1.bin https://github.com/openshwprojects/FlashDumps/tree/main/IoT/BL602
  • ADVERTISEMENT
  • Helpful post
    #92 21471144
    niterian
    Level 9  
    >>21471074 >>21471074
    divadiow wrote:
    what module does your have?

    I haven't desoldered the module, so I can't read the label behind.
    It looks exactly like DT-BL200 and the main PCB even has the same label XLD-QFLWP-YT2.1.


    Small printed circuit board with various electronic components on a white background.
    Green printed circuit board with electrical circuits.


    EDIT: better closeup


    Close-up of an electronic component with a visible integrated circuit and capacitors.
  • ADVERTISEMENT
  • #94 21594766
    divadiow
    Level 35  
    Wondering if 1mb BL602 is working well enough to be included in releases with maybe just a couple of the basic features plus the temp sensor drivers seen in TH01 with 1mb chip @p.kaczmarek2 🤔
  • Helpful post
    #95 21594772
    p.kaczmarek2
    Moderator Smart Home
    I would love to include it, but I don't have 1MB version of BL602, so I need you or someone else to give a greenlight and point me towards to PR to merge. Who should we ping?

    You'd also need to add separate file to builds, like I did for BK7231M, etc.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #96 21594867
    divadiow
    Level 35  
    Ok. I'll look through some posts, ping some people and try 1mb myself when I can. I should have a couple of modules
  • #97 21598537
    divadiow
    Level 35  
    @niterian @minusync @vinibali @Vdragonb @maxim2002 @arphenon assuming you were successful flashing and setting up @miegapele's BL601L10 build for 1MB BL602, how have you found it? All working?

    I note this from an earlier post:

    insmod wrote:
    But what would be the purpose for using it?
    There is no deep sleep implemented for BL602.
    There is no PinDeepSleep for BL602, which is what should be used when sensor is 8310/8315.
    Without those, batteries will be drained very quickly.


    So, I guess battery life on the Cozylife temp/hum devices is not good, assuming standard batteries are in use. Did @insmod add pindeepsleep recently to BL602? I can't find the comment I thought I saw it mentioned in.
  • Helpful post
    #98 21598541
    insmod
    Level 26  
    >>21598537
    No, i added it to XRs.
    Currently PinDeepSleep is supported only by Beken and XR-family.
    Normal DeepSleep is for Beken, ESP and XR
  • Helpful post
    #99 21598546
    p.kaczmarek2
    Moderator Smart Home
    1MB BL602 was seen also in light switches.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #102 21599122
    divadiow
    Level 35  
    >>21598820

    ah OK. that's a shame. I assume powersave 1 didn't help? I wonder if any changes to BL602 code since the PR build, which is a few months old now, would make any difference. Wasn't powersave broken initially with new SDK?
  • #103 21599155
    p.kaczmarek2
    Moderator Smart Home
    @niterian why not just limit brightness at 90% of original value? I can help with LED driver if that's not supported
    Helpful post? Buy me a coffee.
  • #104 21609797
    vinibali
    Level 7  
    >>21598537
    Both 1MB and 2MB BL602s are supported with the latest binaries?
  • #106 21609891
    divadiow
    Level 35  
    refreshing my memory on this build with DT-BL12 before I find a home for it in a plug
    initial boot after flash
    Code: Text
    Log in, to see the code


    Cozylife DS-1211AN 3Gang Touch Switch: 1MB BL602L10 [XT-BL12][DT-BL12] - Images, Firmware & Boot

    I wonder if the toml could be tweaked further and if @insmod's LFS revisions since could be adapted for a tiny LFS
    Screenshot of DT-BL12 module boot log with BL602 chip after flashing, showing system messages and startup status.
  • #107 21618756
    divadiow
    Level 35  
    @miegapele if you have time would you mind merging changes into your 1mb flash build so a new build runs please?
  • #108 21619453
    miegapele
    Level 15  
    There is nothing to merge. The only change required is in sdk
    The 1MB build works on 2MB devices too. I do not have 1MB device.
    There is some user reports that wifi connectivity is bad for 1MB devices. I have 2MB module which also has bad wifi, but I'm not sure why
  • #109 21619463
    p.kaczmarek2
    Moderator Smart Home
    Then we need to build OBK variant with CONFIG_BL602_USE_1M_FLASH defined I guess
    https://github.com/search?q=repo%3Aopenshwpro...enBL602+CONF_BL602_USE_1M_FLASH&type=code
    Helpful post? Buy me a coffee.
  • Helpful post
    #111 21619943
    insmod
    Level 26  
    Deep sleep + pindeepsleep test (only GPIO7 and GPIO8, need both gpio only and gpio with timer, check if gpio wakeup works with timer and timer without triggering gpio)
    and 1M partition file (need to check if LFS works, no media partition but OTA partition with 0xB000 size)
    [pt_table]
    #partition table is 4K in size
    address0 = 0xE000
    address1 = 0xF000
    
    [[pt_entry]]
    type = 0
    name = "FW"
    device = 0
    address0 = 0x10000
    size0 = 0xDC000
    address1 = 0xEC000
    size1 = 0xB000
    # compressed image must set len,normal image can left it to 0
    len = 0
    
    [[pt_entry]]
    type = 4
    name = "PSM"
    device = 0
    address0 = 0xF7000
    size0 = 0x5000
    address1 = 0
    size1 = 0
    # compressed image must set len,normal image can left it to 0
    len = 0
    
    [[pt_entry]]
    type = 7
    name = "factory"
    device = 0
    address0 = 0xFC000
    size0 = 0x4000
    address1 = 0
    size1 = 0
    # compressed image must set len,normal image can left it to 0
    len = 0
  • #112 21619955
    divadiow
    Level 35  
    yay.

    flashed OK.

    it boots but does the thing playing with the 2mb bin +1mb bldc toml used to do and stop at the ENV start address is 0x00000000, size is 20480 bytes point.

    Code: Text
    Log in, to see the code


    Added after 3 [minutes]:

    same result with miegapele 1mb toml and OpenBL602_dev_20250729_061854.bin
    Screenshot of a console showing the BL602 microcontroller boot sequence and system messages.
  • #113 21619957
    insmod
    Level 26  
    Did you flash it to 1mb board?
    Then SDK patch would be needed (probably just enable it by default, since it was mentioned that it works on 2mb)
    ENV start address is 0 because it is addr on partition, not directly on flash.
  • #114 21619960
    divadiow
    Level 35  
    insmod wrote:
    Did you flash it to 1mb board?

    yes. to DT-BL12 above

    Added after 3 [minutes]:

    to 4mb BL602 with your 1mb toml posted above
    Code: Text
    Log in, to see the code


    Added after 10 [minutes]:

    insmod wrote:
    Deep sleep + pindeepsleep test (only GPIO7 and GPIO8, need both gpio only and gpio with timer, check if gpio wakeup works with timer and timer without triggering gpio)
    and 1M partition file (need to check if LFS works, no media partition but OTA partition with 0xB000 size)


    these are 2 tests? deep sleep test then separately 1mb LFS toml for use with miegapele's 1mb binary?
  • #115 21619967
    insmod
    Level 26  
    >>21619960
    Sleep only for now. Partition won't work yet.

    [pt_table]
    #partition table is 4K in size
    address0 = 0xE000
    address1 = 0xF000
    
    [[pt_entry]]
    type = 0
    name = "FW"
    device = 0
    address0 = 0x10000
    size0 = 0xDC000
    address1 = 0
    size1 = 0
    len = 0
    
    [[pt_entry]]
    type = 3
    name = "media"
    device = 0
    address0 = 0xEC000
    size0 = 0xB000
    address1 = 0
    size1 = 0
    len = 0
    
    [[pt_entry]]
    type = 4
    name = "PSM"
    device = 0
    address0 = 0xF7000
    size0 = 0x5000
    address1 = 0
    size1 = 0
    len = 0
    
    [[pt_entry]]
    type = 7
    name = "factory"
    device = 0
    address0 = 0xFC000
    size0 = 0x4000
    address1 = 0
    size1 = 0
    len = 0

    Curious what will happen if OTA is attempted.
  • #116 21620849
    divadiow
    Level 35  
    insmod wrote:
    Curious what will happen if OTA is attempted.


    with that toml and the 1mb miegapele build 1534_merge_be321015279b

    it will do this when trying to OTA to OpenBL602_1534_merge_be321015279b_OTA.bin.xz.ota

    Code: Text
    Log in, to see the code


    then gui dies at malloc fail shortly after OTA attempt
  • #117 21620857
    insmod
    Level 26  
    >>21620849
    Expected, since there is no partition for OTA.
    A check will be needed in OTA code.

    What about deepsleep?
  • #118 21620896
    divadiow
    Level 35  
    insmod wrote:
    What about deepsleep?


    OK. With this flashed
    Cozylife DS-1211AN 3Gang Touch Switch: 1MB BL602L10 [XT-BL12][DT-BL12] - Images, Firmware & Boot

    initial boot
    Code: Text
    Log in, to see the code


    and then with deepsleep 30 it stops responding to pings straight away and wakes at 30s and wifi back ~39s. brb pindeepsleep

    Added after 57 [minutes]:

    With multilpe Btn role set on P7 AND P8 starting pindeepsleep command results in reboot

    Code: Text
    Log in, to see the code


    single Btn on P7 does wake BL602 on grounding. P8 Btn doesn't seem to be effective though.

    Added after 5 [minutes]:

    But let me try HLK BL module to be sure about P8. P8 leg on Ai-Thinker also doesn't put chip into flash download mode if pulled high, even though the boot button on top of dev board works. The pad is labelled IO8/NC so unsure if it's expected to work.

    Or build fw with a different pin?

    Added after 3 [hours] 7 [minutes]:

    no. no wake on GPIO8 on HLK-B35 in this setup: https://www.elektroda.com/rtvforum/topic4051649.html#21126503
  • #119 21624634
    miegapele
    Level 15  
    There seem to be newer version of the bl602 sdk in a branch here. Not sure we need anything there, but maybe somebody wants to take a look.

Topic summary

The discussion focuses on the Cozylife DS-1211AN 3-gang touch wall switch featuring a 1MB BL602L10 Wi-Fi and BLE module, manufactured by Shenzhen Dianling Intelligent Technology Co Ltd. The main challenge is adapting OpenBeken/OpenBL602 firmware, which typically targets 2MB flash BL602 chips, to the 1MB flash variant, as standard builds and tools like OpenBeken do not natively support 1MB BL602L10 devices. Key technical issues include flash memory partitioning, bootloader compatibility, EasyFlash storage initialization, and power supply stability affecting boot loops and Wi-Fi connectivity.

Significant progress was made by creating and testing custom partition table (TOML) files tailored for 1MB flash layouts, notably the partition_cfg_1M_miegapele.toml, which allocates appropriate sizes for firmware, media, PSM, and factory partitions. Firmware builds with specific SDK configurations (e.g., CONFIG_BL602_USE_1M_FLASH and CONFIG_BL602_USE_ROM_DRIVER enabled) successfully boot and run on the 1MB BL602L10, including OpenBK7231T_App builds from GitHub pull requests #1532 and #1534.

Power supply quality and wiring (shorter VCC and ground cables, decoupling capacitors) were critical for stable operation, as the module exhibited boot looping and Wi-Fi instability when powered inadequately or with noisy sources. The GPIO17 pin usage and UART download mode resistor requirements were also discussed for module replacement or debugging.

Wi-Fi connection issues were partially resolved by adjusting router PMF (Protected Management Frames) settings and using simpler passwords. The firmware supports AP mode and basic Wi-Fi functions, though some web API endpoints (e.g., /api/lfs) may be incomplete. The community shared detailed boot logs, flash memory dumps, and PCB images to aid development and testing.

Overall, the topic demonstrates successful adaptation of OpenBL602 firmware to the 1MB BL602L10 module in the Cozylife DS-1211AN switch, with custom partitioning, SDK flags, and power considerations enabling stable boot and Wi-Fi operation, while highlighting ongoing challenges in full feature support and stability.
Summary generated by the language model.
ADVERTISEMENT