ILI9341 display with stm32f103c8t6 with tft_espi library

I am trying to configure stm32f103c8t6 bluepill with ILI9341 display using the tft_espi library .
Connection
stm32 ILI9341
PB15 -> MOSI, T_MOSI
PB14 -> MISO, T_MISO
PB13 -> SCK, T_SCK
PC15 -> TFT_CS
PC14 -> RST
PC13 ->DC
PA0 -> TOUCH_CS

I have made some changes with tft_espi header files to configure the files with stm32f103.

Changes

User_setup.h
i uncommented this statements
#define STM32
#define ILI9341_DRIVER
#define TFT_SPI_PORT 2 // SPI port 2 maximum clock rate is 27MHz
#define TFT_MOSI PB15
#define TFT_MISO PB14
#define TFT_SCLK PB13

User_setup_Select.h
i uncommented this statements
#include <User_Setups/Setup32_ILI9341_STM32F103.h> // Setup for "Blue/Black Pill"

Setup32_ILI9341_STM32F103.h
i change the pin number of CS,DC,RST,TOUCH_CS according to my connection
#define TFT_CS PC15 // Chip select control pin to TFT CS
#define TFT_DC PC13 // Data Command control pin to TFT DC (may be labelled RS = Register Select)
#define TFT_RST PC14 // Reset pin to TFT RST (or RESET)
#define TOUCH_CS PA0

i uploaded a example code TFT_graphicstest_one_lib
i am getting lot of error

\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1033:47: error: 'HAL_SPI_Transmit' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 1, 10); delayMicroseconds(1);}
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3206:9: note: in expansion of macro 'tft_Write_8'
DC_C; tft_Write_8(TFT_CASET);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:223:25: error: 'gpio_dev' has no member named 'BSRR'
#define DC_D DC_PORT->BSRR = DC_PIN_MASK
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3207:3: note: in expansion of macro 'DC_D'
DC_D; tft_Write_32C(xs, xe);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1050:21: error: 'spiHal' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 4, 10); }
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3207:9: note: in expansion of macro 'tft_Write_32C'
DC_D; tft_Write_32C(xs, xe);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1050:45: error: 'HAL_SPI_Transmit' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 4, 10); }
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3207:9: note: in expansion of macro 'tft_Write_32C'
DC_D; tft_Write_32C(xs, xe);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:222:25: error: 'gpio_dev' has no member named 'BSRR'
#define DC_C DC_PORT->BSRR = DC_PIN_MASK<<16
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3210:3: note: in expansion of macro 'DC_C'
DC_C; tft_Write_8(TFT_PASET);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1033:23: error: 'spiHal' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 1, 10); delayMicroseconds(1);}
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3210:9: note: in expansion of macro 'tft_Write_8'
DC_C; tft_Write_8(TFT_PASET);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1033:47: error: 'HAL_SPI_Transmit' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 1, 10); delayMicroseconds(1);}
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3210:9: note: in expansion of macro 'tft_Write_8'
DC_C; tft_Write_8(TFT_PASET);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:223:25: error: 'gpio_dev' has no member named 'BSRR'
#define DC_D DC_PORT->BSRR = DC_PIN_MASK
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3211:3: note: in expansion of macro 'DC_D'
DC_D; tft_Write_32C(ys, ye);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1050:21: error: 'spiHal' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 4, 10); }
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3211:9: note: in expansion of macro 'tft_Write_32C'
DC_D; tft_Write_32C(ys, ye);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1050:45: error: 'HAL_SPI_Transmit' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 4, 10); }
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3211:9: note: in expansion of macro 'tft_Write_32C'
DC_D; tft_Write_32C(ys, ye);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:222:25: error: 'gpio_dev' has no member named 'BSRR'
#define DC_C DC_PORT->BSRR = DC_PIN_MASK<<16
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3214:3: note: in expansion of macro 'DC_C'
DC_C; tft_Write_8(TFT_RAMRD);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1033:23: error: 'spiHal' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 1, 10); delayMicroseconds(1);}
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3214:9: note: in expansion of macro 'tft_Write_8'
DC_C; tft_Write_8(TFT_RAMRD);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1033:47: error: 'HAL_SPI_Transmit' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 1, 10); delayMicroseconds(1);}
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3214:9: note: in expansion of macro 'tft_Write_8'
DC_C; tft_Write_8(TFT_RAMRD);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:223:25: error: 'gpio_dev' has no member named 'BSRR'
#define DC_D DC_PORT->BSRR = DC_PIN_MASK
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3216:3: note: in expansion of macro 'DC_D'
DC_D;
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp: In member function 'virtual void TFT_eSPI::drawPixel(int32_t, int32_t, uint32_t)':
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:222:25: error: 'gpio_dev' has no member named 'BSRR'
#define DC_C DC_PORT->BSRR = DC_PIN_MASK<<16
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3374:5: note: in expansion of macro 'DC_C'
DC_C; tft_Write_8(TFT_CASET);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1033:23: error: 'spiHal' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 1, 10); delayMicroseconds(1);}
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3374:11: note: in expansion of macro 'tft_Write_8'
DC_C; tft_Write_8(TFT_CASET);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1033:47: error: 'HAL_SPI_Transmit' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 1, 10); delayMicroseconds(1);}
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3374:11: note: in expansion of macro 'tft_Write_8'
DC_C; tft_Write_8(TFT_CASET);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:223:25: error: 'gpio_dev' has no member named 'BSRR'
#define DC_D DC_PORT->BSRR = DC_PIN_MASK
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3375:5: note: in expansion of macro 'DC_D'
DC_D; tft_Write_32D(x);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1054:21: error: 'spiHal' was not declared in this scope
HAL_SPI_Transmit(&spiHal, spiBuffer, 4, 10); }
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:3375:11: note: in expansion of macro 'tft_Write_32D'
DC_D; tft_Write_32D(x);
^
C:\Users\Admin\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_STM32.h:1054:45: error: 'HAL_SPI_Transmit' was not declared in

do i need to make some changes in the header files?
please help

I have STM32F103C8T6 wired to a ILI9341 TFT working well but I am not using tft_espi but Adafruit_GFX.h and Adafruit_ILI9341.h instead. The difference is that I am using SPI 1, i.e: PA5, PA6, PA7. To use ISP number 2 I think you should s_pecify SPIClass spi1(2) but I am not sure...

Have you used the touch function?

Yes, with XPT2046_Touchscreen.h library and also SD card with SdFat.h. Display, touchscreen and sd card are working well

Yes, SPI displays should work fine on STM32 and ESP32 boards.
With Adafruit_ILI9341.h and XPT2046.h
Or Bodmer supports both TFT and XPT2046_Touchscreen via TFT_eSPI.

Likewise, Teensy, Due, ... work with most libraries too.

Any target with proper 3.3V logic should be good.

Seriously. If you have a problem, post a link to the display. Quote Arduino target board. Quote library(s).
Post your wiring / user setup / schematic (with colours). Both electronically and a photo which shows the coloured wires.

David.

What Core are you using ? Official ST Micro or Roger Clark.

i am using roger clark

Well, don't expect much support from the civilised world.

Yes, some things are better in RogerClark than the official STM32 core.
TFT_eSPI is designed for official STM32. And it works very well.

If there is something that you can't do in STM32 Core, say so. Readers will help. It might even get added to the official STM32 Core.

David.