cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling touch screen on STM32F469I-Discovery but can not

Keyur Thumar
Associate III

Hello,

I have been following this tutorial to enable touch screen on my STM32F469-Discovery board for STemWin.

I have done all the things shown in article. Code compiled successfully. But I can see only blank screen.

In extra to the tutorial, I need to add stm32469i_discovery_lcd.h, Utilities/Fonts/fonts.h and stm32469i_discovery_sdram.h.

By adding these task I got an error on redefining the DSI_IO_WriteCmd function which already defined in STemwin_wrapper.c. SO I removed defination from stm32469i_discovery_lcd.c and compiled.

Can Anyone help ?

4 REPLIES 4
Imen.D
ST Employee

Hello @Keyur Thumar​ 

Let me first welcome you to the Community 🙂

From your input , I understand that the project is working when removed the DSI_IO_WriteCmd function from stm32469i_discovery_lcd.c. Is this true?

Could you please provide more details on the faced issue:

Which version of CubeF4, CubeMx and STemWin are you using ? Which IDE ?

What exactly did the error message say?

I am curious to know if you faced any particular issue with one of the working LCD example already available in the STM32CubeF4 package?

\STM32Cube_FW_F4_V1.26.1\Projects\STM32469I-Discovery\Examples\LCD_DSI

\STM32Cube_FW_F4_V1.26.1\Projects\STM32469I-Discovery\Applications\Display

If there is no issue faced with these examples, you may check differences between CubeMX generated code and example.

I'll be waiting for your feedback and progress on your project 😊

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Keyur Thumar
Associate III

Hey @Imen DAHMEN​ ,

Thank you for the reply.

  • No, after removing the DSI_IO_WriteCmd API I can compile that successfully. But I can not see anything on display.
  • I am using CubeMX version 5.4.0, Cube IDE version 1.1.0 and 1.6.1 (both tried) and CubeF4 version 1.24.2. I am using emWin library version 5.44 but that is not I have selected. It is generated by CubeMX from CubeF4.
  • error for this is like
STemwin_wrapper.c:(.text.DSI_IO_WriteCmd+0x0): multiple definition of `DSI_IO_WriteCmd'; Drivers/BSP/STM32469I-Discovery/stm32469i_discovery_lcd.o:stm32469i_discovery_lcd.c:(.text.DSI_IO_WriteCmd+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
  • I am using CubeF4 v1.24.2 because I want to configure STemWin using CubeMX. Later version does not support it. No I haven't faced any issue in CubeF4 example. (Note : This issue comes when I am adding touch driver. I can display normal picture on lcd.)
  • I have found that issue happenes because of configuring TIM 3 for polling touch sensing event as explained in the link I am following. Can you explain why it is happening?

Keyur Thumar
Associate III

Hey @Imen DAHMEN​ 

I have found that I2C communication with touch controller does work. Driver can not get reponse for ID in below snippet from stm32469i_discovery_ts.c

uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY)
 
{
 
 uint8_t ts_status = TS_OK;
 
 uint8_t ts_id1, ts_id2 = 0;
 
 /* Note : I2C_Address is un-initialized here, but is not used at all in init function */
 
 /* but the prototype of Init() is like that in template and should be respected    */
 
 
 
 /* Initialize the communication channel to sensor (I2C) if necessary */
 
 /* that is initialization is done only once after a power up     */
 
 ft6x06_ts_drv.Init(I2C_Address);
 
 
 
 ts_id1 = ft6x06_ts_drv.ReadID(TS_I2C_ADDRESS);
 
 if(ts_id1 != FT6206_ID_VALUE)
 
 {
 
  ts_id2 = ft6x06_ts_drv.ReadID(TS_I2C_ADDRESS_A02);
 
  I2C_Address  = TS_I2C_ADDRESS_A02;   
 
 }
 
 else
 
 {
 
  I2C_Address  = TS_I2C_ADDRESS;   
 
 }
 
  
 
 /* Scan FT6xx6 TouchScreen IC controller ID register by I2C Read    */
 
 /* Verify this is a FT6206 or FT6336G, otherwise this is an error case */
 
 if((ts_id1 == FT6206_ID_VALUE) || (ts_id2 == FT6206_ID_VALUE))
 
 {
 
  /* Found FT6206 : Initialize the TS driver structure */
 
  ts_driver = &ft6x06_ts_drv;
 
 
 
  /* Get LCD chosen orientation */
 
  if(ts_SizeX < ts_SizeY)
 
  {
 
   ts_orientation = TS_SWAP_NONE;         
 
  }
 
  else
 
  {
 
   ts_orientation = TS_SWAP_XY | TS_SWAP_Y;         
 
  }
 
 
 
  if(ts_status == TS_OK)
 
  {
 
   /* Software reset the TouchScreen */
 
   ts_driver->Reset(I2C_Address);
 
 
 
   /* Calibrate, Configure and Start the TouchScreen driver */
 
   ts_driver->Start(I2C_Address);
 
 
 
  } /* of if(ts_status == TS_OK) */
 
 }
 
 else
 
 {
 
  ts_status = TS_DEVICE_NOT_FOUND;
 
 }
 
 
 
 return (ts_status);
 
}

I am getting ts_id1 and ts_id2 as 0 and It says touch device not found.

Ebby
Associate II

I am having exactly the same issue. Is there a solution for this?