vApplicationStackOverflowHook although stack size should be big enough

danielriegel wrote on Wednesday, May 03, 2017:

@Hein: Yes, you’re right because I use e.g.

uxTaskGetStackHighWaterMark(mgl_task_handle_1ms  );

to check stack consumption. But I won’t need it when software will be finished.

Now I think I managed to get it work without further research of the cause of stackoverflow. The Renesas RH850 has got another 32kb “Retention RAM” which is intended to use in deep stop modes but can also be used in run mode. Maybe it needs some more cycles to proceed and will not be as fast as normal RAM, but I can use it for RTOS!
I put RTOS ucHeap in heap_2.c into Retention RAM by a #pragma command and am able to increase it a lot more without influencing the general RAM usage:

#pragma ghs section bss = ".os_stack"

    /* Allocate the memory for the heap.  The struct is used to force byte
    alignment without using any non-portable code. */
    static union xRTOS_HEAP
    {
        #if portBYTE_ALIGNMENT == 8
            volatile portDOUBLE dDummy;
        #else
            volatile unsigned long ulDummy;
        #endif
        unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];
    } xHeap;

#pragma ghs section bss = default

I think that’s my solution so far (until I programmed so much that I need more RAM again :-))

Thank you guys for your hints!