cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F413H Discovery touchsreen driver (FMPI2C) Issue

IIvan.0
Associate II

Hello,

I am using the stm32f413h-discover board (MB1274 RevD) which uses touchsreen controller FT6236. I wan to use touch functionality for stemwin, so i've inluded drivers for toucscreen controller chip in my project (official BSP driver) I am having trouble reading chips ID because it seems in initialization part of the official BSP code. Here is what happens:

in TS_IO_Init() fmpi2c and gpio is initialized and then TS_IO_Read() is called which leads to call of FMPI2C_RequestMemoryRead, which returnts ERROR. Error is HAL_FMPI2C_ERROR_AF (ACKF error). Can somebody please give information about this issue? Why is this happening in official code which should work with no problem?

4 REPLIES 4
IIvan.0
Associate II

Somebody please respond

IIvan.0
Associate II

Basically my issue is identical as in this topic: https://community.st.com/s/question/0D50X00009XkYGTSA3/touchscreen-setting-on-custom-board-stm32f7-mcu

However it should not be a HW fault as in the above topic, since I am using stm32f413 discovery board on which i have preloaded example application which includes touch functionality in order to confirm it works, and it really does work, but for some reason it does not work when i use bsp ts driver included in bsp.

IIvan.0
Associate II

Okey, managed to fix the above issue with NACKF, It seems that device was being held in constant reset (TS_RESET_PIN), they didn't managed the resseting in the code. I've added following two in TS_IO_init after rst pin initialization:

 HAL_GPIO_WritePin(TS_RESET_GPIO_PORT,TS_RESET_PIN,0);

 HAL_Delay(10);

 HAL_GPIO_WritePin(TS_RESET_GPIO_PORT,TS_RESET_PIN,1);

However, now I am no longer getting NACKF, but now I am getting HAL_FMPI2C_ERROR_TIMEOUT

Make sure you have the interrupts enabled, and IRQ Handlers in stm32f4xx_it.c

Look over some projects using the touch screen

STM32Cube_FW_F4_V1.21.0\Projects\STM32F413H-Discovery\Applications\USB_Host\HID_Standalone

STM32Cube_FW_F4_V1.21.0\Projects\STM32F413H-Discovery\Applications\USB_Host\MSC_Standalone

STM32Cube_FW_F4_V1.21.0\Projects\STM32F413H-Discovery\Demonstrations\Core\Src

Unfortunately relatively few users with F413H-DISCO here, not a board I have

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