logo elektroda
logo elektroda
X
logo elektroda

Why is BL602 LFS (LittleFS) missing in the current build and can it be implemented?

DeDaMrAz 444 28
ADVERTISEMENT
  • #1 21583294
    DeDaMrAz
    Level 20  
    Hey @divadiow and @insmod

    I am back testing something for 5 minutes and I already ran into a problem 😊 there is no BL602 LFS present in the current build, any particular reason for that or can we implement it?

    Saw this from @divadiow

    #define LFS_BLOCKS_START 0x190000
    #define LFS_BLOCKS_START_MIN 0x190000


    But wanted to ask first if there was any problems with it??
  • ADVERTISEMENT
  • #3 21583316
    p.kaczmarek2
    Moderator Smart Home
    This is the PR that is waiting for "BL602 bricked when OTA file after decompression is too large"? @insmod
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 21583480
    p.kaczmarek2
    Moderator Smart Home
    Maybe it could be done in Javascript in Web App?

    Regarding OTA header - are those bytes checked anywhere?
    Code: Python
    Log in, to see the code

    Maybe use them to keep uncompressed len and in firmware check for default value (older OTA files) - then pass, otherwise check the lenght.
    Helpful post? Buy me a coffee.
  • Helpful post
    #6 21583488
    insmod
    Level 25  
    >>21583480
    I don't see if they are used, but i think it's better to insert file size after sha256. That way compatibility is guaranteed.

    Added after 1 [hours] 45 [minutes]:

    Pushed an update for BL602, needs testing.
    Additionally added heap_5 for W600. + enabled LTO + fixed building with newer gcc versions (gcc 8 +3kb size, gcc 11 +6kb).
    Replaced tls_get_netif in WiFI_GetMacAddress with tls_get_mac_addr. Now MAC address is not zeroed at first boot, leading to normal full name.
    Last release W600 is 545212 bytes, pull with LFS is 548712 bytes. With LFS without LTO is 564952 bytes.
  • #9 21583604
    DeDaMrAz
    Level 20  
    Next question would be to use the toml @max4elektroda provided or stick with the original?


    Screenshot of a terminal showing results of commands related to LFS and TOML file testing.

    LFS present and working, tested with both toml files. Mind you I have no idea what chip is inside WB2-12F module 🙂

    Parsing of LFS backup import looks a bit strange thou 😁


    Computer screen showing a text editor with a TOML configuration file open.
  • #11 21583619
    DeDaMrAz
    Level 20  
    >>21583616

    Info:MAIN:Time 288, idle 0/s, free 112400, MQTT 0(18), bWifi 1, secondsWithNoPing 218, socks 2/21
    Info:MAIN:Time 292, idle 0/s, free 112400, MQTT 0(18), bWifi 1, secondsWithNoPing 222, socks 2/21
    Info:MAIN:Time 293, idle 0/s, free 112408, MQTT 0(18), bWifi 1, secondsWithNoPing 223, socks 2/21
    Error:OTA:Unpacked OTA image size (922368) is bigger than running partition size (884736)
    Info:MAIN:Time 299, idle 0/s, free 111552, MQTT 0(18), bWifi 1, secondsWithNoPing 229, socks 3/21
  • ADVERTISEMENT
  • #12 21583624
    insmod
    Level 25  
    Looks like it works.
    Just to be sure flash with new toml and try to ota to berry again.
    Finally merge-ready?
  • #13 21583658
    DeDaMrAz
    Level 20  
    Let me attach DS18B20 to it first as I think I saw somewhere it can break that sensor (still catching up to all your guys work).
  • #14 21583671
    insmod
    Level 25  
    Pushed an update for delay_us on BL602. Now uses bl_timer_delay_us instead of nops. Untested.
  • #15 21583674
    DeDaMrAz
    Level 20  
    >>21583671

    oh c'mon! 😁 hold up let me test something first

    Why is BL602 LFS (LittleFS) missing in the current build and can it be implemented?

    DS18B20 works...

    Added after 13 [minutes]:

    >>21583624

    OTA to berry passes with the latest build


    Why is BL602 LFS (LittleFS) missing in the current build and can it be implemented?

    LSF present/preserved and working


    Why is BL602 LFS (LittleFS) missing in the current build and can it be implemented?

    Final version of the DevCube with corect 2M toml file can be found here - https://www.dropbox.com/scl/fi/e4351scw2oj5yk...59t5okpqw7h4cvr6a5tz&st=92r6mulg&dl=0

    P.S. I know there is a newer version of devcube but haven'g got to it to test it.

    Added after 9 [minutes]:

    Will try to find W800 module and test that as well and we can call it a day on this PR, correct? @insmod there is still an issue on importing LFS from backup thought!

    @divadiow do you have W800 devboard and know where it is maybe? 🙂
  • ADVERTISEMENT
  • #16 21583704
    insmod
    Level 25  
    There is no real difference in devcube versions, the most important thing is correct toml.
    W800 is already tested and confirmed working.

    Added after 2 [minutes]:

    I suppose W600 can be tested, but when i flashed it and did ota everything was ok.
  • #18 21583713
    insmod
    Level 25  
    I don't know, but LFS itself works fine.
  • #19 21583718
    DeDaMrAz
    Level 20  
    LFS does work fine and is preserved after OTA, but backup import is broken, at least on BL602.

    Same file just downloaded and reimported as if tar parsing is now being done.


    Why is BL602 LFS (LittleFS) missing in the current build and can it be implemented?

    Ok, that seems to be the problem in the webapp it self, I'll give it a check soon and report back.
  • #20 21584032
    divadiow
    Level 35  
    Heyyy. Will reread what's going on shortly. Not sure what needs testing still, if anything.
  • #21 21584288
    p.kaczmarek2
    Moderator Smart Home
    It seems very good to merge now. Variants improvement is also acceptable. I just need a final confirmation. I saw DS18B20 was tested, but was DHT11 tested as well?
    Helpful post? Buy me a coffee.
  • #22 21584294
    DeDaMrAz
    Level 20  
    Why is BL602 LFS (LittleFS) missing in the current build and can it be implemented?

    DHT11 is working on BL602.

    Added after 35 [minutes]:

    @insmod

    Is internal temperature on BL602 now refreshed every second or maybe tied to CH1 somehow??

    I got these reading within seconds if DS was set on CH1


    Why is BL602 LFS (LittleFS) missing in the current build and can it be implemented?

    Why is BL602 LFS (LittleFS) missing in the current build and can it be implemented?

    If I move DS to ch2 it normalizes.
  • #23 21584408
    insmod
    Level 25  
    >>21584294
    I did nothing to temperature sensor, and even then, there should be no correlation between channels and sensor.
    It's likely the same in release version.
  • #24 21584422
    divadiow
    Level 35  
    I've definitely seen the behaviour @DeDaMrAz describes. I'd made the connection with the new SDK rather than any PR, but may be misremembering. I can check unless @DeDaMrAz does first.
  • #25 21584443
    p.kaczmarek2
    Moderator Smart Home
    I've decided to merge it now. Good job, guys! Now, the next thing I would like to have merged ASAP (so I can also start testing on my side) are BK7251 builds, as long as they just boot into OBK, that's ok. Can you open PRs @insmod ?

    I would also like go through @max4elektroda PRs, some of them seem interesting, but they need testing really before merge... especially multiple DS18B20s
    Helpful post? Buy me a coffee.
  • #26 21584448
    insmod
    Level 25  
    >>21584443
    Don't forget to merge XR and W600/W800 pulls.
  • #27 21584464
    p.kaczmarek2
    Moderator Smart Home
    I see you also ported our old MQTT.c lwip fixes for xr872, nice...
    Helpful post? Buy me a coffee.
  • #28 21598479
    divadiow
    Level 35  
    I was about to say maybe the BL602 zip should include the revised toml, but I guess most users would get the individual files from the releases page. How can it be made clear which toml should be used now?

    Added after 8 [minutes]:

    Ooh. Could OpenBL602 list partition addresses/sizes so when a user has x issue that info may help with knowing which toml was used for original flash? Might also be useful for mhflasher OTA situations.
  • #29 21598502
    p.kaczmarek2
    Moderator Smart Home
    maybe add invididual zips to release page instead of just bins? Zip with bin, toml and... a readme.
    Helpful post? Buy me a coffee.

Topic summary

The BL602 LittleFS (LFS) filesystem was initially missing in the current build due to pending issues related to OTA update handling, specifically when decompressed OTA files exceed partition sizes. A pull request (#1629) introduced improved LFS support compatible with various partition layouts, including the older 1.4.8 type. The implementation requires a proper partition configuration TOML file with a media partition; the recommended TOML for 2MB flash devices was shared and tested successfully. LFS functionality was confirmed working and preserved after OTA updates on BL602, W600, and W800 modules. However, LFS backup import currently has issues on BL602, likely due to web app parsing errors. Additional fixes included updating delay functions and ensuring MAC address initialization correctness. Sensor compatibility was verified with DS18B20 and DHT11 on BL602. The PR was deemed ready for merging, with further testing encouraged on BK7251 and other platforms. The discussion also covered potential OTA header modifications to include uncompressed file size for better OTA validation and compatibility.
Summary generated by the language model.
ADVERTISEMENT