Closed cgandrewdev closed 2 years ago
The new ESP32-C3 is not currently supported. Today I received an ESP32-S2 board so will be working on adapting the library for that processor, maybe the C3 will then work too.
As you note the issue seems to be SPI port references.
Thanks very much! I'll be happy to do testing when ready.
The library has been updated for the ESP32 S2 processor variant, the changes may also work with the C3 but this is untested and I do not have a C3 board.
There is a post from Twitter maybe useful: https://twitter.com/martinfasani/status/1386019656016728068?s=20
Thanks for doing the work on the S2.
I have finally been able to get some time to look at this. I noted that ESP32 Arduino board package 2.0.0 is required per the notes, so I reinstalled with GIT etc. per the instructions here: https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html
I have Arduino 1.8.16,
The first test, with no dev module plugged in, was to set the target board to ESP32S2 Dev Module and just do a compile, and that worked just fine.
Then I switched to ESP32C3 Dev Module and tried to recompile but I get a similar list of errors as before. This is without any dev module plugged in at all, just compiling for the C3 dev module as the target. You mentioned that you didnt have a C3 dev module but errors I am getting exist without even a dev module plugged in, just by changing to the C3 module as target.
I have attached the error list if that helps any.
If I selected S2 Dev Module and compiled and tried to upload to the C3 module anyway it wont because it knows I have a C3 Module. I am not sure what else I can do to from here. Thoughts?
#define REG_SPI_BASE(i) (DR_REG_SPI2_BASE + (((i)>3) ? (((i-2) 0x1000) + 0x10000) : ((i - 2) 0x1000 )))
===================================================================
The compile problem is caused by bugs and inconsistencies in the IDF for the ESP32C3.
I have added some patches to the latest Github master.
The examples compile OK now but I have not tested the library on the ESP32C3 as I do not have one!
The compile problem is caused by bugs and inconsistencies in the IDF for the ESP32C3.
I have added some patches to the latest Github master.
The examples compile OK now but I have not tested the library on the ESP32C3 as I do not have one!
Hello, I use your latest library to run on ESP32C3 and drive the ST7789 display screen, but it does not work properly. I use oscilloscope to measure the pin and find no SPI signal output.
Thanks for your information. I think we can say the C3 is currently unsupported. I may get a C3 at some point to figure out what is happening.
I recently got the c3 working with https://github.com/PaulStoffregen/XPT2046_Touchscreen. I published an article about it https://www.gabrielcsapo.com/arduino-esp32-c3-32s-ili9341-with-touchscreen/. My next step is getting this library to work with it. @Bodmer if you need a test chip DM me and I can send you one.
I can get the touchscreen to respond, but no dice on any TFT output.
[code]
TFT_eSPI ver = 2.4.2
Processor = ESP32
Frequency = 80MHz
Transactions = Yes
Interface = SPI
Display driver = 9341
Display width = 240
Display height = 320
MOSI = GPIO 6
MISO = GPIO 5
SCK = GPIO 4
TFT_CS = GPIO 7
TFT_DC = GPIO 8
TFT_RST = GPIO 1
TOUCH_CS = GPIO 2
Font GLCD loaded
Font 2 loaded
Font 4 loaded
Font 6 loaded
Font 7 loaded
Font 8 loaded
Smooth font enabled
Display SPI frequency = 2.50
Touch SPI frequency = 2.50
[/code]
The problem with the C3 variant is likely to do with the SPI configuration. I do not have an ESP32 C3 so am unable to test any changes. At the moment the C3 is no supported. If you can figure out what the problem is then do let me know.
FSPI=0 HSPI=1
Looking at debugging this further tonight.
If anyone has a c3 and wants to help figure this out https://github.com/Bodmer/TFT_eSPI/pull/1586 I have a draft PR opened to collaborate.
The library uses register level access to the SPI registers. Looking at the ESP32 board package I see the C3 requires extra code before triggering the transmit. At the moment the library does not have this, so that is likely to be the problem: https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-spi.c#L734-L737
Thanks @Bodmer , I will look into this.
@Bodmer I have added this https://github.com/Bodmer/TFT_eSPI/pull/1586/commits/92668553f4d8082e5da38af7aea170c9b6227d79 which seems to do exactly what the lines you sent do. Still no dice.
Hi I have been successfully using the TFT_eSPI library on an ESP32 WROOM dev kit in conjunction with an ST7789 based SPI TFT LCD 240x240 module in the Arduino UI. The library works really well, thank you.
I have switched to a newer dev kit, the ESP32-C3-WROOM-02 dev kit which uses the newer C3 module. But I have not been able to compile the example project, for example the Read_User_Setup project. It compiles and runs fine when I set the Board to ESP32 Dev Module but as soon as I change the board to ESP32C3 Dev Module and change the port and recompile, I get pages full of errors:
... and so on, I would have attached the full output as a file but I might not be able to add files.
I am not sure where to start, the errors seem to be SPI related. I have been looking at the specifications for the C3 module and found that it has three SPI ports SPI0, SPI1, and SPI2, only SPI2 is configurable as general purpose SPI. I dont really know what I should be doing to solve this.
If anyone has any advice it would be much appreciated! Thanks