初级会员
- 积分
- 92
- 金钱
- 92
- 注册时间
- 2017-2-28
- 在线时间
- 11 小时
|
楼主 |
发表于 2017-5-29 14:24:09
|
显示全部楼层
*** Using Compiler 'V5.06 update 3 (build 300)', folder: 'D:\Program Files (x86)\Keil5\ARM\ARMCC\Bin'
Rebuild target 'LTDC LCD RGB test'
assembling startup_stm32f429xx.s...
compiling stm32f4xx_hal_flash_ex.c...
compiling stm32f4xx_hal_dsi.c...
compiling stm32f4xx_hal_sdram.c...
compiling stm32f4xx_hal_pwr.c...
compiling stm32f4xx_hal_flash.c...
compiling stm32f4xx_hal_dma_ex.c...
compiling stm32f4xx_hal_dma2d.c...
compiling stm32f4xx_hal_tim_ex.c...
compiling stm32f4xx_hal_ltdc_ex.c...
compiling stm32f4xx_hal.c...
compiling stm32f4xx_hal_uart.c...
compiling stm32f4xx_ll_fmc.c...
compiling stm32f4xx_hal_dma.c...
compiling stm32f4xx_hal_flash_ramfunc.c...
compiling stm32f4xx_hal_cortex.c...
compiling stm32f4xx_hal_pwr_ex.c...
compiling stm32f4xx_hal_tim.c...
compiling stm32f4xx_hal_gpio.c...
compiling stm32f4xx_hal_ltdc.c...
compiling stm32f4xx_hal_rcc_ex.c...
compiling stm32f4xx_hal_rcc.c...
compiling stm32f4xx_hal_msp.c...
compiling gpio.c...
compiling stm32f4xx_hal_sram.c...
compiling dma2d.c...
compiling fmc.c...
compiling ltdc.c...
compiling main.c...
compiling stm32f4xx_it.c...
compiling usart.c...
compiling system_stm32f4xx.c...
compiling lcd.c...
linking...
LTDC LCD RGB test\LTDC LCD RGB test.axf: Error: L6218E: Undefined symbol HAL_SRAM_Init (referred from lcd.o).
Not enough information to list image symbols.
Finished: 1 information, 0 warning and 1 error messages.
"LTDC LCD RGB test\LTDC LCD RGB test.axf" - 1 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed: 00:01:00
###############################################
#ifndef __LCD_H
#define __LCD_H
//#include "sys.h"
#include "stdlib.h"
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_sram.h"
################################################
///////////////////////////////////////////////////////////////////////
#include "lcd.h"
#include "stdlib.h"
#include "font.h"
#include "usart.h"
//#include "delay.h"
#include "ltdc.h"
////////////////////////////////////////////////////////////
SRAM_HandleTypeDef hsram1; //SRAM句柄(用于控制LCD)
//初始化lcd
//该初始化函数可以初始化各种型号的LCD(详见本.c文件最前面的描述)
void LCD_Init(void)
{
GPIO_InitTypeDef GPIO_Initure;
FMC_NORSRAM_TimingTypeDef Timing;
FMC_NORSRAM_TimingTypeDef ExtTiming;
lcddev.id=LTDC_PanelID_Read(); //检查是否有RGB屏接入
if(lcddev.id!=0)
{
//HAL_LTDC_Init(); //ID非零,说明有RGB屏接入.
if (HAL_LTDC_Init(&hltdc) != HAL_OK) //设置 RGBLCD 的相关参数,并使能 LTDC
{
Error_Handler();
}
}
else
{
__HAL_RCC_GPIOB_CLK_ENABLE(); //开启GPIOB时钟
GPIO_Initure.Pin=GPIO_PIN_5; //PB5,背光控制
GPIO_Initure.Mode=GPIO_MODE_OUTPUT_PP; //推挽输出
GPIO_Initure.Pull=GPIO_PULLUP; //上拉
GPIO_Initure.Speed=GPIO_SPEED_HIGH; //高速
HAL_GPIO_Init(GPIOB,&GPIO_Initure);
hsram1.Instance=FMC_NORSRAM_DEVICE; //BANK1
hsram1.Extended=FMC_NORSRAM_EXTENDED_DEVICE;
hsram1.Init.NSBank=FMC_NORSRAM_BANK1; //使用NE1
hsram1.Init.DataAddressMux=FMC_DATA_ADDRESS_MUX_DISABLE; //不复用数据线
hsram1.Init.MemoryType=FMC_MEMORY_TYPE_SRAM; //SRAM
hsram1.Init.MemoryDataWidth=FMC_NORSRAM_MEM_BUS_WIDTH_16; //16位数据宽度
hsram1.Init.BurstAccessMode=FMC_BURST_ACCESS_MODE_DISABLE; //是否使能突发访问,仅对同步突发存储器有效,此处未用到
hsram1.Init.WaitSignalPolarity=FMC_WAIT_SIGNAL_POLARITY_LOW;//等待信号的极性,仅在突发模式访问下有用
hsram1.Init.WaitSignalActive=FMC_WAIT_TIMING_BEFORE_WS; //存储器是在等待周期之前的一个时钟周期还是等待周期期间使能NWAIT
hsram1.Init.WriteOperation=FMC_WRITE_OPERATION_ENABLE; //存储器写使能
hsram1.Init.WaitSignal=FMC_WAIT_SIGNAL_DISABLE; //等待使能位,此处未用到
hsram1.Init.ExtendedMode=FMC_EXTENDED_MODE_ENABLE; //读写使用不同的时序
hsram1.Init.AsynchronousWait=FMC_ASYNCHRONOUS_WAIT_DISABLE;//是否使能同步传输模式下的等待信号,此处未用到
hsram1.Init.WriteBurst=FMC_WRITE_BURST_DISABLE; //禁止突发写
hsram1.Init.ContinuousClock=FMC_CONTINUOUS_CLOCK_SYNC_ASYNC;
hsram1.Init.PageSize = FMC_PAGE_SIZE_NONE;
//FSMC读时序控制寄存器
Timing.AddressSetupTime=15; //地址建立时间(ADDSET)为15个HCLK 1/180M*15=5.5ns*15=82.5ns
Timing.AddressHoldTime=0;
Timing.DataSetupTime=0x46; //数据保存时间(DATAST)为70个HCLK =5.5*70=385ns
Timing.AccessMode=FMC_ACCESS_MODE_A; //模式A
//FSMC写时序控制寄存器
ExtTiming.AddressSetupTime=15; //地址建立时间(ADDSET)为15个HCLK=82.5ns
ExtTiming.AddressHoldTime=0;
ExtTiming.DataSetupTime=15; //数据保存时间(DATAST)为5.5ns*15个HCLK=82.5ns
ExtTiming.AccessMode=FMC_ACCESS_MODE_A; //模式A
// HAL_SRAM_Init(&hsram1,&Timing,&ExtTiming);
if (HAL_SRAM_Init(&hsram1, &Timing, &ExtTiming) != HAL_OK)
{
Error_Handler();
}
HAL_Delay(50); // delay 50 ms
请问这个程序是那里出问题了呢?(大多数是抄原子哥的,怎么会出这个问题呢) |
|