Question
I can't initialize stmpe811.
Hi, I'm working on a project with STM32F746 MCU and I used stmpe811 for touch controller but my code always going into hard fault error during initialization. I attached my project on the drive also I added the initialization part of code. Please help me.
Thank you.
https://drive.google.com/open?id=1HeUqoFNDb-q1m6BLhI72yCxR0O-dKmj0
uint8_t BSP_TS_Init(uint16_t XSize, uint16_t YSize)
{
uint8_t ret = TS_ERROR;
/* Initialize x and y positions boundaries */
TsXBoundary = XSize;
TsYBoundary = YSize;
/* Read ID and verify if the IO expander is ready */
/**
*Problem is in here. TS_I2C_ADDRESS = 0x82 (Get it from datasheet)
* STMPE811_ID = 0x0811 (It was already in library I didn't change.)
*My program is skipping this part and going Hard fault handler.
*on working program (with STM32F429 Discovery board) program goes into this conditional
*/
if(stmpe811_ts_drv.ReadID(TS_I2C_ADDRESS) == STMPE811_ID)
{
/* Initialize the TS driver structure */
TsDrv = &stmpe811_ts_drv;
ret = TS_OK;
}
if(ret == TS_OK)
{
/* Initialize the LL TS Driver */
TsDrv->Init(TS_I2C_ADDRESS);
TsDrv->Start(TS_I2C_ADDRESS);
}
return ret;
}