mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 17:32:18 +00:00
Merge pull request #1727 from meshtastic/ESPIDF-Littlefs
use the native littlefs builder of newer framework
This commit is contained in:
commit
e6bb79f4c1
@ -7,7 +7,7 @@ build_src_filter =
|
|||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
debug_init_break = tbreak setup
|
debug_init_break = tbreak setup
|
||||||
monitor_filters = esp32_exception_decoder
|
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.
|
# 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
|
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
[esp32s3_base]
|
[esp32s3_base]
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform = espressif32
|
platform = espressif32@5.1.1
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040>
|
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040>
|
||||||
upload_speed = 961200
|
upload_speed = 961200
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
debug_init_break = tbreak setup
|
debug_init_break = tbreak setup
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
|
board_build.filesystem = littlefs
|
||||||
|
|
||||||
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
|
# 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
|
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
|
||||||
|
@ -34,7 +34,7 @@ cp $SRCBIN $OUTDIR/$basename.bin
|
|||||||
|
|
||||||
echo "Building Filesystem for ESP32 targets"
|
echo "Building Filesystem for ESP32 targets"
|
||||||
pio run --environment tbeam -t buildfs
|
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 images/system-info.bin $OUTDIR/system-info.bin
|
||||||
|
|
||||||
cp .pio/build/$1/partitions.bin $OUTDIR/partitions.bin
|
cp .pio/build/$1/partitions.bin $OUTDIR/partitions.bin
|
||||||
|
@ -35,6 +35,7 @@ IF EXIST %FILENAME% (
|
|||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x300000 %%f
|
%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 0x10000 %FILENAME%
|
||||||
|
%PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota.bin
|
||||||
) else (
|
) else (
|
||||||
echo "Invalid file: %FILENAME%"
|
echo "Invalid file: %FILENAME%"
|
||||||
goto HELP
|
goto HELP
|
||||||
|
@ -50,6 +50,7 @@ if [ -f "${FILENAME}" ]; then
|
|||||||
"$PYTHON" -m esptool write_flash 0x1000 system-info.bin
|
"$PYTHON" -m esptool write_flash 0x1000 system-info.bin
|
||||||
"$PYTHON" -m esptool write_flash 0x8000 partitions.bin
|
"$PYTHON" -m esptool write_flash 0x8000 partitions.bin
|
||||||
"$PYTHON" -m esptool write_flash 0x300000 littlefs-*.bin
|
"$PYTHON" -m esptool write_flash 0x300000 littlefs-*.bin
|
||||||
|
"$PYTHON" -m esptool write_flash 0x260000 bleota.bin
|
||||||
"$PYTHON" -m esptool write_flash 0x10000 ${FILENAME}
|
"$PYTHON" -m esptool write_flash 0x10000 ${FILENAME}
|
||||||
else
|
else
|
||||||
echo "Invalid file: ${FILENAME}"
|
echo "Invalid file: ${FILENAME}"
|
||||||
|
@ -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)
|
|
@ -6,13 +6,6 @@ import traceback
|
|||||||
import sys
|
import sys
|
||||||
from readprops import readProps
|
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")
|
Import("projenv")
|
||||||
|
|
||||||
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
|
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
|
||||||
|
Loading…
Reference in New Issue
Block a user