New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement LittleFS for LN882H - only first basic testing from WebApp … #1191
Implement LittleFS for LN882H - only first basic testing from WebApp … #1191
Conversation
…!!!! - need to add littlefs-source to sdk/OpenLN882H/project/OpenBeken/CMakeLists.txt Remarks: I had to move the import part of LittleFS in various cmd-source files to nearer to the top of the files otherwise I had very strange (false!!!) compiler errors regarding "conflicting types" for equal(!) typed prototypes and functions or even variables in .h and .c files e.g.: /OpenBK7231T_App/sdk/OpenLN882H/project/OpenBeken/app/src/cmnds/cmd_main.c:47:6: error: conflicting types for 'g_powersave' 47 | bool g_powersave; | ^~~~~~~~~~~ In file included from /OpenBK7231T_App/sdk/OpenLN882H/project/OpenBeken/app/src/cmnds/cmd_local.h:4, from /OpenBK7231T_App/sdk/OpenLN882H/project/OpenBeken/app/src/cmnds/cmd_main.c:6: /OpenBK7231T_App/sdk/OpenLN882H/project/OpenBeken/app/src/cmnds/cmd_public.h:33:13: note: previous declaration of 'g_powersave' was here 33 | extern bool g_powersave; | ^~~~~~~~~~~ /OpenBK7231T_App/sdk/OpenLN882H/project/OpenBeken/app/src/cmnds/cmd_main.c:47:6: error: conflicting types for 'g_powersave' 47 | bool g_powersave; | ^~~~~~~~~~~ Also I had to disable other drivers, or the OTA image would not be flashed (after rebbot old version was still present) Is there a size limit to respect for OTA? the size was well below the shown OTA-size of 0xAA000 (696320k if I calculated correct)
These errors are not false. |
Ah, I see, thanks for the clarification! I just wonder, why this mismatch doesn't break the compile on Beken platforms?? Thanks again! |
beken does not have those defines at all likely because bool is defined to stdbool.h in sdk already |
So I got rid of all those "conflicting types" errors. Thanks to @giedriuslt for pointing this out! This commit also includes a define of "ENABLE_TEST_COMMANDS" for the littlefs tests (lfs_test<n>).
Last image loaded without any problem
I think it still mises change in user_main.c which i think isr esponsible for running sctipts from files. Also maybe it's time to change this:
to this
|
I will have another look. |
… to master Changed #if (defined WINDOWS) || (defined PLATFORM_BEKEN) || (defined PLATFORM_BL602) || (defined PLATFORM_LN882H) back to #if (defined WINDOWS) || (defined PLATFORM_BEKEN) || (defined PLATFORM_BL602) in src/cmnds/cmd_main.c
Restored change in cmd_main.c after syncing
Changed user_main.c to allow SVM_RunThreads() for LN882H with LittleFS
Added the define in user_main.c, too If "SVM_RunThreads(g_deltaTimeMS);" is depending on / can only run if LittleFS is present, then it would be a correction to change the defindes to But I'm not that deep in this code ... |
All the SVN stuff is related to littefs |
Tried to use such script, seems there is some issues.
|
you need one more define |
I can do so. |
LittleFS can host a custom device panel made in http and JS: |
Found the issue, there are two defines missing here OpenBK7231T_App/src/cmnds/cmd_eventHandlers.c Line 302 in 70fc43b
OpenBK7231T_App/src/cmnds/cmd_eventHandlers.c Line 386 in 70fc43b
They cause waitfor to not work |
Also I think here define also needed: OpenBK7231T_App/src/cmnds/cmd_main.c Line 272 in 70fc43b
|
I'll add LN882H (and BL602 to the first two) to these defines. |
Added BL602 in two lines missing this platform, too
…App into LFS4LN882H_WiP
Now my test looks fine |
Sure, new define sounds good, maybe in next PR? Is this one PR good for merge? |
LFS should be o.k. |
but does this LittleFS PR really has anything to do with heap (?) issue? Didn't heap issue occur also without it? |
I just wanted to point out that I can't further investigate this, since I'm not using MQTT. |
I need this feature. I will merge it, hopefully later we can just disable with with #ifdef , just in case |
🎉 This PR is included in version 1.17.572 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Not tested in deep, only a first basic test of creating a file, which could be accessed after reboot.
Remarks:
I had to move the import part of LittleFS
in various cmd-source files to nearer to the top of the files
otherwise I had very strange (false!!!) compiler errors regarding "conflicting types" for equal(!) typed prototypes and functions or even variables in .h and .c files
e.g.:
/OpenBK7231T_App/sdk/OpenLN882H/project/OpenBeken/app/src/cmnds/cmd_main.c:47:6: error: conflicting types for 'g_powersave'
47 | bool g_powersave;
| ^~~~~~~~~~~
In file included from /OpenBK7231T_App/sdk/OpenLN882H/project/OpenBeken/app/src/cmnds/cmd_local.h:4,
from /OpenBK7231T_App/sdk/OpenLN882H/project/OpenBeken/app/src/cmnds/cmd_main.c:6:
/OpenBK7231T_App/sdk/OpenLN882H/project/OpenBeken/app/src/cmnds/cmd_public.h:33:13: note: previous declaration of 'g_powersave' was here
33 | extern bool g_powersave;
| ^~~~~~~~~~~
Also I had to disable other drivers, or the OTA image would not be flashed (after rebbot old version was still present) Is there a size limit to respect for OTA? the size was well below the shown OTA-size of 0xAA000 (696320k if I calculated correct)