2020-02-07 03:41 AM
Hello
i'm using STM32F746G with touchGfx and keil for a project. i have a working empty project (a blank screen with a button). but when i regenerate the project with cubeMX checking the option :"generate peripheral initialization as a pair of '.c/.h/' files per peripheral" i get HardFault Handler. My keil caller stack say is caused by: touchgfx_init ->setLanguage ->hardFault_Handler
2020-02-11 12:36 AM
Hello @Zui ,
Please provide your ioc file with more details about the STM32CubeMX and firmware package versions used.
This will help us to check and analyze your issue.
Best Regards,
Imen
2020-02-11 12:49 AM
Toolchains are notoriously bad at determining stack sizes.
A quick test would be to try that first. With touchGFX involved, I would guess 1 or 2 kBytes.
2020-02-11 12:45 PM
Can you elaborate on how to find and change the stack size?
2020-02-11 12:49 PM
The OP was using Keil, there the stack size is called out in startup_stm32f7xx.s
Seem to recall IAR having something in the .ICF file, whereas GNU/GCC just comingles the heap/stack and hopes they don't plough into each other.
2020-02-12 06:44 AM
i tryed both increasing the stack size in startup_stm32f7xx.s and the stack size given to osThreadDef function inside MX_FREERTOS_Init(); but didn't work.
2020-02-12 06:44 AM
i tryed both increasing the stack size in startup_stm32f7xx.s and the stack size given to osThreadDef function inside MX_FREERTOS_Init(); but didn't work.
2020-02-17 03:58 AM
Have you enabled CRC? The STM32 CRC check may be failing which results in an intentional hard fault.
Otherwise it could have something to do with QSPI initialization since texts and fonts are placed in external flash by default.
2020-02-17 07:50 AM
@Martin KJELDSEN thanks for your reply.
Yes i have crc enabled. i've tryed disabling it, but nothing changed.
How can it be QSPI initialization since the same empry project generated with cubeMx with "generate peripheral initialization as a pair of '.c/.h/' files per peripheral" doesnt work, but without that option do work. the QSPI initialization is the same.
2020-02-17 08:03 AM
Need to look at faulting instructions and processor registers to determine the nature of the failure better. Published routines to dump salient details previously.
An access/probe of QSPI memory will fault if the memory is not properly initialized, same with SDRAM.