cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4Discovery + STemWIN

totti001
Associate II
Posted on September 16, 2013 at 14:58

Hy guys,

I have a problem whit Stm32F4Discovery with 3,5LCD (SSD2119 LCD driver) and STemWIN port. I download the examples from the st website, and try to port to discovery but not working. I have a library to the display, where are functions to write data to the lcd.

/* Note: LCD /CS is NE1 - Bank 1 of NOR/SRAM Bank 1~4 */
#define LCD_BASE_Data ((u32)(0x60000000|0x00100000))
#define LCD_BASE_Addr ((u32)(0x60000000|0x00000000))
#define LCD_CMD (*(vu16 *)LCD_BASE_Addr)
#define LCD_Data (*(vu16 *)LCD_BASE_Data)
void LCD_WriteReg(uint8_t LCD_Reg, uint16_t LCD_RegValue)
{
/* Write 16-bit Index, then Write Reg */
LCD_CMD = LCD_Reg;
/* Write 16-bit Reg */
LCD_Data = LCD_RegValue;
}
/**
* @brief Reads the selected LCD Register.
* @param LCD_Reg: address of the selected register.
* @retval LCD Register Value.
*/
uint16_t LCD_ReadReg(uint8_t LCD_Reg)
{
/* Write 16-bit Index (then Read Reg) */
LCD_CMD = LCD_Reg;
/* Read 16-bit Reg */
return (LCD_Data);
}
/**
* @brief Prepare to write to the LCD RAM.
* @param None
* @retval None
*/
void LCD_WriteRAM_Prepare(void)
{
LCD_CMD = SSD2119_RAM_DATA_REG;
}
/**
* @brief Writes to the LCD RAM.
* @param RGB_Code: the pixel color in RGB mode (5-6-5).
* @retval None
*/
void LCD_WriteRAM(uint16_t RGB_Code)
{
/* Write 16-bit GRAM Reg */
LCD_Data = RGB_Code;
}
/**
* @brief Reads the LCD RAM.
* @param None
* @retval LCD RAM Value.
*/
uint16_t LCD_ReadRAM(void)
{
/* Write 16-bit Index (then Read Reg) */
// LCD_CMD = SSD2119_RAM_DATA_REG; /* Select GRAM Reg */
/* Read 16-bit Reg */
return LCD_Data;
}

So this is working I can write text draw object. I read the STemWIN guide and I need port this functions for working:

pfWrite16_A0

void (*)(U16 Data)

pfWrite16_A1

void (*)(U16 Data)

pfWriteM16_A1

void (*)(U16 * pData, int NumItems)

pfReadM16_A1

void (*)(U16 * pData, int NumItems) I try this for this functions:

#define LCD_BASE_Addr ((u32)(0x60000000|0x00000000))
#define LCD_BASE_Data ((u32)(0x60000000|0x00100000))
#define LCD_CMD (*(vu16 *)(LCD_BASE_Addr))
#define LCD_Data (*(vu16 *)(LCD_BASE_Data))
/*********************************************************************
*
* Local functions
*
**********************************************************************
*/
/********************************************************************
*
* LcdWriteReg
*
* Function description:
* Sets display register
*/
static void LcdWriteReg(U16 Data) {
LCD_CMD = Data;
}
/********************************************************************
*
* LcdWriteData
*
* Function description:
* Writes a value to a display register
*/
static void LcdWriteData(U16 Data) {
LCD_Data = Data;
}
/********************************************************************
*
* LcdWriteDataMultiple
*
* Function description:
* Writes multiple values to a display register.
*/
static void LcdWriteDataMultiple(U16 * pData, int NumItems) {
while (NumItems--) {
LCD_Data = *pData++;
}
}
/********************************************************************
*
* LcdReadDataMultiple
*
* Function description:
* Reads multiple values from a display register.
*/
static void LcdReadDataMultiple(U16 * pData, int NumItems) {
while (NumItems--) {
*pData++ = LCD_Data;
}

But not working. The display is black. Anybody can help me? Thanks #lmgtfy:-stm32-resources
4 REPLIES 4
maiorfi
Associate II
Posted on September 19, 2013 at 15:41

Hi. Where did you download files from?

Posted on September 19, 2013 at 16:02

Hi. Where did you download files from?

 

Tried Google?

http://www.st.com/web/en/catalog/tools/PF259225

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sen
Associate II
Posted on September 21, 2013 at 16:15

Hello Mr. janos. I'm also trying to port to stm32f4dis-BB board with SSD2119 LCD the STM32xG-EVAL standalone STemWin program. It looks that I've the same problem that you mentioned. Have you been able to the problem? My LCD also doesn't works it only goes on blinking in an infinite loop. Kindly share your success...

Posted on September 21, 2013 at 16:47

Google bombing the [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STemWin%20GUI_Init%28%29%20crashed&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=235]infinite loop in STemWin

Add

  /* Enable CRC clock */

  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);

Prior to calling the GUI_Init() function, the library is locked to the STM32 via the response of the CRC polynomial to specific input stimulus.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..