Hello!
I'm not new to Arduino or LCDs, but have little experience with all 3 of the things I'm trying to make work here: a 3.5" TFT LCD with 8-bit parallel interface, "blue pill" STM32F103 board, and the "mcufriend_kbv" library.
Specifically, I'm trying to make this display: (TFT LCD from Amazon) work with this board: ("blue pill" clone from Amazon). I'm also using a clone STLink though I suspect that doesn't matter.
First, just to make sure the display worked and "get the lay of the land" as I'd never used the "mcufriend" library before, I plugged the display into an Uno, installed the library, and loaded and ran all the examples for the library... all worked. The only issue I encountered was the display flickering a little when updated, which I suspect may have had to do with the Uno's 5V logic driving the 3.3v display, as it was the backlight flickering, not the display itself.
Having succeeded at that, I then removed the display from the Uno and wired it to the STM32 board, using a wiring scheme I think came from the library's author:
//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST| |SD_SS|SD_DI|SD_DO|SD_SCK|
//STM32 pin |PA7|PA6|PA5|PA4|PA3|PA2|PA1|PA0| |PB0|PB6|PB7|PB8|PB9| |PA15 |PB5 |PB4 |PB3 | **ALT-SPI1**
Which I don't think matters because... the program won't even compile! I'll attach the sketch but it's pretty much the "testcard_kbv" demo program with comments I added so I could better understand how it works.
The complete compiler output is attached as "errors.txt" but the highlight seems to be this:
\\home\dfs\Eric's Stuff\~Arduino sketchbooks\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp: In member function 'bool Adafruit_I2CDevice::write(const uint8_t*, size_t, bool, const uint8_t*, size_t)':
\\home\dfs\Eric's Stuff\~Arduino sketchbooks\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp:88:47: error: invalid conversion from 'const uint8_t* {aka const unsigned char*}' to 'uint8* {aka unsigned char*}' [-fpermissive]
if (_wire->write(prefix_buffer, prefix_len) != prefix_len) {
^
In file included from C:\Users\eric\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2021.3.4\libraries\Wire/Wire.h:42:0,
from \\home\dfs\Eric's Stuff\~Arduino sketchbooks\libraries\Adafruit_BusIO/Adafruit_I2CDevice.h:1,
from \\home\dfs\Eric's Stuff\~Arduino sketchbooks\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp:1:
C:\Users\eric\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2021.3.4\libraries\Wire/utility/WireBase.h:123:12: error: initializing argument 1 of 'size_t WireBase::write(uint8*, int)' [-fpermissive]
size_t write(uint8*, int);
^
\\home\dfs\Eric's Stuff\~Arduino sketchbooks\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp:97:31: error: invalid conversion from 'const uint8_t* {aka const unsigned char*}' to 'uint8* {aka unsigned char*}' [-fpermissive]
if (_wire->write(buffer, len) != len) {
^
In file included from C:\Users\eric\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2021.3.4\libraries\Wire/Wire.h:42:0,
from \\home\dfs\Eric's Stuff\~Arduino sketchbooks\libraries\Adafruit_BusIO/Adafruit_I2CDevice.h:1,
from \\home\dfs\Eric's Stuff\~Arduino sketchbooks\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp:1:
C:\Users\eric\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2021.3.4\libraries\Wire/utility/WireBase.h:123:12: error: initializing argument 1 of 'size_t WireBase::write(uint8*, int)' [-fpermissive]
size_t write(uint8*, int);
^
Multiple libraries were found for "Wire.h"
Used: C:\Users\eric\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2021.3.4\libraries\Wire
Not used: C:\Users\eric\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2021.3.4\libraries\WireSlave
Does anyone have any idea what I'm doing wrong? As far as I I know I have all the correct libraries installed, and everything (the IDE, board defs, and libraries) are fully up-to-date.
testcard_kbv_STM32_EL.ino (7.07 KB)
errors.txt (67.2 KB)