No Template and No ILI9342C Display Function on M5 Stack CoreS3 #22702
Replies: 5 comments 12 replies
-
Missing config is no issue. Moving to discussions |
Beta Was this translation helpful? Give feedback.
-
Seems the entry for the M5 Stack core S3 is not correct at the template repo site. Have you anything shown on the display? |
Beta Was this translation helpful? Give feedback.
-
Could you please try the following drivers in Berry: Add #-------------------------------------------------------------
- Generic driver for AXP2102 - solidified
-------------------------------------------------------------#
# Specs
# DCDC1 : 1.5-3.4V, 2000mA
# DCDC2 : 0.5-1.2V,1.22-1.54V, 2000mA
# DCDC3 : 0.5-1.2V,1.22-1.54V, 1.6-3.4V, 2000mA
# DCDC4 : 0.5-1.2V, 1.22-1.84V, 1500mA
# DCDC5 : 1.2V , 1.4-3.7V, 1000mA
#
# RTCLDO1/2 : 1.8V/2.5V/3V/3.3V, 30mA
# ALDO1~4 : 0.5-3.5V, 100mV/step 300mA
# LDO index:
# 0=ALDO1 ~ 3=ALDO4 / 4=BLDO1 / 5=BLDO2
#@ solidify:AXP2102
class AXP2102 : I2C_Driver
def init(addr)
if (addr == nil) addr = 0x34 end # default address is 0x34
super(self).init("AXP2102", addr)
end
# Return True = Battery Exist
def battery_present()
return bool(self.wire.read(self.addr, 0x00, 1) & 0x08)
end
# # Battery Charging Status
def get_battery_charging_status()
var val = (self.read8(0x01) >> 5) & 0x03
# 1:charge / 2:dischage / 0:stanby
return (val == 1) ? 1 : ((val == 2) ? -1 : 0)
end
def is_charging()
return (self.read8(0x01) & 0x60) == 0x20
end
def get_battery_level()
return self.read8(0xA4)
end
# AXP chip temperature in °C
def get_temp()
return 22 + ((7274 - self.read16(0x3C)) / 20);
end
def get_bat_power()
return 0
end
def get_bat_voltage()
return self.read14(0x34) / 1000.0
end
def get_bat_current()
return 0
end
def get_bat_charge_current()
return 0
end
def get_aps_voltage()
return 0
end
def get_vbus_good()
return bool(self.wire.read(self.addr, 0x00, 1) & 0x20)
end
def get_vbus_voltage()
if (!self.get_vbus_good()) return 0 end
var vbus = self.read14(0x38)
if (vbus > 16375) return 0 end
return vbus / 1000.0
end
def get_vbus_current()
return 0
end
# set LDO voltage
# 0=ALDO1 ~ 3=ALDO4 / 4=BLDO1 / 5=BLDO2
# voltage: (mV) 0.5-3.5V in 100mV steps
def set_ldo_voltage(num, voltage)
if (num < 0 || num > 5) return end
var reg_volt = num + 0x92
voltage -= 500
# convert voltage to value
var val = (voltage < 0) ? 0 : voltage / 100
if (val > 0x1E) val = 0x1E end
self.write8(reg_volt, val)
var reg90bit = 1 << num
if (voltage < 0)
self.write8(0x90, self.read8(0x90) & ~reg90bit) # bit off
else
self.write8(0x90, self.read8(0x90) | reg90bit) # bit on
end
end
# det DLDO voltage
def set_dldo_voltage(num, voltage)
if (num < 0 || num > 1) return end
var reg_volt = num + 0x99
voltage -= 500
# convert voltage to value
var val = (voltage < 0) ? 0 : voltage / (num ? 50 : 100)
if (val > (num ? 0x13 : 0x1C)) val = num ? 0x13 : 0x1C end
self.write8(reg_volt, val)
var reg = 0x90 + num
var bit = num ? 0x01 : 0x80
if (voltage < 0)
self.write8(0x90, self.read8(reg) & ~bit) # bit off
else
self.write8(0x90, self.read8(reg) | bit) # bit on
end
end
# get LDO enable
def get_ldo_enable(num)
var res = false
if (num <= 5)
var reg90bit = 1 << num
res = bool(self.read8(0x90) & reg90bit)
end
return res
end
def set_battery_charge(enable)
self.write8(0x18, (self.read8(0x18) & 0xFD) | ((enable ? 1 : 0) << 1))
end
static var _pre_charge = [0, 25, 50, 75, 100, 125, 150, 175, 200, 255]
def set_pre_charge_current(max_mA)
if (max_mA < 0) max_mA = 0 end
if (max_mA > 200) max_mA = 200 end
var i = 0
while (self._pre_charge[i] <= max_mA)
i += 1
end
self.write8(0x61, i)
end
static var _charge = [ 25, 30, 35, 40, 60, 80, 100, 120, 140, 160, 180, 200, 255]
def set_charge_current(max_mA)
if (max_mA < 0) max_mA = 0 end
if (max_mA > 200) max_mA = 200 end
var i = 0
while (self._charge[i] <= max_mA)
i += 1
end
i += 4
self.write8(0x62, i)
end
static var _charge_voltage = [410, 420, 435, 440, 460, 655]
def set_charge_voltage(max_mV)
if (max_mV < 0) max_mV = 0 end
if (max_mV > 460) max_mV = 460 end
var i = 0
while (self._charge_voltage[i] <= max_mV)
i += 1
end
i += 1
if (i >= 6) i = 0 end
self.write8(0x64, i)
end
end
return AXP2102 Add #-------------------------------------------------------------
- Specialized driver for AXP2102 of M5CoreS3
-------------------------------------------------------------#
class AXP2102_M5CoreS3 : AXP2102
def init()
super(self).init()
if self.wire
# From https://github.com/m5stack/M5Unified/blob/b8cfec7fed046242da7f7b8024a4e92004a51ff7/src/utility/Power_Class.cpp#L62
# Axp2101.begin();
# static constexpr std::uint8_t reg_data_array[] =
# { 0x90, 0xBF // LDOS ON/OFF control 0
# , 0x92, 18 -5 // ALDO1 set to 1.8v // for AW88298
# , 0x93, 33 -5 // ALDO2 set to 3.3v // for ES7210
# , 0x94, 33 -5 // ALDO3 set to 3.3v // for camera
# , 0x95, 33 -5 // ALDO3 set to 3.3v // for TF card slot
# , 0x27, 0x00 // PowerKey Hold=1sec / PowerOff=4sec
# , 0x69, 0x11 // CHGLED setting
# , 0x10, 0x30 // PMU common config
# , 0x30, 0x0F // ADC enabled (for voltage measurement)
# };
self.write8(0x90, 0xBF) # LDOS ON/OFF control 0
self.write8(0x92, 18 -5) # ALDO1 set to 1.8v // for AW88298
self.write8(0x93, 33 -5) # ALDO2 set to 3.3v // for ES7210
self.write8(0x94, 33 -5) # ALDO3 set to 3.3v // for camera
self.write8(0x95, 33 -5) # ALDO4 set to 3.3v // for TF card slot
self.write8(0x27, 0x00) # PowerKey Hold=1sec / PowerOff=4sec
self.write8(0x69, 0x11) # CHGLED setting
self.write8(0x10, 0x30) # PMU common config
self.write8(0x30, 0x0F) # ADC enabled (for voltage measurement)
tasmota.add_driver(self)
end
end
# set LCD backlight voltage on DLDO1
def set_lcd_voltage(voltage)
if (voltage < 2500) voltage = 2500 end
if (voltage > 3300) voltage = 3300 end
self.set_dldo_voltage(0, voltage) # 0=DLD01
end
# Speaker enable
def set_speaker_enable(state)
self.set_ldo_voltage(2, state ? 3300 : 0) # 2 = ALDO3
end
# Dimmer in percentage
def set_displaydimmer(x)
var v = tasmota.scale_uint(x, 0, 100, 2500, 3300)
self.set_lcd_voltage(v)
end
# respond to display events
def display(cmd, idx, payload, raw)
if cmd == "dim" || cmd == "power"
self.set_displaydimmer(idx)
end
end
end
return AXP2102_M5CoreS3() And finally import AXP2102
import AXP2102_M5CoreS3() |
Beta Was this translation helpful? Give feedback.
-
Ah sorry, preinit.be should be
|
Beta Was this translation helpful? Give feedback.
-
Hi, I checked the initialization sequence for ILI9342C from M5Stack, it is completely different from the one you are using. The file from https://github.com/arendst/Tasmota/blob/development/tasmota/displaydesc/ILI9342_display.ini is a copy from ILI9341, but according to the datasheet, commands are different. Can you try the following
For reference, the sequence used by M5Stack is here: |
Beta Was this translation helpful? Give feedback.
-
DO NOT DELETE ANY TEXT from this template! Otherwise the issue will be auto-closed.
-->
PROBLEM DESCRIPTION
A clear and concise description of what the problem is.
I recently purchased the M5 Stack CoreS3: https://docs.m5stack.com/en/core/CoreS3?ref=mledqdug It is an ESP32-S3@Xtensa LX7, 16MFLASH AND 8M-PSRAM, WIFI, OTG\CDC functions featuring a Touch IPS LCD screen 2.0"@320*240 ILI9342C: https://www.orientdisplay.com/wp-content/uploads/2021/02/ILI9342C_AN_01_20111228.pdf According to this web page it should run Tasmota including support for the display: https://templates.blakadder.com/m5stack_coreS3.html The instructions say: "after flashing Tasmota, open the web UI of the device and navigate to Configuration -> Auto-configuration. Select your device from the drop-down and click Apply Configuration." There is no autoconfig profile to select, so I assigned the GPIOs manually via Template according to this web page: https://docs.m5stack.com/en/core/CoreS3?ref=mledqdug which by the way differ from the recommendations on this webpage: https://templates.blakadder.com/m5stack_coreS3.html The manufacturer (https://docs.m5stack.com/en/core/CoreS3?ref=mledqdug) states that GPIO 35 should be SPI DC, while this web page https://templates.blakadder.com/m5stack_coreS3.html states it should be SPI MISO (which according to the manufacturer is the TF card slot). No GPIO pin information is available which GPIOs should be assigned to display backlight (BL) and display reset (RST).
I used this display.ini https://github.com/arendst/Tasmota/blob/development/tasmota/displaydesc/ILI9342_display.ini However, the display remains black.
:H,ILI9342,320,240,16,SPI,1,,,,,,,,40
:S,2,1,3,0,100,100
:I
EF,3,03,80,02
CF,3,00,C1,30
ED,4,64,03,12,81
E8,3,85,00,78
CB,5,39,2C,00,34,02
F7,1,20
EA,2,00,00
C0,1,23
C1,1,10
C5,2,3e,28
C7,1,86
36,1,48
37,1,00
3A,1,55
B1,2,00,18
B6,3,08,82,27
F2,1,00
26,1,01
E0,0F,0F,31,2B,0C,0E,08,4E,F1,37,07,10,03,0E,09,00
E1,0F,00,0E,14,03,11,07,31,C1,48,08,0F,0C,31,36,0F
21,80
11,80
29,80
:o,28
:O,29
:A,2A,2B,2C,16
:R,36
:0,08,00,00,00
:1,A8,00,00,01
:2,C8,00,00,02
:3,68,00,00,03
:i,21,20
:UTI,FT5206,I2,38,,*
RD A8
CP 11
RTF
RD A3
CP 64
RTF
RT
:UTT
RDM 00 16
MV 2 1
RT
:UTX
MV 3 2
RT
:UTY
MV 5 2
RT
Moreover, I noticed that Tasmota recognizes a particle sensor that is NOT included in the M5 Core S3. It is a separate product: https://shop.m5stack.com/products/pm2-5-air-quality-kit Why?
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:Status 0
:weblog
to 4 and then, when you experience your issue, provide the output of the Console log:TO REPRODUCE
Steps to reproduce the behavior:
Screen is black. Webpage shows non existing particle sensor (there is NO particle sensor included in the M5 Stack CoreS3.
EXPECTED BEHAVIOUR
A clear and concise description of what you expected to happen.
Functioning screen.
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
Add any other context about the problem here.
Boot Log:
00:00:00.000 CMD: Using USB CDC
00:00:00.001 HDW: ESP32-S3 v0.2 (PSRAM)
00:00:00.015 UFS: FlashFS mounted with 12588 kB free
00:00:00.023 CFG: Loaded from File, Count 24
00:00:00.025 SER: Set to 8N1 115200 bit/s
00:00:00.025 SER: HWCDC supports 115200 bit/s only
00:00:00.030 QPC: Count 1
00:00:00.031 CFG: CR 401/699, Busy 0
00:00:00.032 SPI: Bus1 using GPIO36(CLK) and GPIO37(MOSI)
00:00:00.033 I2C: Bus1 using GPIO11(SCL) and GPIO12(SDA)
00:00:00.035 I2C: BM8563 found at 0x51
00:00:00.037 RTC: UTC 2024-12-21T16:25:08Z, DST 2024-03-31T02:00:00, STD 2024-10-27T03:00:00
17:25:08.000 RTC: Synced by BM8563
17:25:08.004 TFS: File 'mcp23x.dat' not found
17:25:08.004 MCP: Invalid template
17:25:08.004 TYA: Active=0
17:25:08.007 ROT: Mode 1
17:25:08.011 BRY: GC from 3832 to 3632 bytes, objects freed 4/21 (in 0 ms) - slots from 37/61 to 29/61
17:25:08.023 CFG: No '*.autoconf' file found
17:25:08.028 BRY: GC from 6910 to 5217 bytes, objects freed 9/46 (in 1 ms) - slots from 73/91 to 49/91
17:25:08.028 BRY: Berry initialized, RAM used 5217 bytes
17:25:08.032 BRY: No 'preinit.be'
17:25:08.046 DSP: File descriptor used
17:25:08.745 DSP: ILI9342 initialized
17:25:08.748 SRC: Restart
17:25:08.751 Project tasmota - Tasmota Version 14.4.1.1(9f3c785-lvgl-haspmota)-3_1_0(2024-12-21T13:59:07)
17:25:08.753 LVG: Allocating buffer1 25 KB in main memory (flushlines 40)
17:25:08.758 LVG: LVGL initialized
17:25:08.783 LVG: Refreshed 12800 pixels in 7 ms (1828 pix/ms)
17:25:08.791 LVG: Refreshed 12800 pixels in 6 ms (2133 pix/ms)
17:25:08.802 LVG: Refreshed 12800 pixels in 7 ms (1828 pix/ms)
17:25:08.813 LVG: Refreshed 12800 pixels in 7 ms (1828 pix/ms)
17:25:08.820 LVG: Refreshed 12800 pixels in 6 ms (2133 pix/ms)
17:25:08.828 LVG: Refreshed 12800 pixels in 6 ms (2133 pix/ms)
17:25:08.830 ETH: No ETH MDC and ETH MDIO GPIO defined
17:25:08.842 SHT: Sensor did not ACK command
17:25:09.246 I2C: SEN5X found at 0x69
17:25:09.260 BRY: No 'autoexec.be'
17:25:09.399 CFG: Saved, Count 25, Bytes 4096
17:25:09.424 S5X: Failed to retrieve readings
17:25:09.517 WIF: Checking connection...
17:25:09.517 WIF: Attempting connection...
17:25:10.654 WIF: Connecting to AP1 Cordoba Channel 6 BSSId C8:0E:14:04:63:0E in mode HT40 as tasmota-66E1D0-0464...
17:25:10.679 S5X: Failed to retrieve readings
17:25:10.712 WIF: IPv4 192.168.178.54, mask 255.255.255.0, gateway 192.168.178.1
17:25:11.427 S5X: Failed to retrieve readings
17:25:11.718 WIF: IPv6 Local fe80::4a27:e2ff:fe66:e1d0%st1
17:25:12.024 WIF: Checking connection...
17:25:12.024 WIF: Connected
17:25:12.269 HTP: Web server active on tasmota-66E1D0-0464 with IP address 192.168.178.54
17:25:12.405 NTP: Sync time...
17:25:12.421 WIF: DNS resolved '2.pool.ntp.org' (141.144.230.32) in 15 ms
17:25:12.444 RTC: UTC 2024-12-21T16:25:14Z, DST 2024-03-31T02:00:00, STD 2024-10-27T03:00:00
17:25:14.000 RTC: Synced by NTP
17:25:14.029 S5X: Failed to retrieve readings
17:25:14.133 HTP: Main Menu
17:25:14.274 WIF: IPv6 Global 2a03:fc82:205:3400:4a27:e2ff:fe66:e1d0
17:25:14.275 WIF: IPv6 Global fdc7:4203:630e:0:4a27:e2ff:fe66:e1d0
17:25:14.439 LVG: Refreshed 12800 pixels in 6 ms (2133 pix/ms)
17:25:14.446 LVG: Refreshed 12800 pixels in 6 ms (2133 pix/ms)
17:25:14.454 LVG: Refreshed 12800 pixels in 7 ms (1828 pix/ms)
17:25:14.461 LVG: Refreshed 12800 pixels in 6 ms (2133 pix/ms)
17:25:14.469 LVG: Refreshed 12800 pixels in 7 ms (1828 pix/ms)
17:25:14.476 LVG: Refreshed 12800 pixels in 6 ms (2133 pix/ms)
17:25:14.266 RSL: INFO1 = {"Info1":{"Module":"ESP32S3","Version":"14.4.1.1(9f3c785-lvgl-haspmota)","FallbackTopic":"cmnd/DVES_66E1D0_fb/","GroupTopic":"cmnd/tasmotas/"}}
17:25:14.268 RSL: INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"tasmota-66E1D0-0464","IPAddress":"192.168.178.54","IP6Global":"2a03:fc82:205:3400:4a27:e2ff:fe66:e1d0","IP6Local":"fe80::4a27:e2ff:fe66:e1d0%st1"}}
17:25:14.270 RSL: INFO3 = {"Info3":{"RestartReason":"Software reset CPU","BootCount":7}}
17:25:14.272 RSL: RESULT = {"POWER":"ON"}
17:25:14.272 RSL: POWER = ON
17:25:14.275 TFS: File 'autoexec.bat' not found
17:25:14.433 S5X: Failed to retrieve readings
17:25:15.307 HTP: Tools
17:25:15.431 S5X: Failed to retrieve readings
(Please, remember to close the issue when the problem has been addressed)
Beta Was this translation helpful? Give feedback.
All reactions