STM32F429i Disco: (1) Fix a bad return value if the LCD driver is already initialized. (2) The LCD driver initialization is now performed during the early boot sequence. (3) Increased the size of the message queue from 32 to 64 in the lcd configuration. From Marco, ocram.lhark@yahoo.com.

This commit is contained in:
Gregory Nutt 2015-04-17 07:04:53 -06:00
parent 2cecfa1036
commit ff7d5d23e9
4 changed files with 107 additions and 145 deletions

View File

@ -141,29 +141,34 @@ config STM32F429I_DISCO_ILI9341
Driver. This sub driver supports only communication with the display driver
connected via 4-wire serial (spi) mcu interface.
config STM32F429I_DISCO_ILI9341_SPIFREQUENCY
int "SPI frequency"
default 12000000
depends on STM32F429I_DISCO_ILI9341
---help---
Define the bus freqency of the spi device.
if STM32F429I_DISCO_ILI9341
config STM32F429I_DISCO_ILI9341_SPIBITS16
bool "Enable 16 bit pixel read/write"
default n
depends on STM32F429I_DISCO_ILI9341
---help---
This enables faster 16-bit spi mode for transmitting or receiving pixel data
to or from the display gram. But uses default 8-bit spi mode for all other
display operations.
choice
prompt "LCD Interface Type"
default STM32F429I_DISCO_ILI9341_NONE if !LCD_ILI9341 && !STM32_LTDC
default STM32F429I_DISCO_ILI9341_LCDIFACE if LCD_ILI9341 && !STM32_LTDC
default STM32F429I_DISCO_ILI9341_FBIFACE if STM32_LTDC
config STM32F429I_DISCO_ILI9341_NONE
bool "No LCD interface"
config STM32F429I_DISCO_ILI9341_LCDIFACE
bool "Enable support for nuttx lcd interface"
default n
depends on STM32F429I_DISCO_ILI9341 && LCD_ILI9341
bool "Enable support for nuttx LCD interface"
depends on LCD_ILI9341
---help---
Enable lcd driver support for the nuttx lcd interface.
config STM32F429I_DISCO_ILI9341_FBIFACE
bool "Enable support for nuttx framebuffer interface"
depends on STM32_LTDC
---help---
Enable lcd driver support for the nuttx framebuffer interface to displaying
data via ltdc controller of the stm32f429i mcu.
endchoice # LCD Interface Type
if STM32F429I_DISCO_ILI9341_LCDIFACE
config STM32F429I_DISCO_ILI9341_LCDDEVICE
int "LCD interface"
default 0
@ -171,16 +176,24 @@ config STM32F429I_DISCO_ILI9341_LCDDEVICE
depends on STM32F429I_DISCO_ILI9341_LCDIFACE
---help---
Define the lcd interface which should be used. This must be
corresponding to the configured ili9341 lcd device in the driver
corresponding to the configured ili9341 LCD device in the driver
section.
config STM32F429I_DISCO_ILI9341_FBIFACE
bool "Enable support for nuttx frambuffer interface"
default n
depends on STM32F429I_DISCO_ILI9341 && STM32_LTDC
config STM32F429I_DISCO_ILI9341_SPIFREQUENCY
int "SPI frequency"
default 12000000
---help---
Enable lcd driver support for the nuttx framebuffer interface to displaying
data via ltdc controller of the stm32f429i mcu.
Define the bus frequency of the SPI device.
config STM32F429I_DISCO_ILI9341_SPIBITS16
bool "Enable 16 bit pixel read/write"
default n
---help---
This enables faster 16-bit SPI mode for transmitting or receiving pixel data
to or from the display gram. But uses default 8-bit SPI mode for all other
display operations.
endif # STM32F429I_DISCO_ILI9341_LCDIFACE
if STM32F429I_DISCO_ILI9341_FBIFACE
@ -211,5 +224,7 @@ config STM32F429I_DISCO_ILI9341_FBIFACE_RORTRAIT
Define for "reverse portrait" orientation support.
endchoice
endif
endif
endif # STM32F429I_DISCO_ILI9341_FBIFACE
endif # STM32F429I_DISCO_ILI9341
endif # ARCH_BOARD_STM32F429I_DISCO

View File

@ -42,8 +42,9 @@ CONFIG_RAW_BINARY=y
# Debug Options
#
# CONFIG_DEBUG is not set
CONFIG_ARCH_HAVE_STACKCHECK=y
CONFIG_ARCH_HAVE_HEAPCHECK=y
CONFIG_ARCH_HAVE_STACKCHECK=y
# CONFIG_STACK_COLORATION is not set
CONFIG_DEBUG_SYMBOLS=y
CONFIG_ARCH_HAVE_CUSTOMOPT=y
# CONFIG_DEBUG_NOOPT is not set
@ -88,6 +89,7 @@ CONFIG_ARCH="arm"
# CONFIG_ARCH_CHIP_SAMA5 is not set
# CONFIG_ARCH_CHIP_SAMD is not set
# CONFIG_ARCH_CHIP_SAM34 is not set
# CONFIG_ARCH_CHIP_SAMV7 is not set
CONFIG_ARCH_CHIP_STM32=y
# CONFIG_ARCH_CHIP_STR71X is not set
# CONFIG_ARCH_ARM7TDMI is not set
@ -96,6 +98,7 @@ CONFIG_ARCH_CHIP_STM32=y
# CONFIG_ARCH_CORTEXM0 is not set
# CONFIG_ARCH_CORTEXM3 is not set
CONFIG_ARCH_CORTEXM4=y
# CONFIG_ARCH_CORTEXM7 is not set
# CONFIG_ARCH_CORTEXA5 is not set
# CONFIG_ARCH_CORTEXA8 is not set
CONFIG_ARCH_FAMILY="armv7-m"
@ -103,17 +106,24 @@ CONFIG_ARCH_CHIP="stm32"
# CONFIG_ARMV7M_USEBASEPRI is not set
CONFIG_ARCH_HAVE_CMNVECTOR=y
# CONFIG_ARMV7M_CMNVECTOR is not set
# CONFIG_ARMV7M_LAZYFPU is not set
CONFIG_ARCH_HAVE_FPU=y
# CONFIG_ARCH_HAVE_DPFPU is not set
# CONFIG_ARCH_FPU is not set
# CONFIG_ARMV7M_MPU is not set
#
# ARMV7M Configuration Options
#
# CONFIG_ARMV7M_HAVE_ICACHE is not set
# CONFIG_ARMV7M_HAVE_DCACHE is not set
# CONFIG_ARMV7M_HAVE_ITCM is not set
# CONFIG_ARMV7M_HAVE_DTCM is not set
# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set
# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y
# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL is not set
CONFIG_ARMV7M_HAVE_STACKCHECK=y
# CONFIG_ARMV7M_STACKCHECK is not set
# CONFIG_ARMV7M_ITMSYSLOG is not set
@ -139,6 +149,7 @@ CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y
# CONFIG_ARCH_CHIP_STM32L152V8 is not set
# CONFIG_ARCH_CHIP_STM32L152VB is not set
# CONFIG_ARCH_CHIP_STM32L162ZD is not set
# CONFIG_ARCH_CHIP_STM32L162VE is not set
# CONFIG_ARCH_CHIP_STM32F100C8 is not set
# CONFIG_ARCH_CHIP_STM32F100CB is not set
# CONFIG_ARCH_CHIP_STM32F100R8 is not set
@ -184,6 +195,24 @@ CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y
# CONFIG_ARCH_CHIP_STM32F303RC is not set
# CONFIG_ARCH_CHIP_STM32F303VB is not set
# CONFIG_ARCH_CHIP_STM32F303VC is not set
# CONFIG_ARCH_CHIP_STM32F372C8 is not set
# CONFIG_ARCH_CHIP_STM32F372R8 is not set
# CONFIG_ARCH_CHIP_STM32F372V8 is not set
# CONFIG_ARCH_CHIP_STM32F372CB is not set
# CONFIG_ARCH_CHIP_STM32F372RB is not set
# CONFIG_ARCH_CHIP_STM32F372VB is not set
# CONFIG_ARCH_CHIP_STM32F372CC is not set
# CONFIG_ARCH_CHIP_STM32F372RC is not set
# CONFIG_ARCH_CHIP_STM32F372VC is not set
# CONFIG_ARCH_CHIP_STM32F373C8 is not set
# CONFIG_ARCH_CHIP_STM32F373R8 is not set
# CONFIG_ARCH_CHIP_STM32F373V8 is not set
# CONFIG_ARCH_CHIP_STM32F373CB is not set
# CONFIG_ARCH_CHIP_STM32F373RB is not set
# CONFIG_ARCH_CHIP_STM32F373VB is not set
# CONFIG_ARCH_CHIP_STM32F373CC is not set
# CONFIG_ARCH_CHIP_STM32F373RC is not set
# CONFIG_ARCH_CHIP_STM32F373VC is not set
# CONFIG_ARCH_CHIP_STM32F401RE is not set
# CONFIG_ARCH_CHIP_STM32F411RE is not set
# CONFIG_ARCH_CHIP_STM32F405RG is not set
@ -216,6 +245,7 @@ CONFIG_ARCH_CHIP_STM32F429Z=y
# CONFIG_STM32_STM32F20XX is not set
# CONFIG_STM32_STM32F207 is not set
# CONFIG_STM32_STM32F30XX is not set
# CONFIG_STM32_STM32F37XX is not set
CONFIG_STM32_STM32F40XX=y
# CONFIG_STM32_STM32F401 is not set
# CONFIG_STM32_STM32F411 is not set
@ -263,6 +293,7 @@ CONFIG_STM32_HAVE_SPI2=y
CONFIG_STM32_HAVE_SPI3=y
CONFIG_STM32_HAVE_SPI4=y
CONFIG_STM32_HAVE_SPI5=y
CONFIG_STM32_HAVE_SPI6=y
# CONFIG_STM32_ADC1 is not set
# CONFIG_STM32_ADC2 is not set
# CONFIG_STM32_ADC3 is not set
@ -320,6 +351,7 @@ CONFIG_STM32_USART1=y
# CONFIG_STM32_UART8 is not set
# CONFIG_STM32_IWDG is not set
# CONFIG_STM32_WWDG is not set
# CONFIG_STM32_NOEXT_VECTORS is not set
#
# Alternate Pin Mapping
@ -343,6 +375,8 @@ CONFIG_STM32_USART=y
# CONFIG_SERIAL_DISABLE_REORDERING is not set
# CONFIG_STM32_FLOWCONTROL_BROKEN is not set
# CONFIG_STM32_USART_SINGLEWIRE is not set
# CONFIG_STM32_HAVE_RTC_COUNTER is not set
# CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set
#
# USB FS Host Configuration
@ -439,10 +473,12 @@ CONFIG_NSH_MMCSDMINOR=0
# CONFIG_STM32F429I_DISCO_FLASH is not set
# CONFIG_STM32F429I_DISCO_RAMMTD is not set
CONFIG_STM32F429I_DISCO_ILI9341=y
CONFIG_STM32F429I_DISCO_ILI9341_SPIFREQUENCY=20000000
CONFIG_STM32F429I_DISCO_ILI9341_SPIBITS16=y
# CONFIG_STM32F429I_DISCO_ILI9341_NONE is not set
CONFIG_STM32F429I_DISCO_ILI9341_LCDIFACE=y
CONFIG_STM32F429I_DISCO_ILI9341_LCDDEVICE=0
CONFIG_STM32F429I_DISCO_ILI9341_SPIFREQUENCY=20000000
CONFIG_STM32F429I_DISCO_ILI9341_SPIBITS16=y
# CONFIG_LIB_BOARDCTL is not set
#
# RTOS Features
@ -509,7 +545,8 @@ CONFIG_NAME_MAX=32
#
# RTOS hooks
#
# CONFIG_BOARD_INITIALIZE is not set
CONFIG_BOARD_INITIALIZE=y
# CONFIG_BOARD_INITTHREAD is not set
# CONFIG_SCHED_STARTHOOK is not set
# CONFIG_SCHED_ATEXIT is not set
# CONFIG_SCHED_ONEXIT is not set
@ -526,7 +563,7 @@ CONFIG_SIG_SIGCONDTIMEDOUT=16
# POSIX Message Queue Options
#
CONFIG_PREALLOC_MQ_MSGS=4
CONFIG_MQ_MAXMSGSIZE=32
CONFIG_MQ_MAXMSGSIZE=64
#
# Work Queue Support
@ -565,9 +602,13 @@ CONFIG_ARCH_HAVE_I2CRESET=y
# CONFIG_I2C is not set
# CONFIG_SPI is not set
# CONFIG_I2S is not set
#
# Timer Driver Support
#
# CONFIG_TIMER is not set
# CONFIG_RTC is not set
# CONFIG_WATCHDOG is not set
# CONFIG_TIMER is not set
# CONFIG_ANALOG is not set
# CONFIG_AUDIO_DEVICES is not set
# CONFIG_VIDEO_DEVICES is not set
@ -683,6 +724,7 @@ CONFIG_USART1_2STOP=0
# System Logging
#
# CONFIG_RAMLOG is not set
# CONFIG_SYSLOG_CONSOLE is not set
#
# Networking Support
@ -871,6 +913,7 @@ CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
# CONFIG_LIBC_PERROR_STDOUT is not set
CONFIG_ARCH_LOWPUTC=y
# CONFIG_LIBC_LOCALTIME is not set
# CONFIG_TIME_EXTENDED is not set
CONFIG_LIB_SENDFILE_BUFSIZE=512
# CONFIG_ARCH_ROMGETC is not set
# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
@ -940,7 +983,6 @@ CONFIG_EXAMPLES_NX_DEFAULT_FONT=y
CONFIG_EXAMPLES_NX_BPP=16
# CONFIG_EXAMPLES_NX_RAWWINDOWS is not set
CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16
# CONFIG_EXAMPLES_NX_EXTERNINIT is not set
#
# Multi-User Configuration Options
@ -959,10 +1001,10 @@ CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4
# CONFIG_EXAMPLES_NXTEXT is not set
# CONFIG_EXAMPLES_OSTEST is not set
# CONFIG_EXAMPLES_PIPE is not set
# CONFIG_EXAMPLES_PPPD is not set
# CONFIG_EXAMPLES_POSIXSPAWN is not set
# CONFIG_EXAMPLES_QENCODER is not set
# CONFIG_EXAMPLES_RGMP is not set
# CONFIG_EXAMPLES_ROMFS is not set
# CONFIG_EXAMPLES_SENDMAIL is not set
# CONFIG_EXAMPLES_SERIALBLASTER is not set
# CONFIG_EXAMPLES_SERIALRX is not set
@ -975,7 +1017,6 @@ CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
# CONFIG_EXAMPLES_TOUCHSCREEN is not set
# CONFIG_EXAMPLES_UDP is not set
# CONFIG_EXAMPLES_WEBSERVER is not set
# CONFIG_EXAMPLES_USBSERIAL is not set
# CONFIG_EXAMPLES_USBTERM is not set
@ -992,6 +1033,7 @@ CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4
#
# CONFIG_INTERPRETERS_FICL is not set
# CONFIG_INTERPRETERS_PCODE is not set
# CONFIG_INTERPRETERS_MICROPYTHON is not set
#
# Network Utilities
@ -1001,15 +1043,11 @@ CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4
# Networking Utilities
#
# CONFIG_NETUTILS_CODECS is not set
# CONFIG_NETUTILS_DHCPD is not set
# CONFIG_NETUTILS_FTPC is not set
# CONFIG_NETUTILS_FTPD is not set
# CONFIG_NETUTILS_JSON is not set
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_TFTPC is not set
# CONFIG_NETUTILS_THTTPD is not set
# CONFIG_NETUTILS_NETLIB is not set
# CONFIG_NETUTILS_WEBCLIENT is not set
# CONFIG_NETUTILS_PPPD is not set
#
# FreeModBus
@ -1043,6 +1081,7 @@ CONFIG_NSH_BUILTIN_APPS=y
# CONFIG_NSH_DISABLE_CD is not set
# CONFIG_NSH_DISABLE_CP is not set
# CONFIG_NSH_DISABLE_CMP is not set
CONFIG_NSH_DISABLE_DATE=y
# CONFIG_NSH_DISABLE_DD is not set
# CONFIG_NSH_DISABLE_DF is not set
# CONFIG_NSH_DISABLE_DELROUTE is not set
@ -1063,6 +1102,7 @@ CONFIG_NSH_BUILTIN_APPS=y
# CONFIG_NSH_DISABLE_MKRD is not set
# CONFIG_NSH_DISABLE_MH is not set
# CONFIG_NSH_DISABLE_MOUNT is not set
# CONFIG_NSH_DISABLE_MV is not set
# CONFIG_NSH_DISABLE_MW is not set
# CONFIG_NSH_DISABLE_PS is not set
# CONFIG_NSH_DISABLE_PUT is not set
@ -1114,120 +1154,20 @@ CONFIG_NSH_CONSOLE=y
#
# System Libraries and NSH Add-Ons
#
#
# Custom Free Memory Command
#
# CONFIG_SYSTEM_FREE is not set
#
# EMACS-like Command Line Editor
#
# CONFIG_SYSTEM_CLE is not set
#
# CU Minimal Terminal
#
# CONFIG_SYSTEM_CUTERM is not set
#
# FLASH Program Installation
#
# CONFIG_SYSTEM_INSTALL is not set
#
# FLASH Erase-all Command
#
#
# Intel HEX to binary conversion
#
# CONFIG_SYSTEM_HEX2BIN is not set
#
# I2C tool
#
#
# INI File Parser
#
# CONFIG_SYSTEM_INIFILE is not set
#
# NxPlayer media player library / command Line
#
#
# RAM test
#
# CONFIG_SYSTEM_RAMTEST is not set
#
# readline()
#
CONFIG_SYSTEM_READLINE=y
CONFIG_READLINE_ECHO=y
#
# P-Code Support
#
#
# PHY Tool
#
#
# Power Off
#
# CONFIG_SYSTEM_POWEROFF is not set
#
# RAMTRON
#
# CONFIG_SYSTEM_RAMTRON is not set
#
# SD Card
#
# CONFIG_SYSTEM_SDCARD is not set
#
# Sudoku
#
# CONFIG_SYSTEM_SUDOKU is not set
#
# Sysinfo
#
CONFIG_SYSTEM_SYSINFO=y
CONFIG_SYSTEM_SYSINFO_STACKSIZE=1024
#
# VI Work-Alike Editor
#
# CONFIG_SYSTEM_VI is not set
#
# Stack Monitor
#
#
# USB CDC/ACM Device Commands
#
#
# USB Composite Device Commands
#
#
# USB Mass Storage Device Commands
#
#
# USB Monitor
#
#
# Zmodem Commands
#
# CONFIG_SYSTEM_ZMODEM is not set

View File

@ -109,7 +109,7 @@ void stm32_boardinitialize(void)
#endif
#ifdef HAVE_CCM_HEAP
/* Initialize ccm allocator */
/* Initialize CCM allocator */
ccm_initialize();
#endif
@ -131,12 +131,18 @@ void stm32_boardinitialize(void)
#ifdef CONFIG_BOARD_INITIALIZE
void board_initialize(void)
{
#ifdef CONFIG_STM32_LTDC
#ifdef CONFIG_STM32F429I_DISCO_ILI9341_FBIFACE
/* Initialize the framebuffer driver */
up_fbinitialize();
#endif
#ifdef CONFIG_STM32F429I_DISCO_ILI9341_LCDIFACE
/* Initialize the SPI-based LCD early */
board_lcd_initialize();
#endif
#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_NSH_ARCHINIT)
/* Perform NSH initialization here instead of from the NSH. This
* alternative NSH initialization is necessary when NSH is ran in user-space
@ -147,4 +153,3 @@ void board_initialize(void)
#endif
}
#endif

View File

@ -92,6 +92,7 @@
* RCM: 2 (DE Mode)
* ByPass_Mode: 1 (Memory)
*/
#define STM32_ILI9341_IFMODE_PARAM ((!ILI9341_INTERFACE_CONTROL_EPL) | \
ILI9341_INTERFACE_CONTROL_DPL | \
(!ILI9341_INTERFACE_CONTROL_HSPL) | \
@ -497,15 +498,16 @@ int board_lcd_initialize(void)
*/
g_lcd = ili9341_initialize(dev, ILI9341_LCD_DEVICE);
if (g_lcd)
{
return OK;
}
}
return -errno;
}
return -errno;
return OK;
}
#endif /* CONFIG_STM32F429I_DISCO_ILI9341_LCDIFACE */