Skip to content

Commit

Permalink
Fix SPIFFS location and update LFS loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zero committed Oct 23, 2021
1 parent d4fd143 commit 6f5c81f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion firmware/nodemcu-firmware-overlay/app/include/user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@

#define BUILD_SPIFFS
#define SPIFFS_CACHE 1 // Enable if you use you SPIFFS in R/W mode
//#define SPIFFS_MAX_FILESYSTEM_SIZE 128000
#define SPIFFS_MAX_FILESYSTEM_SIZE 0x100000
#define SPIFFS_FIXED_LOCATION 0x100000
#define SPIFFS_MAX_OPEN_FILES 4 // maximum number of open files for SPIFFS
#define FS_OBJ_NAME_LEN 31 // maximum length of a filename

Expand Down
2 changes: 1 addition & 1 deletion firmware/nodemcu-firmware-overlay/app/user/user_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static const struct defaultpt rompt IROM_PTABLE_ATTR USED_ATTR = {
{ NODEMCU_PARTITION_IROM0TEXT, 0x10000, 0x0000},
{ NODEMCU_PARTITION_LFS, 0x0, LUA_FLASH_STORE},
{ NODEMCU_PARTITION_SPIFFS, 0x0, SPIFFS_MAX_FILESYSTEM_SIZE},
{ SYSTEM_PARTITION_SYSTEM_PARAMETER, 0x0, SYSTEM_PARAMETER_SIZE},
{ SYSTEM_PARTITION_SYSTEM_PARAMETER, 0x0, SYSTEM_PARAMETER_SIZE},
{0,(uint32_t) &_irom0_text_end,0}
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/init.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
print("Heap: ", node.heap(), "Initializing Konnected (" .. string.gsub(wifi.sta.getmac(), ":", "") .. ")")

-- load the application in LFS if needed
if node.flashindex() == nil then
node.flashreload("lfs.img")
if node.flashindex("_init") == nil then
node.LFS.reload("lfs.img")
end

pcall(node.flashindex("_init"))
Expand Down

0 comments on commit 6f5c81f

Please sign in to comment.