Library 18- ILI9341 with LTDC on STM32F429 Discovery

It’s been a while when I first got ILI9341 lcd working on discovery, but without LTDC driver. Yesterday I decided to make a new library. With LTDC, you can actually display movies, because it uses parallel communication and support 2 layers simultaneously what gives you a high refresh rate.

I used my old ILI9341 library and just add/modify some things to get LTDC to work.

LTDC also supports 2 layers, so this means that while one layer is displayed, other layer can be filled with data.

Note: This library only works on STM32F429 Discovery, it’s not for STM32F4 Discovery.

ILI9341 connected with STM32F429 for LTDC
ILI9341 DISCOVERY DESCRIPTION
B5 PA3 Blue 5
VSYNC PA4 VYSNC
G2 PA6 Green 2
R4 PA11 Red 4
R5 PA12 Red 5
R3 PB0 Red 3
R6 PB1 Red 6
B6 PB8 Blue 6
B7 PB9 Blue 7
G4 PB10 Green 4
G5 PB11 Green 5
HSYNC PC6 HSYNC
G6 PC7 Green 6
R2 PC10 Red 2
G7 PD3 Green 7
B2 PD6 Blue 2
E PF10 Enable
R7 PG6 Red 7
DOTCLK PG7 Dot clock
G3 PG10 Green 3
B3 PG11 Blue 3
B4 PG12 Blue 4
MOSI PF9 SPI5 MOSI pin
MISO PF8 SPI5 MISO pin
SCK PF7 SPI5 SCK pin
CS PC2 CS pin for SPI5
RESET Reset pin
WRX PD13 Data/Command selection

Library

Features

  • Supports LTDC peripheral on STM32F429 Discovery
  • Supports fonts
  • Uses SDRAM on STM32F429 Discovery board
  • Rotation to all 4 directions
  • 2 layers support
  • Supported layer opacity
  • High speed refresh rate
  • Graphic support
  • Support for LCD display on or off

Dependencies

  • STM32F4xx
    • STM32F4xx RCC
    • STM32F4xx DMA2D
    • STM32F4xx GPIO
    • STM32F4xx FMC
    • STM32F4xx LTDC
    • STM32F4xx SPI
  • TM
    • TM DMA2D
    • TM SPI
    • TM FONTS
    • TM SDRAM
    • TM GPIO
    • defines.h

Functions

There are some modifications to functions. Other functions are the same as if you use my ILI9341 using SPI. They are listed below:

For other functions look at my old ILI9341 library.

Example

View project on Github, download library below.

Icon
TM STM32F4 ILI9341 LTDC Library

LTDC support for ILI9341 LCD

tilz0R

Owner of this site. Also electronic enthusiasts, web developer, 3D printer fan, handball player and more. Big fan of STM32F4 devices. In anticipation of the new Discovery board for STM32F7 lines.

You may also like...

Read before commenting!

Before you make a new comment, make sure you agree with things listed below:

  • - Read post to make sure if it is already posted what you are asking for,
  • - Make sure you have the latest version of libraries used in your project,
  • - Make a clean and grammatically correct written message,
  • - Report as many details as possible, including what have you done so far,
  • - Do NOT post any code here. Use Pastebin,
  • - Do NOT post any error codes here. Use Pastebin,
  • - Specify STM32Fxxx family and used Discovery/EVAL/Nucleo or custom made board,
  • - Make sure your clock is set correct for PLL,
  • - If you are using my HAL drivers, please check this post how to start.
Comment will be deleted on breaking these rules without notification!
  • eelfakir

    Hi,

    I tried to compile the libs with gcc on Ubuntu, but I got a lot of errors :

    arm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -Iinc/tm_stm32f4_delay/ -Iinc/tm_stm32f4_fonts/ -Iinc/tm_stm32f4_ili9341_ltdc/ -Iinc/tm_stm32f4_sdram/ -Iinc/tm_stm32f4_spi/ -c -o tm_stm32f4_ili9341_ltdc.o src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c

    In file included from src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:19:0:

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c: In function ‘TM_ILI9341_Init’:

    inc/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.h:61:25: error: ‘SPI5’ undeclared (first use in this function)

    #define ILI9341_SPI SPI5

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:32:14: note: in expansion of macro ‘ILI9341_SPI’

    TM_SPI_Init(ILI9341_SPI, ILI9341_SPI_PINS);

    ^

    inc/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.h:61:25: note: each undeclared identifier is reported only once for each function it appears in

    #define ILI9341_SPI SPI5

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:32:14: note: in expansion of macro ‘ILI9341_SPI’

    TM_SPI_Init(ILI9341_SPI, ILI9341_SPI_PINS);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c: In function ‘TM_ILI9341_InitPins’:

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:81:43: error: ‘GPIO_AF_LTDC’ undeclared (first use in this function)

    GPIO_PinAFConfig(GPIOA, GPIO_PinSource3, GPIO_AF_LTDC);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c: In function ‘TM_LCD9341_InitLTDC’:

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:247:2: error: unknown type name ‘LTDC_InitTypeDef’

    LTDC_InitTypeDef LTDC_InitStruct;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:250:25: error: ‘RCC_APB2Periph_LTDC’ undeclared (first use in this function)

    RCC_APB2PeriphClockCmd(RCC_APB2Periph_LTDC, ENABLE);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:253:25: error: ‘RCC_AHB1Periph_DMA2D’ undeclared (first use in this function)

    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2D, ENABLE);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:257:17: error: request for member ‘LTDC_HSPolarity’ in something not a structure or union

    LTDC_InitStruct.LTDC_HSPolarity = LTDC_HSPolarity_AL;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:257:36: error: ‘LTDC_HSPolarity_AL’ undeclared (first use in this function)

    LTDC_InitStruct.LTDC_HSPolarity = LTDC_HSPolarity_AL;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:259:17: error: request for member ‘LTDC_VSPolarity’ in something not a structure or union

    LTDC_InitStruct.LTDC_VSPolarity = LTDC_VSPolarity_AL;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:259:36: error: ‘LTDC_VSPolarity_AL’ undeclared (first use in this function)

    LTDC_InitStruct.LTDC_VSPolarity = LTDC_VSPolarity_AL;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:261:17: error: request for member ‘LTDC_DEPolarity’ in something not a structure or union

    LTDC_InitStruct.LTDC_DEPolarity = LTDC_DEPolarity_AL;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:261:36: error: ‘LTDC_DEPolarity_AL’ undeclared (first use in this function)

    LTDC_InitStruct.LTDC_DEPolarity = LTDC_DEPolarity_AL;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:263:17: error: request for member ‘LTDC_PCPolarity’ in something not a structure or union

    LTDC_InitStruct.LTDC_PCPolarity = LTDC_PCPolarity_IPC;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:263:36: error: ‘LTDC_PCPolarity_IPC’ undeclared (first use in this function)

    LTDC_InitStruct.LTDC_PCPolarity = LTDC_PCPolarity_IPC;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:266:17: error: request for member ‘LTDC_BackgroundRedValue’ in something not a structure or union

    LTDC_InitStruct.LTDC_BackgroundRedValue = 0;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:267:17: error: request for member ‘LTDC_BackgroundGreenValue’ in something not a structure or union

    LTDC_InitStruct.LTDC_BackgroundGreenValue = 0;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:268:17: error: request for member ‘LTDC_BackgroundBlueValue’ in something not a structure or union

    LTDC_InitStruct.LTDC_BackgroundBlueValue = 0;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:276:2: warning: implicit declaration of function ‘RCC_PLLSAIConfig’ [-Wimplicit-function-declaration]

    RCC_PLLSAIConfig(192, 7, 4);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:277:2: warning: implicit declaration of function ‘RCC_LTDCCLKDivConfig’ [-Wimplicit-function-declaration]

    RCC_LTDCCLKDivConfig(RCC_PLLSAIDivR_Div4);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:277:23: error: ‘RCC_PLLSAIDivR_Div4’ undeclared (first use in this function)

    RCC_LTDCCLKDivConfig(RCC_PLLSAIDivR_Div4);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:280:5: warning: implicit declaration of function ‘RCC_PLLSAICmd’ [-Wimplicit-function-declaration]

    RCC_PLLSAICmd(ENABLE);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:282:27: error: ‘RCC_FLAG_PLLSAIRDY’ undeclared (first use in this function)

    while (RCC_GetFlagStatus(RCC_FLAG_PLLSAIRDY) == RESET);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:286:20: error: request for member ‘LTDC_HorizontalSync’ in something not a structure or union

    LTDC_InitStruct.LTDC_HorizontalSync = 9;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:288:20: error: request for member ‘LTDC_VerticalSync’ in something not a structure or union

    LTDC_InitStruct.LTDC_VerticalSync = 1;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:290:20: error: request for member ‘LTDC_AccumulatedHBP’ in something not a structure or union

    LTDC_InitStruct.LTDC_AccumulatedHBP = 29;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:292:20: error: request for member ‘LTDC_AccumulatedVBP’ in something not a structure or union

    LTDC_InitStruct.LTDC_AccumulatedVBP = 3;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:294:20: error: request for member ‘LTDC_AccumulatedActiveW’ in something not a structure or union

    LTDC_InitStruct.LTDC_AccumulatedActiveW = 269;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:296:20: error: request for member ‘LTDC_AccumulatedActiveH’ in something not a structure or union

    LTDC_InitStruct.LTDC_AccumulatedActiveH = 323;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:298:20: error: request for member ‘LTDC_TotalWidth’ in something not a structure or union

    LTDC_InitStruct.LTDC_TotalWidth = 279;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:300:20: error: request for member ‘LTDC_TotalHeigh’ in something not a structure or union

    LTDC_InitStruct.LTDC_TotalHeigh = 327;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:302:2: warning: implicit declaration of function ‘LTDC_Init’ [-Wimplicit-function-declaration]

    LTDC_Init(&LTDC_InitStruct);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c: In function ‘TM_ILI9341_InitLayers’:

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:306:2: error: unknown type name ‘LTDC_Layer_InitTypeDef’

    LTDC_Layer_InitTypeDef LTDC_Layer_InitStruct;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:314:23: error: request for member ‘LTDC_HorizontalStart’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_HorizontalStart = 30;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:315:23: error: request for member ‘LTDC_HorizontalStop’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_HorizontalStop = 269;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:316:23: error: request for member ‘LTDC_VerticalStart’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_VerticalStart = 4;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:317:23: error: request for member ‘LTDC_VerticalStop’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_VerticalStop = 323;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:320:26: error: request for member ‘LTDC_PixelFormat’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_PixelFormat = LTDC_Pixelformat_RGB565;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:320:46: error: ‘LTDC_Pixelformat_RGB565’ undeclared (first use in this function)

    LTDC_Layer_InitStruct.LTDC_PixelFormat = LTDC_Pixelformat_RGB565;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:322:26: error: request for member ‘LTDC_ConstantAlpha’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_ConstantAlpha = 255;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:324:26: error: request for member ‘LTDC_DefaultColorBlue’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_DefaultColorBlue = 0;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:325:26: error: request for member ‘LTDC_DefaultColorGreen’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_DefaultColorGreen = 0;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:326:26: error: request for member ‘LTDC_DefaultColorRed’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_DefaultColorRed = 0;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:327:26: error: request for member ‘LTDC_DefaultColorAlpha’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_DefaultColorAlpha = 0;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:330:26: error: request for member ‘LTDC_BlendingFactor_1’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_BlendingFactor_1 = LTDC_BlendingFactor1_CA;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:330:51: error: ‘LTDC_BlendingFactor1_CA’ undeclared (first use in this function)

    LTDC_Layer_InitStruct.LTDC_BlendingFactor_1 = LTDC_BlendingFactor1_CA;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:331:26: error: request for member ‘LTDC_BlendingFactor_2’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_BlendingFactor_2 = LTDC_BlendingFactor2_CA;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:331:51: error: ‘LTDC_BlendingFactor2_CA’ undeclared (first use in this function)

    LTDC_Layer_InitStruct.LTDC_BlendingFactor_2 = LTDC_BlendingFactor2_CA;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:339:23: error: request for member ‘LTDC_CFBLineLength’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_CFBLineLength = 240 * 2 + 3;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:345:23: error: request for member ‘LTDC_CFBPitch’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_CFBPitch = 240 * 2;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:347:23: error: request for member ‘LTDC_CFBLineNumber’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_CFBLineNumber = 320;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:350:23: error: request for member ‘LTDC_CFBStartAdress’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_CFBStartAdress = ILI9341_FRAME_BUFFER;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:352:2: warning: implicit declaration of function ‘LTDC_LayerInit’ [-Wimplicit-function-declaration]

    LTDC_LayerInit(LTDC_Layer1, &LTDC_Layer_InitStruct);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:352:17: error: ‘LTDC_Layer1’ undeclared (first use in this function)

    LTDC_LayerInit(LTDC_Layer1, &LTDC_Layer_InitStruct);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:356:23: error: request for member ‘LTDC_CFBStartAdress’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_CFBStartAdress = ILI9341_FRAME_BUFFER + ILI9341_FRAME_OFFSET;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:359:23: error: request for member ‘LTDC_BlendingFactor_1’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_BlendingFactor_1 = LTDC_BlendingFactor1_PAxCA;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:359:48: error: ‘LTDC_BlendingFactor1_PAxCA’ undeclared (first use in this function)

    LTDC_Layer_InitStruct.LTDC_BlendingFactor_1 = LTDC_BlendingFactor1_PAxCA;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:360:23: error: request for member ‘LTDC_BlendingFactor_2’ in something not a structure or union

    LTDC_Layer_InitStruct.LTDC_BlendingFactor_2 = LTDC_BlendingFactor2_PAxCA;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:360:48: error: ‘LTDC_BlendingFactor2_PAxCA’ undeclared (first use in this function)

    LTDC_Layer_InitStruct.LTDC_BlendingFactor_2 = LTDC_BlendingFactor2_PAxCA;

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:362:17: error: ‘LTDC_Layer2’ undeclared (first use in this function)

    LTDC_LayerInit(LTDC_Layer2, &LTDC_Layer_InitStruct);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:364:2: warning: implicit declaration of function ‘LTDC_ReloadConfig’ [-Wimplicit-function-declaration]

    LTDC_ReloadConfig(LTDC_IMReload);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:364:20: error: ‘LTDC_IMReload’ undeclared (first use in this function)

    LTDC_ReloadConfig(LTDC_IMReload);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:366:2: warning: implicit declaration of function ‘LTDC_LayerCmd’ [-Wimplicit-function-declaration]

    LTDC_LayerCmd(LTDC_Layer1, ENABLE);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:370:2: warning: implicit declaration of function ‘LTDC_DitherCmd’ [-Wimplicit-function-declaration]

    LTDC_DitherCmd(ENABLE);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:373:2: warning: implicit declaration of function ‘LTDC_Cmd’ [-Wimplicit-function-declaration]

    LTDC_Cmd(ENABLE);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:375:2: warning: implicit declaration of function ‘LTDC_LayerAlpha’ [-Wimplicit-function-declaration]

    LTDC_LayerAlpha(LTDC_Layer1, 255);

    ^

    In file included from src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:19:0:

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c: In function ‘TM_ILI9341_SendCommand’:

    inc/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.h:61:25: error: ‘SPI5’ undeclared (first use in this function)

    #define ILI9341_SPI SPI5

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:383:14: note: in expansion of macro ‘ILI9341_SPI’

    TM_SPI_Send(ILI9341_SPI, data);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c: In function ‘TM_ILI9341_SendData’:

    inc/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.h:61:25: error: ‘SPI5’ undeclared (first use in this function)

    #define ILI9341_SPI SPI5

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:390:14: note: in expansion of macro ‘ILI9341_SPI’

    TM_SPI_Send(ILI9341_SPI, data);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c: In function ‘TM_ILI9341_UpdateLayerOpacity’:

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:469:18: error: ‘LTDC_Layer1’ undeclared (first use in this function)

    LTDC_LayerAlpha(LTDC_Layer1, ILI9341_Opts.Layer1Opacity);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:470:18: error: ‘LTDC_Layer2’ undeclared (first use in this function)

    LTDC_LayerAlpha(LTDC_Layer2, ILI9341_Opts.Layer2Opacity);

    ^

    src/tm_stm32f4_ili9341_ltdc/tm_stm32f4_ili9341_ltdc.c:472:20: error: ‘LTDC_IMReload’ undeclared (first use in this function)

    LTDC_ReloadConfig(LTDC_IMReload);

    ^

    make[1]: *** [tm_stm32f4_ili9341_ltdc.o] Erreur 1

    make[1]: quittant le répertoire « /opt/stm32f4_M4/stm32f4_projects/lcd/lib »

    make: *** [lib] Erreur 2

    • Hi, you are using probably Coocox or EmBlocks without support for STM32F429, and there is not SPI4,5,6, FMC, LTDC, UART7, UART8 and maybe more.

      Go to the link below and download coocox template for F429 discovery. This will then work for you.

      http://stm32f4-discovery.com/2014/04/stm32f429-inside-coocox-coide/

      • eelfakir

        I don’t use Coocox, I use only gcc with makefile if this is what you mean.
        Yes I don’t have those header/source files ! how can I get them ?

      • eelfakir

        when I compile tm_stm32f4_ili9341_ltdc.c it gives error: unknown type name ‘LTDC_InitTypeDef’ wich is defined in stm32f4xx_ltdc.h, but it’s not included in tm_stm32f4_ili9341_ltdc.h ??

        • Include stm32f4xx_ltdc.h in your project.

          Edit: make a library re-download from this page above.

          • eelfakir

            Okey Thank you it works finally (y) ! good job TM

  • Seba

    Hi,

    Can you please tell me how to draw picture on stm32f429 with this liprary?

    thankyou

    • If you have a 16bit picture saved in flash/ram, then you can just simple call 2 foor loops for rows and columns and set corresponding pixel using DrawPixel function.
      If you have .jpg (or any other format) then you need converter to convert to 16bit color depth for one pixel.

      • Seba

        Thank yo for answer! Which is the best software to convert picture. Is it possible to obtain transparency?

      • Seba

        Do you maybe have an example how to draw picture? Do i have to just include it in my project or i have to do something else?

    • Richie

      I made a simple test (http://pastebin.com/zgjRhwfz). For the image buffer I used a tool from ST (http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF257934) called “Resource Editor For Embedded Gui Library” which includes a bmp (24 to 16 bit) image converter (just select option “Output C array without BMP header”). The pixel format RGB565 is already set in the library.

      • Seba

        Hello Richie!

        First thank you very much for replay! I have already solved the problem before you reply on my post. Here is the link of function https://www.dropbox.com/s/2y1ydotsr426dfg/draw%20image.txt?dl=0. I include picture “filname.h” as 2D array.

        But i have got one question on your code what exactly did you mean whit this line “color = SantaImageBuffer[i–] << 8 | SantaImageBuffer[i–];" ?

        Have you been able to obtain transparency somehow?

  • Richie

    It works excellently.
    You may need to include the following files:

    cmsis_lib/source/stm32f4xx_fmc.c
    cmsis_lib/source/stm32f4xx_ltdc.c
    cmsis_lib/include/stm32f4xx_fmc.h
    cmsis_lib/include/stm32f4xx_ltdc.h

    you can download as stm32f4 dsp stdperiph lib from st, in order to make the project work in CooCox. Remember to select the target as STM32F429_439xx device in stm32f4xx.h file and also to add the following files:

    tm_stm32f4_delay.h
    tm_stm32f4_delay.c

    you can find from library 10.
    Thanks for sharing this library.

  • timopen5

    Tried this on my STM32F429ZI. Everything gets scrambled on the internal LCD. I’m using visual studio with VisualGDB. I can get it to work with the old ili9341 library without LTDC, but it’s slow. Any ideas? it looks like the sync not working properly.

    • No idea what and how you did everythin right now.
      Did you just use this lib and sdram lib?

      Send hex, or project, or whatever. Check PLL settings for clock, etc.

      • timopen5

        I used all the files that you have linked above + STM32F4XX files from github. The clock config is added by VisualGDB. I’m quite new at this, where should I check PLL settings and what should they be?

        • check for HSE_VALUE define in stm32f4xx.h, set it to 8000000
          check for PLL_M in system_stm32f4xx.c, set it to 8

          • timopen5

            It’s working now. Found a system_stm32f4xx.c with the correct values on a stm32 forum. Thanks a lot for your fast help.

  • Richie

    Does the library support fonts with anti-aliasing?

  • Pingback: Library 08- ILI9341 LCD for STM32F4 - STM32F4 Discovery()

  • Christian Julius

    HI,

    is there a chance to vary the intensitity of the characters and lines? I am not familiar
    with the display controller and I prefer your “Arduino style” für the STM 🙂

    • Christian Julius

      PS: Display ON and OFF would be nice, too 🙂

    • This about “Arduino style” is very offensive to me.
      Characters are stored in array. For different characters, you need different array of fonts you will use.

      PS: You can add those defines by yourself.

      • Christian Julius

        I have a tool for the AVR to create font structures from Windows Fonts, but is is very different. The smallest font 10×7 is a little bit too small (I am 45 🙂 and the next larger one 11×18 a little bit to big. At the moment i try to implement “ncurses” for the STM32 Display, a “VT100 Terminal” from the 70s Lib I worked with on Z80 old-school machines, too. And a “text scroller” display like we know from Linux console. Dont know if the encapsulation of your routines into a third higher level package is effcient but the STM32 is more like a PC and this “Arduino style” makes everyday work simpler. (We use Arduino in Hardware development section of my company, too)

        • Like I said, this is offensive to me that you said that this is “Arduino” style.
          STM32 is a little bit MORE powerful than Arduinos 😉

          • Christian Julius

            Dont worry….. in the biggest Electronic Forum in Germany, mikrocontrollernet. using the word “Arduino” causes heay shitstorms and “closed threads”, so it is abbreviated with “Jehova”.

            The STM32 is one of the most powerful micros today (ok, not an A20 or ARM 11 which you cannot use withput an RTOS) and its complexity is too high for working on register level, like I did with the LPC23xxx parts.

          • Ok, for STM32F4 I do register access if this is possible and where is really better than call functions. Register access is faster than calling subroutine, but at 180MHz this might don’t have a really feature. But still, if it is possible, I do it as faster as I can 🙂

          • Christian Julius

            Just an idea for your next project: The computer without “CPU” 🙂

            http://www.mycpu.eu/ Absolutely amazing piece of work.

          • Nope 😉

          • Christian Julius

            This is my “old school power”, 0,75 MIPS 🙂 And 100% understanding of all mechanism inside and acesss to all signals.
            🙂

          • Nice to hear 😉

          • Christian Julius

            Id did this last night on the STM32 for educational purpose and it is 1000 times faster at 320×240 than with 80×20 on a Z80. But the whole simulation needs several days with varies in parameters.

            Ok, time for sports now, thanks for a conversation and have a nice day!

      • Christian Julius

        Well OFF means “Display white, LED on”? Is there a chance to make it dark with LED off without re-init after a wake up?

        • Disable LEDs. Leds are connected to transistor or similar. Not controlled with commands.
          No other idea.

          Or fill entire LCD with dark color.

  • Christian Julius

    Tilen,
    is it possible that you create a font which is 2px larger than 7×10? 7×10 is too small for this display. If yes, I would create an open source add-on to your library which allows text scrolling like on a Linux terminal (gree characters on black terminal?) with

    sprintf(buf, , …)
    print_lcd(buf)

    it would be nice to have a VT100 style display with 80 chars in y and as much as possible lines (minimum 24) in y direction.

    I start to code now, but the calculations depend on the used font.

    Regards,
    Christian

    • Christian Julius

      Ok, did it. The “Matrix” is ready. Maybe can be speed optimized because this is maximum with 2 Layers overblending.

      • Christian Julius

        Ok, I took the “blue pill” and achieved better speeeeeeeeeeed, fixed some bugs…

  • Nicolas Leroy

    Hi Tilen,

    I’m using your library to control the LCD screen on STM32F429 Disco, and i saw it uses the SPI5. Problem is i already use this SPI5 to communicate with an external chip. I’ve tried to change your library to use SPI4/3/2/1 but it never worked. Any idea how i could do that please ?

    Thank you for all the help you give me with your library by the way, keep up the good work !

    • Well, you can use SPI5 for different things.
      In LTDC mode, SPI is only used to specify some initialization settings for LCD, then it does not work with LCD anymore.
      You can use SPI5 for more than just one device. That’s why SPI is here.

      Also, LCD is fixed to some pins which belongs to SPI5, you can use SPI4 or any other.

      • Nicolas Leroy

        Oh, i didn’t know that wouldn’t be a problem, i’ll keep up with SPI5 then 🙂 Thank you for your answer !

        • Just select another CS pin for your device. Every device on SPI uses the same MOSI,MISO,SCK pins but different CS pins.

          • Nicolas Leroy

            Hi again, i tried to keep the SPI5 for both the LCD Screen & my other device, but it seems to have interferences between the 2 as my lcd screen isn’t clear, we can barely see texts & shapes but its “moving”, any idea how i could fix that ?

  • Christian Julius

    Yuhuuuuuu !

    Do you think that is is necessary to write a library for things like bargraphs, tachometer and indicators? I want to tune up my car with some Knight Rider K.I.T.T features and need flickerings bars for oil pressure, turbo charger compression and so on.

    Or are there ready to use libraries somewhere on this planet?

      • Christian Julius

        Germany … the country who introduced the VW Scirocco 🙂

        • Then you should know that 😉

          • Christian Julius

            Ok, Segger is 50km from my location (Duesseldorf) here in Hilden. I try two write bargraphs with your lib but I have to change the time consuming calculations for landscape, portrait etc for every simple pixel.

          • Enable rotation in my lib, use rotation feature with GUI_SetRotation or similar.
            And we are done here, this is not part of this post anymore!

          • Christian Julius

            You? Bulgaria? Czechoslowakia? Kroatia?

  • Anıl

    Hello,

    Is it possible to add more layers? I want to build kind of menu but i couldn’t add new layers. Thank you

    • STM supports 2 layer.
      Maybe you can do it by changing layer memory address where you data is in RAM.
      But, for example, emWin tool uses 1 layer only to build everything what it needs, so I think you can do it too 😉

  • DonQuijote

    Hi,

    thank you for your comprehensive Page, just started to learn ARM. First question 😉
    where i can find the library ?

    All Best

    • Hello,

      stdio si a standard C library.
      Using a google, you will be able to find all standard libraries.

      • DonQuijote

        Great thank you for your quick response. Únfortunately i can’t find the right file, seems to be hughe differences

        • There is no any files of source code for public.
          Only header files. So just include library you need with .h in your project and that’s all for you!

          • DonQuijote

            Can you please clarify this ? I do not get it at all 🙁 i get the error messages which i showed you above

          • This is a problem having wrong include paths set in your environment.
            These files are standard peripheral drivers from ST.com for STM32F4xx series.

          • DonQuijote

            How to fix this ? I am using CooCox and STM32F429 Discovery

          • Ok, now I see. You are a totally beginner here.
            Start with first tutorial here on this site before starting with this LCD driver.

          • DonQuijote

            that’s true, i allready did this one : http://stm32f4-discovery.com/2014/04/first-time-with-stm32f429-discovery/

            i read it through again but i can’t see how this one could help me

          • THere is also donwload link for project template! If you read it correct!!
            So use that project with libraries included all you need!

          • DonQuijote

            This ridicules… sorry but i am only getting mistakes and i followed all your steps

          • DonQuijote

            GCC HOME: C:Program Files (x86)GNU Tools ARM Embedded4.9 2015q1bin

            compile:

            [mkdir] Skipping C:UsersJerDownloadsFirstProjectFirstProjectfirstprojectDebugbin because it already exists.

            [mkdir] Skipping C:UsersJerDownloadsFirstProjectFirstProjectfirstprojectDebugobj because it already exists.

            [cc] 10 total files to be compiled.

            [cc] arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Wall -ffunction-sections -g -O0 -c -DSTM32F407VG -DSTM32F4XX -DUSE_STDPERIPH_DRIVER -D__ASSEMBLY__ -IC:UsersJerDownloadsFirstProjectFirstProjectcmsis_boot -IC:UsersJerDesktopSTM32Librariestm_stm32fililtdc -IC:UsersJerDownloadsFirstProjectFirstProject -IC:UsersJerDesktopSTM32 -IC:UsersJerDownloadsFirstProjectFirstProjectcmsis_lib -IC:UsersJerDesktopSTM32Libraries -IC:UsersJerDownloadsFirstProjectFirstProjectcmsis -IC:UsersJerDesktopSTM32Librariesdefines -IC:UsersJerDownloadsFirstProject -IC:UsersJerDownloadsFirstProjectFirstProjectcmsis_libinclude -IC:UsersJerDesktopSTM32Librariestm_stm32fdelay C:UsersJerDownloadsFirstProjectFirstProjectcmsis_bootstartupstartup_stm32f4xx.c C:UsersJerDownloadsFirstProjectFirstProjectmain.c C:UsersJerDownloadsFirstProjectFirstProjectcmsis_libsourcestm32f4xx_rcc.c C:UsersJerDesktopSTM32Librariestm_stm32fdelaytm_stm32f4_delay.c C:UsersJerDownloadsFirstProjectFirstProjectcmsis_libsourcestm32f4xx_gpio.c C:UsersJerDownloadsFirstProjectFirstProjectcmsis_bootsystem_stm32f4xx.c C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c C:UsersJerDownloadsFirstProjectFirstProjectcmsis_libsourcestm32f4xx_spi.c C:UsersJerDesktopSTM32Librariestm_stm32fdelaytm_stm32f4_timer_properties.c C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_fonts.c

            [cc] In file included from C:UsersJerDesktopSTM32Librariestm_stm32fililtdc/tm_stm32f4_ili9341_ltdc.h:102:0,

            [cc] from C:UsersJerDownloadsFirstProjectFirstProjectmain.c:12:

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:487:21: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_LayerInit(LTDC_Layer_TypeDef* LTDC_Layerx, LTDC_Layer_InitTypeDef* LTDC_Layer_InitStruct);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:489:20: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] ^

            [cc] void LTDC_LayerCmd(LTDC_Layer_TypeDef* LTDC_Layerx, FunctionalState NewState);

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:493:29: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_ColorKeyingConfig(LTDC_Layer_TypeDef* LTDC_Layerx, LTDC_ColorKeying_InitTypeDef* LTDC_colorkeying_InitStruct, FunctionalState NewState);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:495:19: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_CLUTCmd(LTDC_Layer_TypeDef* LTDC_Layerx, FunctionalState NewState);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:496:20: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] ^

            [cc] void LTDC_LayerPosition(LTDC_Layer_TypeDef* LTDC_Layerx, uint16_t OffsetX, uint16_t OffsetY);

            [cc] void LTDC_CLUTInit(LTDC_Layer_TypeDef* LTDC_Layerx, LTDC_CLUT_InitTypeDef* LTDC_CLUT_InitStruct);

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:498:25: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:499:22: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_LayerAlpha(LTDC_Layer_TypeDef* LTDC_Layerx, uint8_t ConstantAlpha);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:500:24: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_LayerAddress(LTDC_Layer_TypeDef* LTDC_Layerx, uint32_t Address);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:501:21: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_LayerSize(LTDC_Layer_TypeDef* LTDC_Layerx, uint32_t Width, uint32_t Height);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:502:28: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] ^

            [cc] void LTDC_LayerPixelFormat(LTDC_Layer_TypeDef* LTDC_Layerx, uint32_t PixelFormat);

            [cc] In file included from C:UsersJerDownloadsFirstProjectFirstProjectmain.c:15:0:

            [cc] C:UsersJerDesktopSTM32/stdio.h:1:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token

            [cc] Datei: /usr/include/stdio.h

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stdio.h:17:0: warning: ignoring #pragma ident [-Wunknown-pragmas]

            [cc] #pragma ident “@(#)stdio.h 1.37 95/08/29 SMI” /* SVr4.0 2.34.1.2 */

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stdio.h:19:31: fatal error: sys/feature_tests.h: No such file or directory

            [cc] #include

            [cc] ^

            [cc] compilation terminated.

            [cc] In file included from C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.h:102:0,

            [cc] from C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:19:

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:487:21: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] ^

            [cc] void LTDC_LayerInit(LTDC_Layer_TypeDef* LTDC_Layerx, LTDC_Layer_InitTypeDef* LTDC_Layer_InitStruct);

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:489:20: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_LayerCmd(LTDC_Layer_TypeDef* LTDC_Layerx, FunctionalState NewState);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:493:29: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_ColorKeyingConfig(LTDC_Layer_TypeDef* LTDC_Layerx, LTDC_ColorKeying_InitTypeDef* LTDC_colorkeying_InitStruct, FunctionalState NewState);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:495:19: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_CLUTCmd(LTDC_Layer_TypeDef* LTDC_Layerx, FunctionalState NewState);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:496:20: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_CLUTInit(LTDC_Layer_TypeDef* LTDC_Layerx, LTDC_CLUT_InitTypeDef* LTDC_CLUT_InitStruct);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:498:25: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_LayerPosition(LTDC_Layer_TypeDef* LTDC_Layerx, uint16_t OffsetX, uint16_t OffsetY);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:499:22: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_LayerAlpha(LTDC_Layer_TypeDef* LTDC_Layerx, uint8_t ConstantAlpha);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:500:24: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_LayerAddress(LTDC_Layer_TypeDef* LTDC_Layerx, uint32_t Address);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:501:21: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_LayerSize(LTDC_Layer_TypeDef* LTDC_Layerx, uint32_t Width, uint32_t Height);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:502:28: error: unknown type name ‘LTDC_Layer_TypeDef’

            [cc] void LTDC_LayerPixelFormat(LTDC_Layer_TypeDef* LTDC_Layerx, uint32_t PixelFormat);

            [cc] ^

            [cc] In file included from C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:19:0:

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c: In function ‘TM_ILI9341_Init’:

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.h:119:25: error: ‘SPI5’ undeclared (first use in this function)

            [cc] #define ILI9341_SPI SPI5

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:121:14: note: in expansion of macro ‘ILI9341_SPI’

            [cc] TM_SPI_Init(ILI9341_SPI, ILI9341_SPI_PINS);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.h:119:25: note: each undeclared identifier is reported only once for each function it appears in

            [cc] #define ILI9341_SPI SPI5

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:121:14: note: in expansion of macro ‘ILI9341_SPI’

            [cc] TM_SPI_Init(ILI9341_SPI, ILI9341_SPI_PINS);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c: In function ‘TM_ILI9341_InitPins’:

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:159:156: error: ‘GPIO_AF_LTDC’ undeclared (first use in this function)

            [cc] TM_GPIO_InitAlternate(GPIOA, GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_6 | GPIO_PIN_11 | GPIO_PIN_12, TM_GPIO_OType_PP, TM_GPIO_PuPd_NOPULL, TM_GPIO_Speed_High, GPIO_AF_LTDC);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c: In function ‘TM_LCD9341_InitLTDC’:

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:305:18: error: ‘RCC_APB2ENR_LTDCEN’ undeclared (first use in this function)

            [cc] RCC->APB2ENR |= RCC_APB2ENR_LTDCEN;

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:308:18: error: ‘RCC_AHB1ENR_DMA2DEN’ undeclared (first use in this function)

            [cc] RCC->AHB1ENR |= RCC_AHB1ENR_DMA2DEN;

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:331:2: warning: implicit declaration of function ‘RCC_PLLSAIConfig’ [-Wimplicit-function-declaration]

            [cc] RCC_PLLSAIConfig(192, 7, 4);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:332:2: warning: implicit declaration of function ‘RCC_LTDCCLKDivConfig’ [-Wimplicit-function-declaration]

            [cc] RCC_LTDCCLKDivConfig(RCC_PLLSAIDivR_Div4);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:332:23: error: ‘RCC_PLLSAIDivR_Div4’ undeclared (first use in this function)

            [cc] RCC_LTDCCLKDivConfig(RCC_PLLSAIDivR_Div4);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:335:5: warning: implicit declaration of function ‘RCC_PLLSAICmd’ [-Wimplicit-function-declaration]

            [cc] RCC_PLLSAICmd(ENABLE);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:338:27: error: ‘RCC_FLAG_PLLSAIRDY’ undeclared (first use in this function)

            [cc] while (RCC_GetFlagStatus(RCC_FLAG_PLLSAIRDY) == RESET) {

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c: In function ‘TM_ILI9341_InitLayers’:

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:424:2: warning: implicit declaration of function ‘LTDC_LayerInit’ [-Wimplicit-function-declaration]

            [cc] LTDC_LayerInit(LTDC_Layer1, &LTDC_Layer_InitStruct);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:424:17: error: ‘LTDC_Layer1’ undeclared (first use in this function)

            [cc] LTDC_LayerInit(LTDC_Layer1, &LTDC_Layer_InitStruct);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:434:17: error: ‘LTDC_Layer2’ undeclared (first use in this function)

            [cc] LTDC_LayerInit(LTDC_Layer2, &LTDC_Layer_InitStruct);

            [cc] ^

            [cc] In file included from C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.h:102:0,

            [cc] from C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:19:

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:275:43: error: ‘LTDC_SRCR_IMR’ undeclared (first use in this function)

            [cc] #define LTDC_IMReload LTDC_SRCR_IMR /*!< Immediately Reload. */

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:436:20: note: in expansion of macro 'LTDC_IMReload'

            [cc] ^

            [cc] LTDC_ReloadConfig(LTDC_IMReload);

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:439:2: warning: implicit declaration of function 'LTDC_LayerCmd' [-Wimplicit-function-declaration]

            [cc] LTDC_LayerCmd(LTDC_Layer1, ENABLE);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:451:2: warning: implicit declaration of function 'LTDC_LayerAlpha' [-Wimplicit-function-declaration]

            [cc] LTDC_LayerAlpha(LTDC_Layer1, 255);

            [cc] ^

            [cc] In file included from C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:19:0:

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c: In function 'TM_ILI9341_SendCommand':

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.h:119:25: error: 'SPI5' undeclared (first use in this function)

            [cc] #define ILI9341_SPI SPI5

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:461:14: note: in expansion of macro 'ILI9341_SPI'

            [cc] TM_SPI_Send(ILI9341_SPI, data);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c: In function 'TM_ILI9341_SendData':

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.h:119:25: error: 'SPI5' undeclared (first use in this function)

            [cc] #define ILI9341_SPI SPI5

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:468:14: note: in expansion of macro 'ILI9341_SPI'

            [cc] TM_SPI_Send(ILI9341_SPI, data);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c: In function 'TM_ILI9341_UpdateLayerOpacity':

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:548:18: error: 'LTDC_Layer1' undeclared (first use in this function)

            [cc] LTDC_LayerAlpha(LTDC_Layer1, ILI9341_Opts.Layer1Opacity);

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:549:18: error: 'LTDC_Layer2' undeclared (first use in this function)

            [cc] LTDC_LayerAlpha(LTDC_Layer2, ILI9341_Opts.Layer2Opacity);

            [cc] ^

            [cc] In file included from C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.h:102:0,

            [cc] from C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:19:

            [cc] C:UsersJerDesktopSTM32/stm32f4xx_ltdc.h:275:43: error: 'LTDC_SRCR_IMR' undeclared (first use in this function)

            [cc] #define LTDC_IMReload LTDC_SRCR_IMR /*!< Immediately Reload. */

            [cc] ^

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fililtdctm_stm32f4_ili9341_ltdc.c:552:20: note: in expansion of macro 'LTDC_IMReload'

            [cc] ^

            [cc] LTDC_ReloadConfig(LTDC_IMReload);

            [cc] In file included from C:UsersJerDesktopSTM32Librariestm_stm32fdelaytm_stm32f4_timer_properties.c:19:0:

            [cc] C:UsersJerDesktopSTM32Librariestm_stm32fdelaytm_stm32f4_timer_properties.h:48:27: fatal error: stm32f4xx_tim.h: No such file or directory

            [cc] #include "stm32f4xx_tim.h"

            [cc] ^

            [cc] compilation terminated.

            BUILD FAILED

            Total time: 2 seconds

          • Oh man!!

            The steps I did were:

            1. Downloaded Coocox template from site here,
            2. Downloaded all libraries provided here as “dependencies”
            3. I open main.c in project and copy/replace with content on site here from Example section!

            And woila! It works! Tell again about your ridiciluis and you will do it yourself next time. If you are beginner, then I can’t help you here. Start learning C first and how files are structured!

            Link to project download:
            http://bit.ly/1ApJFKx

          • DonQuijote

            Ok I really appreciate your help, i am just starting to learn so pleaase appologize if i do not get something at the beginning. Now it seems i getting closer and closer but…

            GCC HOME: C:Program Files (x86)GNU Tools ARM Embedded4.9 2015q1bin
            compile:
            [mkdir] Skipping C:UsersJerDesktopSTM32ProjectTemplatestm32f429_projectDebugbin because it already exists.
            [mkdir] Skipping C:UsersJerDesktopSTM32ProjectTemplatestm32f429_projectDebugobj because it already exists.
            [cc] 43 total files to be compiled.
            [cc] arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Wall -ffunction-sections -g -O0 -c -DSTM32F4XX -DUSE_STDPERIPH_DRIVER -D__ASSEMBLY__ -DSTM32F429_439xx -IC:UsersJerDesktopSTM32ProjectTemplatecmsis -IC:UsersJerDesktopSTM32ProjectTemplatetm -IC:UsersJerDesktopSTM32ProjectTemplatecmsis_lib -IC:UsersJerDesktop -IC:UsersJerDesktopSTM32ProjectTemplate -IC:UsersJerDesktopSTM32ProjectTemplatecmsis_libinclude -IC:UsersJerDesktopSTM32 -IC:UsersJer -IC:UsersJerDesktopSTM32ProjectTemplatecmsis_boot C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_syscfg.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_sdio.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_dma2d.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_hash.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_cryp_aes.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_hash_sha1.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_usart.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_pwr.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_can.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_wwdg.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_hash_md5.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_dac.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_ltdc.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_bootstartupstartup_stm32f4xx.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_crc.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_iwdg.c C:UsersJerDesktopSTM32ProjectTemplatemain.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_rcc.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_adc.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_dcmi.c C:UsersJerDesktopSTM32ProjectTemplatetmtm_stm32f4_delay.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_cryp_des.c C:UsersJerDesktopSTM32ProjectTemplatetmtm_stm32f4_spi.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_cryp.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_gpio.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_flash.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_sai.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_bootsystem_stm32f4xx.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_dma.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_fmc.c C:UsersJerDesktopSTM32ProjectTemplatetmtm_stm32f4_sdram.c C:UsersJerDesktopSTM32ProjectTemplatetmtm_stm32f4_ili9341_ltdc.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_spi.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_i2c.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_rng.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_exti.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcemisc.c C:UsersJerDesktopSTM32ProjectTemplatetmtm_stm32f4_gpio.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_rtc.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_cryp_tdes.c C:UsersJerDesktopSTM32ProjectTemplatetmtm_stm32f4_fonts.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_tim.c C:UsersJerDesktopSTM32ProjectTemplatecmsis_libsourcestm32f4xx_dbgmcu.c
            [cc] In file included from C:UsersJerDesktopSTM32ProjectTemplatemain.c:15:0:
            [cc] C:UsersJerDesktopSTM32/stdio.h:1:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
            [cc] Datei: /usr/include/stdio.h
            [cc] ^
            [cc] C:UsersJerDesktopSTM32/stdio.h:17:0: warning: ignoring #pragma ident [-Wunknown-pragmas]
            [cc] #pragma ident “@(#)stdio.h 1.37 95/08/29 SMI” /* SVr4.0 2.34.1.2 */
            [cc] ^
            [cc] C:UsersJerDesktopSTM32/stdio.h:19:31: fatal error: sys/feature_tests.h: No such file or directory
            [cc] #include
            [cc] ^
            [cc] compilation terminated.

            Can you give me another tip ??

          • Use pastebin or somethink like that for posting so big list of errors like this.
            You made stdio.h file inside your project?
            Why would you do that? I told you, it’s a hidden file, just include it and use it!

          • DonQuijote

            Hm it is not in my project where all the other libraries are placed. I’m just including it but still it shows me the mistake

          • DonQuijote

            I also uploaded now the LCD, it is working but still it shows me the mistake with the stdio.h when building.

            but thank you so far, it works pretty well

          • Ok, add me to skype, we can try teamviewer for more.

            Don’t ask for skype account, search it on web.

          • DonQuijote

            Ok, i added you

  • Wellington Mateus

    Hi Majerle Tilen,

    I was trying to use your library but I’ve been gotten this errors:

    C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c: In function ‘TM_SPI_InitWithMode’:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:82:14: error: ‘SPI4’ undeclared (first use in this function)

    [cc] if (SPIx == SPI4) {

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:87:14: error: ‘SPI5’ undeclared (first use in this function)

    [cc] if (SPIx == SPI5) {

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:92:14: error: ‘SPI6’ undeclared (first use in this function)

    [cc] if (SPIx == SPI6) {

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c: In function ‘TM_SPI_InitFull’:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:123:14: error: ‘SPI4’ undeclared (first use in this function)

    [cc] if (SPIx == SPI4) {

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:128:14: error: ‘SPI5’ undeclared (first use in this function)

    [cc] if (SPIx == SPI5) {

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:133:14: error: ‘SPI6’ undeclared (first use in this function)

    [cc] if (SPIx == SPI6) {

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c: In function ‘TM_SPI_GetPrescalerFromMaxFrequency’:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:158:14: error: ‘SPI4’ undeclared (first use in this function)

    [cc] || SPIx == SPI4

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:161:14: error: ‘SPI5’ undeclared (first use in this function)

    [cc] || SPIx == SPI5

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:164:14: error: ‘SPI6’ undeclared (first use in this function)

    [cc] || SPIx == SPI6

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c: In function ‘TM_SPIx_Init’:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:350:14: error: ‘SPI4’ undeclared (first use in this function)

    [cc] if (SPIx == SPI4) {

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:362:14: error: ‘SPI5’ undeclared (first use in this function)

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:352:19: error: ‘RCC_APB2ENR_SPI4EN’ undeclared (first use in this function)

    [cc] if (SPIx == SPI5) {

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:364:19: error: ‘RCC_APB2ENR_SPI5EN’ undeclared (first use in this function)

    [cc] ^

    [cc] RCC->APB2ENR |= RCC_APB2ENR_SPI5EN;

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:374:14: error: ‘SPI6’ undeclared (first use in this function)

    [cc] if (SPIx == SPI6) {

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:376:19: error: ‘RCC_APB2ENR_SPI6EN’ undeclared (first use in this function)

    [cc] RCC->APB2ENR |= RCC_APB2ENR_SPI6EN;

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c: In function ‘TM_SPI4_INT_InitPins’:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:490:129: error: ‘GPIO_AF_SPI4’ undeclared (first use in this function)

    [cc] TM_GPIO_InitAlternate(GPIOE, GPIO_PIN_2 | GPIO_PIN_5 | GPIO_PIN_6, TM_GPIO_OType_PP, TM_GPIO_PuPd_NOPULL, TM_GPIO_Speed_High, GPIO_AF_SPI4);

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:500:33: error: ‘SPI4’ undeclared (first use in this function)

    [cc] TM_SPI_InitCustomPinsCallback(SPI4);

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c: In function ‘TM_SPI5_INT_InitPins’:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:510:129: error: ‘GPIO_AF_SPI5’ undeclared (first use in this function)

    [cc] TM_GPIO_InitAlternate(GPIOF, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9, TM_GPIO_OType_PP, TM_GPIO_PuPd_NOPULL, TM_GPIO_Speed_High, GPIO_AF_SPI5);

    [cc] ^

    [cc] RCC->APB2ENR |= RCC_APB2ENR_SPI4EN;

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:521:33: error: ‘SPI5’ undeclared (first use in this function)

    [cc] TM_SPI_InitCustomPinsCallback(SPI5);

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c: In function ‘TM_SPI6_INT_InitPins’:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:531:132: error: ‘GPIO_AF_SPI6’ undeclared (first use in this function)

    [cc] TM_GPIO_InitAlternate(GPIOG, GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14, TM_GPIO_OType_PP, TM_GPIO_PuPd_NOPULL, TM_GPIO_Speed_High, GPIO_AF_SPI6);

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novolcdtm_stm32f4_spi.c:536:33: error: ‘SPI6’ undeclared (first use in this function)

    [cc] TM_SPI_InitCustomPinsCallback(SPI6);

    [cc] ^

    [cc] In file included from C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c:19:0:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c: In function ‘TM_ILI9341_Init’:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.h:146:25: error: ‘SPI5’ undeclared (first use in this function)

    [cc] #define ILI9341_SPI SPI5

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c:108:14: note: in expansion of macro ‘ILI9341_SPI’

    [cc] TM_SPI_Init(ILI9341_SPI, ILI9341_SPI_PINS);

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.h:146:25: note: each undeclared identifier is reported only once for each function it appears in

    [cc] #define ILI9341_SPI SPI5

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c:108:14: note: in expansion of macro ‘ILI9341_SPI’

    [cc] TM_SPI_Init(ILI9341_SPI, ILI9341_SPI_PINS);

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c: In function ‘TM_ILI9341_SendCommand’:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.h:146:25: error: ‘SPI5’ undeclared (first use in this function)

    [cc] #define ILI9341_SPI SPI5

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c:248:14: note: in expansion of macro ‘ILI9341_SPI’

    [cc] TM_SPI_Send(ILI9341_SPI, data);

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.h:146:25: error: ‘SPI5’ undeclared (first use in this function)

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c: In function ‘TM_ILI9341_SendData’:

    [cc] #define ILI9341_SPI SPI5

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c:255:14: note: in expansion of macro ‘ILI9341_SPI’

    [cc] TM_SPI_Send(ILI9341_SPI, data);

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c: In function ‘TM_ILI9341_INT_Fill’:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c:304:2: warning: implicit declaration of function ‘TM_SPI_SetDataSize’ [-Wimplicit-function-declaration]

    [cc] TM_SPI_SetDataSize(ILI9341_SPI, TM_SPI_DataSize_16b);

    [cc] ^

    [cc] In file included from C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c:19:0:

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.h:146:25: error: ‘SPI5’ undeclared (first use in this function)

    [cc] #define ILI9341_SPI SPI5

    [cc] ^

    [cc] TM_SPI_SetDataSize(ILI9341_SPI, TM_SPI_DataSize_16b);

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c:304:21: note: in expansion of macro ‘ILI9341_SPI’

    [cc] TM_SPI_SetDataSize(ILI9341_SPI, TM_SPI_DataSize_16b);

    [cc] ^

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c:304:34: error: ‘TM_SPI_DataSize_16b’ undeclared (first use in this function)

    [cc] C:UsersUsuarioDownloadsprjetos_arm_novodisplaytm_stm32f4_ili9341.c:322:34: error: ‘TM_SPI_DataSize_8b’ undeclared (first use in this function)

    [cc] TM_SPI_SetDataSize(ILI9341_SPI, TM_SPI_DataSize_8b);

    Please, could you help me with it?

    • Really? So big error list you post here? Kidding me, right?
      Ok, Update standard peripheral drivers in you Coocox or Emblocks you use for SPI and everything.
      Then redownload my SPI, ILI and so on libraries you need.

  • Luis Afonso

    Hi Majerle,

    I have been looking for examples and/or libraries to use the LCD on the discovery board. I tried first your other library that uses SPI and it didn’t work, I tried this one and I got it working.

    I just have 1 question. The LCD on the STM32F429 only supports the LTDC interface or does it support SPI as well? (pretty newbie at LCDs)

    • It supports SPI as well.
      SPI is used here to tell LCD that we wanna use LTDC mode, so in this example, both, SPI and LTDC are used to get it working.

  • Anoop Kumar

    If we need to use LTDC is necessary to use SPI. I mean in initLCD() why are those commands sent through SPI.
    Can’t we make controller work only in LTDC mode?

    • ILI9341 LCD is not standard RGB LCD where you just need to setup pins for pixel clock, data, hsync, vsync and so on. This LCD can work also on other communications and that’s the reason why you need to setup it first for LTDC. Then, after you do this, you can use LTDC.

      LTDC is only used for data transfer. For commands, you can’t use LTDC.

  • Febryn Ngk

    why my pin ili9341 not 0:17 but 0:15? so this library need paralel comunication using 0:17 pin? using parallel and spi comunication? or one of them?

    • Learn english also!
      LCD needs both communications in order to get it to work with LTDC. SPI is used for LCD settings and LTDC after that for data transfer. 16 data pins is used for transferring, in RGB565 mode!

      • Febryn Ngk

        haha ok majerle i will learn english soon, i have see thath in datasheet ili9341, but why my ili9341 just have pin 0:15 not 0:17,

        • It has all pins, believe me, but maybe they are not connected out to pins!

    • Febryn Ngk

      can or not use 6 bit paralel using this library? not 16 bit like your example? because my ili934 lcd just have 0:15 pin, not 0:17 pin

      • So, if you have 0:15 pins, this is 16 data lines. And library works with 16 data lines. Where is problem now? Next time think before you make comment!

        • Febryn Ngk

          sorry majerle, but i see in your ILI9341 conented with stm32f49, for collor RGB you using 18 pin? Red 6 pins, Green 6 pins and Blue 6 pins,

  • Christian Julius

    Tilen,
    I use you LTDC Lib in my starter project. I programmed a neverending colored Game-of-live simulation and it works fine, because the 429 is very fast. The problem: I use 2 fields for calculations and they consume 160kb, the whole internal SRAM. I modified the linker script so tht I can use SDRAM too. e.g. int SDRAM field[0…10.000]. The problem is, that SDRAM is awful slow, 10 times slower that internal RAM. This is because the display used DMA and allocates the bus very often while my access has to wait. Do you see a chance to disable the DMA (and there fore the display freezes) during heavy calculations? It does not matter if the display flickers. It is fine to have 8 MB (1 MB is used for display) but DMA blocks the whole 8 MB for every access.

    • Disable ltdc with LTDC_Cmd(DISABLE) or sonething like that. Then enable again

  • sel mesal

    Hi Majerle, because I am using TrueStudio, I think I cannot use your libraries, correct?
    If that is the case, do you know of any functions in the standard peripherals library to simply write text on the LCD?
    (For example, for UART transmission, the library provides HAL_UART_Transmit)

    • This is not true and regarding HAL, you missed topic here.
      Libraries are written in C89 language and I don’t see a problem for TrueSTUDIO to compile them as long as it knows how to compile C89.

  • parham davami

    Hi Majerle,
    First of all thanks for your incredibly useful web.
    And my question is this:
    How can i use LTDC to communicate with a standard 40pin TFT LCD?
    Does it need any controllerdriver between?
    I saw on comments that SPI is just for initial setting so we can neglect it,right?

    • Simply just dont init spi 🙂 init only ltdc and pins for it and thats all.