Files
ESP32-S3-LCD-1.3/README.md
T
julian 3613387d41 Add wiki second brain and root CLAUDE.md; retire .docs
- New wiki/ (Obsidian vault) following the LLM Wiki pattern: schema, index, log,
  entity page for the board, concept pages for the A->B link, wired+wireless
  redundancy, and Patrol gauge outputs, open questions, two sources
- New CLAUDE.md distilled from the surviving .docs content: verified pins,
  brightness/receiver/debug APIs, SquareLine rules, CH343 serial notes,
  gear-enum drift warning, Waveshare demo and schematic URLs
- Delete .docs/ (14 files): stale pin-hunting and troubleshooting guides,
  wrong header table, finished phase roadmap, duplicate UART spec (now in the
  5B repo at docs/UART_PROTOCOL.md)
- README.md repointed to CLAUDE.md and wiki/

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-21 10:57:05 +02:00

213 lines
5.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ESP32-S3-LCD-1.3 - Controller B (Phase 1)
**Compact Automotive Display Unit**
## Project Status
**Current Phase**: Phase 1 - Hardware Setup & Basic Display ✅
## Overview
This is Controller B in the BMW Patrol automotive data display system. It receives UART data from Controller A (ESP32-S3-Touch-LCD-5B) and displays it on a compact 1.3" round display.
### Phase 1 Goals
- ✅ PlatformIO project structure created
- ⏳ Display initialization with LovyanGFX
- ⏳ LVGL 8.4.0 integration for round display
- ⏳ Test UI with circular viewport
- ⏳ Verify 30+ FPS performance
## Hardware
- **Board**: Waveshare ESP32-S3-LCD-1.3
- **Display**: 1.3" round (240×240) ST7789VW IPS
- **MCU**: ESP32-S3R8 (240MHz dual-core)
- **RAM**: 512KB SRAM + 8MB PSRAM
- **Flash**: 16MB
## Quick Start
### 1. Install Dependencies
```bash
# Install PlatformIO if not already installed
pip install platformio
# Or use PlatformIO IDE extension in VSCode
```
### 2. Configure Display Pins
**IMPORTANT**: Before building, verify the display pin assignments in `src/display_init.cpp` match your board's schematic.
Pins are fixed in `src/modules/display_init.cpp` and were verified against the Waveshare demo code. See `CLAUDE.md`.
### 3. Build and Upload
```bash
# Build the project
pio run
# Upload to board
pio run --target upload
# Monitor serial output
pio device monitor
```
## Project Structure
```
ESP32-S3-LCD-1.3/
├── include/
│ ├── config/
│ │ └── lv_conf.h # LVGL 8.4.0 configuration
│ ├── display/ # Display-specific headers
│ ├── modules/
│ │ └── display_init.h # Display initialization
│ ├── protocol/
│ │ └── automotive_data.h # UART protocol (for future phases)
│ └── ui/ # SquareLine Studio UI exports
│ ├── components/ # UI components
│ ├── screens/ # UI screens
│ └── ui.c/ui.h # Main UI files
├── src/
│ ├── main.cpp # Phase 1 main application
│ └── display_init.cpp # Display driver implementation
├── platformio.ini # PlatformIO configuration
├── CLAUDE.md # Developer guide (pins, build, architecture)
├── wiki/ # Second-brain knowledge base (Obsidian vault)
└── README.md # This file
```
See `CLAUDE.md` for the developer guide and `wiki/index.md` for domain knowledge.
## Phase 1 Features
### Current Implementation
- **Display Initialization**: LovyanGFX setup for ST7789VW
- **LVGL Integration**: 8.4.0 with circular viewport
- **Test UI**: Demonstrates round display capabilities
- **Performance Monitoring**: FPS and memory stats
- **Dual-core Architecture**: LVGL on Core 1, main loop on Core 0
### Test UI Elements
- Circular mask for round display
- Title and status labels
- Decorative arc widget
- Live uptime counter
- Performance statistics
### SquareLine Studio UI (Optional)
The project includes exported UI from SquareLine Studio in `include/ui/`. To use it:
1. Replace the test UI in `src/main.cpp` with:
```cpp
#include "ui/ui.h"
void setup() {
// ... display init ...
ui_init(); // Initialize SquareLine UI
// ... start LVGL task ...
}
```
2. Customize the UI by editing in SquareLine Studio and re-exporting to `include/ui/`
## Serial Monitor Output
Expected output during Phase 1:
```
=================================
ESP32-S3-LCD-1.3 - Controller B
Phase 1: Display Initialization
=================================
CPU Frequency: 240 MHz
Free Heap: 327680 bytes
PSRAM Size: 8388608 bytes
PSRAM Free: 8388608 bytes
[DisplayInit] Initializing display...
[DisplayInit] Display initialized: 240x240
[DisplayInit] LVGL initialized
[DisplayInit] Display test pattern shown
[UI] Creating Phase 1 test interface...
[UI] Test interface created successfully
[LVGL Task] Started on Core 1
[Setup] Complete! Starting main loop...
[Stats] Uptime: 1 s | Free Heap: 315432 | Loop: 100
```
## Configuration
### Display Settings (platformio.ini)
```ini
-DDISPLAY_WIDTH=240
-DDISPLAY_HEIGHT=240
```
### LVGL Settings (lv_conf.h)
- **Color Depth**: RGB565 (16-bit)
- **Memory**: 64KB heap
- **Theme**: Dark theme enabled
- **Widgets**: Arc, Label, LED, Meter (for future phases)
## Troubleshooting
### Display Shows Nothing
1. Check power supply (5V via USB-C)
2. Verify pin assignments in `src/display_init.cpp`
3. Check SPI connections
4. Try reducing SPI frequency from 80MHz to 40MHz
### Compilation Errors
```bash
# Clean build directory
pio run --target clean
# Update dependencies
pio pkg update
# Rebuild
pio run
```
### Upload Fails
1. Press and hold BOOT button while uploading
2. Check USB cable supports data transfer
3. Verify correct COM port in platformio.ini
4. Try lower upload speed: `upload_speed = 460800`
## Next Steps (Future Phases)
- **Phase 2**: UART reception and protocol implementation
- **Phase 3**: Automotive dashboard UI
- **Phase 4**: Data validation and error handling
- **Phase 5**: Polish and optimization
See `wiki/pages/open-questions.md` for the current roadmap.
## Resources
- [Waveshare Product Page](https://www.waveshare.com/esp32-s3-lcd-1.3.htm)
- [Waveshare Wiki](https://www.waveshare.com/wiki/ESP32-S3-LCD-1.3)
- [LovyanGFX Documentation](https://github.com/lovyan03/LovyanGFX)
- [LVGL Documentation](https://docs.lvgl.io/8.4/)
## License
Project specific license (if applicable)