2025-06-30 7:15 AM - edited 2025-06-30 8:26 AM
Hello,
I am using TouchGFX with freeRTOS on an STM32G0 board.
I call the touchgfxSignalVSync through a Timer Interrupt and quickly after I get an HardFault in the blitCopyARGB8888 function. As this is a library I cannot debug further. I am trying to go around the issue by increasing the stack size (24*3072 = 73728 bytes) but this does not fix the issue. Commenting the draw function in the touchgfxDisplayDriverTransmitBlock function does not help either.
Doing a step by step debug, I see that the load looks to be the issue where the address 0x2000cXXX is loaded.
Let me know if you need any more information.
Thanks!
if (htim->Instance == TIM4) {
touchgfxSignalVSync();
}
Solved! Go to Solution.
2025-07-22 12:52 AM
The issue was not direcly linked to touchGFX but from the fact that the code/data were exceeding a bank in flash
Updating PREFETCH_ENABLE macro in stm32g0xx_hal_conf.h helped
// It seems that we can get some trouble with Prefetch failure when branching across flash memory bank
// See Device Errata. So we disable the prefetch. Code might be slower after this setting
// This value is already in HAL_Init
// https://www.st.com/resource/en/errata_sheet/es0549-stm32g0c1xcxe-device-errata-stmicroelectronics.pdf
// 2.2.10 Prefetch failure when branching across flash memory banks
#define PREFETCH_ENABLE 0U
2025-07-02 7:05 AM
Hello @pokitoz ,
Can you try to set your "Number of blocks" in STM32CubeMX to 4 instead of 3?
Regards,
2025-07-02 8:10 AM
Hello Gaetan,
Thanks for the reply.
I had to lower the buffer from 8K to 4K to use 4 buffers because of memory constraints.
However, I still get an issue:
Do you have a sample configuration using an external flash, STM32G0, CMSISv1 and Partial Frame buffer ?
Best,
2025-07-22 12:52 AM
The issue was not direcly linked to touchGFX but from the fact that the code/data were exceeding a bank in flash
Updating PREFETCH_ENABLE macro in stm32g0xx_hal_conf.h helped
// It seems that we can get some trouble with Prefetch failure when branching across flash memory bank
// See Device Errata. So we disable the prefetch. Code might be slower after this setting
// This value is already in HAL_Init
// https://www.st.com/resource/en/errata_sheet/es0549-stm32g0c1xcxe-device-errata-stmicroelectronics.pdf
// 2.2.10 Prefetch failure when branching across flash memory banks
#define PREFETCH_ENABLE 0U