easy build and flash bk7231n

This commit is contained in:
Mit4el
2024-11-25 00:20:16 +03:00
parent 3a17e0c57c
commit 13d0b514a3
3 changed files with 75 additions and 1 deletions

34
tools/lt_fsflash.py Normal file
View File

@@ -0,0 +1,34 @@
# c:\Users\bmw\.platformio\penv\Scripts\pio run -t buildfs
#c:\Users\bmw\.platformio\penv\.libretiny\Scripts\ltchiptool -v flash write lt_littlefs.bin --start 0x1db000 -f BK7231N -c
Import("env")
# Определите имя таргета
target_name = "flashfs"
# Получите путь к выходному файлу LittleFS из переменной среды env
output_file = env.subst("$PROJECT_DIR") + "/lt_littlefs.bin"
# Получите путь к mklittlefs.exe из переменной среды env
ltchiptool_path = "${LTCHIPTOOL}"
# Определите команду, которая будет выполнена при вызове таргета
command = "{} flash write {} -s 0x1db000 -c -f BK7231N ".format(ltchiptool_path, output_file)
# Добавьте кастомный таргет
env.AddCustomTarget(
name=target_name,
dependencies=None,
actions=[command],
title="Flash LittleFS",
description="Flash LittleFS file system"
)
# Определите путь к исполняемому файлу ltchiptool
print("Custom target '{}' added!".format(target_name))