Skip to content
Calvin Hass edited this page Feb 3, 2019 · 26 revisions

Overview >

Table of Contents

General Troubleshooting

  • Ensure that debug/error messages are enabled
    • In GUIslice_config.h: #define DEBUG_ERR 1
    • In user code: call gslc_InitDebug() and provide link to user-supplied character output function (eg. DebugOut(char ch)). See below for examples.

Enabling debug messages for Arduino

Define an output function:

  static int16_t DebugOut(char ch) { Serial.write(ch); return 0; }

Then, at the start of the initialization:

  Serial.begin(9600);  
  gslc_InitDebug(&DebugOut);

Enable the Serial Monitor in the Arduino IDE to show any Debug messages. It is very important to change the baud rate (selected at the bottom of the window) to match the Serial rate configured in the program with Serial.begin() (the examples use 9600). If the baud rate doesn’t match then often no messages will be displayed.

Note that in the case of the Feather M0 or Cortex M0, it appears that a 1 second delay may be required before the serial port connection to the Arduino IDE captures messages. Therefore for debugging purposes, it may be advisable to add a delay(1000); after the InitDebug().

Enabling debug messages for Raspberry Pi

Define an output function:

  static int16_t DebugOut(char ch) { fputc(ch,stderr); return 0; }

Then, at the start of the initialization:

  gslc_InitDebug(&DebugOut);

== Testing debug messages To ensure that debug messaging is working, add the following after the InitDebug():

  GSLC_DEBUG_PRINT("Test\n",0);

Runtime errors (Common)

The following lists some of the errors that may be reported during program operation and how they can be fixed.

  • ERROR: CollectElemAdd() too many element references (max=#)
    • Indicates that the total number of elements created exceeded the maximum configured in gslc_PageAdd(). To fix, increase the nMaxElemRef parameter in gslc_PageAdd().
  • ERROR: CollectElemAddExt() too many RAM elements (max=#)
    • Indicates that the number of elements created in RAM exceeded the maximum configured in gslc_PageAdd(). To fix, increase the nMaxElem parameter in gslc_PageAdd().
  • ERROR: PageAdd() added too many pages
    • Indicates that the number of pages added (by gslc_PageAdd()) exceeded the maximum configured in gslc_Init(). To fix, increase the nMaxPage parameter in gslc_Init().
  • ERROR: FontAdd() added too many fonts
    • Indicates that the number of fonts added (by gslc_FontAdd()) exceeded the maximum configured in gslc_Init(). To fix, increase the nMaxFont parameter in gslc_Init().
  • ERROR: undefined reference to `gslc_Drv...'
    • Indicates that the driver specified in `DRV_DISP_*` doesn't appear to support the detected device platform type (eg. Arduino, ESP8266, etc.).
    • Please refer to the Device Configuration table ( TODO: Add link).

Troubleshooting for Arduino

Issues during compile

  • error: unknown type name 'SDL_Rect'"
    • This error indicates that the Arduino IDE is attempting to include and compile the LINUX SDL drivers. Ensure the GUIslice_drv_sdl.* files are removed from the Arduino library / Sketch folder before compiling.
  • fatal error: GUIslice_drv_sdl.h: No such file or directory
    • This error indicates that the config file has enabled the SDL driver (intended for LINUX). Edit GUIslice_config.h and ensure that DRV_DISP_SDL* are commented out and that DRV_DISP_ADAGFX is uncommented.
  • Not enough memory
    • Some sketches with advanced features will exceed the RAM capacity of smaller Arduino devices.
    • A set of memory-optimized versions of the examples has been provided in the /arduino_min folder.
  • error: 'class TFT_eSPI' has no member named 'getTouch'
    • This error indicates that either:
      • Touch support was intended (by setting #define DRV_TOUCH_TFT_ESPI in 'GUIslice_config_ard.h') but that the TOUCH_CS setting has not been configured in TFT_eSPI's 'User_Setup.h'
      • Touch support was not intended but that #define DRV_TOUCH_TFT_ESPI in 'GUIslice_config_ard.h' was set instead of #define DRV_TOUCH_NONE
  • error: 'gslc_tsXSelNum' does not name a type
    • This error indicates that #define GSLC_FEATURE_COMPOUND has not been enabled.
    • A similar error may be shown for `gslc_tsXGauge` and `gslc_tsXTextbox` for other #define GSLC_FEATURE_* enables. Many of these extended element types are not enabled by default in order to conserve program memory.

Issues during runtime (with DRV_DISP_TFT_ESPI)

If you are running into troubles when using the TFT_eSPI mode (eg. with ESP8266 / ESP32 / M5Stack), then it is best to start with the following checks:

  • Ensure TFT_eSPI has been configured properly
    • From Arduino IDE, run Examples -> TFT_eSPI -> TFT_graphicstest_one_lib. This test will ensure that the TFT_eSPI configuration in User_Setup is correct.
    • Enable Arduino IDE's Serial Monitor and check for any debug messages upon startup

Issues during runtime

  • All I see is a white screen
    • Ensure that debug messages are enabled (see above) as it is likely that an error has stopped further program execution.
  • ERROR: InitTouch() failed in touch driver init
    • The configured touch device couldn't startup correctly. Ensure that the right touch driver has been selected in the config (DRV_TOUCH_*). If no touch capability is present, select DRV_TOUCH_NONE.
  • ERROR: DrvInit() SD init failed (Arduino)
    • Indicates that the SD card device couldn't initialize. Check to see if an SD card is inserted and that the pin ADAGFX_PIN_SDCS is configured for the correct connection between the processor and the display (which contains the SD card reader).
  • ERROR: DrvDrawBmp24FromSD() file not found [?] (Arduino)
    • Indicates that the file path to the image on the SD card appears incorrect.
  • My images are not showing
    • Ensure that the SD card support is enabled. #define ADAGFX_SD_EN 1 in GUIslice_config.h
  • Debug messages are not displayed in Serial Monitor
    • Ensure DEBUG is enabled (#define DEBUG_ERR 1 in the config) and that the baud rate of the Serial Monitor window matches the Serial.begin() code initialization.

Troubleshooting for ARM Cortex

Issues during compile

  • Adafruit_GFX.cpp:44:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] in #define pgm_read_word...
    • This warning comes from the Adafruit-GFX library when compiled for ARM CPUs and can be ignored.

Troubleshooting for Raspberry Pi

Issues during compile

  • fatal error: SDL/SDL.h: No such file or directory
    • This error indicates that the SDL 1.2 driver has not been installed. To fix this:
    • sudo apt-get install libsdl1.2-dev
  • fatal error: tslib.h: No such file or directory
    • This error indicates that the tslib touch driver has not been installed. To fix this, do one of the following:
    • Install tslib from sources (see https://www.impulseadventure.com/elec/rpi-install-tslib.html)
    • Select a different touch driver (eg. DRV_TOUCH_SDL) in GUIslice_config_linux.h
    • Disable touch support (eg. DRV_TOUCH_NONE) in GUIslice_config_linux.h
  • /usr/bin/ld: cannot find -lts
    • This error indicates that the tslib touch library has not been installed. If no touch support was required (eg. DRV_TOUCH_NONE), then remove -lts from the GSLC_LDLIB_EXTRA line in the linux/Makefile. If touch support was required, then install tslib from sources (see https://www.impulseadventure.com/elec/rpi-install-tslib.html)

Issues during runtime

  • Unable to open a console terminal (LINUX)
    • Usually indicates that you need to run the program as root (with sudo). For example:
    • sudo ./test-sdl1
  • Couldnt load module input / No raw modules loaded. / ERROR: ts_config() failed (LINUX)
    • Indicates that the touchscreen library (tslib) could not initialize correctly.
    • Check that the paths provided in the user code environment variable setup are valid. For example, check that TSLIB_PLUGINDIR is set to the correct path (eg. /usr/lib/arm-linux-gnueabihf/ts0 or /usr/local/lib/ts).
  • ERROR: DrvFontAdd(/usr/share/fonts/truetype/droid/DroidSans.ttf) failed in TTF_OpenFont
    • Indicates that the program attempted to add the above font file but couldn't find it. Check to see if the file exists in the named path.
    • Note that recent versions of LINUX / Raspberry Pi have removed the droid font, so it is recommended to use a replacement such as noto (eg. /usr/share/fonts/truetype/noto/NotoSans-Regular.ttf). Older GUIslice example files used the droid fonts, so please update to the latest example files.
  • ERROR: DrvFontAdd(/usr/share/fonts/truetype/noto/NotoSans-Regular.ttf) failed in TTF_OpenFont
    • Indicates that the program attempted to add the above font file but couldn't find it. Check to see if the file exists in the named path.
    • If the noto font isn't already installed, you can install with sudo apt-get install fonts-noto
Clone this wiki locally