2025-01-03 08:43 PM - edited 2025-01-03 08:50 PM
I customized a board with stm32h743iit6 for HMI application, the main hardware features available on the board are RMII ethernet, 32bit SDRAM and LTDC RGB565 interface. Below is the board picture.
A test MDK keil project is generated by cubemx to test ethernet communication, freertos and lwip are enabled.
Packet loss ratio is zero even for a very long time test, and tcp echo application works fine.
But packet loss ratio rises to about 0.1% when touchgfx added to the project. if interacting with touchgfx screen, ethernet connection will break immediately,while touchgfx still works correctly.
I have tried to improve priority and increase stack size of lwip thread, still can't solve it.
what did I miss?
here is the cubemx config file.
2025-01-09 02:33 AM
Hello,
That is a packed pinout :)
I have a few suggestions you could try:
I noticed all your interrupts are set to the same priority. Does it help if you lower the priority of the DMA2D and TDC interrupts? I don't think they need to have the "Uses FreeRTOS functions" option checked - at least the LTDC is handled entirely in TouchGFX.
You could also try to increase your heap size in the FreeRTOS settings.
What project are you running in TouchGFX? If it's complex, I would debug with a very basic applicatiion, for example just a box with the "draggable" option set.
What screen are you using?
If you have any test points available in your pinout, you can try to map them as outputs with the names VSYNC_FREQ, RENDER_TIME and FRAME_RATE. This will show you how often the LTDC vsync interrupt is fired (the length of the pulse is the time spent between the front and back porch, so the frame time is measured as the high time plus the low time of each cycle), how much time TouchGFX takes to render the screen, and the resulting frame rate.
In general, I would advise you set your framebuffer location in TouchGFX to "by allocation". This requires you to specifically link them in your .sct file. In the example project supplied with TouchGFX, this is handled like this:
LR_IROM1 0x08000000 0x00200000 { ; load region size_region
ER_IROM1 0x08000000 0x00200000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_IRAM1 0x24000000 0x00020000 { ; RW data
.ANY (+RW +ZI)
}
RW_SDRAM 0xd0000000 UNINIT 0xd1ffffff {
*.o (TouchGFX_Framebuffer)
}
}
Your addresses and sizes will of course be different. The important part is to link the TouchGFX_Framebuffer object uninitialised to external memory. Remember to change your configuration in the IDE to use the .sct file.