Ili9488 3.5 low fps high cpu, hspi, and touch finetuning

Description

after a lot of tries i managed to make ili9488 3.5 480x320 to work.

My first problem for is that i have enabled the autoscroll of the demostration and it was slow the fps is clearly not good. it is 7FPS and 98-100% CPU all the time. Without autoscroll we are fine though

What MCU/Processor/Board and compiler are you using?

ili9488 / ESP32 / ESP32-DEVKTC32VE v4 / ESP-IDF v4.4.2-dirty

What have you tried so far?

I am using a ESP32-DEVKTC32VE v4 ,

I managed to make working with VSPI only when i used HSPI screen is not responding is just white.

It is clear that 40Mhz for spi speed is the best if i make it lower it is then refreshing screen by screen and 80Mhz is just black screen.

I am very new and i do not really understand how to change and manipulate things like the buffers though i have read everything in docs.lvgl.io before the widgets section.

I loaded the sample only (which means that i am far from making my first program). the touch which is still resisting, it works it gives signal but i can not find the proper setup between swap and invert of the axes for a landscape setup, so touch does whatever now

So from this topic there are a lot o things that someone can guide.

  1. FPS and CPU ( from another topic i had the idea for this size of screen everything would have been great even at the example). Is animation the only problem?
  2. HSPI usage can i use it in general cause it gives data for touch but not for the screen
  3. touch X2046 is what the screen has ,it works with HSPI when i have VSPI used in tft but i whould like to use the same bus with different CS. From the datasheet i saw that each bus has 3 CS but only the CS0 is listed as pin.
    Also touch issue is that data do not much

Ido not see the pattern. Scroll work in proper landscape direction if i swap xy but the location do not much to any other widget.
no swap, no invert :

center: 		x=121 ,	y=89
top left: 		x=220, 	y=146
bottom left: 	x= 223, 	y=20
top right: 		x=20, 	y=143
bottom right: 	x=16. 	y=15

swap xy, no invert

center: 		x=136 ,	y=74
top left: 		x=221, 	y=150
bottom left: 	x=40, 	y=140
top right: 		x=105, 	y=84
bottom right: 	x=15. 	y=59

swap xy, all invert

center: 		x= 349,	y=240
top left: 		x=280, 	y=171
bottom left: 	x=465, 	y=168
top right: 		x=268, 	y=306
bottom right: 	x=462. 	y=305
  1. Is there any better step by step guide on how to really make your own project, i am reading about the ticks and all these staff but for someone that it is not familiar with screens and tries to start with this a better analytical guide where explanation exists would have been great

Code to reproduce

Add the relevant code snippets here.

The code block(s) should be between ```c and ``` tags:

I (27) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (27) boot: compile time 19:40:22
I (27) boot: chip revision: 3
I (31) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (38) boot.esp32: SPI Speed      : 40MHz
I (42) boot.esp32: SPI Mode       : DIO
I (47) boot.esp32: SPI Flash Size : 8MB
I (51) boot: Enabling RNG early entropy source...
I (57) boot: Partition Table:
I (60) boot: ## Label            Usage          Type ST Offset   Length
I (68) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (75) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (83) boot:  2 factory          factory app      00 00 00010000 00100000
I (90) boot: End of partition table
I (94) boot_comm: chip revision: 3, min. application chip revision: 0
I (101) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=0e5a4h ( 58788) map
I (131) esp_image: segment 1: paddr=0001e5cc vaddr=3ffb0000 size=01a4ch (  6732) load
I (134) esp_image: segment 2: paddr=00020020 vaddr=400d0020 size=492c0h (299712) map
I (245) esp_image: segment 3: paddr=000692e8 vaddr=3ffb1a4c size=00af0h (  2800) load
I (247) esp_image: segment 4: paddr=00069de0 vaddr=40080000 size=0d014h ( 53268) load
I (273) esp_image: segment 5: paddr=00076dfc vaddr=50000000 size=00010h (    16) load
I (280) boot: Loaded app from partition at offset 0x10000
I (280) boot: Disabling RNG early entropy source...
I (293) cpu_start: Pro cpu up.
I (294) cpu_start: Starting app cpu, entry point is 0x400811b0

I (0) cpu_start: App cpu up.
I (310) cpu_start: Pro cpu start user code
I (310) cpu_start: cpu freq: 160000000
I (310) cpu_start: Application information:
I (314) cpu_start: Project name:     lvgl-demo
I (320) cpu_start: App version:      v2.0-65-gc192eac
I (325) cpu_start: Compile time:     Oct 28 2022 17:43:05
I (331) cpu_start: ELF file SHA256:  6bef08bb4fd88e7e...
I (337) cpu_start: ESP-IDF:          v4.4.2-dirty
I (343) heap_init: Initializing. RAM available for dynamic allocation:
I (350) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (356) heap_init: At 3FFBB7D8 len 00024828 (146 KiB): DRAM
I (362) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (369) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (375) heap_init: At 4008D014 len 00012FEC (75 KiB): IRAM
I (382) spi_flash: detected chip: generic
I (386) spi_flash: flash io: dio
I (391) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (40) lvgl_helpers: Display hor size: 480, ver size: 320
I (40) lvgl_helpers: Display buffer size: 19200
I (40) lvgl_helpers: Initializing SPI master for display
I (50) lvgl_helpers: Configuring SPI host VSPI_HOST (2)
I (60) lvgl_helpers: MISO pin: 19, MOSI pin: 23, SCLK pin: 18, IO2/WP pin: -1, IO3/HD pin: -1
I (60) lvgl_helpers: Max transfer size: 57600 (bytes)
I (70) lvgl_helpers: Initializing SPI bus...
I (80) disp_spi: Adding SPI device
I (80) disp_spi: Clock speed: 40000000Hz, mode: 0, CS pin: 5
I (310) ILI9488: ILI9488 initialization.
I (640) ILI9488: Enabling backlight.
I (640) ILI9488: Display orientation: LANDSCAPE
I (640) ILI9488: 0x36 command value: 0x28

It normal. ESP32 cpu is slowly compared to MPU on you smart phone. Your smart phone CPU run at 1.2MHz or more, high speed and big RAM space but ESP32 run at 240MHz (only MCU, PSRAM, RAM run on APB max speed is 80MHz), RAM only have about 512 kB