TFT_ILI9163 does not work on UNO R4 Minima

Hello Forum,
I'm sure that I'm not the first one experiencing some compatibility issues with the R4...
I've been downloading a sketch (that works on the R3 UNO) to a brand new R4 Minima.
I get the following errors, basically it detects something wrong at the TFT library,any idea on how to fix this?

Thanks

FQBN: arduino:renesas_uno:minima
Using board 'minima' from platform in folder: C:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5
Using core 'arduino' from platform in folder: C:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5

Detecting libraries used...
C:\Users\39340\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -nostdlib -DF_CPU=48000000 -DARDUINO_UNOR4_MINIMA -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -w -x c++ -E -CC -DARDUINO=10607 -DPROJECT_NAME="C:\Users\39340\AppData\Local\Temp\arduino\sketches\1D85F1BE584E027B7F0047D374D5D933/FINAL_QO100_GPS_e_PA_e_2_screens_UNO_R4.ino" -DARDUINO_MINIMA -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @C:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\variants\MINIMA/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -IC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\cores\arduino/tinyusb -IC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\cores\arduino/api/deprecated -IC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\cores\arduino/api/deprecated-avr-comp -IC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\cores\arduino -IC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\variants\MINIMA -iprefixC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5 @C:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\variants\MINIMA/includes.txt C:\Users\39340\AppData\Local\Temp\arduino\sketches\1D85F1BE584E027B7F0047D374D5D933\sketch\FINAL_QO100_GPS_e_PA_e_2_screens_UNO_R4.ino.cpp -o nul
Alternatives for TFT_ILI9163.h: [TFT_ILI9163@0.17]
ResolveLibrary(TFT_ILI9163.h)
  -> candidates: [TFT_ILI9163@0.17]
C:\Users\39340\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -nostdlib -DF_CPU=48000000 -DARDUINO_UNOR4_MINIMA -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -w -x c++ -E -CC -DARDUINO=10607 -DPROJECT_NAME="C:\Users\39340\AppData\Local\Temp\arduino\sketches\1D85F1BE584E027B7F0047D374D5D933/FINAL_QO100_GPS_e_PA_e_2_screens_UNO_R4.ino" -DARDUINO_MINIMA -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE=700 -mthumb @C:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\variants\MINIMA/defines.txt -DCFG_TUSB_MCU=OPT_MCU_RAXXX -IC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\cores\arduino/tinyusb -IC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\cores\arduino/api/deprecated -IC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\cores\arduino/api/deprecated-avr-comp -IC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\cores\arduino -IC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\variants\MINIMA -IC:\Users\39340\Documents\Arduino\libraries\TFT_ILI9163 -iprefixC:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5 @C:\Users\39340\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\variants\MINIMA/includes.txt C:\Users\39340\AppData\Local\Temp\arduino\sketches\1D85F1BE584E027B7F0047D374D5D933\sketch\FINAL_QO100_GPS_e_PA_e_2_screens_UNO_R4.ino.cpp -o nul
In file included from C:\Users\39340\Documents\Arduino\libraries\TFT_ILI9163/TFT_ILI9163.h:22:0,
                 from C:\Users\QO100 PLUTO GPS Temp_Volt monitor TFT\Code\FINAL_QO100_GPS_e_PA_e_2_screens_UNO_R4\FINAL_QO100_GPS_e_PA_e_2_screens_UNO_R4.ino:96:
C:\Users\39340\Documents\Arduino\libraries\TFT_ILI9163/TFT_FastPin.h:33:9: fatal error: avr/io.h: No such file or directory
 #include<avr/io.h>
         ^~~~~~~~~~
compilation terminated.

Alternatives for avr/io.h: []
ResolveLibrary(avr/io.h)
  -> candidates: []
Using library TFT_ILI9163 at version 0.17 in folder: C:\Users\39340\Documents\Arduino\libraries\TFT_ILI9163 
exit status 1

Compilation error: exit status 1

The TFT_ILI9163 library, which was last updated 7 years ago, does not support the new renasas_uno architecture. The giveaway is in the library.properties file:

architectures=avr

You'll either have to find a fork that's done the necessary updates, do the work yourself, or find a different library.

https://github.com/Bodmer/TFT_ILI9163 was indeed updated last time 7 years ago, keywords.txt updated 6 years ago.

An Arduino IDE compatible graphics and fonts library for AVR processors with a driver for the ILI9163 based TFT displays.

Google knows ILI9163. But it is not well known. I expected it to by a typo in the title.

Try to open an issue, but I doubt it will be updated.

I see......
any suggestion for another TFT library (good for the UNO R4) to be used as a replacement of the TFT_ILI9163, with minimum impact on coding?

Thanks

I would ask for addition of the needed driver to Arduino_GFX. They are very active.
But maybe more for more modern displays and controllers.

If I were in your situation, I would add that driver myself, by copying relevant parts, e.g. initialization, from the Bodmer library.

Personally, I wish Arduino would just make it work...

You can do a quick and dirty (temporary) fix to this: If you simply create an empty file:
C:\Users\username\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\cores\arduino\avr\wiring_private.h

Note: the username needs to be edited and potentially the board version mine is 1.0.5

Earlier I suggested it in an Issue:

compatibility - Consider shipping an empty wiring_private.h · Issue #72 · arduino/ArduinoCore-renesas (github.com)
But it was blown off

Alternatively, you can just edit the library and remove it: One preferred way is to bracket the include ...

from:
#include <avr/pgmspace.h>

to

#if defined(__has_include)
#if __has_include("wiring_private.h")
#include "wiring_private.h"
#endif  // __has_include("wiring_private.h")
#else  //defined(__has_include)
#include "wiring_private.h"
#endif  //defined(__has_include)

Note that the library Arduino_GFX is from moononournation.
Arduino_GFX is its name on GitHub, GFX Library for Arduino is its name known to Library Manager, see library.properties.

uses avr/io.h
This is where @KurtE could help with FastPinIO for UNO R4.

Sorry, I am not currently doing very much with the UNO R4s. Currently playing with the GIGA

It looks like this library is pretty specific to be used on AVR boards: From the readme file:

An Arduino IDE compatible graphics and fonts library for AVR processors with a driver for the ILI9163 based TFT displays.

The library contains proportional fonts, different sizes can be enabled/disabled at compile time to optimise the use of FLASH memory. The library has been tested with the UNO, Mega (ATmega328 or ATmega2560 processor) and the Leonardo compatible boards (ATmega32u4 processor).

Besides the use of the avr specific header file avr\io.h as well as the wiring_private.h

The code is setup to use AVR port/registers and the like, which can be worked around some,
plus there are other issues like:

For some reason, it does not like the use of: y0...