TLE92466ED ESP32 Examples Documentation
π Documentation Index
Complete documentation for TLE92466ED driver examples on ESP32-C6.
π― Quick Start
| Document | Purpose | When to Read |
|---|---|---|
| Driver Integration Test | Driver API validation | Start here for driver testing |
| Solenoid Control Test | Real hardware solenoid testing | For actual solenoid operation |
| Configuration Guide | All configuration options | Before customizing |
| Test Framework Reference | Framework API details | Writing custom tests |
π Documentation Structure
1. Driver Integration Test Suite
Guide to the driver integration test suite
Contents
- β Test Framework Architecture - How the test infrastructure works
- β Test Suite Structure - All 13 test sections with 40+ tests
- β Hardware Setup - Complete wiring diagrams and pin configurations
- β Configuration - Hardware and test settings
- β Building and Running - Build commands and workflows
- β Expected Output - Full example outputs with explanations
- β Test Coverage - Complete API coverage breakdown
- β Individual Test Details - Deep dive into each test
- β Telemetry Testing - Telemetry validation
- β Troubleshooting - Common issues and solutions
- β Performance Characteristics - Timing and memory usage
Start here for driver API validation (no hardware required)!
2. Solenoid Control Test
Complete guide to real hardware solenoid testing
Contents
- β Hardware Requirements - Complete component list and specifications
- β System Architecture - Block diagrams and control flow
- β Hardware Setup - Detailed wiring diagrams and connections
- β ADC Configuration - Analog input setup and calibration
- β Solenoid Configuration - Single channel and parallel pair setup
- β Control Algorithm - Current calculation and regulation
- β Real-Time Telemetry - Monitoring and display
- β Operation - Startup sequence and control loop
- β Troubleshooting - Hardware-specific issues and solutions
- β Safety Considerations - Electrical and operational safety
Use this for real hardware testing with actual solenoids!
3. Configuration Guide
Complete reference for all configuration files and options
Contents
- β
Hardware Configuration (
TLE92466ED_TestConfig.hpp) - SPI pins, frequencies, current limits - β
Application Configuration (
app_config.yml) - Build metadata and app definitions - β Test Section Configuration - Compile-time test enable/disable
- β
ESP-IDF SDK Configuration (
sdkconfig) - Framework settings - β Component Configuration - ESP-IDF component setup
- β Configuration Workflows - Development and production setups
- β Troubleshooting - Configuration-related issues
Read this when you need to customize hardware or build settings.
4. Test Framework Reference
Detailed API reference for the TLE92466ED Test Framework
Contents
- β GPIO14 Progress Indicator - Visual feedback system
- β Test Result Tracking - Automatic pass/fail counting
- β
Test Execution Macros -
RUN_TEST,RUN_TEST_IN_TASK, sections - β Usage Guide - How to write test functions
- β Advanced Usage - Custom contexts, stack sizes, timeouts
- β Best Practices - Test organization
- β Performance Impact - Memory and timing overhead
- β CI/CD Integration - Automated testing
Essential reading for creating custom tests or understanding the framework.
π Getting Started
Prerequisites
- Hardware:
- ESP32-C6-DevKitC-1 development board
- TLE92466ED evaluation board or custom PCB
- 12-24V power supply (2A minimum)
- Test load (solenoid, resistor, or LED)
- USB-C cable for programming
- Software:
- ESP-IDF v5.3 or later (v5.5 recommended)
- Python 3.8+
- Git with submodules support
- Serial terminal (screen, minicom, or built-in monitor)
Quick Start Steps
- Clone and setup:
1 2 3
git clone https://github.com/N3b3x/hf-tle92466ed-driver.git cd hf-tle92466ed-driver/examples/esp32 git submodule update --init --recursive
- Configure ESP-IDF:
1 2
. $IDF_PATH/export.sh idf.py set-target esp32c6
- Build driver integration test:
1
./scripts/build_app.sh driver_integration_test Debug
- Flash and monitor:
1 2
./scripts/flash_app.sh driver_integration_test Debug ./scripts/monitor_app.sh driver_integration_test
- See results:
- Serial output shows test execution
- GPIO14 toggles with test progress
- Summary printed at end
π Example Overview
Driver Integration Test
Purpose: Driver API validation without hardware requirements
Test Sections (13 total):
- INITIALIZATION_TESTS - HAL setup, driver init, chip ID verification
- MODE_CONTROL_TESTS - Mode transitions and state management
- GLOBAL_CONFIGURATION_TESTS - Global device configuration
- CHANNEL_CONTROL_TESTS - Channel enable/disable and mode configuration
- CURRENT_CONTROL_TESTS - Current setpoint control and ramping
- PWM_CONFIGURATION_TESTS - PWM period configuration
- DITHER_CONFIGURATION_TESTS - Dither configuration
- DIAGNOSTICS_TESTS - Telemetry and diagnostics
- FAULT_MANAGEMENT_TESTS - Fault handling
- WATCHDOG_TESTS - Watchdog functionality
- GPIO_CONTROL_TESTS - GPIO pin control
- MULTI_CHANNEL_TESTS - All channels individually tested
- PARALLEL_OPERATION_TESTS - Parallel pair configuration
- ERROR_CONDITION_TESTS - Error handling validation
Features:
- β 40+ individual tests
- β Complete API coverage
- β FreeRTOS task-based test execution
- β GPIO14 progress indicator
- β Automatic result tracking
- β Telemetry testing
- β Formatted output
- β No actual solenoids required
Read: Driver Integration Test
Solenoid Control Test
Purpose: Real hardware solenoid testing with ADC-based current control
Features:
- β Two solenoids: single channel and parallel pair
- β ADC-based control (0-3.3V β 0-100% current)
- β Independent current ranges per solenoid
- β Real-time telemetry (every 1 second)
- β Continuous operation
- β Fault monitoring
Hardware Required: TLE92466ED IC + Two Solenoids + Power Supplies
Read: Solenoid Control Test
π§ Configuration Overview
Hardware Configuration
File: main/TLE92466ED_TestConfig.hpp
Whatβs configured:
- SPI GPIO pins (MISO, MOSI, SCLK, CS)
- SPI frequency and mode
- Current limits (single and parallel)
- Hardware specifications (voltage, temperature)
- Test parameters
Example:
cpp
struct SPIPins {
static constexpr int MISO = 2; // GPIO2
static constexpr int MOSI = 7; // GPIO7
static constexpr int SCLK = 6; // GPIO6
static constexpr int CS = 10; // GPIO10
};
text
Read: Configuration Guide - Hardware Configuration
Build Configuration
File: app_config.yml
Whatβs configured:
- Available applications (basic_usage, multi_channel, etc.)
- Build types (Debug, Release)
- ESP-IDF version compatibility
- CI/CD settings
- Documentation links
Example:
yaml
apps:
basic_usage:
description: "Basic usage example for TLE92466ED"
source_file: "BasicUsageExample.cpp"
build_types: ["Debug", "Release"]
text
Read: Configuration Guide - Application Configuration
Test Configuration
File: Each example source file (e.g., BasicUsageExample.cpp)
Whatβs configured:
- Test section enable/disable flags
- Compile-time test selection
Example:
cpp
#define ENABLE_INITIALIZATION_TESTS 1 // Enable
#define ENABLE_BASIC_OPERATION_TESTS 1 // Enable
#define ENABLE_CURRENT_CONTROL_TESTS 0 // Disable
text
Read: Configuration Guide - Test Section Configuration
π§ͺ Test Framework Features
The examples use a test framework with:
β FreeRTOS Task-Based Execution
- Each test runs in isolated task
- Custom stack size per test (default: 8KB)
- Automatic semaphore synchronization
- 30-second timeout protection
β GPIO14 Progress Indicator
- Visual feedback on oscilloscope/logic analyzer
- Toggle: HIGH/LOW on test completion
- Blink patterns: 5 blinks at section boundaries
- Hardware-level progress tracking
β Automatic Result Tracking
- Pass/fail counting
- Microsecond-precision execution timing
- Success rate calculation
- Formatted summaries
β Test Section Management
- Compile-time section enable/disable
- Organized test grouping
- Custom blink patterns per section
Read: Test Framework Reference
π Example Output
Test Execution
```text ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β TLE92466ED BASIC USAGE TEST SUITE - ESP32-C6 β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Target: esp32c6 ESP-IDF Version: v5.5.0
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β SECTION: INITIALIZATION TESTS β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ [GPIO14: Blink pattern - 5 blinks]
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β Running (task): hal_initialization β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ I (1234) TLE92466ED_Basic: Creating HAL instanceβ¦ I (1235) TLE92466ED_Basic: β HAL initialized successfully [SUCCESS] PASSED (task): hal_initialization (12.34 ms) [GPIO14: Toggle HIGH]
β¦ (more tests) β¦
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β TEST RESULTS SUMMARY β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£ β Total Tests: 7 β β Passed: 7 β β Failed: 0 β β Success Rate: 100.00% β β Total Time: 234.56 ms β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
I (5000) TLE92466ED_Basic: β ALL TESTS PASSED! ```text
π Troubleshooting Quick Reference
Common Issues
| Issue | Quick Fix | Full Guide |
|---|---|---|
| All tests fail | Check VIO power (3.0-5.5V, typical 3.3V) and wiring | Driver Integration Test - Troubleshooting |
| HAL init fails | Verify GPIO pins in TLE92466ED_TestConfig.hpp |
Configuration - GPIO Conflict |
| Chip ID read fails | Check SPI wiring, CS pin, RESN pin | Driver Integration Test - Troubleshooting |
| Solenoids not working | Check VBAT, EN pin, channel enable | Solenoid Control Test - Troubleshooting |
| Stack overflow | Increase stack size in RUN_TEST_IN_TASK |
Configuration - Stack Overflow |
| Build errors | Clean and rebuild: idf.py fullclean && idf.py build |
Configuration - Build Type Issues |
π¦ Project Structure
text
examples/esp32/
βββ app_config.yml # Build metadata
βββ CMakeLists.txt # Main CMake configuration
βββ sdkconfig # ESP-IDF SDK configuration
β
βββ main/ # Application source
β βββ CMakeLists.txt # Main component build
β βββ TLE92466ED_TestConfig.hpp # Hardware configuration
β βββ TLE92466ED_TestFramework.hpp # Test infrastructure
β βββ ESP32C6_HAL.hpp/.cpp # ESP32-C6 HAL implementation
β βββ DriverIntegrationTest.cpp # Driver integration test suite
β βββ SolenoidControlTest.cpp # Real hardware solenoid test
β
βββ components/ # ESP-IDF components
β βββ hf_tle92466ed/ # TLE92466ED driver component
β βββ CMakeLists.txt
β βββ idf_component.yml
β βββ README.md
β
βββ docs/ # Documentation
β βββ README.md # This file
β βββ readme_driver_integration_test.md # Driver integration test guide
β βββ readme_solenoid_control_test.md # Solenoid control test guide
β βββ readme_configuration.md # Configuration reference
β βββ README_TEST_FRAMEWORK.md # Test framework API
β
βββ scripts/ # Build/flash scripts (submodule)
βββ build_app.sh
βββ flash_app.sh
βββ monitor_app.sh
text
π Related Documentation
Driver Documentation
- Driver Overview - Main driver README
- Driver API Reference - Complete API docs
- HAL Implementation Guide - Porting guide
- Register Map - TLE92466ED registers
- Diagnostics - Fault detection
ESP32 Resources
TLE92466ED Resources
π Learning Path
Beginner Path
- Read: Driver Integration Test
- Build: Driver integration test (Debug mode)
- Run: Flash to ESP32-C6 and observe output
- Verify: All tests should pass (100% success rate)
- Explore: Review telemetry tests and diagnostics
Intermediate Path
- Read: Solenoid Control Test
- Setup: Connect solenoids and power supplies
- Configure: Adjust solenoid current ranges if needed
- Test: Run solenoid control test with real hardware
- Monitor: Observe real-time telemetry and current regulation
Advanced Path
- Read: Test Framework Reference
- Extend: Add custom test functions
- Port: Implement HAL for different MCU (ESP32-S3, etc.)
- Integrate: Set up CI/CD pipeline with test parsing
- Optimize: Profile and optimize for your application
π‘ Tips and Best Practices
Development Tips
- Start with Debug builds for detailed logging
- Use GPIO14 indicator to track progress without serial
- Monitor SPI signals with logic analyzer during bring-up
- Test with known-good load (resistor) before real solenoids
- Enable all test sections initially, disable as needed
Configuration Tips
- Keep hardware config centralized in
TLE92466ED_TestConfig.hpp - Use compile-time flags for test sections (faster than runtime)
- Document custom settings in code comments
- Version control sdkconfig.defaults for team consistency
- Use Release builds for final performance testing
Testing Tips
- Run full test suite after any changes
- Check GPIO14 patterns on oscilloscope for test flow
- Analyze execution times to find performance issues
- Test with realistic loads matching your application
- Monitor diagnostics for fault conditions
π Getting Help
Documentation Issues
If documentation is unclear or incomplete:
- Check the specific guide (Basic Usage, Configuration, Test Framework)
- Search for keywords in all docs
- Review related driver documentation
- Open GitHub issue with details
Build/Configuration Issues
If you have build or configuration problems:
- Check Configuration Guide - Troubleshooting
- Verify ESP-IDF version (v5.3+)
- Clean and rebuild:
idf.py fullclean && idf.py build - Check
sdkconfigfor conflicts
Hardware/Test Issues
If tests fail or hardware doesnβt work:
- Driver Integration Test: Check Driver Integration Test - Troubleshooting
- Solenoid Control Test: Check Solenoid Control Test - Troubleshooting
- Verify wiring against pin configuration
- Measure power supplies (VDD: 5V for central logic; VIO: 3.0-5.5V for SPI I/O levels; VBAT: 5.5-41V for solenoids)
- Test SPI communication with logic analyzer
- Try lower SPI frequency (100kHz) for debugging
Support Channels
- GitHub Issues: Bug reports, feature requests
- GitHub Discussions: Questions, general help
- Driver Documentation: Technical reference
π Example Statistics
Driver Integration Test
| Metric | Value |
|---|---|
| Total Tests | 40+ |
| Test Sections | 13 |
| Typical Execution Time | 10-15 seconds |
| Flash Size | ~350KB |
| RAM Usage | ~15KB |
| Stack per Task | 8KB |
Test Breakdown
| Section | Tests | Time |
|---|---|---|
| Initialization | 5 | ~50-100ms |
| Mode Control | 3 | ~30-50ms |
| Global Configuration | 3 | ~200-300ms |
| Channel Control | 4 | ~500-800ms |
| Current Control | 2 | ~2000-3000ms |
| PWM Configuration | 2 | ~300-500ms |
| Dither Configuration | 2 | ~300-500ms |
| Diagnostics | 7 | ~1000-1500ms |
| Fault Management | 2 | ~100-200ms |
| Watchdog | 1 | ~200-300ms |
| GPIO Control | 1 | ~200-300ms |
| Multi-Channel | 1 | ~2000-3000ms |
| Parallel Operation | 1 | ~300-500ms |
| Error Conditions | 1 | ~100-200ms |
Solenoid Control Test
| Metric | Value |
|---|---|
| Control Update Rate | 10 Hz (100ms) |
| Telemetry Update Rate | 1 Hz (1 second) |
| ADC Sampling Rate | 1 kHz |
| Flash Size | ~380KB |
| RAM Usage | ~18KB |
| Stack | 8KB |
π Success Criteria
Youβve successfully set up the examples when:
- β Build completes without errors
- β Flash and monitor show output
- β All tests pass (100% success rate)
- β GPIO14 toggles during execution
- β Test summary shows timing information
- β System restarts automatically after tests
Example success output: ```text ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β TEST RESULTS SUMMARY β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£ β Total Tests: 7 β β Passed: 7 β β Failed: 0 β β Success Rate: 100.00% β β Total Time: 234.56 ms β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ALL TESTS PASSED! System will restart in 10 secondsβ¦ ```text
Documentation Version: 1.0.0
Last Updated: 2025-10-21
Status: β
Complete
Next: Start with Driver Integration Test β