mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2026-01-14 01:07:30 +08:00
* update v2 partition table readme * feat: Add user only tool * Add image cache * smaller cache and buffer, more heap * use MAIN_EVENT_CLOCK_TICK to avoid audio glitches * fix: esp_psram_get_size not found in c3 * Bump to 1.9.0
4.1 KiB
4.1 KiB
Version 2 Partition Table
This version introduces significant improvements over v1 by adding an assets partition to support network-loadable content and optimizing partition layouts for different flash sizes.
Key Changes from v1
Major Improvements
- Added Assets Partition: New
assetspartition for network-loadable content - Replaced Model Partition: The old
modelpartition (960KB) is replaced with a largerassetspartition - Optimized App Partitions: Reduced application partition sizes to accommodate assets
- Enhanced Flexibility: Support for dynamic content updates without reflashing
Assets Partition Features
The assets partition stores:
- Wake word models: Customizable wake word models that can be loaded from the network
- Theme files: Complete theming system including:
- Fonts (text and icon fonts)
- Audio effects and sound files
- Background images and UI elements
- Custom emoji packs
- Language configuration files
- Dynamic Content: All content can be updated over-the-air via HTTP downloads
Partition Layout Comparison
v1 Layout (16MB)
nvs: 16KB (non-volatile storage)otadata: 8KB (OTA data)phy_init: 4KB (PHY initialization data)model: 960KB (model storage - fixed content)ota_0: 6MB (application partition 0)ota_1: 6MB (application partition 1)
v2 Layout (16MB)
nvs: 16KB (non-volatile storage)otadata: 8KB (OTA data)phy_init: 4KB (PHY initialization data)ota_0: 4MB (application partition 0)ota_1: 4MB (application partition 1)assets: 8MB (network-loadable assets)
Available Configurations
8MB Flash Devices (8m.csv)
nvs: 16KBotadata: 8KBphy_init: 4KBota_0: 3MBota_1: 3MBassets: 2MB
16MB Flash Devices (16m.csv) - Standard
nvs: 16KBotadata: 8KBphy_init: 4KBota_0: 4MBota_1: 4MBassets: 8MB
16MB Flash Devices (16m_c3.csv) - ESP32-C3 Optimized
nvs: 16KBotadata: 8KBphy_init: 4KBota_0: 4MBota_1: 4MBassets: 4MB (4000K - limited by available mmap pages)
32MB Flash Devices (32m.csv)
nvsfactory: 200KBnvs: 840KBotadata: 8KBphy_init: 4KBota_0: 4MBota_1: 4MBassets: 16MB
Benefits
- Dynamic Content Management: Users can download and update wake word models, themes, and other assets without reflashing the device
- Reduced App Size: Application partitions are optimized, allowing more space for dynamic content
- Enhanced Customization: Support for custom themes, wake words, and language packs enhances user experience
- Network Flexibility: Assets can be updated independently of the main application firmware
- Better Resource Utilization: Efficient use of flash memory with configurable asset storage
- OTA Asset Updates: Assets can be updated over-the-air via HTTP downloads
Technical Details
- Partition Type: Assets partition uses
spiffssubtype for SPIFFS filesystem compatibility - Memory Mapping: Assets are memory-mapped for efficient access during runtime
- Checksum Validation: Built-in integrity checking ensures asset data validity
- Progressive Download: Assets can be downloaded progressively with progress tracking
- Fallback Support: Graceful fallback to default assets if network updates fail
Migration from v1
When upgrading from v1 to v2:
- Backup Important Data: Ensure any important data in the old
modelpartition is backed up - Flash New Partition Table: Use the appropriate v2 partition table for your flash size
- Download Assets: The device will automatically download required assets on first boot
- Verify Functionality: Ensure all features work correctly with the new partition layout
Usage Notes
- The
assetspartition size varies by configuration to optimize for different flash sizes - ESP32-C3 devices use a smaller assets partition (4MB) due to limited available mmap pages in the system
- 32MB devices get the largest assets partition (16MB) for maximum content storage
- All partition tables maintain proper alignment for optimal flash performance