cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429I DISCO LCD Help

abotha
Associate III
Posted on December 17, 2015 at 14:03

Hi Guys.

I recently picked up the above-mentioned evaluation board. I am currently using TrueStudio. I want to display text strings on the on-board LCD. I have been trying to butcher one of the examples to include and use ''stm32f429i_discovery_lcd.h'' library but without any success. I seem to run into all kinds of issues when trying to compile. Does anyone have an example regarding which files should be included and in which sequence do I initialize to display text on the screen? This is what I currently have, but not yet compiling. I will update as soon as I have something that compiles. Help would be greatly appreciated.. Thanks! AJBotha


/**

******************************************************************************

* @file EXTI_Example/main.c

* @author MCD Application Team

* @version V1.0.0

* @date 20-September-2013

* @brief This example shows how to configure external interrupt lines.

******************************************************************************

* @attention

*

* <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2>

*

* Licensed under MCD-ST Liberty SW License Agreement V2, (the ''License'');

* You may not use this file except in compliance with the License.

* You may obtain a copy of the License at:

*

* http://www.st.com/software_license_agreement_liberty_v2

*

* Unless required by applicable law or agreed to in writing, software 

* distributed under the License is distributed on an ''AS IS'' BASIS, 

* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

* See the License for the specific language governing permissions and

* limitations under the License.

*

******************************************************************************

*/

/* Includes ------------------------------------------------------------------*/

#include ''main.h''

#include ''stm32f429i_discovery_lcd.h''

#include ''fonts.h''


/** @addtogroup STM32F429I_DISCOVERY_Examples

* @{

*/


/** @addtogroup EXTI_Example

* @{

*/


/* Private typedef -----------------------------------------------------------*/

EXTI_InitTypeDef EXTI_InitStructure;

/* Private define ------------------------------------------------------------*/

/* Private macro -------------------------------------------------------------*/

__IO uint32_t TimingDelay;

/* Private variables ---------------------------------------------------------*/

/* Private function prototypes -----------------------------------------------*/

static
void
EXTILine0_Config(
void
);

static
void
EXTILine13_Config(
void
);

/* Private functions ---------------------------------------------------------*/


/**

* @brief Main program

* @param None

* @retval None

*/

int
main(
void
)

{

/*!< At this stage the microcontroller clock setting is already configured, 

this is done through SystemInit() function which is called from startup

files (startup_stm32f429_439xx.s) before to branch to application main. 

To reconfigure the default setting of SystemInit() function, refer to

system_stm32f4xx.c file

*/


RCC_ClocksTypeDef RCC_Clocks;

/* SysTick end of count event each 1ms */

RCC_GetClocksFreq(&RCC_Clocks);

SysTick_Config(RCC_Clocks.HCLK_Frequency / 1000);



BSP_LCD_Init();

BSP_LCD_LayerDefaultInit(0, (uint32_t) LCD_FRAME_BUFFER);

BSP_LCD_SelectLayer(0);

BSP_LCD_SetLayerVisible(0,ENABLE);

BSP_LCD_DisplayOn();


BSP_LCD_Clear(LCD_COLOR_RED);

BSP_LCD_DisplayChar(1,1,0x41);

BSP_LCD_DisplayStringAt(2,2, (uint8_t *) 
''Hello!''
, CENTER_MODE);




LCD_SetLayer(0);

LCD_DisplayOn();

LCD_SetTextColor(5-6-5);

LCD_DisplayStringLine(2, (uint8_t *)
''Test Display''
);



/* Initialize LEDs mounted on EVAL board */

STM_EVAL_LEDInit(LED3);

STM_EVAL_LEDInit(LED4);


/* Put LED3 on */

STM_EVAL_LEDOn(LED3);


/* Configure EXTI Line0 (connected to PA0 pin) in interrupt mode */

EXTILine0_Config();


/* Configure EXTI Line13 (connected to PC13 pin) in interrupt mode */

EXTILine13_Config();


while
(1)

{

/* Generate software interrupt: simulate a falling edge applied on EXTI0 line */

EXTI_GenerateSWInterrupt(EXTI_Line13);


Delay(500);

}

}


/**

* @brief Configures EXTI Line0 (connected to PA0 pin) in interrupt mode

* @param None

* @retval None

*/

static
void
EXTILine0_Config(
void
)

{

EXTI_InitTypeDef EXTI_InitStructure;

GPIO_InitTypeDef GPIO_InitStructure;

NVIC_InitTypeDef NVIC_InitStructure;


/* Enable GPIOA clock */

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);

/* Enable SYSCFG clock */

RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);


/* Configure PA0 pin as input floating */

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;

GPIO_Init(GPIOA, &GPIO_InitStructure);


/* Connect EXTI Line0 to PA0 pin */

SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource0);


/* Configure EXTI Line0 */

EXTI_InitStructure.EXTI_Line = EXTI_Line0;

EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;

EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; 

EXTI_InitStructure.EXTI_LineCmd = ENABLE;

EXTI_Init(&EXTI_InitStructure);


/* Enable and set EXTI Line0 Interrupt to the lowest priority */

NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;

NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F;

NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F;

NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;

NVIC_Init(&NVIC_InitStructure);

}


/**

* @brief Configures EXTI Line15 (connected to PG15 pin) in interrupt mode

* @param None

* @retval None

*/

static
void
EXTILine13_Config(
void
)

{

EXTI_InitTypeDef EXTI_InitStructure;

GPIO_InitTypeDef GPIO_InitStructure;

NVIC_InitTypeDef NVIC_InitStructure;


/* Enable GPIOC clock */

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);


/* Enable SYSCFG clock */

RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);


/* Configure PC13 pin as input floating */

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;

GPIO_Init(GPIOC, &GPIO_InitStructure);


/* Connect EXTI Line15 to PC13 pin */

SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOC, EXTI_PinSource13);


/* Configure EXTI Line13 */

EXTI_InitStructure.EXTI_Line = EXTI_Line13;

EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;

EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;

EXTI_InitStructure.EXTI_LineCmd = ENABLE;

EXTI_Init(&EXTI_InitStructure);


/* Enable and set EXTI15_10 Interrupt to the lowest priority */

NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn;

NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F;

NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F;

NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;


NVIC_Init(&NVIC_InitStructure);

}


/**

* @brief Inserts a delay time.

* @param nTime: specifies the delay time length, in 10 ms.

* @retval None

*/

void
Delay(__IO uint32_t nTime)

{

TimingDelay = nTime;


while
(TimingDelay != 0);

}


/**

* @brief Decrements the TimingDelay variable.

* @param None

* @retval None

*/

void
TimingDelay_Decrement(
void
)

{

if
(TimingDelay != 0x00)

{ 

TimingDelay--;

}

}


#ifdef USE_FULL_ASSERT


/**

* @brief Reports the name of the source file and the source line number

* where the assert_param error has occurred.

* @param file: pointer to the source file name

* @param line: assert_param error line source number

* @retval None

*/

void
assert_failed(uint8_t* file, uint32_t line)

{

/* User can add his own implementation to report the file name and line number,

ex: printf(''Wrong parameters value: file %s on line %d\r\n'', file, line) */


/* Infinite loop */

while
(1)

{

}

}

#endif


/**

* @}

*/


/**

* @}

*/


/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

#discovery #!stm32-!lcd-!tft-!discovery-! #stm32f429i #stm32
1 REPLY 1
abotha
Associate III
Posted on December 17, 2015 at 14:57

These are the compile errors that I get. I checked the location of the ili9h and the file is there, don't know why the compiler can't find it?   I think the sdram error is the real issue.    15:34:11 **** Incremental Build of configuration Debug

for

project STM32F429I-Discovery ****

Info: Internal Builder

is

used

for

build

arm-atollic-eabi-gcc -c -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -std=gnu90 -DUSE_HAL_DRIVER -DSTM32F429xx -DUSE_STM32F429I_DISCO -I..\..\..\Inc -I..\..\..\..\..\..\..\..\Drivers\CMSIS\Device\ST\STM32F4xx\Include -I..\..\..\..\..\..\..\..\Drivers\STM32F4xx_HAL_Driver\Inc -I..\..\..\..\..\..\..\..\Drivers\BSP\STM32F429I-Discovery -I..\..\..\..\..\..\..\..\Drivers\CMSIS\Include -Os -ffunction-sections -fdata-sections -g -Wall -Wno-unused-but-

set

-variable -Wno-unused-variable -o Example\User\main.o ..\..\..\Src\main.c

In file included from ..\..\..\..\..\..\..\..\Drivers\BSP\STM32F429I-Discovery/stm32f429i_discovery_lcd.h:50:0,

from ..\..\..\Src\main.c:41:

..\..\..\..\..\..\..\..\Drivers\BSP\STM32F429I-Discovery/stm32f429i_discovery_sdram.h:153:37: error: unknown type name

'FMC_SDRAM_CommandTypeDef'

HAL_StatusTypeDef BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd);

^

In file included from ..\..\..\Src\main.c:41:0:

..\..\..\..\..\..\..\..\Drivers\BSP\STM32F429I-Discovery/stm32f429i_discovery_lcd.h:53:46: fatal error: ../Components/ili9341/ili9h: No such file or directory

#include ''../Components/ili9341/ili9h''

^

compilation terminated.

15:34:11 Build Finished (took 258ms)