Skip to content

Fix for LilyGO T-HMI SD card#515

Open
KenVanHoeylandt wants to merge 7 commits intomainfrom
develop
Open

Fix for LilyGO T-HMI SD card#515
KenVanHoeylandt wants to merge 7 commits intomainfrom
develop

Conversation

@KenVanHoeylandt
Copy link
Copy Markdown
Contributor

@KenVanHoeylandt KenVanHoeylandt commented Mar 17, 2026

Summary by CodeRabbit

  • New Features

    • Optional internal pull-ups for SD/MMC pins
    • Selectable on‑chip LDO channel for SD/MMC power (can be disabled)
    • Added several sensor/driver modules to generic ESP32 device configurations
  • Improvements

    • SD card mount now prints card information for clearer diagnostics
  • Build / Packaging

    • Modularized packaging to generate per‑module build files and include driver assets
  • Tests / Integration

    • Expanded integration build to include new modules and headers

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added SDMMC configuration and tooling updates: the sdmmc0 devicetree node gains a pullups property; the ESP32 SDMMC binding adds pullups (bool) and on-chip-ldo-chan (int); Esp32SdmmcConfig now includes pullups and on_chip_ldo_chan. The driver applies internal pull-ups when enabled, conditionally initializes the on‑chip LDO only when on_chip_ldo_chan > 0, and prints card info after a successful mount. Build and packaging scripts (CMake and release tooling) were revised to produce per‑module CMakeLists and adjust prebuilt/component handling; several device YAMLs and tests were updated to reference additional driver modules.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title describes a fix for LilyGO T-HMI SD card, but the changeset includes extensive modifications to build scripts, driver modules, device trees, and SDMMC configuration across multiple ESP32 platforms. Consider using a more specific title that reflects the scope of changes, such as 'Add configurable SD/MMC pullups and LDO support across ESP32 variants' or clarify whether changes beyond the T-HMI device are intentional.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5b3db675-3bd0-49a3-bf99-56f9ae0109b8

📥 Commits

Reviewing files that changed from the base of the PR and between e560cc7 and 36db476.

📒 Files selected for processing (4)
  • Devices/lilygo-thmi/lilygo,thmi.dts
  • Platforms/platform-esp32/bindings/espressif,esp32-sdmmc.yaml
  • Platforms/platform-esp32/include/tactility/drivers/esp32_sdmmc.h
  • Platforms/platform-esp32/source/drivers/esp32_sdmmc_fs.cpp

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ce0a974f-e435-45d0-8ce1-eb7f04bb3628

📥 Commits

Reviewing files that changed from the base of the PR and between e7e8c50 and aa954da.

📒 Files selected for processing (6)
  • Buildscripts/TactilitySDK/CMakeLists.txt
  • Buildscripts/release-sdk.py
  • Devices/generic-esp32/devicetree.yaml
  • Devices/generic-esp32c6/devicetree.yaml
  • Devices/generic-esp32p4/devicetree.yaml
  • Devices/generic-esp32s3/devicetree.yaml
✅ Files skipped from review due to trivial changes (4)
  • Devices/generic-esp32s3/devicetree.yaml
  • Devices/generic-esp32c6/devicetree.yaml
  • Devices/generic-esp32/devicetree.yaml
  • Devices/generic-esp32p4/devicetree.yaml

Comment on lines +78 to +85
def create_module_cmakelists(module_name):
return dedent(f'''
cmake_minimum_required(VERSION 3.20)
idf_component_register(
INCLUDE_DIRS "include"
)
add_prebuilt_library({module_name} "binary/lib{module_name}.a")
'''.format(module_name=module_name))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Redundant .format() call on f-string; also missing target_link_libraries.

  1. Line 85 uses .format(module_name=module_name) on an f-string, which is redundant since the f-string already interpolates {module_name}.

  2. The generated CMakeLists.txt registers the prebuilt library but doesn't link it to ${COMPONENT_LIB}, so consumers won't automatically get the library linked.

🐛 Proposed fix
 def create_module_cmakelists(module_name):
     return dedent(f'''
     cmake_minimum_required(VERSION 3.20)
     idf_component_register(
         INCLUDE_DIRS "include"
     )
     add_prebuilt_library({module_name} "binary/lib{module_name}.a")
-    '''.format(module_name=module_name))
+    target_link_libraries(${{COMPONENT_LIB}} INTERFACE {module_name})
+    ''')

Note: ${{COMPONENT_LIB}} uses double braces to escape the CMake variable from Python f-string interpolation.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def create_module_cmakelists(module_name):
return dedent(f'''
cmake_minimum_required(VERSION 3.20)
idf_component_register(
INCLUDE_DIRS "include"
)
add_prebuilt_library({module_name} "binary/lib{module_name}.a")
'''.format(module_name=module_name))
def create_module_cmakelists(module_name):
return dedent(f'''
cmake_minimum_required(VERSION 3.20)
idf_component_register(
INCLUDE_DIRS "include"
)
add_prebuilt_library({module_name} "binary/lib{module_name}.a")
target_link_libraries(${{COMPONENT_LIB}} INTERFACE {module_name})
''')

Comment on lines +149 to +156
# Drivers
add_driver(target_path, "bm8563-module")
add_driver(target_path, "bm8563-module")
add_driver(target_path, "bmi270-module")
add_driver(target_path, "mpu6886-module")
add_driver(target_path, "pi4ioe5v6408-module")
add_driver(target_path, "qmi8658-module")
add_driver(target_path, "rx8130ce-module")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Duplicate entry: bm8563-module is added twice.

Lines 150-151 both call add_driver(target_path, "bm8563-module"). This mirrors the same duplicate in CMakeLists.txt and appears to be a copy-paste error.

🐛 Proposed fix
     # Drivers
     add_driver(target_path, "bm8563-module")
-    add_driver(target_path, "bm8563-module")
     add_driver(target_path, "bmi270-module")
     add_driver(target_path, "mpu6886-module")
     add_driver(target_path, "pi4ioe5v6408-module")
     add_driver(target_path, "qmi8658-module")
     add_driver(target_path, "rx8130ce-module")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Drivers
add_driver(target_path, "bm8563-module")
add_driver(target_path, "bm8563-module")
add_driver(target_path, "bmi270-module")
add_driver(target_path, "mpu6886-module")
add_driver(target_path, "pi4ioe5v6408-module")
add_driver(target_path, "qmi8658-module")
add_driver(target_path, "rx8130ce-module")
# Drivers
add_driver(target_path, "bm8563-module")
add_driver(target_path, "bmi270-module")
add_driver(target_path, "mpu6886-module")
add_driver(target_path, "pi4ioe5v6408-module")
add_driver(target_path, "qmi8658-module")
add_driver(target_path, "rx8130ce-module")

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (3)
Buildscripts/TactilitySDK/TactilitySDK.cmake (1)

1-5: Empty function stubs should be documented or removed.

The tactility_project() function and _tactility_project() function are empty stubs. If they serve a purpose (e.g., forward declarations or placeholders for future use), consider adding a comment. Otherwise, they add noise.

Tests/SdkIntegration/main/Source/main.c (1)

27-33: Headers included for validation only - consider adding a comment.

These driver headers appear to be included solely to validate SDK packaging rather than for actual use in the test. A brief comment would clarify intent.

📝 Suggested documentation
 `#include` <tactility/lvgl_module.h>

+// Driver headers included to validate SDK packaging
 `#include` <drivers/bm8563.h>
 `#include` <drivers/bmi270.h>
Buildscripts/release-sdk.py (1)

91-95: add_driver uses create_module_cmakelists — verify this is intentional.

The add_driver function (line 94) calls create_module_cmakelists(driver_name) to generate the CMakeLists.txt. This creates identical CMakeLists content for both drivers and modules. If drivers require different CMake configuration (e.g., different REQUIRES), consider creating a separate create_driver_cmakelists function.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 69a45870-e720-4b26-ae52-f82851b6030d

📥 Commits

Reviewing files that changed from the base of the PR and between aa954da and 4d245d4.

📒 Files selected for processing (6)
  • Buildscripts/TactilitySDK/CMakeLists.txt
  • Buildscripts/TactilitySDK/TactilitySDK.cmake
  • Buildscripts/release-sdk.py
  • Tests/SdkIntegration/CMakeLists.txt
  • Tests/SdkIntegration/main/CMakeLists.txt
  • Tests/SdkIntegration/main/Source/main.c
💤 Files with no reviewable changes (1)
  • Buildscripts/TactilitySDK/CMakeLists.txt

Comment on lines +18 to +22
set(EXTRA_COMPONENT_DIRS
"Libraries/TactilityFreeRtos"
"Modules"
"Drivers"
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Relative paths in EXTRA_COMPONENT_DIRS may not resolve correctly.

The paths set here (Libraries/TactilityFreeRtos, Modules, Drivers) are relative but don't use ${TACTILITY_SDK_PATH} as a base. When the macro is invoked from an SDK consumer project, these paths will be resolved relative to the consumer's project directory rather than the SDK directory.

🐛 Proposed fix
     set(EXTRA_COMPONENT_DIRS
-        "Libraries/TactilityFreeRtos"
-        "Modules"
-        "Drivers"
+        "${TACTILITY_SDK_PATH}/Libraries/TactilityFreeRtos"
+        "${TACTILITY_SDK_PATH}/Modules"
+        "${TACTILITY_SDK_PATH}/Drivers"
     )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
set(EXTRA_COMPONENT_DIRS
"Libraries/TactilityFreeRtos"
"Modules"
"Drivers"
)
set(EXTRA_COMPONENT_DIRS
"${TACTILITY_SDK_PATH}/Libraries/TactilityFreeRtos"
"${TACTILITY_SDK_PATH}/Modules"
"${TACTILITY_SDK_PATH}/Drivers"
)

Comment on lines +26 to +27
bm8563-module
bm8563-module
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Duplicate entry: bm8563-module is listed twice.

Lines 26 and 27 both include bm8563-module in the COMPONENTS list. This appears to be a copy-paste error and should be removed to avoid potential issues with ESP-IDF's component resolution.

🐛 Proposed fix
     set(COMPONENTS
         TactilityFreeRtos
         bm8563-module
-        bm8563-module
         bmi270-module
         mpu6886-module
         pi4ioe5v6408-module
         qmi8658-module
         rx8130ce-module
     )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
bm8563-module
bm8563-module
set(COMPONENTS
TactilityFreeRtos
bm8563-module
bmi270-module
mpu6886-module
pi4ioe5v6408-module
qmi8658-module
rx8130ce-module
)

Comment on lines +13 to 16
set(EXTRA_COMPONENT_DIRS ${TACTILITY_SDK_PATH} ${TACTILITY_SDK_PATH}/Modules ${TACTILITY_SDK_PATH}/Drivers)

project(SdkTest)
tactility_project(SdkTest)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

EXTRA_COMPONENT_DIRS will be overwritten by tactility_project macro.

Line 13 sets EXTRA_COMPONENT_DIRS, but the tactility_project macro (line 16) also sets this variable unconditionally (see lines 18-22 in TactilitySDK.cmake). The macro's assignment will override the test's paths.

Consider either:

  1. Having the macro append to EXTRA_COMPONENT_DIRS instead of replacing it
  2. Moving this assignment after the macro call
  3. Setting paths within the macro using ${TACTILITY_SDK_PATH} as suggested in the other review

Comment on lines +29 to +30
#include <drivers/mpu6886.h>
#include <drivers/mpu6886.h>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Duplicate include: mpu6886.h is included twice.

Lines 29 and 30 both include <drivers/mpu6886.h>. Remove the duplicate.

🐛 Proposed fix
 `#include` <drivers/bmi270.h>
 `#include` <drivers/mpu6886.h>
-#include <drivers/mpu6886.h>
 `#include` <drivers/pi4ioe5v6408.h>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#include <drivers/mpu6886.h>
#include <drivers/mpu6886.h>
`#include` <drivers/bmi270.h>
`#include` <drivers/mpu6886.h>
`#include` <drivers/pi4ioe5v6408.h>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant