10 years, 1 month ago.

ILI9341 STM32F103RB Nucleo compilation error

Hello guys,

I'm an Mbed newbie and my first time to interface TFT LCD's with my STM32F103RB Nucleo. I did successful compilations and correct expected outputs on LED2 etc.with some basic programs like blink, PWM and adcin with the board I have now but I'm kinda confuse interfacing the ILI9341 TFT LCD from Peter Drescher / SPI_TFT_ILI9341 which gives me an error when to be compiled with the platform STM32F103RB Nucleo board. It gives me a first line Warning: Members and base-classes will be initialized in declaration order, not in member initialisation list order":_spi9mosi,miso,Sclk),cs(cs). in "SPI_TFT_ILI9341/SPI_TFT_ILI9341.cpp", Line: 25, Col: 64

then a second line error - an error Identifier "LocalFileSystem" is undefined "LocalFileSystem local("local");"

I'm stuck with this and cannot compile the program with it's library successfully.

Can someone help me?

Thanks

Question relating to:

Lib for the new LCD Display with ILI9341 controller

Miko, what example did you use? I dont see declaration in ILI9431 library. Please always provide an example which gives you an error, so we can correct any error.

posted by Martin Kojtal 11 May 2014

Hello Martin, I'll post a screenshot later. I'm on mobile. Thanks

posted by Miko Ledesma 11 May 2014

example to test the TFT Display Thanks to the GraphicsDisplay and TextDisplay classes test2.bmp has to be on the mbed file system

#define NO_DMA

  1. include "stdio.h"
  2. include "mbed.h"
  3. include "SPI_TFT_ILI9341.h"
  4. include "string"
  5. include "Arial12x12.h"
  6. include "Arial24x23.h"
  7. include "Arial28x28.h"
  8. include "font_big.h"

extern unsigned char p1[]; the mbed logo

the TFT is connected to SPI pin 11-14

SPI_TFT_ILI9341 TFT(p5, p6, p7, p8, p9, p10,"TFT"); mosi, miso, sclk, cs, reset, dc

int main() { int i; unsigned int y; TFT.claim(stdout); send stdout to the TFT display TFT.claim(stderr); send stderr to the TFT display TFT.set_orientation(1); TFT.background(Black); set background to black TFT.foreground(White); set chars to white TFT.cls(); clear the screen

y= 0; TFT.background(Black); TFT.cls();

TFT.set_font((unsigned char*) Arial12x12); TFT.locate(0,0); printf(" Hello Mbed ");

wait(5); wait two seconds

draw some graphics TFT.cls(); TFT.set_font((unsigned char*) Arial24x23); TFT.locate(100,100); TFT.printf("Graphic");

TFT.line(0,0,100,0,Green); TFT.line(0,0,0,200,Green); TFT.line(0,0,100,200,Green);

TFT.rect(100,50,150,100,Red); TFT.fillrect(180,25,220,70,Blue);

TFT.circle(80,150,33,White); TFT.fillcircle(160,190,20,Yellow);

double s;

for (i=0; i<320; i++) { s =20 * sin((long double) i / 10 ); TFT.pixel(i,100 + (int)s ,Red); }

wait(5); wait two seconds

bigger text TFT.foreground(White); TFT.background(Blue); TFT.cls(); TFT.set_font((unsigned char*) Arial24x23); TFT.locate(0,0); TFT.printf("Different Fonts :");

TFT.set_font((unsigned char*) Neu42x35); TFT.locate(0,30); TFT.printf("Hello Mbed 1"); TFT.set_font((unsigned char*) Arial24x23); TFT.locate(20,80); TFT.printf("Hello Mbed 2"); TFT.set_font((unsigned char*) Arial12x12); TFT.locate(35,120); TFT.printf("Hello Mbed 3"); wait(5);

mbed logo TFT.background(Black); TFT.cls();

TFT.locate(10,10); TFT.printf("Graphic from Flash");

TFT.Bitmap(90,90,172,55,p1);

wait(5); TFT.cls(); TFT.locate(10,10); TFT.printf("Graphic from File System"); TFT.locate(10,20); TFT.printf("open test.bmp"); int err = TFT.BMP_16(20,50,"test.bmp"); if (err != 1) TFT.printf(" - Err: %d",err); }

Martin, this is the exact program that Peter wrote and I just imported it. Pardon me if you think there are corrections to be made should STM32F103RB Nucleo board will be used. - Sorry I'm really a newbie here.

Thanks

posted by Miko Ledesma 12 May 2014

an error Identifier "LocalFileSystem" is undefined "LocalFileSystem local("local");" this error still comes out on STM32 series Nucleo boards even though I already changed the pin assignments with PA_7,PA_6,PA5_ etc. It's kinda weird why on LPC1768, it builds successfully. Hope you can help or someone can fix the problem for STM32 MCU's

posted by Miko Ledesma 12 May 2014

2 Answers

10 years, 1 month ago.

Comment out the local filesystem stuff, if i'm not wrong it can be used only on early LPC boards

Thanks Geremia G. I'll try your suggestion later.

posted by Miko Ledesma 11 May 2014

https://mbed.org/handbook/HDK-and-CMSIS-DAP There are 3 platforms that use the original mbed Interface. mbed LPC1768, mbed LPC11U24 and the retired mbed LPC2368. The new ones uses CMSIS-DAP and there is no 2MB external storage for localfilesystem, so if you need storage for your project, you need to hookup an sdcard and use sdfilesystem

posted by Geremia G 12 May 2014
10 years, 1 month ago.

The warning can be ignored, the program will still run. The problem can be solved by changing the order in which the parameters are initialized. Check my fork of the ILI9341 driver to see how it can be fixed.

Hello Wim, I remember the warning can be ignored but the error still doesn't compile the program and no download bin file appears on stm32 Nucleo drive. I'll try also your suggestion with Geremia G later as soon as I got home. Thanks

posted by Miko Ledesma 11 May 2014