1k views
in Platform Packages by
Hi all,

I use an esp32 pico d4 and a display controlled by ili9341 and it got a touch driver xpt 2046, my question is, anybody had an example that work with the xpt2046?

Many thanks

Michele

1 Answer

0 votes
by

Hello Michele,

you can have a look into the Build Environment for STM32F407-Discovery, there you will find a driver for XPT2046 via SPI (/TargetSpecific/Drivers).

This can serve as template for you.

I hope this helps...

Best regards,

Manfred.

 

by
Hi Manfred,

many thanks for your quick answer really appreciated

Regards

 

Michele
by

Based on Build Environment for STM32F407-Discovery i have implemented the touch screen, but the system panic when I touch the screen.

I have previously tested the touch in a separate project with the same version of IDF to be sure.

In my HW configuration I use the same SPI master controller (HSPI_HOST) as the display for touch: .
Is it necessary to protect spi transactions in some way (for example with mutex)?

 

Regards

Antonello

by

Do you get any error message on the console - then it might be more clear what the system panic causes.

Best regards,

Manfred.

by

Hi Manfred,

this is what I see on the console:
 

Initialize Touch Driver...                   I (1252) gpio: GPIO[33]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
[not supported]
Initialize Memory Manager...                 [OK]
Initialize Graphics Engine...                [OK]
Create Embedded Wizard Root Object...        [OK]
Create Embedded Wizard Viewport...           [OK]
I (1272) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:3
Starting Embedded Wizard main loop - press <p> to shutdown application...
---------------------------------------------
Target system                                ESP-WROVER-KIT
Color format                                 RGB565
MemoryPool address                           0x3FFB9420
MemoryPool size                              81920 bytes
Scratch-pad buffer address                   0x3FFB1284
Scratch-pad buffer size                      12800 pixel
Framebuffer size                             320 x 40
EwScreeenSize                                320 x 240
Graphics accelerator                         none
Vector graphics support                      enabled
Warp function support                        enabled
Index8 bitmap resource format                enabled
RGB565 bitmap resource format                enabled
Bidirectional text support                   enabled
Operating system                             FreeRTOS
Toolchain                                    GCC
C-Compiler version                           8.2.0
Build date and time                          Mar  6 2020, 16:28:01
Runtime Environment (RTE) version            9.30
Graphics Engine (GFX) version                9.30
Max surface cache size                       0 bytes
Glyph cache size                             128 x 128
Max issue tasks                              40
Surface rotation                             0
---------------------------------------------
XPT2046_ReadTouchPos: pinState = 0
Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x3ffcf710  PS      : 0x00060031  A0      : 0x80083140  A1      : 0x3ffb0640
A2      : 0x3ffd1364  A3      : 0x3ffcf690  A4      : 0x800d22a7  A5      : 0x3ffcfe70
A6      : 0x00000000  A7      : 0x3ffcfe90  A8      : 0x80082f8c  A9      : 0x3ffb0610
A10     : 0x3ffcf690  A11     : 0x3ffcf6b0  A12     : 0x00000012  A13     : 0x3ffcfe60
A14     : 0x00000003  A15     : 0x00060b23  SAR     : 0x00000013  EXCCAUSE: 0x00000014
EXCVADDR: 0x3ffcf710  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000
Core 0 was running in ISR context:
EPC1    : 0x3ffcf710  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x00000000

ELF file SHA256: ets Jun  8 2016 00:22:57

rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:7112
load:0x40078000,len:14076
load:0x40080400,len:4352
entry 0x400806ec

Best regards,

Antonello

by
Hi Antonello,

difficult to give you good advices here... I never tried this. If touch and display works independent and the system panic happens only when using both in parallel, there must be some conflicts when using the same SPI master controller (HSPI_HOST).

Maybe some ESP32 forums are the better source to get information about sharing the SPI master controller between display and touch.

Best regards,

Manfred.
by
Hi Antonello,

any success in having touch in working ?

can you share your ew_bsp_touch.c ?

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...