Teensy 4.1: SdFat interferes with GUIslice

u1550

Member
I have a TFT display with touch (ili9341 / XPT2046) attached to my Teensy 4.1.
These pins are used:
C:
#define ADAGFX_PIN_CS       0
#define ADAGFX_PIN_DC       5
#define ADAGFX_PIN_RST      3
#define XPT2046_CS          4

#define ADAGFX_PIN_MOSI     26
#define ADAGFX_PIN_MISO     1
#define ADAGFX_PIN_CLK      27

When the onboard CFcard is accessed (using SdFat), the GUI will not react any more.

My question:
How is the onboard CF accessed? does the driver interact with the ports of my TFT?
 
I did some more investigation:
SDCARD is initialized by
C++:
#define SD_CONFIG  SdioConfig(FIFO_SDIO)
..
if (!SD.begin(SD_CONFIG)) {
    ..

linked libraries:
SdFat library Version 2.1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat
GUIslice is using ILI9341_t3n in Version 1.1.1 (got it from github)
SPI Version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI

As far as I could see, The ILI9341_t3n uses SPI1 using the settings mentioned previously.

So, there should be no overlapping of SD card access and display use.

But, each time a read or write access to the sdcard is done, the display stops updating. Reinitializing the SPI1 settings brings it up again.
The SDcard is not affected by this.
Although this is a work-around, I can not understand, why the teensy FIFO SD is affecting the SPI settings.
 
I did not yet check the interrupt settings as I assumed that the SPI library delivered with Teensyduino is perconfigured correctly.
I my assumption wrong?
 
SD access must IMHO be always at the lowest priority level and all other continuous activities should run on interrupt level.
 
Back
Top