2018-08-11 08:07 AM
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?
2018-08-11 02:14 PM
Somebody please respond
2018-08-11 04:04 PM
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.
2018-08-12 03:54 AM
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
2018-08-12 05:48 AM
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