How can I get OpenBK/OpenBL602 running on this Cozylife DS-1211AN with a 1 MB BL602L10 chip?
Yes — the thread ended up showing that OpenBK/OpenBL602 can run on the 1 MB BL602L10, but you need the 1 MB-aware SDK/build path and a matching partition layout [#21438533][#21439639] The key fix was enabling `CONFIG_BL602_USE_1M_FLASH := 1`; once that was set, the device booted and EasyFlash worked [#21438533][#21438595] A tester confirmed a 1 MB BL602L10 device flashed successfully, joined Wi‑Fi, and saved settings using the `partition_cfg_1M_miegapele.toml` partition file plus the PR 1534 build artifact [#21456497] The stock 1 MB layout was a problem because its PSM partition was only 8 KB, which was too small for this firmware and caused boot/init/config-save issues; the revised layout used a larger PSM and adjusted/removing other partitions as needed [#21431575][#21442160] Later replies also noted that the 1 MB build works on 2 MB devices too, and that the standard release was later reported to boot on 1 MB hardware as well [#21619453][#21798426]
This is the Cozylife DS-1211AN 3-gang touch wall switch. The sticker on the box states it was manufactured by Shenzhen Dianling Intelligent Technology Co Ltd.
Unfortunately it comes with a 1mb BL602 so is not an easy candidate for freeing from Cozylife cloud services as OpenBeken does not work on 1mb BL602s. It's a standard-sized 12S type module that could be replaced with an ESP-12S.
>>21301826 Is GPIO17 used for anything? If so, then transplantation to ESP-12 would require to solder additional resistor to IO0-3V3 (about 1K), otherwise it may not boot.
On this switch, when i replaced the stock BL602 module with an ESP one, GPIO0 low at boot prevented it from working.
This was the latest on the issue. I have not tried to disable LFS yet but I did try really old BL602 builds before LFS was implemented. That was with old SDK though
that's memory layout in application, not flash layout. It's most likely the same regardless how much flash you have. I would look into partition layout files (toml) and check what we use. Also now I think about it bootloader might be different too maybe?
There is partitions missing in there I believe. You will need to modify it to have all the required partitions or do not use the partitions which don't exists on 1mb layout in the application.
Hey guys, any hope for running BL602 OBK port on this chip? We've got the same switch on polish elektroda side, this topic:
https://www.elektroda.pl/rtvforum/topic4103835.html#21427337 I can help by making PR and reducing build size with obk_config.h , but I don't have XT-BL12 on my site for testing.
Latest OBK version have even options (defines) to disable stuff like config HTML pages, so maybe we could reduce size a lot futher...
There is partitions missing in there I believe. You will need to modify it to have all the required partitions or do not use the partitions which don't exists on 1mb layout in the application.
how do we turn off OpenBL602 knowing about the OTA partition/expecting one to exist?
I've already tried pre-LFS OpenBL602 to 1mb chip in case it was LFS to blame
old and new builds and even the latest SDK PR flash fine but always fail at the same point in boot
Added after 6 [minutes]:
I've transplanted the BL from a 1mb Tuya device into a dump of an OBKd BL602 dump but this made no difference. From what I was reading on Lupyuen, the BL is constructed at build from the toml file anyway, so the BL was already being created ready for 1mb device.
Personally, I'd stick a JTAG probe on it and just debug the code. You should be able to single step it almost right from reset. Just knowing this type of problem, there's probably a flash for filesystems or partition tables or overriding code or stack or something Very Important.
>>21427362 Which flasher version and which toml file are you using for the module? I don't think size in itself is an issue. It should fit, absence of separate upgrade partition might be issue. Maybe there is different boot loader for that?
>>21431287 I do not see that toml for 1.4.8, there is only one with 2mb. 1.9.0 works with standard module and 1mb toml, so additional partitions are not used it seems.
Do you get any boot log?
[EF] Found Valid PSM partition, XIP Addr 230e8000, flash addr 000f9000
*default_env_size = 0x00000001
ENV start address is 0x00000000, size is 32768 bytes.
PSM partition is not at zero, but at 000f9000 and size is not 32768, but only 8096 bytes. This looks strange. Although same logs work with 2mb flash...
[pt_table]
#partition table is 4K in size
address0 = 0xE000
address1 = 0xF000
[[pt_entry]]
type = 0
name = "FW"
device = 0
address0 = 0x010000
size0 = 0xD7000
address1 = 0x000
size1 = 0x000
# compressed image must set len,normal image can left it to 0
len = 0
[[pt_entry]]
type = 3
name = "media"
device = 0
address0 = 0x0E7000
size0 = 0x2000
address1 = 0
size1 = 0
# compressed image must set len,normal image can left it to 0
len = 0
[[pt_entry]]
type = 4
name = "PSM"
device = 0
address0 = 0x0E9000
size0 = 0x8000
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 = 0x0F1000
size0 = 0x7000
address1 = 0
size1 = 0
# compressed image must set len,normal image can left it to 0
len = 0
#if user want to put RF calibration data on flash, uncomment following pt entry
#[[pt_entry]]
#type = 8
#name = "rf_para"
#device = 0
#address0 = 0x1FF000
#size0 = 0x1000
#address1 = 0
#size1 = 0
## compressed image must set len,normal image can left it to 0
#len = 0
So it's boot looping and not freezing? Then that feels like power problem... How are you powering this?
The same might be with standard build, it tries to erase some flash and that also requires power.
Good!. I think normal firmware will work too. You might need to use toml I provided though, not sure. BL602 is rated up to 3.6V, so should be no issue with that.
✨ 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. Generated by the language model.
TL;DR: 1 MB BL602L10 modules run OpenBeken after setting CONFIG_BL602_USE_1M_FLASH=1, growing PSM to 32 KB and flashing a 793 kB image—"works on every sample we had" [Elektroda, miegapele, post #21438533] Why it matters: you can free cheap touch-switches and sensors from cloud lock-in with one flash.
What change finally made 1 MB BL602L10 boot OpenBeken?
Defining CONFIG_BL602_USE_1M_FLASH := 1 switches the SDK to the alternate XIP flash routine (XIP_SFlash_Read_Need_Lock_Ext). This prevents EasyFlash from hanging at 0xE9000 and lets the board reach Wi-Fi initialisation [Elektroda, maxim2002, post #21438533]
Which partition table should I flash?
Use the 1 MB TOML posted by @miegapele: 64 KB boot+PT, 912 KB FW (0x010000-0x0F3FFF), 32 KB PSM (0x0F4000-0x0F7FFF), 16 KB factory DTB (0x0FC000). 8 KB PSM from the stock 1 MB table is too small and corrupts config saves [Elektroda, miegapele, post #21440834]
Why does the board reboot when I save Wi-Fi?
If PSM is only 8 KB the 3.6 KB config plus garbage–collection fills the sector, EasyFlash triggers GC every save and the watchdog resets. Expanding PSM to 32 KB fixes the loop [Elektroda, maxim2002, post #21438474]
How do I enter UART-download mode safely?
Hold IO8 high through a 10 kΩ pull-up to 3.3 V. 2. Reset or power-cycle. 3. Release after handshake. Direct 3.3 V without resistor may destroy the internal pull-up; one user measured 133 Ω to GND after such short [Elektroda, chemik_16, post #21440354]
What’s the preferred flashing procedure?
Pick DevCube 1.9.0, 2 Mbaud, 40 MHz clock. 2. Select the 1 MB TOML and the 1 MB OpenBL602 build (whole_img.bin & ro_params.dtb). 3. Erase, program, verify (≈17 s total). Verified SHA equals host value means success [Elektroda, niterian, post #21456497]
My module boots but loops every 3 s—why?
Long, thin supply leads add >100 mV drop during Wi-Fi TX. Shorten VCC/GND to <5 cm or power the module in-circuit. After trimming leads one tester eliminated the loop at 3.55 V [Elektroda, divadiow, post #21434069]
Does deep-sleep work on BL602?
Normal DeepSleep works; PinDeepSleep is not yet ported (available only for BK and XR chips) [Elektroda, insmod, post #21598541] Battery sensors such as TH01 will therefore drain faster than with XR modules.
Yes. The 1 MB image boots fine on 2 MB BL602; the unused upper flash stays blank. OTA partition is omitted, so remote upgrade is disabled [Elektroda, miegapele, post #21440834]
How much free RAM remains after boot?
With full 1 MB build and Wi-Fi connected the board reports ~113 kB free; worst-case after WebApp stress it dipped to 18 kB before recovery [Elektroda, maxim2002, post #21441931]
It indicates the Wi-Fi driver ran out of TX descriptors during heavy HTTP polling; the stack recovers automatically but may drop the TCP connection [Elektroda, maxim2002, post #21441931] Keep polling intervals >100 ms.
How can I cut heat in the 18 W bulb?
Limit PWM brightness to 90 %. “Even at 90 % the RGBCWW bulb is visually identical but 8 °C cooler” [Elektroda, p.kaczmarek2, post #21599155] Add LED_Map 0 90 in autoexec.
Steps to build your own 1 MB image?
Checkout OpenBeken dev branch and Bouffalo SDK 1.6.39. 2. In proj_config.mk set CONFIG_BL602_USE_1M_FLASH=1. 3. Place the 1 MB TOML in partition. Compile with make BL602L10_1M. Output should be ~793 kB [Elektroda, miegapele, post #21438328]