ST7735 based LCDs?

External hardware connected to the STM32 board
User avatar
KingBeetle66
Posts: 2
Joined: Wed Feb 10, 2016 11:00 pm
Location: Central Ohio
Contact:

Re: ST7735 based LCDs?

Post by KingBeetle66 » Wed Feb 10, 2016 11:10 pm

I purchased an ST7735 driven 1.44" TFT (128x128) from China and used your fine library to successfully connect it via hardware SPI to a STM32F103C8T6 minimum system development board. In the process, I believe a found a bug in your code.

My particular display needs initialized using the INITR_144GREENTAB constant, which in Adafruit_ST7735.cpp sets colstart = 2 and rowstart = 3. I discovered however, that these offset values were being ignored, causing 0,0 to be off the top left corner of the display, and leaving several rows and colums of random pixels along the right side and bottom.

Digging a little deeper, I discovered that in Adafruit_ST7735.cpp's setAddrWindow() function, the colstart and rowstart values weren't being applied to the SPI section of the code:

Code: Select all

void Adafruit_ST7735::setAddrWindow(uint8_t x0, uint8_t y0, uint8_t x1,
 uint8_t y1) {

  if (hwSPI) {
#if defined (__STM32F1__)
    writecommand(ST7735_CASET);
    *rsport |=  rspinmask;
    *csport &= ~cspinmask;
    SPI.setDataSize (SPI_CR1_DFF);
    
    //SPI.write(x0);          //Original 
    SPI.write(x0+colstart);   //Revised code including colstart offset
    //SPI.write(x1);          //Original
    SPI.write(x1+colstart);   //Revised code including colstart offset

    writecommand(ST7735_RASET);
    *rsport |=  rspinmask;
    *csport &= ~cspinmask;
  
    //SPI.write(y0);          //Original       
    SPI.write(y0+rowstart);   //Revised code including rowstart offset
    //SPI.write(y1);          //Original 
    SPI.write(y1+rowstart);   //Revised code including rowstart offset
    
    SPI.setDataSize(0);
  
    writecommand(ST7735_RAMWR);
 #endif 
  } else {    
    writecommand(ST7735_CASET); // Column addr set
    writedata(0x00);
    writedata(x0+colstart);     // XSTART 
    writedata(0x00);
    writedata(x1+colstart);     // XEND
  
    writecommand(ST7735_RASET); // Row addr set
    writedata(0x00);
    writedata(y0+rowstart);     // YSTART
    writedata(0x00);
    writedata(y1+rowstart);     // YEND
  
    writecommand(ST7735_RAMWR); // write to RAM
  } // end else
}
I revised the code to match what appears in the non-SPI section of the function, and voilà, 0,0 is in the corner, and no more bands of pixels on the side and bottom.

A great port of the library to support the STM32. Thanks!

User avatar
Kenjutsu
Posts: 134
Joined: Fri May 29, 2015 8:26 am

Re: ST7735 based LCDs?

Post by Kenjutsu » Thu Feb 11, 2016 6:49 am

Thank you, and well spotted! 8-)

I will test and update later today.
Pieter

OSX: 10.12.6
Arduino IDE: 1.6.12
Blue pill STM32F103C8T6 Dev Board
Maple Mini Clones

User avatar
Kenjutsu
Posts: 134
Joined: Fri May 29, 2015 8:26 am

Re: ST7735 based LCDs?

Post by Kenjutsu » Thu Feb 11, 2016 10:46 am

GitHub repository updated ;)
Pieter

OSX: 10.12.6
Arduino IDE: 1.6.12
Blue pill STM32F103C8T6 Dev Board
Maple Mini Clones

User avatar
KingBeetle66
Posts: 2
Joined: Wed Feb 10, 2016 11:00 pm
Location: Central Ohio
Contact:

Re: Update in place

Post by KingBeetle66 » Thu Feb 11, 2016 1:30 pm

Cool beans. Thanks for the fast response!

michael_l
Posts: 364
Joined: Mon Aug 24, 2015 6:11 pm

Re: ST7735 based LCDs?

Post by michael_l » Sat Jul 16, 2016 7:08 pm

I just tried this with my 1.8 SPI TFT. I downloaded from here:

https://github.com/KenjutsuGH/Adafruit-ST7735-Library

and installed via Arduino IDE's 'install library .zip'.

I tried to compile 'graphicstest' but there are errors. Here's the error message. Any ideas ?

Code: Select all

Arduino: 1.6.9 (Windows 7), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STLink"

"C:\Users\mika\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-ar" rcs  "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\core\core.a" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\core\stm32f1\wirish_debug.cpp.o"
"C:\Users\mika\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-ar" rcs  "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\core\core.a" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\core\stm32f1\wirish_digital_f1.cpp.o"
"C:\Users\mika\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -Os -Wl,--gc-sections -mcpu=cortex-m3 "-TC:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c/ld/jtag_c8.ld" "-Wl,-Map,C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp/graphicstest.ino.map" "-LC:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c/ld" -o "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp/graphicstest.ino.elf" "-LC:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\sketch\graphicstest.ino.cpp.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\glcdfont.c.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit-ST7735-Library-master\Adafruit_ST7735.cpp.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Font16.c.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Font32.c.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Font64.c.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Font7s.c.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\glcdfont.c.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\SPI\SPI.cpp.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\core\wirish\start.S.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\core\wirish\start_c.c.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\core\wirish\syscalls.c.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\core\board.cpp.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\core\wirish\boards.cpp.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\core\wirish\boards_setup.cpp.o" "C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp/core\core.a" -Wl,--end-group
C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::invertDisplay(bool)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:185: multiple definition of `Adafruit_GFX::drawLine(short, short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:172: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::drawRoundRect(short, short, short, short, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:227: multiple definition of `Adafruit_GFX::drawRect(short, short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:213: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::drawUnicode(unsigned short, short, short, short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:235: multiple definition of `Adafruit_GFX::drawFastVLine(short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:221: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::drawFastHLine(short, short, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:241: multiple definition of `Adafruit_GFX::drawFastHLine(short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:227: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::fillRect(short, short, short, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:247: multiple definition of `Adafruit_GFX::fillRect(short, short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:233: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::fillScreen(unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:254: multiple definition of `Adafruit_GFX::fillScreen(unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:240: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::invertDisplay(bool)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:498: multiple definition of `Adafruit_GFX::invertDisplay(bool)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:818: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::Adafruit_GFX(short, short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:62: multiple definition of `Adafruit_GFX::Adafruit_GFX(short, short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:48: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::Adafruit_GFX(short, short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:62: multiple definition of `Adafruit_GFX::Adafruit_GFX(short, short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:48: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::drawCircle(short, short, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:76: multiple definition of `Adafruit_GFX::drawCircle(short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:64: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::drawCircleHelper(short, short, short, unsigned char, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:110: multiple definition of `Adafruit_GFX::drawCircleHelper(short, short, short, unsigned char, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:98: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::fillCircleHelper(short, short, short, unsigned char, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:153: multiple definition of `Adafruit_GFX::fillCircleHelper(short, short, short, unsigned char, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:141: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::fillCircle(short, short, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:146: multiple definition of `Adafruit_GFX::fillCircle(short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:134: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::drawRoundRect(short, short, short, short, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:260: multiple definition of `Adafruit_GFX::drawRoundRect(short, short, short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:246: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::fillRoundRect(short, short, short, short, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:275: multiple definition of `Adafruit_GFX::fillRoundRect(short, short, short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:261: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::drawTriangle(short, short, short, short, short, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:287: multiple definition of `Adafruit_GFX::drawTriangle(short, short, short, short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:272: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::fillTriangle(short, short, short, short, short, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:296: multiple definition of `Adafruit_GFX::fillTriangle(short, short, short, short, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:280: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::drawBitmap(short, short, unsigned char const*, short, short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:373: multiple definition of `Adafruit_GFX::drawBitmap(short, short, unsigned char const*, short, short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:357: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::drawChar(short, short, unsigned char, unsigned short, unsigned short, unsigned char)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:411: multiple definition of `Adafruit_GFX::drawChar(short, short, unsigned char, unsigned short, unsigned short, unsigned char)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:464: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::write(unsigned char)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:387: multiple definition of `Adafruit_GFX::write(unsigned char)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:408: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::setCursor(short, short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:446: multiple definition of `Adafruit_GFX::setCursor(short, short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:554: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::setTextSize(unsigned char)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:451: multiple definition of `Adafruit_GFX::setTextSize(unsigned char)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:567: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::setTextColor(unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:457: multiple definition of `Adafruit_GFX::setTextColor(unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:573: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::setTextColor(unsigned short, unsigned short)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:461: multiple definition of `Adafruit_GFX::setTextColor(unsigned short, unsigned short)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:577: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::setTextWrap(bool)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:466: multiple definition of `Adafruit_GFX::setTextWrap(bool)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:582: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o: In function `Adafruit_GFX::setRotation(unsigned char)':

C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS/Adafruit_GFX_AS.cpp:474: multiple definition of `Adafruit_GFX::setRotation(unsigned char)'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.cpp:590: first defined here

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_AS\Adafruit_GFX_AS.cpp.o:(.rodata._ZTV12Adafruit_GFX+0x0): multiple definition of `vtable for Adafruit_GFX'

C:\Users\mika\AppData\Local\Temp\build5684cb2874fc56fde03f9ed7fa1bbd00.tmp\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o:(.rodata._ZTV12Adafruit_GFX+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

Using library Adafruit_GFX_Library at version 1.1 in folder: C:\Users\mika\Documents\Arduino\libraries\Adafruit_GFX_Library 
Using library Adafruit-ST7735-Library-master at version 1.0.4 in folder: C:\Users\mika\Documents\Arduino\libraries\Adafruit-ST7735-Library-master 
Using library Adafruit_GFX_AS in folder: C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS (legacy)
Using library SPI at version 1.0 in folder: C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI 
exit status 1
Error compiling for board Generic STM32F103C series.

User avatar
martinayotte
Posts: 1241
Joined: Mon Apr 27, 2015 1:45 pm

Re: ST7735 based LCDs?

Post by martinayotte » Sat Jul 16, 2016 7:47 pm

You have 2 versions of Adafruit_GFX conflicting each others.
Move away the oldest one (keep it as backup), close/restart IDE and try to compile again.

michael_l
Posts: 364
Joined: Mon Aug 24, 2015 6:11 pm

Re: ST7735 based LCDs?

Post by michael_l » Fri Jul 22, 2016 7:31 am

martinayotte wrote:You have 2 versions of Adafruit_GFX conflicting each others.
Move away the oldest one (keep it as backup), close/restart IDE and try to compile again.
Thanks! Now it works !

krtodoroff
Posts: 1
Joined: Tue Dec 20, 2016 8:22 am

Re: ST7735 based LCDs?

Post by krtodoroff » Tue Dec 20, 2016 8:34 am

I did described in the post, but only display only blinks. Any idea what was wrong.

dROb
Posts: 10
Joined: Wed Aug 02, 2017 7:28 pm

Re: ST7735 based LCDs?

Post by dROb » Wed Aug 09, 2017 4:35 pm

I found that fillScreen works quite slow. The reason was that by default it was sending to DMA 65535+ bytes (even if 128x160 is only 20480)

Should be like that:

Code: Select all

......
#if defined (__STM32F1__)
    setAddrWindow(1, 1, _width, _height);

    *rsport |=  rspinmask;
    *csport &= ~cspinmask;
    SPI.setDataSize (SPI_CR1_DFF); // Set spi 16bit mode
    lineBuffer[0] = color;
    if ((_width*_height) <= 65535) {
    SPI.dmaSend(lineBuffer, (_width*_height), 0);
    }
    else {
    SPI.dmaSend(lineBuffer, (65535), 0);
    SPI.dmaSend(lineBuffer, ((_width*_height) - 65535), 0);
    }

    SPI.setDataSize (0);
#endif
....
Also, my screen edges had some unreacheable pixels of random colors, so, in fillScreen I used setAddrWindow(1, 1, _width, _height); instead of setAddrWindow(0, 0, _width-1, _height-1); . Do not know why this works better :)

Post Reply