ILI9341 not working

damian_py
Posts: 4
Joined: Tue Oct 24, 2017 7:29 am

ILI9341 not working

Postby damian_py » Tue Oct 24, 2017 9:19 am

Hi everyone,

I have spent the last two weeks on trying to use the ILI9341 SPI display.

Neither the Loboris TFT driver nor other works. They all work perfectly on ESP Wrover kit, but do not work on ESP32 Wroom kit. I tried different pin configuration and changed the code, but none of them worked.

Does anyone has a tested driver on ILI9341 display? I ordered 4 displays like this one, it works on none of them.
https://www.amazon.fr/Hiletgo-%C3%A9cran-240-320-Ili9341-51-Stm32/dp/B01CZL6QIQ/ref=sr_1_1?ie=UTF8&qid=1508836654&sr=8-1&keywords=ili9341

Thank you for your help.

User avatar
loboris
Posts: 386
Joined: Wed Dec 21, 2016 7:40 pm

Re: ILI9341 not working

Postby loboris » Wed Oct 25, 2017 7:15 am

I've tested the library on a similar board (only with touch panel) and there was no problem.
Can you be more specific about what exactly does not work?
You have to connect +5V to display's Vcc or to short the jumper J1 and connect Vcc to +3.3V.
Of course, you also have to connect LED pin to +5V.

Zwegogo
Posts: 7
Joined: Wed Oct 25, 2017 2:51 pm

Re: ILI9341 not working

Postby Zwegogo » Wed Oct 25, 2017 2:56 pm

Hi,

I am also trying to hook-up my Esp32 to the ILI9341

I am trying to build and flash the ESP32_TFT_library to my ESP32, but i am getting the same error over and over. (i am on windows 10 and using Mingw32). I have the latest version of the esp-idf from git and also your latests update of the ESP32_TFT_library. Why am i getting this error and how to fix this?
Attachments
171025_error_message.png
171025_error_message.png (91.51 KiB) Viewed 1187 times

damian_py
Posts: 4
Joined: Tue Oct 24, 2017 7:29 am

Re: ILI9341 not working

Postby damian_py » Wed Oct 25, 2017 6:05 pm

Hi Loboris,

Thank you for your answer. In fact it was just that I had not pulled the reset pin to +3.3V. Now it works.
Currently my problem is driving the ESP23S17. Do you have a library for this SPI chip?

Thank you,

Damian

User avatar
loboris
Posts: 386
Joined: Wed Dec 21, 2016 7:40 pm

Re: ILI9341 not working

Postby loboris » Thu Oct 26, 2017 7:40 am

Zwegogo wrote:I am also trying to hook-up my Esp32 to the ILI9341

It is caused by the latest changes in esp-idf.
For now, just comment the line 836 in components/spiffs/spiffs_vfs.c
The fix will be pushed soon (I'm working on some other changes too).

User avatar
loboris
Posts: 386
Joined: Wed Dec 21, 2016 7:40 pm

Re: ILI9341 not working

Postby loboris » Thu Oct 26, 2017 7:44 am

damian_py wrote:Hi Loboris,

Thank you for your answer. In fact it was just that I had not pulled the reset pin to +3.3V. Now it works.
Currently my problem is driving the ESP23S17. Do you have a library for this SPI chip?

Thank you,

Damian

I've never heard of ESP23S17 and can't find any info on it.

Zwegogo
Posts: 7
Joined: Wed Oct 25, 2017 2:51 pm

Re: ILI9341 not working

Postby Zwegogo » Thu Oct 26, 2017 8:17 am

loboris wrote:
Zwegogo wrote:I am also trying to hook-up my Esp32 to the ILI9341

It is caused by the latest changes in esp-idf.
For now, just comment the line 836 in components/spiffs/spiffs_vfs.c
The fix will be pushed soon (I'm working on some other changes too).



Thank you Loboris, that did the trick!

damian_py
Posts: 4
Joined: Tue Oct 24, 2017 7:29 am

Re: ILI9341 not working

Postby damian_py » Fri Oct 27, 2017 12:50 pm

Sorry, I was thinking about MCP23S17 by microchip, the SPI equivalent of the MCP23017.
http://ww1.microchip.com/downloads/en/DeviceDoc/20001952C.pdf

Zwegogo
Posts: 7
Joined: Wed Oct 25, 2017 2:51 pm

Re: ILI9341 not working

Postby Zwegogo » Tue Nov 21, 2017 10:20 am

Hi Loboris,

I am trying to combine the SD card example code (included in the esp-idf) with the ili9341 TFT library to display my images to the screen from the SD-card. I had the SD card example working both in SPI mode and SDMMC mode, but want to use the SPI mode, because it takes up less connections and components for my final setup. I have searched, but haven't found an example anywhere that combines your tft library with an SD-card. So therefore i wanted to combine the code myself. When i want to make all , i get the error messages below, saying that the SPI libaries of the sd_card example collide with the SPI_loboris libaries of the TFT. What can i do to fix this? Or is there another way to use an SD-card with your library so I can load the images from the SD-card on to the TFT screen?

Regards,

Stefan

$ make app
CC build/main/main.o
In file included from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_master.h:23:0,
from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/sdspi_host.h:22,
from C:/msys32/home/stefan/esp/esp-idf/components/fatfs/src/esp_vfs_fat.h:21,
from C:/msys32/home/stefan/esp/sns_proto/main/sd_card.h:15,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:36:
C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_common.h:40:5: error: redeclaration of en umerator 'SPI_HOST'
SPI_HOST=0, ///< SPI1, SPI
^
In file included from C:/msys32/home/stefan/esp/sns_proto/components/tft/tftspi.h:11:0,
from C:/msys32/home/stefan/esp/sns_proto/main/images_1.h:25,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:35:
C:/msys32/home/stefan/esp/sns_proto/components/spidriver/spi_master_lobo.h:42:5: note: previous definition of 'S PI_HOST' was here
SPI_HOST=0, ///< SPI1, SPI; Cannot be used in this driver!
^
In file included from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_master.h:23:0,
from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/sdspi_host.h:22,
from C:/msys32/home/stefan/esp/esp-idf/components/fatfs/src/esp_vfs_fat.h:21,
from C:/msys32/home/stefan/esp/sns_proto/main/sd_card.h:15,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:36:
C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_common.h:41:5: error: redeclaration of en umerator 'HSPI_HOST'
HSPI_HOST=1, ///< SPI2, HSPI
^
In file included from C:/msys32/home/stefan/esp/sns_proto/components/tft/tftspi.h:11:0,
from C:/msys32/home/stefan/esp/sns_proto/main/images_1.h:25,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:35:
C:/msys32/home/stefan/esp/sns_proto/components/spidriver/spi_master_lobo.h:43:5: note: previous definition of 'H SPI_HOST' was here
HSPI_HOST=1, ///< SPI2, HSPI
^
In file included from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_master.h:23:0,
from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/sdspi_host.h:22,
from C:/msys32/home/stefan/esp/esp-idf/components/fatfs/src/esp_vfs_fat.h:21,
from C:/msys32/home/stefan/esp/sns_proto/main/sd_card.h:15,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:36:
C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_common.h:42:5: error: redeclaration of en umerator 'VSPI_HOST'
VSPI_HOST=2 ///< SPI3, VSPI
^
In file included from C:/msys32/home/stefan/esp/sns_proto/components/tft/tftspi.h:11:0,
from C:/msys32/home/stefan/esp/sns_proto/main/images_1.h:25,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:35:
C:/msys32/home/stefan/esp/sns_proto/components/spidriver/spi_master_lobo.h:44:5: note: previous definition of 'V SPI_HOST' was here
VSPI_HOST=2 ///< SPI3, VSPI
^
In file included from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/sdspi_host.h:22:0,
from C:/msys32/home/stefan/esp/esp-idf/components/fatfs/src/esp_vfs_fat.h:21,
from C:/msys32/home/stefan/esp/sns_proto/main/sd_card.h:15,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:36:
C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_master.h:33:0: warning: "SPI_DEVICE_BIT_L SBFIRST" redefined
#define SPI_DEVICE_BIT_LSBFIRST (SPI_DEVICE_TXBIT_LSBFIRST|SPI_DEVICE_RXBIT_LSBFIRST); ///< Transmit and receive LSB first
^
In file included from C:/msys32/home/stefan/esp/sns_proto/components/tft/tftspi.h:11:0,
from C:/msys32/home/stefan/esp/sns_proto/main/images_1.h:25,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:35:
C:/msys32/home/stefan/esp/sns_proto/components/spidriver/spi_master_lobo.h:67:0: note: this is the location of t he previous definition
#define SPI_DEVICE_BIT_LSBFIRST (SPI_TXBIT_LSBFIRST|SPI_RXBIT_LSBFIRST); ///< Transmit and receive L SB first
^
In file included from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/sdspi_host.h:22:0,
from C:/msys32/home/stefan/esp/esp-idf/components/fatfs/src/esp_vfs_fat.h:21,
from C:/msys32/home/stefan/esp/sns_proto/main/sd_card.h:15,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:36:
C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_master.h:41:15: error: conflicting types for 'transaction_cb_t'
typedef void(*transaction_cb_t)(spi_transaction_t *trans);
^
In file included from C:/msys32/home/stefan/esp/sns_proto/components/tft/tftspi.h:11:0,
from C:/msys32/home/stefan/esp/sns_proto/main/images_1.h:25,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:35:
C:/msys32/home/stefan/esp/sns_proto/components/spidriver/spi_master_lobo.h:76:15: note: previous declaration of 'transaction_cb_t' was here
typedef void(*transaction_cb_t)(spi_lobo_transaction_t *trans);
^
In file included from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/sdspi_host.h:22:0,
from C:/msys32/home/stefan/esp/esp-idf/components/fatfs/src/esp_vfs_fat.h:21,
from C:/msys32/home/stefan/esp/sns_proto/main/sd_card.h:15,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:36:
C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_master.h:65:0: warning: "SPI_TRANS_MODE_D IOQIO_ADDR" redefined
#define SPI_TRANS_MODE_DIOQIO_ADDR (1<<4) ///< Also transmit address in mode selected by SPI_MODE_DIO/SPI_M ODE_QIO
^
In file included from C:/msys32/home/stefan/esp/sns_proto/components/tft/tftspi.h:11:0,
from C:/msys32/home/stefan/esp/sns_proto/main/images_1.h:25,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:35:
C:/msys32/home/stefan/esp/sns_proto/components/spidriver/spi_master_lobo.h:101:0: note: this is the location of the previous definition
#define SPI_TRANS_MODE_DIOQIO_ADDR (1<<2) ///< Also transmit address in mode selected by SPI_MODE_DIO/SPI_M ODE_QIO
^
In file included from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/sdspi_host.h:22:0,
from C:/msys32/home/stefan/esp/esp-idf/components/fatfs/src/esp_vfs_fat.h:21,
from C:/msys32/home/stefan/esp/sns_proto/main/sd_card.h:15,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:36:
C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_master.h:66:0: warning: "SPI_TRANS_USE_RX DATA" redefined
#define SPI_TRANS_USE_RXDATA (1<<2) ///< Receive into rx_data member of spi_transaction_t instead int o memory at rx_buffer.
^
In file included from C:/msys32/home/stefan/esp/sns_proto/components/tft/tftspi.h:11:0,
from C:/msys32/home/stefan/esp/sns_proto/main/images_1.h:25,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:35:
C:/msys32/home/stefan/esp/sns_proto/components/spidriver/spi_master_lobo.h:102:0: note: this is the location of the previous definition
#define SPI_TRANS_USE_RXDATA (1<<3) ///< Receive into rx_data member of spi_lobo_transaction_t instea d into memory at rx_buffer.
^
In file included from C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/sdspi_host.h:22:0,
from C:/msys32/home/stefan/esp/esp-idf/components/fatfs/src/esp_vfs_fat.h:21,
from C:/msys32/home/stefan/esp/sns_proto/main/sd_card.h:15,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:36:
C:/msys32/home/stefan/esp/esp-idf/components/driver/include/driver/spi_master.h:67:0: warning: "SPI_TRANS_USE_TX DATA" redefined
#define SPI_TRANS_USE_TXDATA (1<<3) ///< Transmit tx_data member of spi_transaction_t instead of data at tx_buffer. Do not set tx_buffer when using this.
^
In file included from C:/msys32/home/stefan/esp/sns_proto/components/tft/tftspi.h:11:0,
from C:/msys32/home/stefan/esp/sns_proto/main/images_1.h:25,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:35:
C:/msys32/home/stefan/esp/sns_proto/components/spidriver/spi_master_lobo.h:103:0: note: this is the location of the previous definition
#define SPI_TRANS_USE_TXDATA (1<<4) ///< Transmit tx_data member of spi_lobo_transaction_t instead of data at tx_buffer. Do not set tx_buffer when using this.
^
In file included from C:/msys32/home/stefan/esp/esp-idf/components/bt/bluedroid/include/bt_target.h:1829:0,
from C:/msys32/home/stefan/esp/esp-idf/components/bt/bluedroid/bta/include/bta_api.h:28,
from C:/msys32/home/stefan/esp/sns_proto/main/main.c:26:
C:/msys32/home/stefan/esp/esp-idf/components/bt/bluedroid/include/bt_trace.h:28:14: error: expected identifier o r '(' before string constant
#define TAG "BT"
^
C:/msys32/home/stefan/esp/sns_proto/main/sd_card.h:20:20: note: in expansion of macro 'TAG'
static const char *TAG = "example";
^
C:/msys32/home/stefan/esp/sns_proto/main/main.c: In function 'app_main':
C:/msys32/home/stefan/esp/sns_proto/main/main.c:177:35: error: 'card' undeclared (first use in this function)
sdmmc_card_print_info(stdout, card);
^
C:/msys32/home/stefan/esp/sns_proto/main/main.c:177:35: note: each undeclared identifier is reported only once f or each function it appears in
C:/msys32/home/stefan/esp/sns_proto/main/main.c:153:38: warning: unused variable 'mount_config' [-Wunused-variab le]
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
^
C:/msys32/home/stefan/esp/sns_proto/main/main.c:141:25: warning: variable 'slot_config' set but not used [-Wunus ed-but-set-variable]
sdspi_slot_config_t slot_config = SDSPI_SLOT_CONFIG_DEFAULT();
^
C:/msys32/home/stefan/esp/sns_proto/main/main.c:139:18: warning: unused variable 'host' [-Wunused-variable]
sdmmc_host_t host = SDSPI_HOST_DEFAULT();
^
make[1]: *** [/home/stefan/esp/esp-idf/make/component_wrapper.mk:243: main.o] Error 1
make: *** [C:/msys32/home/stefan/esp/esp-idf/make/project.mk:434: component-main-build] Error 2

User avatar
loboris
Posts: 386
Joined: Wed Dec 21, 2016 7:40 pm

Re: ILI9341 not working

Postby loboris » Tue Nov 21, 2017 5:16 pm

Zwegogo wrote:Hi Loboris,

I am trying to combine the SD card example code (included in the esp-idf) with the ili9341 TFT library to display my images to the screen from the SD-card. I had the SD card example working both in SPI mode and SDMMC mode, but want to use the SPI mode, because it takes up less connections and components for my final setup. I have searched, but haven't found an example anywhere that combines your tft library with an SD-card. So therefore i wanted to combine the code myself. When i want to make all , i get the error messages below, saying that the SPI libaries of the sd_card example collide with the SPI_loboris libaries of the TFT. What can i do to fix this? Or is there another way to use an SD-card with your library so I can load the images from the SD-card on to the TFT screen?

Regards,

Stefan


Thank you for reporting the issue, I'll check it and try to fix it.

Who is online

Users browsing this forum: No registered users and 1 guest