Merge develop into main (#161)
- Fix CoreS3 boot failure (I2C now returns bool instead of err_result_t) - Flashing scripts now erase before flashing (to ensure it's a clean install) - M5Stack Core2 and CoreS3: Experimental SPI speed increase
This commit is contained in:
parent
ceec04b34c
commit
431fa84ffb
@ -58,12 +58,12 @@ bool initGpioExpander() {
|
||||
// SD card
|
||||
aw9523_P0 |= (1 << 4);
|
||||
|
||||
if (tt::hal::i2c::masterWrite(I2C_NUM_0, AW9523_ADDRESS, 0x02, &aw9523_P0, 1, 1000) != ESP_OK) {
|
||||
if (!tt::hal::i2c::masterWrite(I2C_NUM_0, AW9523_ADDRESS, 0x02, &aw9523_P0, 1, 1000)) {
|
||||
TT_LOG_E(TAG, "Failed to enable LCD");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tt::hal::i2c::masterWrite(I2C_NUM_0, AW9523_ADDRESS, 0x03, &aw9523_P1, 1, 1000) != ESP_OK) {
|
||||
if (!tt::hal::i2c::masterWrite(I2C_NUM_0, AW9523_ADDRESS, 0x03, &aw9523_P1, 1, 1000)) {
|
||||
TT_LOG_E(TAG, "Failed to enable touch");
|
||||
return false;
|
||||
}
|
||||
@ -76,21 +76,21 @@ bool initPowerControl() {
|
||||
|
||||
uint8_t sdcard_3v3 = 0b00011100;
|
||||
// TODO: Refactor to use Axp2101 class with https://github.com/m5stack/M5Unified/blob/b8cfec7fed046242da7f7b8024a4e92004a51ff7/src/utility/AXP2101_Class.cpp#L62
|
||||
if (tt::hal::i2c::masterWrite(I2C_NUM_0, AXP2101_ADDRESS, 0x95, &sdcard_3v3, 1, 1000) != ESP_OK) {
|
||||
if (!tt::hal::i2c::masterWrite(I2C_NUM_0, AXP2101_ADDRESS, 0x95, &sdcard_3v3, 1, 1000)) {
|
||||
TT_LOG_E(TAG, "Failed to enable SD card");
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Refactor to use Axp2102 class with https://github.com/m5stack/M5Unified/blob/b8cfec7fed046242da7f7b8024a4e92004a51ff7/src/utility/AXP2101_Class.cpp#L42
|
||||
uint8_t axp_dld01_enable = 0xBF; // For backlight
|
||||
if (tt::hal::i2c::masterWrite(I2C_NUM_0, AXP2101_ADDRESS, 0x90, &axp_dld01_enable, 1, 1000) != ESP_OK) {
|
||||
if (!tt::hal::i2c::masterWrite(I2C_NUM_0, AXP2101_ADDRESS, 0x90, &axp_dld01_enable, 1, 1000)) {
|
||||
TT_LOG_E(TAG, "Failed to enable display backlight");
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Refactor to use Axp2101 class with https://github.com/m5stack/M5Unified/blob/b8cfec7fed046242da7f7b8024a4e92004a51ff7/src/utility/AXP2101_Class.cpp#L62
|
||||
uint8_t axp_dld01_voltage = 0b00011000; // For backlight
|
||||
if (tt::hal::i2c::masterWrite(I2C_NUM_0, AXP2101_ADDRESS, 0x99, &axp_dld01_voltage, 1, 1000) != ESP_OK) {
|
||||
if (!tt::hal::i2c::masterWrite(I2C_NUM_0, AXP2101_ADDRESS, 0x99, &axp_dld01_voltage, 1, 1000)) {
|
||||
TT_LOG_E(TAG, "Failed to set display backlight voltage");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ void CoreS3Display::setGammaCurve(uint8_t index) {
|
||||
void CoreS3Display::setBacklightDuty(uint8_t backlightDuty) {
|
||||
const uint8_t voltage = 20 + ((8 * backlightDuty) / 255); // [0b00000, 0b11100] - under 20 is too dark
|
||||
// TODO: Refactor to use Axp2102 class with https://github.com/m5stack/M5Unified/blob/b8cfec7fed046242da7f7b8024a4e92004a51ff7/src/utility/AXP2101_Class.cpp#L42
|
||||
if (tt::hal::i2c::masterWrite(I2C_NUM_0, AXP2101_ADDRESS, 0x99, &voltage, 1, 1000) != ESP_OK) {
|
||||
if (!tt::hal::i2c::masterWrite(I2C_NUM_0, AXP2101_ADDRESS, 0x99, &voltage, 1, 1000)) {
|
||||
TT_LOG_E(TAG, "Failed to set display backlight voltage");
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,8 @@ $jsonClean = $json.flash_files -replace '[\{\}\@\;]', ''
|
||||
$jsonClean = $jsonClean -replace '[\=]', ' '
|
||||
|
||||
cd Binaries
|
||||
$command = "esptool --port $port erase_flash"
|
||||
Invoke-Expression $command
|
||||
$command = "esptool --port $port -b 460800 write_flash $jsonClean"
|
||||
Invoke-Expression $command
|
||||
cd ..
|
||||
|
||||
@ -38,4 +38,5 @@ fi
|
||||
cd Binaries
|
||||
# Create flash command based on partitions
|
||||
KEY_VALUES=`jq -r '.flash_files | keys[] as $k | "\($k) \(.[$k])"' flasher_args.json | tr "\n" " "`
|
||||
esptool.py --port $1 erase_flash
|
||||
esptool.py --port $1 --connect-attempts 10 -b 460800 write_flash $KEY_VALUES
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
- Consistently use either ESP_TARGET or ESP_PLATFORM
|
||||
- tt_check() failure during app argument bundle nullptr check seems to trigger SIGSEGV
|
||||
- Fix bug in T-Deck/etc: esp_lvgl_port settings has a large stack size (~9kB) to fix an issue where the T-Deck would get a stackoverflow. This sometimes happens when WiFi is auto-enabled and you open the app while it is still connecting.
|
||||
- M5Stack Core only shows 4MB of SPIRAM in use
|
||||
|
||||
# TODOs
|
||||
- Make a ledger for setting CPU affinity of various services and tasks
|
||||
|
||||
@ -29,15 +29,18 @@ CONFIG_FATFS_LFN_HEAP=y
|
||||
CONFIG_FATFS_VOLUME_COUNT=3
|
||||
|
||||
# Hardware: Main
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
CONFIG_TT_BOARD_M5STACK_CORE2=y
|
||||
CONFIG_IDF_TARGET="esp32"
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
||||
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
|
||||
CONFIG_FLASHMODE_QIO=y
|
||||
# Hardware: SPI RAM
|
||||
CONFIG_ESP32_SPIRAM_SUPPORT=y
|
||||
CONFIG_SPIRAM=y
|
||||
CONFIG_SPIRAM_MODE_OCT=y
|
||||
CONFIG_SPIRAM_MODE_QUAD=y
|
||||
CONFIG_SPIRAM_SPEED_80M=y
|
||||
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
|
||||
# LVGL
|
||||
|
||||
@ -29,6 +29,7 @@ CONFIG_FATFS_LFN_HEAP=y
|
||||
CONFIG_FATFS_VOLUME_COUNT=3
|
||||
|
||||
# Hardware: Main
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
CONFIG_TT_BOARD_M5STACK_CORES3=y
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
@ -41,11 +42,13 @@ CONFIG_SPIRAM_MODE_QUAD=y
|
||||
CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y
|
||||
CONFIG_SPIRAM_CLK_IO=30
|
||||
CONFIG_SPIRAM_CS_IO=26
|
||||
CONFIG_SPIRAM_SPEED_40M=y
|
||||
CONFIG_SPIRAM_SPEED=40
|
||||
CONFIG_SPIRAM_SPEED_120M=y
|
||||
CONFIG_SPIRAM_SPEED=120
|
||||
CONFIG_SPIRAM_BOOT_INIT=y
|
||||
CONFIG_SPIRAM_USE_MALLOC=y
|
||||
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
|
||||
# SPI Flash (can set back to 80MHz after ESP-IDF bug is resolved)
|
||||
CONFIG_ESPTOOLPY_FLASHFREQ_120M=y
|
||||
# LVGL
|
||||
CONFIG_LV_DISP_DEF_REFR_PERIOD=17
|
||||
CONFIG_LV_INDEV_DEF_READ_PERIOD=17
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user