bitbank2 / bb_spi_lcd

SPI LCD/OLED library which can be built for Arduino and Linux
GNU General Public License v3.0
78 stars 13 forks source link

Errors trying to compile and run on ESP32 #14

Open rsiemens77 opened 5 months ago

rsiemens77 commented 5 months ago

I have my ST7789 LCD setup and working with my ESP32 board with the TFT_eSPI library. But, I want to support multiple displays, so without changing anything in my working hardware set up, I'm trying this library. But I'm having trouble getting it to work.

The first issue I encountered is that the parallel file does not compile. I get numerous errors, some of the most obvious are unknown types, such as:

lcd_cam_dev_t esp_lcd_i80_bus_handle_t

I noticed there's references to S3 in this file, is this perhaps only for S3? I removed references to the parallel API in the main file, and then I was able to compile. I'm only using SPI anyway.

But now I get an exception when trying to init, from this call:

spilcdInit(&lcd, LCD_ST7789, FLAGS_NONE, 40000000, -1, 21, 19, -1, -1, 22, 23);

0x400dd0a3: spilcdWriteCommand(tagSPILCD, unsigned char) at C:/exp/frameworks/esp-idf-v4.4.6/components/arduino/libraries/bb_spi_lcd/src/bb_spi_lcd.cpp:2909 0x400dd336: spilcdInit(tagSPILCD, int, int, int, int, int, int, int, int, int, int) at C:/exp/frameworks/esp-idf-v4.4.6/components/arduino/libraries/bb_spi_lcd/src/bb_spi_lcd.cpp:1951 ...

bitbank2 commented 5 months ago

Thanks for letting me know about the issues. The error you're getting is probably because of the changes I made for parallel. You should use the C++ API, not the C API. Try setting the lcd structure to 0's before calling spilcdInit(). I'll work on these 2 issues.

rsiemens77 commented 5 months ago

Thanks, I switched to BB_SPI_LCD class and did get that working and can fill and draw to lcd. I was following the spi_lcd_demo example. Are there any C++ examples?

I cannot display images however, so I created a separate issue for that.

bitbank2 commented 5 months ago

There are 3 c++ examples: UNO_shield_demo atoms3_gif parallel_shield_demo You can also look at the Wiki of this repo for details about all of the class methods.

Did clearing the C structure to 0 before calling spilcdInit() work?

rsiemens77 commented 5 months ago

I'm using the C++ api now as you suggested, but I went back and tried C for you. Yes, I could start if I initialize to 0.

There's no wiki tab on this repository, I took a look on your other repository JPEGDEC: that has one.

bitbank2 commented 5 months ago

ooh - you're right about the lack of Wiki. I haven't given this repo as much attention because it seemed like few people were using it. I'll correct that shortly.

rsiemens77 commented 4 months ago

I gather it's few people are using it, because you haven't paid much attention to it. It doesn't compile on the most common ESP32 platform, and when hacked to make it compile it has runtime bugs.

bitbank2 commented 4 months ago

Open Source projects are unfortunately on hobby time because I have a family to feed. When someone pays me to make this higher priority it will get faster fixes. It works for my projects on my copy of the repo. I would really like for people to use this code instead of TFT_eSPI which is excessively awful for newbies because of its dumb .H file config. The problem is that I'm not independently wealthy, so priorities shift to where I will get paid.

bitbank2 commented 4 months ago

I pushed a fix, please give it a try.

guedesite commented 3 months ago

Hi @rsiemens77, I'm in the same situation as you are. I would like to use these libraries. Do they work properly now? Have you noticed a significant performance gain?

rsiemens77 commented 3 months ago

Hi, @guedesite. From what I can tell, this is only being used on ESP32 S3. If that is your platform, you may have some success. It clearly has not been tested on standard ESP32 as it doesn't even compile on that platform, and looking at the code history, it looks like that has been the situation for a long time.

Not sure by what you mean about performance gain, that wasn't my aim in using this. I like the design model better than other libraries, as theoretically you should be able to use multiple LCD with this. I never got to the point to test if DMA is supported on ESP32 with this library. I switch to a library where I have DMA updates working now.

guedesite commented 3 months ago

I was disappointed, but I still gave it a shot, and surprise... the compilation went smoothly, the demo runs without any issues on an unofficial esp32-wroom-UE 16N, well done! Despite the lack of a wiki, I find it much simpler and easier to use with a basic understanding of coding compared to TFT_eSPI, which I think is too heavy for certain applications. It's exactly what I needed.