modifying TouchGFX project for a STM32H735G-Disco for a 7" LCD and FT5446 Touch Controller
Hi everybody,
I successfully created a project for the STM32H735G-Disco. It's rather simple, just two screen with a button in each one. You press the button and you move to the other screen. Nothing more simple than that.
I migrate the project to a custom board which is almost identical to the Disco one with these exceptions :
- ext Flash on OSP1 has a different chip (16Meg vs the original 64Meg)
- 7" LCD
- the Capacitive Touch Controller (integrated in the LCD) is the FT5446 not the FT5336 like in the Disco one.
External Ram chip is the same as in the Disco Board.
After modifying the .ioc file I managed correctly the 7" by adjusting the LTCD parameters according to the LCD datasheet. I also increased the clock of the LTDC peripheral up to 32MHz according to the LCD datasheet. The 7" display works properly.
Then I modified the touch controller driver.
The clue was to compare the content of the FT5336_CHIP_ID_REG with a different value - the FT5446 stores in such a reg a different value respect to the original FT5336 -
I also remove gesture and multitouch features from the driver which was unuseful for my applications (a lot of lines of code)
Of Course I modified the linker file .ld by removing the ext flash section since I still have no external loader for such a flash chip for the STlink.
As far as the external flash is concerned, I also modified the .ioc file by disabling OSP1 and the relative regions in the CORTEX M7 menu in Cube MX.
With these main modifications I was able to have the original project running on the custom board. Well but... here the issues I was unable to fix after several days of attempts:
- I have tearing effects with screen transitions. From screen1 to screen2 I selected "slide transition" and I actually have the tearing effect. In the opposite transition, from screen2 to screen1 I selected "transition none" and it works fine with very few (maybe absent) tearing effect. I tested all the possible configurations regarding the caching of ram and/or MPU configuration. I also moved from RGB888 to RGB565 for reducing the size of the frame buffer but the tearing effect is still present. Using a double frame buffer doesn't fix the issue.
- For having the touch controller working properly I was force to put a delay in the STM32TouchController.cpp file (see below)
void STM32TouchController::init()
{
TS_Init_t hTS;
hTS.Orientation = TS_SWAP_XY;
hTS.Accuracy = 0;
hTS.Width = touchgfx::HAL::FRAME_BUFFER_WIDTH;
hTS.Height = touchgfx::HAL::FRAME_BUFFER_HEIGHT;
HAL_Delay(1000); //without it BSP_TS_Init() fails the return code.
//shorter delay fails too.
//osDelay() crash the system
tstatus = BSP_TS_Init(0, &hTS);
}
In the past I did almost the same operation for migrating a project from a STM32F746-Disco to a different custom board with same external flash and ram but with the same 7" display. The 7" display was the same I'm using now with the different Touch controller (Panasys NMLCD-70800480 with on board FT5446 touch controller).
At that time the touch driver worked fine - no need to add a 1000ms delay in the STM32TouchController.cpp file, but I have had the same issue with the tearing effects in screen transistion.
At that time, moving from RGB888 to RGB565 worked fine with the STM32F746 custom board derived from the disco.
Since the issue of the tearing effect seems continuing to "follow me" from project to project, please someone have some idea on how to fix it?
And finally, Why should I stop the system for 1 sec at boot for having the Touch controller working properly ?
Thanks for your precious suggestions
Regards
