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

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

×