cancel
Showing results for 
Search instead for 
Did you mean: 

MX_TouchGFX_Init configuring wrong I2C touchscreen pins on MCU

DWWelch
Associate III

I am using a touch controller with TouchGFX on a custom board. It is using I2C1 on the MCU and is working fine with TouchGFX. However, when MX_TouchGFX_Init() runs it is reconfiguring pins on the MCU for I2C2 that I am using for other functions. I2C2 is not being used and I never enabled or configured it in CubeMX. HAL::initialize() in the following TouchGFX code is remapping the GPIO pins to I2C2:

 

void TouchGFXGeneratedHAL::initialize()

{

HAL::initialize();

registerEventListener(*(Application::getInstance()));

enableLCDControllerInterrupt();

enableInterrupts();

setFrameBufferStartAddresses((void*)frameBuf, (void*)(frameBuf + sizeof(frameBuf) / (sizeof(uint32_t) * 2)), (void*)0);

}

 

I am reconfiguring the pins back to GPIO after MX_TouchGFX_Init() runs, but would like to fix this in TouchGFX.

There is a reference to a touch controller driver in the TouchGFX HAL - touchController(touchCtrl), but

I can't find where TouchGFX is trying to use I2C2 when my touchscreen driver is using I2C1 and is working.

If anyone knows where the TouchGFX HAL touch controller I2C pins are defined please let me know.

 

Thanks,

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
DWWelch
Associate III

Hello All,

Just after posting this I found the definition for the touchscreen and corrected the values. All is working correctly now.

Dan

View solution in original post

1 REPLY 1
DWWelch
Associate III

Hello All,

Just after posting this I found the definition for the touchscreen and corrected the values. All is working correctly now.

Dan