Implement posix app loading (#643)

- Added POSIX desktop support for SDK builds, application packaging, and integration testing.
- Added POSIX filesystem partitions and improved application path handling.
- Added simulator support for loading and running applications dynamically.
- Improved simulator task stack handling and display startup reliability.
- Improved simulator display scaling, resizing, high-DPI support, and pointer accuracy.
- Fixed LVGL timers and input polling on POSIX. (fixes simulator with Linux on some Intel graphics platforms)
- Standardized data paths across platforms.
- Logging now works via separate task: this allows apps to write to log without it affecting their stdout (for apps that output text as relevant date for other apps, like the File Selection app)
- Fixes for app stdio
This commit is contained in:
Ken Van Hoeylandt
2026-08-31 22:09:04 +02:00
committed by GitHub
parent d3656bcd3d
commit 643cbc3806
66 changed files with 2139 additions and 336 deletions
@@ -4,7 +4,12 @@ endfunction()
function(_tactility_project)
endfunction()
macro(tactility_project project_name)
macro(tactility_project_pre project_name)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS ${TACTILITY_SDK_PATH} ${TACTILITY_SDK_PATH}/Modules)
endmacro()
macro(tactility_project_post project_name)
set(TACTILITY_SKIP_SPIFFS 1)
# Tactility's PanicHandler.cpp needs s0 to stay a frame pointer to capture a callstack for
@@ -45,3 +50,13 @@ macro(tactility_project project_name)
)
endmacro()
macro(tactility_component_register)
cmake_parse_arguments(TT_COMPONENT "" "" "SRCS;INCLUDE_DIRS;REQUIRES;PRIV_REQUIRES" ${ARGN})
idf_component_register(
SRCS ${TT_COMPONENT_SRCS}
INCLUDE_DIRS ${TT_COMPONENT_INCLUDE_DIRS}
REQUIRES TactilitySDK ${TT_COMPONENT_REQUIRES}
PRIV_REQUIRES ${TT_COMPONENT_PRIV_REQUIRES}
)
endmacro()
@@ -0,0 +1,51 @@
function(tactility_project)
endfunction()
function(_tactility_project)
endfunction()
macro(tactility_project_pre project_name)
endmacro()
macro(tactility_project_post project_name)
# The app's own library target is defined in a subdirectory (e.g. "main"); without this it
# would land nested under that subdirectory instead of directly in the build dir.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# Mirrors the ESP-IDF "TactilitySDK" component (Buildscripts/TactilitySDK/CMakeLists.txt):
# apps link against this single target instead of listing SDK include dirs themselves.
# Posix apps are dlopen()ed into a running Tactility process (see app-posix-module) and
# resolve symbols against Tactility's own copies at load time, so headers are all they need
# at compile time - no libraries to link.
add_library(TactilitySDK INTERFACE)
target_include_directories(TactilitySDK INTERFACE
${TACTILITY_SDK_PATH}/Modules/app-module/include
${TACTILITY_SDK_PATH}/Modules/crypt-module/include
${TACTILITY_SDK_PATH}/Modules/gps-module/include
${TACTILITY_SDK_PATH}/Modules/lvgl-module/include
${TACTILITY_SDK_PATH}/Modules/lvgl-window-manager-module/include
${TACTILITY_SDK_PATH}/Modules/service-module/include
${TACTILITY_SDK_PATH}/Libraries/TactilityKernel/include
${TACTILITY_SDK_PATH}/Libraries/lvgl/include
${TACTILITY_SDK_PATH}/Libraries/FreeRTOS-Kernel/include
${TACTILITY_SDK_PATH}/Libraries/FreeRTOS-Kernel/portable/ThirdParty/GCC/Posix
${TACTILITY_SDK_PATH}/Libraries/FreeRTOS-Kernel/portable/ThirdParty/GCC/Posix/utils
)
target_compile_definitions(TactilitySDK INTERFACE LV_LVGL_H_INCLUDE_SIMPLE)
# ESP-IDF's project() auto-discovers the "main" component; plain CMake doesn't.
add_subdirectory(main)
endmacro()
macro(tactility_component_register)
cmake_parse_arguments(TT_COMPONENT "" "" "SRCS;INCLUDE_DIRS;REQUIRES;PRIV_REQUIRES" ${ARGN})
# Must be a SHARED object, not a -pie executable: glibc's dlopen() unconditionally refuses
# any ET_DYN carrying the DF_1_PIE flag ("cannot dynamically load position-independent
# executable"), regardless of whether it has a dynamic-linker segment - verified empirically.
add_library(${PROJECT_NAME} SHARED ${TT_COMPONENT_SRCS})
target_link_libraries(${PROJECT_NAME} PRIVATE TactilitySDK)
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
if (TT_COMPONENT_INCLUDE_DIRS)
target_include_directories(${PROJECT_NAME} PRIVATE ${TT_COMPONENT_INCLUDE_DIRS})
endif ()
endmacro()