logo elektroda
logo elektroda
X
logo elektroda

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

divadiow 2808 92
ADVERTISEMENT
  • #31 21434176
    p.kaczmarek2
    Moderator Smart Home
    It would be interesting to see if there are any decoupling capacitors under the metal shielding. I've did some MCU PCB design in the past and I remember that datasheed required putting a 100nF capacitor on each VDD pin within like few mm of it.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #32 21434177
    divadiow
    Level 34  
    ah OK. I should add capacitors to my little test board?
  • #33 21434185
    miegapele
    Level 15  
    I don't see much point doing that if board works fine at 3.6V. You will not be using bare module anyway. And hopefully it works then in it's original place.
  • ADVERTISEMENT
  • #34 21434190
    divadiow
    Level 34  
    ok sure. thanks. I've no use for the real device and intend to keep module separate for testing. :)
  • #35 21434394
    p.kaczmarek2
    Moderator Smart Home
    So OBK now works on 1MB BL602? Good job guys! I'm glad to hear it's working. So to sum up, what were the changes required to run on 1MB Flash version? Do we need a separate 1MB Flash build or does it all just boils down to setting TOML file in the flash tool?

    Maybe we can create a separate topic/guide for that once we test it well so others don't have to dig through many posts. We already had 2 other questions about the same 1MB BL602 in the last few days.
    Helpful post? Buy me a coffee.
  • #36 21435036
    miegapele
    Level 15  
    So it works without EasyFlash, which is not very useful. Still not tested in full, although I believe it should work.
  • ADVERTISEMENT
  • #37 21435172
    divadiow
    Level 34  
    I have been distracted with my apparent power problem with this module, so have not progressed in testing. I have been adding capacitors in an attempt to get it stable. No stability even at 3.6v.

    Would be good to have someone else try a 1MB device. Or I could solder back into original DS-1211AN I suppose.

    Ideally, it'd be operational test module. My multimeter doesn't have a capacitance test mode. @p.kaczmarek2 said try 100nF but I've only found 100uF in my collection so far. Have been also using 22pF in parallel with 100uF test.
    Electronic module with a soldered capacitor on a wooden surface.

    I also note this at the end of the XT-BL12 doc http://download.bl602.fun/XT-BL12_User_Manual.pdf

    Code: Text
    Log in, to see the code
  • #38 21435202
    p.kaczmarek2
    Moderator Smart Home
    miegapele wrote:
    So it works without EasyFlash, which is not very useful

    What was exactly the EasyFlash problem? Wrong storage offset? Wrong storage size? Can we fix it by changing this offset, creating a separate obk binary for 1MB BL602?
    Helpful post? Buy me a coffee.
  • #39 21435305
    divadiow
    Level 34  
    to confirm, nothing saves at the moment (as stated earlier), always in AP mode after reboot. Client is incredibly quick to finish wifi negotiation with AP it seems.

    Added after 1 [hours] 27 [minutes]:

    Text indicating software build date and online runtime.

    Circuit board with a Wi-Fi module and connected wires on a wooden table.
  • #40 21435475
    maxim2002
    Level 13  
    Congratulations on successful boot >>21434069. Odd that your uart log doesn't show partition table ;)
    Not sure if you didn't add any mods to OpenBL602 sdk, but was unable to replicate it on my bl602 temp-hum sensor using @miegapele fork and no_easyflash branch.
    Still being hit with boot freeze.
    Code: Text
    Log in, to see the code
    Played a bit with pine64 and bouffalolab (master and dev_602 branches) sdks...
    "Hello world" always works fine, but whenever I'm trying wifi or anything more complicated it gets stuck exactly same place.
    Not really an expert in this... are you able to share your setup that brought you guys to this flawless success ?
  • #41 21435633
    miegapele
    Level 15  
    With no_easyflash that log can't be printed. So you might have flashed wrong version.
    Also try using toml file I posted upthread.
  • #42 21435676
    maxim2002
    Level 13  
    Yes, your partition toml was one of the paths I've taken. Pretty confident I was compiling and flashing the right folder tho as you may ask.
  • ADVERTISEMENT
  • #44 21435975
    maxim2002
    Level 13  
    No, I've compiled it myself. Will give it a go and lyk, thanks for the bin.

    Added after 32 [minutes]:

    This one has a boot loop.
    Firmware options configuration panel for BL602
    ... it has partition table at the top of the log.
    Code: Text
    Log in, to see the code
  • #45 21436697
    miegapele
    Level 15  
    Post >>21432090 shows standard firmware boot looping on flash read/write. That probably means it works fine, just needs proper power supply.
  • #46 21436714
    divadiow
    Level 34  
    My module is back in original device where 3.3v through test pad provides necessary stability through capacitors /resistors I do not have separately to get module stable on its own. So, ready for testing requests.
  • #47 21436902
    maxim2002
    Level 13  
    You are right! It's stable when ground connected closer to the board. Thank you.
  • #48 21436960
    divadiow
    Level 34  
    >>21436902
    this is interesting. I didn't consider making ground shorter.
  • #49 21437146
    miegapele
    Level 15  
    So, does the standard firmware work?
  • #50 21437356
    maxim2002
    Level 13  
    >>21436960 Yah, thats pretty odd. Did couple of ESPs and BKs... never had this issue.
    >>21437146 No, it doesn't.
    Code: Text
    Log in, to see the code

    For sake of repeatability when returned to OpenBL602_1532_merge_d11ce44f3af6.bin it does work.
  • Helpful post
    #51 21438215
    maxim2002
    Level 13  
    I've played with it a bit. Appears that it freezes directly at components/hal_drv/bl602_hal/bl_flash.c @78
    Code: C / C++
    Log in, to see the code

    Tries to read correct address as set in PSM parition:
    [ 7][INFO : bl_flash.c: 78] before RomDriver_XIP_SFlash_Read_With_Lock addr: 0xE9000
    It's prob something at chip config lvl... but figuring what is way above my pay grade.
  • Helpful post
    #53 21438474
    maxim2002
    Level 13  
    Sure. Tried both partition tables (yours and buffalo) - same result, freezed.
    Firmware configuration interface for BL602 with options for partition table, firmware, and other settings.

    PSM 0x000e9000
    Code: Text
    Log in, to see the code

    PSM 0x000f9000
    Code: Text
    Log in, to see the code


    Added after 9 [minutes]:

    Not sure if that the correct place, but if this BL602L10 is actually 1MB, why the sdk/OpenBL602/components/platform/soc/bl602/bl602/evb/ld/flash.ld has this ?
    Code: Text
    Log in, to see the code

    I've went through couple of articles from this guy https://lupyuen.github.io/ but it just convinced me to grab some books ;)
  • #54 21438486
    miegapele
    Level 15  
    Digging into this further I found that there is specific define needed for 1MB flash:
    #if CONF_BL602_USE_1M_FLASH
        XIP_SFlash_Read_Need_Lock_Ext(
                &g_flash_cfg,
                addr,
                dst,
                len
        );
    #else
        XIP_SFlash_Opt_Enter(&isAesEnable);
        RomDriver_XIP_SFlash_Read_Need_Lock(
                &g_flash_cfg,
                addr,
                dst,
                len
        );
        XIP_SFlash_Opt_Exit(isAesEnable);
    #endif


    could you try that flag with this new sdk?
  • #56 21438497
    maxim2002
    Level 13  
    Nope, freezes. Unless sdk/OpenBL602/customer_app/bl602_sharedApp/proj_config.mk isn't the correct place for that.
    Edited proj_config.mk configuration file with flash memory settings.
  • #57 21438522
    miegapele
    Level 15  
    Hmm, looks correct, but not sure.
    Another idea to try maybe remove romdriver too?
    there is CONFIG_BL602_USE_ROM_DRIVER :=1 below in that file. Maybe try 0?
  • Helpful post
    #58 21438533
    maxim2002
    Level 13  
    Need afk for a bit, should update tn.

    Added after 43 [minutes]:

    Apparently each time when rebuilding we also need to run ./sdk/OpenBL602/clean script, noted that build date wasn't changed...
    Code: Text
    Log in, to see the code

    So this config is a GO!!!
    CONFIG_BL602_USE_1M_FLASH := 1
    CONFIG_BL602_USE_ROM_DRIVER:=1
    We have it running, yey!

    Code: Text
    Log in, to see the code


    Added after 2 [minutes]:

    Worked also with CONFIG_BL602_USE_ROM_DRIVER:=0, so the CONFIG_BL602_USE_1M_FLASH is what we where after.
  • #59 21438594
    miegapele
    Level 15  
    Great!. Now I guess a build for 1mb can be made in github.
  • #60 21438595
    maxim2002
    Level 13  
    Appears that easyflash works.
    Code: Text
    Log in, to see the code


    Very nicely spotted @miegapele, congratulations!

Topic summary

The discussion revolves around the Cozylife DS-1211AN 3-gang touch wall switch, which utilizes a 1MB BL602 chip, making it challenging to free from Cozylife's cloud services. Users explore the possibility of replacing the BL602 with an ESP-12S module, discussing GPIO configurations and the need for additional resistors for proper booting. Several users share their experiences with firmware modifications, including attempts to disable EasyFlash and adjust partition tables to accommodate the 1MB flash size. The conversation highlights issues with power supply stability, boot loops, and the need for specific configurations in the toml files to achieve successful firmware flashing. Ultimately, a successful build for the 1MB BL602 is achieved, allowing for further development and testing.
Summary generated by the language model.
ADVERTISEMENT