Arduino_GFX icon indicating copy to clipboard operation
Arduino_GFX copied to clipboard

Unknown operation id with esp32 and st7735 displays

Open XanCraft21 opened this issue 2 years ago • 12 comments

Hello. I really love this library for it’s speed and capabilities, but there is a small problem. When using esp32, if i use any of the st7735 display drivers, something strange happens. If i open the serial monitor and reset the board, after the boot info will say “unknown operation id at” then some numbers. This also affects the display somehow, making it seem brighter and it doesn’t work correctly, like if i keep the screen all black and have an animated image, sometimes there will be a ghost image left behind, it’s very faint and is hard to get rid of unless i let it rest for a while. If you can investigate this problem and find a solution, i will really appreciate that. Thank you.

XanCraft21 avatar Jul 26 '22 18:07 XanCraft21

seems it is caused by read flash data corruption. may be lower the flash speed or provide a better power source.

moononournation avatar Jul 26 '22 23:07 moononournation

It only happens for st7735, other drivers work fine. And other libraries i can use work fine as well. I am giving it the required 5v usb supply and i’ve never had problems with the flash speed before. I will try lowering the speed and see what happens, but i think there might be a hard to spot bug in the code with an easy fix.

XanCraft21 avatar Jul 27 '22 06:07 XanCraft21

if only happen in ST7735, what is the SPI speed?

moononournation avatar Jul 27 '22 06:07 moononournation

The absolute maximum i can make the display run without malfunction, 40mhz (actually 39999999 because Arduino is weird). Even with this problem the display seems to run ok with an unusual brightness and occasional ghosting from power down. I believe the problem is only during the initialization of the display within the cpp file in the library, although every other function works fine.

XanCraft21 avatar Jul 27 '22 06:07 XanCraft21

I remember the max speed for ST7735 should be 27000000, you may test it again with this setting.

moononournation avatar Jul 27 '22 07:07 moononournation

The current issue is still there. I lowered the spi speed and the errors in Serial are still there. I even tried lowering the flash speed on the esp32. Any other ideas you have?

XanCraft21 avatar Jul 27 '22 07:07 XanCraft21

I never seem the error message “unknown operation id at” and google no result. So I don't know where the message come from...

moononournation avatar Jul 27 '22 07:07 moononournation

That is very strange. I even tried a different controller and still got the same errors. I can only assume the latest version of the esp32 core has a compatibility issue with some libraries. Thank you for your help. I will try my best to work around these errors. I will leave this post open in case other members have had the same problem as i did.

XanCraft21 avatar Jul 27 '22 07:07 XanCraft21

is it any problems when you run PDQgraphicstest with ST7735?

moononournation avatar Jul 27 '22 07:07 moononournation

Sadly yes. Like i said up above I believe the esp32 core has compatibly errors. And about the ghosting issue is best visible on an IPS display. It also happens with other controllers even though there are no error messages.

XanCraft21 avatar Jul 27 '22 08:07 XanCraft21

I am also using ST7735, I just checked with latest arduino-esp32 without any problems.image

moononournation avatar Jul 27 '22 08:07 moononournation

Ok. I am not sure why i am the only one with this problem. I will wait and see what happens over time. Thank you once again for your help.

XanCraft21 avatar Jul 27 '22 08:07 XanCraft21

Hello, I have encountered the same problem on the same equipment, and the fault is in this part.

gfx->begin(); gfx->fillScreen(BLACK); Serial.println("GFX BEGIN"); gfx->setCursor(10, 10); gfx->setTextColor(RED); gfx->println("Hello World!");

411956158 avatar Aug 13 '22 13:08 411956158

whats mean you have same problem? you also see “unknown operation id at” ?

moononournation avatar Aug 13 '22 14:08 moononournation

Yes, as shown in the figure below.(/_\)4540b0d4e82cb138.png

411956158 avatar Aug 13 '22 16:08 411956158

I think i might know the reason to the unknown operation id bug. In the file st7735 . cpp inside the folder display, the init commands are different to the other displays, there is no full init command list and only a gamma adjustment. That adjustment might have been conflicting with a bug in the latest expressif esp32 arduino package. There is also another problem, because there are no init commands like the ones used in other displays like st7789 . cpp, the display is over saturated and seems brighter. Using the same display with a different library does not have this problem. There is also a faint ghosting with ips display with the st7735 driver, like the 0.96 inch 80x160 display. Even with these bugs i still love using this library since it has the most display chip support and good controller support.

XanCraft21 avatar Aug 13 '22 20:08 XanCraft21

I made many attempts but failed to get the screen to display the content. The serial port can print the correct benchmark information, and I can observe that the screen has undergone a series of refreshes, but there is no display content. Here is my configuration.

#define GFX_BL 39 
#define TFT_RST 42

Arduino_DataBus *bus = new Arduino_ESP32PAR8(41/*TFT_DC*/, 40/*TFT_CS*/, 9 /* WR */, 10 /* RD */, 0 /* D0 */, 1 /* D1 */, 2 /* D2 */, 3 /* D3 */, 4 /* D4 */, 5 /* D5 */, 6 /* D6 */, 7 /* D7 */);

Arduino_GFX *gfx = new Arduino_ST7735(bus, TFT_RST, 0 /* rotation */, false /* IPS */, 128 /* width */, 128 /* height */, 0 /* col offset 1 */, 32 /* row offset 1 */,true);

When I don't change the data bus, I only change the chip selection to any chip except ST7735, although it can't be displayed, the serial no longer outputs error messages. Incidentally, I'm sure the mistake happened in this step. When I reduced the speed to 2000000, the error still existed.

gfx->begin();

411956158 avatar Aug 14 '22 09:08 411956158

The mentioned code is related to #149 , may be I try to align this to other display class

moononournation avatar Aug 14 '22 09:08 moononournation

Please help to get update and check if the latest code can fix your problems.

moononournation avatar Aug 14 '22 10:08 moononournation

Thank you very much for your willingness to devote so much time and energy to my problem, but unfortunately, the mistake is the same as before.

411956158 avatar Aug 14 '22 11:08 411956158

It is worth adding that I noticed that you seem to be using SPI mode in the photos you sent, while my screen is 8-8bit parallel.

411956158 avatar Aug 14 '22 12:08 411956158

I just removed the gamma adjustment in the ST7735 file and the error disappeared. Although the program worked normally, it was strange that my screen didn't display correctly.

411956158 avatar Aug 16 '22 11:08 411956158

please check is it a latest code is work for you

moononournation avatar Aug 17 '22 10:08 moononournation

So far for me it is still the same. The display colors are probably improved but the ips displays still have the faint ghosting and the unknown operation error is still there.

XanCraft21 avatar Aug 18 '22 00:08 XanCraft21

any pictures?

moononournation avatar Aug 18 '22 00:08 moononournation

I do not have them ready at this time but i will take some soon. Thank you.

XanCraft21 avatar Aug 18 '22 00:08 XanCraft21

I have found another clue about this situation. Under arduino_databus . cpp in the function batch operation, it will print out the error “unknown operation is at” with some numbers if it finds an invalid code. Something in the st7735 drivers is affecting that function. Maybe if the gamma adjustment is removed and the initialization code from the tft_espi st7735 were used instead might fix the problem.

XanCraft21 avatar Aug 22 '22 14:08 XanCraft21

this error should already fixed in latest code. please download latest code to test again.

moononournation avatar Aug 22 '22 14:08 moononournation

In my case the problem is still there, and i feel like it will never get fixed. I will soon close this issue. Thank you for the help you were able to give me.

XanCraft21 avatar Aug 29 '22 18:08 XanCraft21

I’m very sorry for being late to come back to this. I thought this was not going to get fixed, but i was wrong. With the newest update the unknown operation error has been fixed and the displays bugs i found are also fixed. Sorry for being impatient, thank you for your help.

XanCraft21 avatar Sep 17 '22 05:09 XanCraft21