Jump to content

Running µGFX on ESP32 and Arduino IDE


Paul Christopher

Recommended Posts

See https://community.ugfx.io/topic/921-errors-into-compile-ili9341-driver-for-arduino/?tab=comments#comment-6704

and for the sake of documentation for other users: If you want to run µGFX on an ESP32 and Arduino IDE, you need to enable as OS "FreeRTOS" and not "Arduino":

#define GFX_USE_OS_FREERTOS	TRUE
#define GFX_OS_NO_INIT 		TRUE

You might get a compiler error that "FreeRTOSConfig.h" cannot be found. Something seems to be wrong with the include paths, see https://github.com/espressif/arduino-esp32/issues/1423

In "gos_freertos.h", change the includes as follows:

#include "freertos/FreeRTOS.h"
#include "freertos/FreeRTOSConfig.h"
#include "freertos/semphr.h"
#include "freertos/task.h"

Then it should compile.

 

Link to comment
Share on other sites

Note you should only set GFX_USE_OS_FREERTOS if you really are using the FreeRTOS operating system.

The problem with the paths is caused by the Arduino IDE itself. Normally you will add the FreeRTOS directory to the compiler include path. The Arduino IDE doesn't support that and uses a crazy "library module" scheme hence requiring changes to the sources that are different to every other compiler. Whether there is some way to fool it or not is another matter - I haven't had time to investigate in enough detail.

Link to comment
Share on other sites

Hi inmarket and thank you for the quick reply. See http://esp-idf.readthedocs.io/en/latest/api-guides/freertos-smp.html . The ESP32 (based on a Tensilica Xtensa LX6 processor) seems to really run a FreeRTOS based operating system. I will further test this and report the results here. Otherwise there seems to be no way to run µGFX on the ESP32 since there is no setjmp available (which is also considered incompatible with the freertos approach). Or do I miss something?

Link to comment
Share on other sites

  • 5 months later...
  • 1 year later...

I would love to try this library but it seems to have a rather steep learning curve.

Hope to be using this lib, most popular one I found (bodmer TFT_eSPI) is not async proof and does not support multiple displays.

The ArduinoIDE_ESP32_ILI9341.zip project looks very promising since this is precisely the hardware I'm using. However, the file was removed. Can anybody get hold of it?

Thanks!

Link to comment
Share on other sites

On 29/02/2020 at 01:36, Ronald Wijnsema said:

I would love to try this library but it seems to have a rather steep learning curve.

We're happy to help where we can - don't hesitate to ask on the forum.

 

On 29/02/2020 at 01:36, Ronald Wijnsema said:

However, the file was removed. Can anybody get hold of it?

I assume you're referring to the attachment of a few posts above yours? I had no issues downloading it. I've re-attached it to this post. Let me know if the issue persists.ArduinoIDE_ESP32_ILI9341.zip

Link to comment
Share on other sites

  • 1 month later...

So it seems the very basic system is working but nothing else. 

I have the config file setup correctly and I can draw shapes, etc on the screen. Making a call to the below causes a core panic.

//with defines
#define   textColor    HTML2COLOR(0x001f2b)
font_t font = gdispOpenFont("UI2");

//in setup
gdispGDrawString(0,20,20,"TEST",font,textColor);

//These work in setup
gdispFillArea(0, 0, 320, 240, mainBackground);
gdispFillArea(0, 0, 320, 40, menuActive);
gdispDrawLine(0,40,320,40, menuOutline);

 

Also trying to use the GWIN module needs the GINPUT module and that fails. I'm far from figuring that out but it's only worth the effort if I can get the text to draw. 

 

Maybe I have a false understanding of uGFX. 

I would like to make some widgets on the screen that I can move and update from code. I'd like to handle the navigation on my own and be able to highlight areas, etc. Why do I require GINPUT to use GWIN?

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...