I finally got my command line debug working through st link. https://gist.github.com/ht93/93f4ed2667 ... 8e053403e3 is the debug log of my code (2.0.0 core, display not working). However it only runs 'Adafruit_ST7789 tft = Adafruit_ST7789(&SPI_1, TFT_CS, TFT_DC, TFT_RST);' and part of 'tft.init(240, 320);' since it's too long and running similar command for a long time. Let me know how can I provide enough info.
Code: Select all
//#include "pins_arduino.h"
//#include "wiring_private.h"
//#define ARDUINO_STM32_FEATHER 1
#include <SPI.h>
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
// https://learn.adafruit.com/2-0-inch-320-x-240-color-ips-tft-display?view=all#arduino-wiring-test
// https://cdn-learn.adafruit.com/downloads/pdf/adafruit-gfx-graphics-library.pdf?timestamp=1620544055
#define TFT_CS PA4//8
#define TFT_DC PB1//9
#define TFT_RST PB0//10
#define TFT_MOSI PA7//PB15//11
#define TFT_SCLK PA5//PB13//13
SPIClass SPI_1(PA7, PA6, PA5);
//SPIClass SPI_2(PB15, PB14, PB13);
//Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
//Adafruit_ST7789 tft = Adafruit_ST7789(&SPI_1, TFT_CS, TFT_DC, TFT_RST);
//Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
int value = 0;
void setup(void) {
delay(10000);
// delay(1000);
// delay(5000);
Adafruit_ST7789 tft = Adafruit_ST7789(&SPI_1, TFT_CS, TFT_DC, TFT_RST);
tft.init(240, 320); // Init ST7789 320x240
tft.fillScreen(ST77XX_BLACK);
tft.setRotation(1);
tft.setTextWrap(false);
tft.setTextColor(ST77XX_WHITE, ST77XX_BLACK);
tft.setTextSize(5);
tft.setCursor(0, 75);
tft.println("test");
tft.setCursor(0, 125);
tft.println("test1");