Jump to content
Paul Christopher

Running µGFX on ESP32 and Arduino IDE

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.

 

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Hi, 

 

I was able to get this working (on VSPI, since thats what mine is hardwired to) by adding 

SPIClass SPI2(VSPI);

I then changed all SPI to SPI2 and all HSPI to VSPI. File attached incase this helps anyone else. 

board_ILI9341.cpp

Edited by craigzyc

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...