Merge pull request #1727 from meshtastic/ESPIDF-Littlefs

use the native littlefs builder of newer framework
pull/1721/head
Thomas Göttgens 2022-09-27 00:50:41 +02:00 zatwierdzone przez GitHub
commit e6bb79f4c1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
7 zmienionych plików z 6 dodań i 61 usunięć

Wyświetl plik

@ -7,7 +7,7 @@ build_src_filter =
upload_speed = 921600
debug_init_break = tbreak setup
monitor_filters = esp32_exception_decoder
platform_packages = platformio/tool-esptoolpy@^1.40201.0
board_build.filesystem = littlefs
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h

Wyświetl plik

@ -1,12 +1,13 @@
[esp32s3_base]
extends = arduino_base
platform = espressif32
platform = espressif32@5.1.1
build_src_filter =
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040>
upload_speed = 961200
monitor_speed = 115200
debug_init_break = tbreak setup
monitor_filters = esp32_exception_decoder
board_build.filesystem = littlefs
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h

Wyświetl plik

@ -34,7 +34,7 @@ cp $SRCBIN $OUTDIR/$basename.bin
echo "Building Filesystem for ESP32 targets"
pio run --environment tbeam -t buildfs
cp .pio/build/tbeam/spiffs.bin $OUTDIR/littlefs-$VERSION.bin
cp .pio/build/tbeam/littlefs.bin $OUTDIR/littlefs-$VERSION.bin
cp images/system-info.bin $OUTDIR/system-info.bin
cp .pio/build/$1/partitions.bin $OUTDIR/partitions.bin

Wyświetl plik

@ -35,6 +35,7 @@ IF EXIST %FILENAME% (
%PYTHON% -m esptool --baud 115200 write_flash 0x300000 %%f
)
%PYTHON% -m esptool --baud 115200 write_flash 0x10000 %FILENAME%
%PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota.bin
) else (
echo "Invalid file: %FILENAME%"
goto HELP

Wyświetl plik

@ -50,6 +50,7 @@ if [ -f "${FILENAME}" ]; then
"$PYTHON" -m esptool write_flash 0x1000 system-info.bin
"$PYTHON" -m esptool write_flash 0x8000 partitions.bin
"$PYTHON" -m esptool write_flash 0x300000 littlefs-*.bin
"$PYTHON" -m esptool write_flash 0x260000 bleota.bin
"$PYTHON" -m esptool write_flash 0x10000 ${FILENAME}
else
echo "Invalid file: ${FILENAME}"

Wyświetl plik

@ -1,51 +0,0 @@
#!/usr/bin/env python3
import getopt
import sys
import os
from littlefs import LittleFS
from pathlib import Path
print( "Building LittleFS image..." )
argList = sys.argv[1:]
arxx = { argList[i]: argList[i+1] for i in range(0, len(argList)-1, 2) }
dataPath = arxx["-c"]
blockSize = int(arxx["-b"])
blockCount = int(arxx["-s"]) / blockSize
cwd = os.getcwd()
os.chdir(dataPath)
fileList = []
dirList = []
for (dirpath, dirnames, filenames) in os.walk('.'):
for f in filenames:
if (f[:1] != '.'):
fileList.append( os.path.join(dirpath, f) )
for d in dirnames:
if (d[:1] != '.'):
dirList.append( os.path.join(dirpath, d) )
fs = LittleFS(block_size=blockSize, block_count=blockCount) # create a 448kB partition
for curDir in dirList:
print( "Creating dir " + curDir )
fs.mkdir( curDir )
for curFile in fileList:
print( "Adding file " + curFile )
with open( curFile, 'rb' ) as f:
data = f.read()
with fs.open( curFile, 'wb') as fh:
fh.write( data )
outName = argList[-1]
os.chdir(cwd)
with open(outName, 'wb') as fh:
fh.write(fs.context.buffer)

Wyświetl plik

@ -6,13 +6,6 @@ import traceback
import sys
from readprops import readProps
Import("env")
env.Replace( MKSPIFFSTOOL=env.get("PROJECT_DIR") + '/bin/mklittlefs.py' )
try:
import littlefs
except ImportError:
env.Execute("$PYTHONEXE -m pip install littlefs-python")
Import("projenv")
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"