device.properties must set user data path to internal flash or sd card

This commit is contained in:
Ken Van Hoeylandt 2026-07-03 01:04:45 +02:00
parent 90afba647e
commit f1d75e780f
54 changed files with 127 additions and 7 deletions

View File

@ -76,6 +76,7 @@ else ()
add_compile_definitions(CONFIG_TT_DEVICE_NAME_SIMPLE="Simulator")
add_compile_definitions(CONFIG_TT_LAUNCHER_APP_ID="Launcher")
add_compile_definitions(CONFIG_TT_AUTO_START_APP_ID="")
add_compile_definitions(CONFIG_TT_USER_DATA_LOCATION_INTERNAL)
endif ()
project(Tactility)

View File

@ -12,6 +12,8 @@ hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
hardware.usbHostEnabled=true
storage.userDataLocation=Internal
display.size=5"
display.shape=rectangle
display.dpi=187

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=2.4"
display.shape=rectangle
display.dpi=167

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=2.4"
display.shape=rectangle
display.dpi=167

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=2.8"
display.shape=rectangle
display.dpi=143

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=2.8"
display.shape=rectangle
display.dpi=143

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=3.2"
display.shape=rectangle
display.dpi=125

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=3.5"
display.shape=rectangle
display.dpi=165

View File

@ -10,6 +10,8 @@ hardware.spiRamMode=OCT
hardware.spiRamSpeed=80M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=4"
display.shape=rectangle
display.dpi=170

View File

@ -12,6 +12,8 @@ hardware.spiRamSpeed=80M
hardware.esptoolFlashFreq=80M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=4.3"
display.shape=rectangle
display.dpi=217

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=2.8"
display.shape=rectangle
display.dpi=143

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=2.8"
display.shape=rectangle
display.dpi=125

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=2.8"
display.shape=rectangle
display.dpi=143

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=3.5"
display.shape=rectangle
display.dpi=165

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=5"
display.shape=rectangle
display.dpi=187

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=2.8"
display.shape=rectangle
display.dpi=143

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=3.5"
display.shape=rectangle
display.dpi=165

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=5.0"
display.shape=rectangle
display.dpi=187

View File

@ -7,3 +7,4 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=Internal

View File

@ -7,3 +7,4 @@ hardware.target=ESP32C6
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=Internal

View File

@ -7,3 +7,4 @@ hardware.target=ESP32P4
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=Internal

View File

@ -7,3 +7,4 @@ hardware.target=ESP32S3
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=Internal

View File

@ -11,6 +11,8 @@ hardware.spiRamSpeed=200M
hardware.esptoolFlashFreq=80M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=7"
display.shape=rectangle
display.dpi=187

View File

@ -7,6 +7,8 @@ hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=2.8"
display.shape=rectangle
display.dpi=143

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=3.5"
display.shape=rectangle
display.dpi=165

View File

@ -11,6 +11,8 @@ hardware.spiRamSpeed=80M
hardware.esptoolFlashFreq=80M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=5"
display.shape=rectangle
display.dpi=187

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=Internal
display.size=0.96"
display.shape=rectangle
display.dpi=149

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=2.8"
display.shape=rectangle
display.dpi=143

View File

@ -13,6 +13,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=Internal
display.size=1.9"
display.shape=rectangle
display.dpi=191

View File

@ -10,6 +10,8 @@ hardware.flashSize=16MB
hardware.spiRam=false
hardware.esptoolFlashFreq=80M
storage.userDataLocation=Internal
display.size=1.14"
display.shape=rectangle
display.dpi=242

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=0.96"
display.shape=rectangle
display.dpi=186

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=2.8"
display.shape=rectangle
display.dpi=125

View File

@ -13,6 +13,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=40M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=2.33"
display.shape=rectangle
display.dpi=227

View File

@ -10,6 +10,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=1.14"
display.shape=rectangle
# TODO: dps is actually 242, but this breaks UI (button selection becomes invisible and switch visibility is reduced)

View File

@ -10,6 +10,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=1.14"
display.shape=rectangle
# TODO: dps is actually 242, but this breaks UI (button selection becomes invisible and switch visibility is reduced)

View File

@ -10,6 +10,8 @@ hardware.spiRamMode=QUAD
hardware.spiRamSpeed=80M
hardware.esptoolFlashFreq=80M
storage.userDataLocation=SD
display.size=2"
display.shape=rectangle
display.dpi=200

View File

@ -12,8 +12,10 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=2"
display.shape=rectangle
display.dpi=200
lvgl.colorDepth=16
lvgl.colorDepth=16

View File

@ -13,6 +13,8 @@ hardware.esptoolFlashFreq=80M
hardware.tinyUsb=true
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=4.7"
display.shape=rectangle
display.dpi=235
@ -22,5 +24,3 @@ lvgl.fontSize=24
lvgl.theme=Mono
sdkconfig.CONFIG_EPD_DISPLAY_TYPE_ED047TC2=y

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=2"
display.shape=rectangle
display.dpi=200

View File

@ -10,6 +10,8 @@ hardware.flashSize=4MB
hardware.spiRam=false
hardware.esptoolFlashFreq=80M
storage.userDataLocation=Internal
display.size=1.14"
display.shape=rectangle
display.dpi=242

View File

@ -12,6 +12,8 @@ hardware.spiRamMode=QUAD
hardware.spiRamSpeed=80M
hardware.esptoolFlashFreq=80M
storage.userDataLocation=Internal
display.size=1.14"
display.shape=rectangle
display.dpi=242

View File

@ -12,6 +12,8 @@ hardware.esptoolFlashFreq=80M
hardware.tinyUsb=true
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=1.14"
display.shape=rectangle
display.dpi=242

View File

@ -13,6 +13,8 @@ hardware.bluetooth=true
hardware.usbHostEnabled=true
hardware.tinyUsb=true
storage.userDataLocation=SD
display.size=5"
display.shape=rectangle
display.dpi=294

View File

@ -5,5 +5,7 @@ apps.launcherAppId=Launcher
hardware.target=POSIX
storage.userDataLocation=Internal
lvgl.colorDepth=16
lvgl.fontSize=14

View File

@ -10,6 +10,8 @@ hardware.spiRamMode=OCT
hardware.spiRamSpeed=80M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=3.5"
display.shape=rectangle
display.dpi=165

View File

@ -14,6 +14,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=1.14"
display.shape=rectangle
display.dpi=143

View File

@ -14,6 +14,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=1.3"
display.shape=rectangle
display.dpi=261

View File

@ -14,6 +14,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=1.28"
display.shape=circle
display.dpi=265
@ -24,4 +26,4 @@ lvgl.uiDensity=compact
# Fix error "PSRAM space not enough for the Flash instructions" on boot:
sdkconfig.CONFIG_SPIRAM_FETCH_INSTRUCTIONS=n
sdkconfig.CONFIG_SPIRAM_RODATA=n
sdkconfig.CONFIG_SPIRAM_XIP_FROM_PSRAM=n
sdkconfig.CONFIG_SPIRAM_XIP_FROM_PSRAM=n

View File

@ -14,6 +14,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=1.47"
display.shape=rectangle
display.dpi=247

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=4.3"
display.shape=rectangle
display.dpi=217

View File

@ -12,6 +12,8 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=80M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=3.5"
display.shape=rectangle
display.dpi=165

View File

@ -77,6 +77,18 @@ menu "Tactility App"
config TT_TDECK_WORKAROUND
bool "Temporary work-around until we fix the T-Deck keyboard and trackball settings"
default n
choice TT_USER_DATA_LOCATION
prompt "User Data Location"
default TT_USER_DATA_LOCATION_INTERNAL
help
Where user data is stored on this device.
"Internal Flash" assumes /data always exists.
"SD Card" looks for the first mounted SD card at runtime and requires one to be present.
config TT_USER_DATA_LOCATION_SD
bool "SD Card"
config TT_USER_DATA_LOCATION_INTERNAL
bool "Internal Flash"
endchoice
config TT_SPLASH_DURATION
int "Splash Duration (ms)"
default 1000

View File

@ -4,6 +4,7 @@
#include <Tactility/MountPoints.h>
#include <format>
#include <tactility/check.h>
#include <tactility/filesystem/file_system.h>
namespace tt {
@ -36,11 +37,15 @@ FileSystem* findSdcardFileSystem(bool mustBeMounted) {
}
std::string getSystemRootPath() {
#ifdef CONFIG_TT_USER_DATA_LOCATION_INTERNAL
return file::MOUNT_POINT_DATA;
#elif CONFIG_TT_USER_DATA_LOCATION_SD
std::string root_path;
if (!findFirstMountedSdCardPath(root_path)) {
root_path = file::MOUNT_POINT_DATA;
}
check(findFirstMountedSdCardPath(root_path), "No SD card mounted");
return root_path;
#else
#error CONFIG_TT_USER_DATA_* not set or unsupported
#endif
}
std::string getTempPath() {

View File

@ -128,6 +128,14 @@ def write_tactility_variables(output_file, device_properties: dict, device_id: s
if auto_start_app_id is not None:
safe_auto_start_app_id = auto_start_app_id.replace("\"", "\\\"")
output_file.write(f"CONFIG_TT_AUTO_START_APP_ID=\"{safe_auto_start_app_id}\"\n")
# User data location
user_data_location = get_property_or_exit(device_properties, "storage", "userDataLocation")
if user_data_location == "SD":
output_file.write("CONFIG_TT_USER_DATA_LOCATION_SD=y\n")
elif user_data_location == "Internal":
output_file.write("CONFIG_TT_USER_DATA_LOCATION_INTERNAL=y\n")
else:
exit_with_error(f"storage.userDataLocation must be 'SD' or 'Internal', but was: '{user_data_location}'")
def write_core_variables(output_file, device_properties: dict):
idf_target = get_property_or_exit(device_properties, "hardware", "target").lower()