Thank you Luis for the hint! You led me on the right track!
With the help of AN4393, page 16 bottom I was able to modify the FlexBus configuration to read from TWR-LCD.
The FB_CLK is set to 40MHz in MQX, therefore I have 25ns for each cycle and at least 4 cycles are needed for each write/read cycle. According to the SSD1289 datasheet a write cycle needs at least 100ns, which is fine without wait state.
But the read cycle needs 1000ns. Therefore I added (1000ns - 4*25ns) / 25ns = 36 wait states.
In init_hw.c i modified the function _bsp_flexbus_lcd_setup:
fb_ptr->CS[0].CSCR = FB_CSCR_BLS_MASK |
FB_CSCR_AA_MASK |
FB_CSCR_WS(36) |
FB_CSCR_PS(2) |
FB_CSCR_BEM_MASK;
There also is an error in eGUI (v3 beta) read FlexBus MQX function:
static unsigned short D4DLCDHW_ReadDataWord_Mqx(void)
{
return *((unsigned short*)BSP_EXTERNAL_LCD_BASE;
}
should be:
static unsigned short D4DLCDHW_ReadDataWord_Mqx(void)
{
return *((unsigned short*)BSP_EXTERNAL_LCD_DC);
}
With these changes reading works fine and I can use the eGUI function D4D_PrintScreenToBMP to take screenshots from the LCD and write them to the attached USB device.