NXP MCUXpresso Touch controller not working on iMXRT1050, iMXRT1060 and iMXRT1064 - panel RK043FN02H
There is a software bundle and demo for the iMXRT10xx family already included in the NXP MCUXpresso SDK Builder for the common EVK evaluation boards, available directly from NXP and I discovered that touch was not working out of the box with the sample applications provided.
The latest NXP MCUXpresso SDK includes Storyboard support but the there are now at least 2 different 4.3inch 480x272 LCD panels available RK043FN66HS and RK043FN02H which fit the common boards.
To reproduce this for the for the RT1060 EVK in particular I downloaded the latest SDK from NXP as follows:
And configured the SDK to include FreeRTOS and Crank Storyboard GUI options:
It built and I downloaded the SDK from the email link and imported the 3 sample projects from the SDK into a new MCUXpresso Workspace:
I built the samples and took the CoffeeApp sample (evkmimxrt1060_crank_storyboard_coffeeapp) and flashed it to the board just fine but the touch input was not detected.
After a bit of debugging I found that in the touch code task in source/sbengine_task_pxp.c : sbengine_input_task(void *arg) the I2C touch screen initilisation in Board_Touch_Init() was not completing correctly and the controller therefore was not registering touch events :
It turned out that the panel that I had on my board (DEMO_PANEL_RK043FN02H) was not the same as the default for the latest EVK (DEMO_PANEL_RK043FN66HS) and needed to be corrected. This was easily done by setting the define in board\touch.h and rebuilding:
#define DEMO_PANEL DEMO_PANEL_RK043FN02H
After a quick reflash the touch worked perfectly and I could now run the demo successfully.
You will need to make the same change to the evkmimxrt1064_crank_storyboard_homecontrols and evkmimxrt1064_crank_storyboard_helloworld projects although the latter does not actually use touch.