After updating to 4.11.1, im facing a few problems.
my ___stack_chk_fail function gets called as xTraceEventCreate1 is returned.
in trcTaskMonitor.c, there is an assumption that standard stdio.h can always used. It looks like it is prepared that TRC_CFG_PRINTF should be a standard configuration define, but it is not mentioned in any other file. I caught this as I have poisoned “malloc” and printf references malloc via reent.h
In trcKernelPort.h, there are a lot of macros that expand to switch statements. All of these switch statements lack default cases which triggers warnings when compiling with -Wswitch-default
The last two bullets are simply feedback to @johankraft, however I would appreciate help on the stack issue.
I have started to investigate the stack issue, but so far, all things I have done to influence the issue have had no effect.
I have tested on both GCC 13.3 and 14.3.
I have tried both -Os and -Og.
drastically changing _Min_Stack_Size in my .ld file.
I also tried to increase the idle task stack, knowing that it should not have any effect.
I am working via stm32CubeIDE 2.0 on a stm32G474RE. FreeRTOS version is 11.2.0.
The problem is somehow connected to the use of __stack_chk_fail.
If I comment out the definition of the __stack_chk_guard variable, the problem disappears.
If I remove the -fstack-check-all compiler flag, the problem is instead turned into a Hardfault (Bus, memory management or usage fault, Attempt to switch into invalid state). It is also the detected at another place
It looks like you’re simply running out of stack space. If you investigate the HardFault, you will probably find a value in BFAR that’s just outside of a stack. When a SysTick IRQ happens, which stack is used? Are you sure that you tried to increase this stack?
But you are right. The problem is indeed a blown stack. I had a too aggressively big heap area which obviously gave me a (too) small stack. The reason why I did not catch that seems to be that I have done something wrong with the stack canaries that does not seem to trigger in the way that it should.
Thanks so much for the assistance.
I will keep adding to this thread when i figure out why that is.
But for now it works. I am abit confused about some of the output as View does not seem to pick up all the task names.