TLE92466ED ESP32 Examples Documentation
π Documentation Index
Complete documentation for TLE92466ED driver examples on ESP32-C6.
π― Quick Start
| Document | Purpose | When to Read |
|---|---|---|
| Basic Usage Test Suite | Your first example | Start here! |
| Configuration Guide | All configuration options | Before customizing |
| Test Framework Reference | Framework API details | Writing custom tests |
π Documentation Structure
1. Basic Usage Test Suite
Comprehensive guide to the basic usage example
Contents
- β Test Framework Architecture - How the test infrastructure works
- β Test Suite Structure - All test sections and functions
- β 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
- β Individual Test Details - Deep dive into each test
- β Troubleshooting - Common issues and solutions
- β Performance Characteristics - Timing and memory usage
Start here if youβre new to the examples!
2. Configuration Guide
Complete reference for all configuration files and options
Contents
- β
Hardware Configuration (
TLE92466ED_Config.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.
3. 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 - Professional 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 basic example:
1
./scripts/build_app.sh basic_usage Debug
- Flash and monitor:
1 2
./scripts/flash_app.sh basic_usage Debug ./scripts/monitor_app.sh basic_usage
- See results:
- Serial output shows test execution
- GPIO14 toggles with test progress
- Summary printed at end
π Example Overview
BasicUsageExample
Purpose: Validate TLE92466ED driver functionality with comprehensive test suite
Test Sections:
- INITIALIZATION_TESTS - HAL setup, driver init, chip ID verification
- BASIC_OPERATION_TESTS - Channel control, current setting, diagnostics
- CURRENT_CONTROL_TESTS - Current ramping and smooth transitions
Features:
- β FreeRTOS task-based test execution
- β GPIO14 progress indicator
- β Automatic result tracking
- β Professional formatted output
- β 30-second timeout per test
- β Compile-time test section control
Complexity: βββββ
Read: Basic Usage Test Suite
MultiChannelExample
Purpose: Demonstrate independent control of all 6 TLE92466ED channels
Features (planned):
- Sequential channel activation
- Synchronized channel control
- Wave patterns across channels
- Performance monitoring
- Advanced diagnostics
Complexity: βββββ
Status: π§ In Development
π§ Configuration Overview
Hardware Configuration
File: main/TLE92466ED_Config.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
Professional Test Infrastructure
The examples use a production-grade 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
- Professional 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 VBAT power (12-24V) and wiring | Basic Usage - Troubleshooting |
| HAL init fails | Verify GPIO pins in TLE92466ED_Config.hpp |
Configuration - GPIO Conflict |
| Chip ID read fails | Check SPI wiring, CS pin | Basic Usage - Chip ID Fails |
| 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_Config.hpp # Hardware configuration
β βββ TLE92466ED_TestFramework.hpp # Test infrastructure
β βββ ESP32C6_HAL.hpp/.cpp # ESP32-C6 HAL implementation
β βββ BasicUsageExample.cpp # Basic test suite
β βββ MultiChannelExample.cpp # Multi-channel tests
β
βββ components/ # ESP-IDF components
β βββ tle92466ed-espidf/ # TLE92466ED driver component
β βββ CMakeLists.txt
β βββ idf_component.yml
β βββ README.md
β
βββ docs/ # Documentation
β βββ README.md # This file
β βββ README_BASIC_USAGE.md # Basic usage 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: Basic Usage Test Suite
- Build: Basic usage example (Debug mode)
- Run: Flash to ESP32-C6 and observe output
- Modify: Change current values in tests
- Experiment: Try with different loads
Intermediate Path
- Read: Configuration Guide
- Customize: Modify
TLE92466ED_Config.hppfor your hardware - Configure: Adjust test sections and parameters
- Optimize: Try Release build, measure performance
- Debug: Use oscilloscope to observe SPI and GPIO14
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_Config.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:
- Check Basic Usage - Troubleshooting
- Verify wiring against pin configuration
- Measure power supplies (VBAT, VDD)
- 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
BasicUsageExample
| Metric | Value |
|---|---|
| Total Tests | 7 |
| Test Sections | 3 |
| Typical Execution Time | 200-250ms |
| Flash Size | ~55KB |
| RAM Usage | ~12KB |
| Stack per Task | 8KB |
Test Breakdown
| Section | Tests | Time |
|---|---|---|
| Initialization | 3 | ~40ms |
| Basic Operations | 3 | ~100ms |
| Current Control | 1 | ~70ms |
π 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 Basic Usage Test Suite β