Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QSPI PSRAM esp32s3 board screen not working #246

Open
yusuhua opened this issue Jan 5, 2025 · 14 comments
Open

QSPI PSRAM esp32s3 board screen not working #246

yusuhua opened this issue Jan 5, 2025 · 14 comments

Comments

@yusuhua
Copy link

yusuhua commented Jan 5, 2025

When I build using this command

python3 make.py esp32 clean BOARD=ESP32_GENERIC_S3 --flash-size=16 DISPLAY=st7789 INDEV=cst816s

gc.mem_alloc() + gc.mem_free() print 8M, but the screen not working.

The same code, built with the addition of BOARD_VARIANT=SPIRAM_OCT screen works, but the PSRAM size is incorrect(For the reason of "QSPI").

board: https://github.com/Xinyuan-LilyGO/T-CameraPlus-S3

import lcd_bus
from micropython import const
import machine


# display settings
_WIDTH = const(240)
_HEIGHT = const(240)
_BL = const(46)
_DC = const(45)

_MOSI = const(35)
_MISO = const(-1)
_SCK = const(36)
_HOST = const(1)

_LCD_CS = const(34)
_LCD_FREQ = const(80000000)

_TOUCH_CS = const(18)
_TOUCH_FREQ = const(10000000)

spi_bus = machine.SPI.Bus(
    host=_HOST,
    mosi=_MOSI,
    miso=_MISO,
    sck=_SCK
)

display_bus = lcd_bus.SPIBus(
    spi_bus=spi_bus,
    freq=_LCD_FREQ,
    dc=_DC,
    cs=_LCD_CS,
)

import st7789
import lvgl as lv


display = st7789.ST7789(
    data_bus=display_bus,
    display_width=_WIDTH,
    display_height=_HEIGHT,
    backlight_pin=_BL,
    color_space=lv.COLOR_FORMAT.RGB565,
    color_byte_order=st7789.BYTE_ORDER_BGR,
    rgb565_byte_swap=True,
)

import task_handler
import cst816s
import i2c
import time

display.set_power(True)
display.init()
display.set_backlight(100)

I2C_BUS = i2c.I2C.Bus(host=0, scl=2, sda=1, freq=400000, use_locks=False)
touch_dev = i2c.I2C.Device(bus=I2C_BUS, dev_id=cst816s.I2C_ADDR, reg_bits=cst816s.BITS)

indev = cst816s.CST816S(device=touch_dev, reset_pin=48)

th = task_handler.TaskHandler()

scrn = lv.screen_active()
scrn.set_style_bg_color(lv.color_hex(0x000000), 0)

slider = lv.slider(scrn)
slider.set_size(180, 30)
slider.center()

label = lv.label(scrn)
label.set_text('HELLO WORLD!')
label.align(lv.ALIGN.CENTER, 0, -50)

@kdschlosser
Copy link
Collaborator

delete your clone of the repo and start from scratch and clone it again. I want to make sure that your build is clean and using the latest code.

do not use the BOARD_VARIANT in your build command... There also should only be a single bin file in the build folder unless you have tried multiple times to compile using different build parameters.

@yusuhua
Copy link
Author

yusuhua commented Jan 5, 2025

I just saw that you submitted the code, deleted the clone, and encountered a build problem.

/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c: In function 'i2c_bus_deinit_internal':
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:75:59: error: 'mp_machine_hw_i2c_bus_obj_t' {aka 'struct _mp_machine_hw_i2c_bus_obj_t'} has no member named 'lock'
75 |     #define I2C_BUS_LOCK_ACQUIRE(self) xSemaphoreTake(self->lock.handle, portMAX_DELAY)
|                                                           ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h:279:76: note: in definition of macro 'xSemaphoreTake'
279 | #define xSemaphoreTake( xSemaphore, xBlockTime )    xQueueSemaphoreTake( ( xSemaphore ), ( xBlockTime ) )
|                                                                            ^~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:114:17: note: in expansion of macro 'I2C_BUS_LOCK_ACQUIRE'
114 |                 I2C_BUS_LOCK_ACQUIRE(self);
|                 ^~~~~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:77:59: error: 'mp_machine_hw_i2c_bus_obj_t' {aka 'struct _mp_machine_hw_i2c_bus_obj_t'} has no member named 'lock'
77 |     #define I2C_BUS_LOCK_RELEASE(self) xSemaphoreGive(self->lock.handle)
|                                                           ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h:428:80: note: in definition of macro 'xSemaphoreGive'
428 | #define xSemaphoreGive( xSemaphore )    xQueueGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )
|                                                                                ^~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:115:17: note: in expansion of macro 'I2C_BUS_LOCK_RELEASE'
115 |                 I2C_BUS_LOCK_RELEASE(self);
|                 ^~~~~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:76:60: error: 'mp_machine_hw_i2c_bus_obj_t' {aka 'struct _mp_machine_hw_i2c_bus_obj_t'} has no member named 'lock'
76 |     #define I2C_BUS_LOCK_DELETE(self) vSemaphoreDelete(self->lock.handle)
|                                                            ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h:1042:77: note: in definition of macro 'vSemaphoreDelete'
1042 | #define vSemaphoreDelete( xSemaphore )    vQueueDelete( ( QueueHandle_t ) ( xSemaphore ) )
|                                                                             ^~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:116:17: note: in expansion of macro 'I2C_BUS_LOCK_DELETE'
116 |                 I2C_BUS_LOCK_DELETE(self);
|                 ^~~~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c: In function 'i2c_bus_transfer':
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:75:59: error: 'mp_machine_hw_i2c_bus_obj_t' {aka 'struct _mp_machine_hw_i2c_bus_obj_t'} has no member named 'lock'
75 |     #define I2C_BUS_LOCK_ACQUIRE(self) xSemaphoreTake(self->lock.handle, portMAX_DELAY)
|                                                           ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h:279:76: note: in definition of macro 'xSemaphoreTake'
279 | #define xSemaphoreTake( xSemaphore, xBlockTime )    xQueueSemaphoreTake( ( xSemaphore ), ( xBlockTime ) )
|                                                                            ^~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:154:39: note: in expansion of macro 'I2C_BUS_LOCK_ACQUIRE'
154 |             if (self->use_locks == 1) I2C_BUS_LOCK_ACQUIRE(self);
|                                       ^~~~~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:77:59: error: 'mp_machine_hw_i2c_bus_obj_t' {aka 'struct _mp_machine_hw_i2c_bus_obj_t'} has no member named 'lock'
77 |     #define I2C_BUS_LOCK_RELEASE(self) xSemaphoreGive(self->lock.handle)
|                                                           ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h:428:80: note: in definition of macro 'xSemaphoreGive'
428 | #define xSemaphoreGive( xSemaphore )    xQueueGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )
|                                                                                ^~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:190:39: note: in expansion of macro 'I2C_BUS_LOCK_RELEASE'
190 |             if (self->use_locks == 1) I2C_BUS_LOCK_RELEASE(self);
|                                       ^~~~~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c: In function 'i2c_bus_print':
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:209:9: error: unknown type name 'machine_hw_i2c_obj_t'; did you mean 'machine_i2s_obj_t'?
209 |         machine_hw_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in);
|         ^~~~~~~~~~~~~~~~~~~~
|         machine_i2s_obj_t
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:211:28: error: request for member 'port' in something not a structure or union
211 |         i2c_get_period(self->port, &h, &l);
|                            ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:213:17: error: request for member 'port' in something not a structure or union
213 |             self->port, self->scl, self->sda, I2C_SCLK_FREQ / (h + l));
|                 ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:213:29: error: request for member 'scl' in something not a structure or union
213 |             self->port, self->scl, self->sda, I2C_SCLK_FREQ / (h + l));
|                             ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:213:40: error: request for member 'sda' in something not a structure or union
213 |             self->port, self->scl, self->sda, I2C_SCLK_FREQ / (h + l));
|                                        ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c: In function 'i2c_bus_make_new':
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:235:55: error: expected ',' or ';' before ')' token
235 |         uint8_t i2c_id = (uint8_t)args[ARG_host].u_int);
|                                                       ^
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:236:25: warning: comparison is always true due to limited range of data type [-Wtype-limits]
236 |         if (!(I2C_NUM_0 <= i2c_id && i2c_id < I2C_NUM_MAX)) {
|                         ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:247:28: error: 'mp_machine_i2c_bus_type' undeclared (first use in this function); did you mean 'mp_machine_hw_i2c_bus_type'?
247 |         self->base.type = &mp_machine_i2c_bus_type;
|                            ^~~~~~~~~~~~~~~~~~~~~~~
|                            mp_machine_hw_i2c_bus_type
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:247:28: note: each undeclared identifier is reported only once for each function it appears in
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:79:9: error: 'lock' undeclared (first use in this function); did you mean 'clock_t'?
79 |         lock->handle = xSemaphoreCreateBinaryStatic(&self->lock.buffer); \
|         ^~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:259:35: note: in expansion of macro 'I2C_BUS_LOCK_INIT'
259 |         if (self->use_locks == 1) I2C_BUS_LOCK_INIT(self)
|                                   ^~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:79:58: error: 'mp_machine_hw_i2c_bus_obj_t' {aka 'struct _mp_machine_hw_i2c_bus_obj_t'} has no member named 'lock'
79 |         lock->handle = xSemaphoreCreateBinaryStatic(&self->lock.buffer); \
|                                                          ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h:217:152: note: in definition of macro 'xSemaphoreCreateBinaryStatic'
217 |     #define xSemaphoreCreateBinaryStatic( pxStaticSemaphore )    xQueueGenericCreateStatic( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, ( pxStaticSemaphore ), queueQUEUE_TYPE_BINARY_SEMAPHORE )
|                                                                                                                                                        ^~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:259:35: note: in expansion of macro 'I2C_BUS_LOCK_INIT'
259 |         if (self->use_locks == 1) I2C_BUS_LOCK_INIT(self)
|                                   ^~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:80:28: error: 'mp_machine_hw_i2c_bus_obj_t' {aka 'struct _mp_machine_hw_i2c_bus_obj_t'} has no member named 'lock'
80 |         xSemaphoreGive(self->lock.handle); \
|                            ^~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h:428:80: note: in definition of macro 'xSemaphoreGive'
428 | #define xSemaphoreGive( xSemaphore )    xQueueGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )
|                                                                                ^~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:259:35: note: in expansion of macro 'I2C_BUS_LOCK_INIT'
259 |         if (self->use_locks == 1) I2C_BUS_LOCK_INIT(self)
|                                   ^~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c: In function 'device_write':
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:332:30: error: implicit declaration of function 'fill_memaddr_buf'; did you mean 'get_memaddr_buf'? [-Werror=implicit-function-declaration]
332 |         size_t memaddr_len = fill_memaddr_buf(&memaddr_buf[0], memaddr, addrsize);
|                              ^~~~~~~~~~~~~~~~
|                              get_memaddr_buf
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c: In function 'device_deinit_internal':
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:378:9: error: expected ',' or ';' before 'for'
378 |         for (;i<self->bus->device_count;i++) {
|         ^~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:378:16: error: statement with no effect [-Werror=unused-value]
378 |         for (;i<self->bus->device_count;i++) {
|               ~^~~~~~~~~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:378:44: error: expected ';' before ')' token
378 |         for (;i<self->bus->device_count;i++) {
|                                            ^
|                                            ;
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:378:44: error: expected statement before ')' token
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:381:17: error: break statement not within loop or switch
381 |                 break;
|                 ^~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c: In function 'i2c_device_write_readinto':
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:428:50: warning: comparison is always true due to limited range of data type [-Wtype-limits]
428 |         for (uint8_t i=(self->reg_bits / 8) - 1;i>-1;i--) {
|                                                  ^
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:429:62: warning: dereferencing 'void *' pointer
429 |             memaddr |= (uint32_t)(((uint8_t)write_bufinfo.buf[i]) << ((~i + (self.reg_bits / 8)) * 8));
|                                                              ^
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:429:36: error: invalid use of void expression
429 |             memaddr |= (uint32_t)(((uint8_t)write_bufinfo.buf[i]) << ((~i + (self.reg_bits / 8)) * 8));
|                                    ^
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:429:82: error: 'self' is a pointer; did you mean to use '->'?
429 |             memaddr |= (uint32_t)(((uint8_t)write_bufinfo.buf[i]) << ((~i + (self.reg_bits / 8)) * 8));
|                                                                                  ^
|                                                                                  ->
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c: In function 'i2c_device_read':
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:550:19: error: too few arguments to function 'device_readfrom'
550 |             ret = device_readfrom(self, self->device_id, (uint8_t *)vstr.buf, vstr.len);
|                   ^~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:345:16: note: declared here
345 |     static int device_readfrom(mp_machine_hw_i2c_device_obj_t *self, uint16_t addr,
|                ^~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c: In function 'i2c_device_write':
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:578:9: error: 'ret' undeclared (first use in this function)
578 |         ret = device_writeto(self, self->device_id, (uint8_t *)bufinfo.buf, bufinfo.len, true);
|         ^~~
In file included from /Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/py/mpstate.h:35:
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c: At top level:
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/machine_i2c.c:626:60: error: 'machine_i2c_init_obj' undeclared here (not in a function); did you mean 'machine_hw_i2c_obj'?
626 |         { MP_ROM_QSTR(MP_QSTR_init),           MP_ROM_PTR(&machine_i2c_init_obj)          },
|                                                            ^~~~~~~~~~~~~~~~~~~~
/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/py/obj.h:348:24: note: in definition of macro 'MP_ROM_PTR'
348 | #define MP_ROM_PTR(p) (p)
|                        ^
cc1: some warnings being treated as errors
[1363/2050] Building C object esp-idf/main_esp32s3/CMakeFiles/__idf_main_esp32s3[1364/2050] Building C object esp-idf/main_esp32s3/CMakeFiles/__idf_main_esp32s3[1365/2050] Building C object esp-idf/main_esp32s3/CMakeFiles/__idf_main_esp32s3[1366/2050] Building C object esp-idf/main_esp32s3/CMakeFiles/__idf_main_esp32s3[1367/2050] Building C object esp-idf/main_esp32s3/CMakeFiles/__idf_main_esp32s3[1368/2050] Building C object esp-idf/main_esp32s3/CMakeFiles/__idf_main_esp32s3.dir/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/lib/littlef[1369/2050] Building C object esp-idf/main_esp32s3/CMakeFiles/__idf_main_esp32s3.dir/__/modsocket.c.obj                                                         [1370/2050] Building C object esp-idf/main_esp32s3/CMakeFiles/__idf_main_esp32s3.dir/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/lib/oofatfs[1371/2050] Building C object esp-idf/main_esp32s3/CMakeFiles/__idf_main_esp32s3.dir/Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/lib/littlefs/lfs2.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3/log/idf_py_stderr_output_17289 and /Users/yusuhua/Documents/github/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3/log/idf_py_stdout_output_17289
-e See https://github.com/micropython/micropython/wiki/Build-Troubleshooting
make: *** [all] Error 1

@yusuhua
Copy link
Author

yusuhua commented Jan 5, 2025

Maybe I should try again later, the version without the BOARD_VARIANT screen not working is your last commit on Jan 4, 2025.

@kdschlosser
Copy link
Collaborator

Just hold on for a few. I am ironing out the last few kinks in it right now. I had to shuffle some things around because of an issue with soft resetting. once I get the last couple of things sorted out I will let you know. It should only take me a few more minutes. I am checking right now to see if it compiles properly. once it compiles hopefully it will run without any issue.

I am specifically messing around with the I2C driver.

@kdschlosser
Copy link
Collaborator

If you click on the actions tab at the top of the repo here you should be able to watch it compile. There are 3 that run each commit. one for unix, one for macOS and the last is Windows which doesn't do anything currently.

@kdschlosser
Copy link
Collaborator

It is compiling properly now.

@yusuhua
Copy link
Author

yusuhua commented Jan 5, 2025

I did a fresh git clone to a new directory, the screen still cannot display.
But there is no error.

python3 make.py esp32 clean BOARD=ESP32_GENERIC_S3 --flash-size=16 DISPLAY=st7789 INDEV=cst816s

When I open this code, an error message is output, and it seems that there is something wrong with the data read out.

I2C_BUS = i2c.I2C.Bus(host=0, scl=2, sda=1, freq=400000, use_locks=False)
touch_dev = i2c.I2C.Device(bus=I2C_BUS, dev_id=cst816s.I2C_ADDR, reg_bits=cst816s.BITS)

indev = cst816s.CST816S(device=touch_dev, reset_pin=48)
MPY: soft reboot
Chip ID: 0x0
Touch version: 0
Proj ID: 0x0
FW Version: 0x0
Traceback (most recent call last):
  File "<stdin>", line 63, in <module>
  File "cst816s.py", line 207, in __init__
RuntimeError: Incorrect chip id (0xb5)

@yusuhua
Copy link
Author

yusuhua commented Jan 5, 2025

For comparison, I built a firmware with BOARD_VARIANT=SPIRAM_OCT and found that the screen display was fine, but the touch was still the same as without BOARD_VARIANT=SPIRAM_OCT. The last version with BOARD_VARIANT=SPIRAM_OCT yesterday also had no problem with touch.

@kdschlosser
Copy link
Collaborator

do a hard reset and see if the error persists. I don't know if I have everything sorted out yet with the soft resets.

@kdschlosser
Copy link
Collaborator

I think I found the problem. Go ahead and give it another try and see if it works.

@yusuhua
Copy link
Author

yusuhua commented Jan 6, 2025

Unfortunately that didn't change anything, I already did a hard reboot.

@kdschlosser
Copy link
Collaborator

I am going to have to add some debugging code so we can see what is happening.

@yusuhua
Copy link
Author

yusuhua commented Jan 8, 2025

After reverse the touch is fine, but the firmware without BOARD_VARIANT=SPIRAM_OCT build still cannot drive the display.
The phenomenon is that there is no error, the display is slightly white, and no widgets are displayed.

@kdschlosser
Copy link
Collaborator

That's because you don't have octal spiram you only have quad spiram.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants