vApplicationStackOverflowHook

Hi i would like to create just 2 tasks. But i gor error of vApplicationStackOverflowHook. ~~~

include “stm32f30x.h”

include “FreeRTOS.h”

include “task.h”

//Task functions prototypes void vTask1handlder(void *params); void vTask2handlder(void *params); TaskHandlet xTaskHandle1 = NULL; TaskHandlet xTaskHandle2 = NULL; int main(void) { //1. Reset the RCC clock configuration to the default reset state //HSI ON,PLL OFF, HSE OFF, system clock = 8 MHz RCC_DeInit();
//2. update the SystemCoreClock variable
SystemCoreClockUpdate();

xTaskCreate(vTask1_handlder, "Task-1",configMINIMAL_STACK_SIZE,NULL,2,&xTaskHandle1);

xTaskCreate(vTask2_handlder, "Task-2",configMINIMAL_STACK_SIZE,NULL,2,&xTaskHandle2);
for(;;);
} void vTask1_handlder(void *params) { while(1); } void vTask2_handlder(void *params) { while(1); } ~~~ as far as I know, this kind of error are connected with FreeRTOSConfig.h. I search something in the forum but changing some parameters value like configUSEMALLOCFAILEDHOOK, configCHECKFORSTACKOVERFLOW, i have never solved the issues. The compiler gives me: ~~~ d:/openstm32/plugins/fr.ac6.mcu.externaltools.arm-none.win321.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: STM32HelloWorld.elf section .bss' will not fit in regionRAM’ d:/openstm32/plugins/fr.ac6.mcu.externaltools.arm-none.win321.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: region RAM' overflowed by 13736 bytes Third-Party/FreeRTOS/ong/Source/tasks.o: In functionvTaskSwitchContext’: D:WorkspaceRTOSworkspaceSTM32HelloWorldDebug/../Third-Party/FreeRTOS/ong/Source/tasks.c:2988: undefined reference to `vApplicationStackOverflowHook’ collect2.exe: error: ld returned 1 exit status makefile:38: recipe for target ‘STM32HelloWorld.elf’ failed make: *** [STM32_HelloWorld.elf] Error 1 ~~~ My Config file is: ~~~ ….

include “stm32f30x.h”

extern uint32_t SystemCoreClock;

define configUSE_PREEMPTION 1

define configUSEIDLEHOOK 0

define configUSETICKHOOK 0// it was 1

define configCPUCLOCKHZ (SystemCoreClock)

define configTICKRATEHZ ((portTickType) 1000)

define configMAXPRIORITIES (5) //it was ((unsigned portBASETYPE) 5)

define configMINIMALSTACKSIZE ((unsigned short) 130)

define configTOTALHEAPSIZE ((size_t) (75 * 1024))

define configMAXTASKNAME_LEN (10)

define configUSETRACEFACILITY 1

define configUSE16BIT_TICKS 0

define configIDLESHOULDYIELD 1

define configUSE_MUTEXES 1

define configQUEUEREGISTRYSIZE 8

define configCHECKFORSTACK_OVERFLOW 2 // it was 2

define configUSERECURSIVEMUTEXES 1

define configUSEMALLOCFAILED_HOOK 0

define configUSEAPPLICATIONTASK_TAG 0

define configUSECOUNTINGSEMAPHORES 1

define configGENERATERUNTIME_STATS 0

/* Co-routine definitions. */

define configUSECOROUTINES 0

define configMAXCOROUTINE_PRIORITIES (2)

/* Software timer definitions. */

define configUSE_TIMERS 1

define configTIMERTASKPRIORITY (2)

define configTIMERQUEUELENGTH 10

define configTIMERTASKSTACKDEPTH (configMINIMALSTACK_SIZE * 2)

/* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */

define INCLUDE_vTaskPrioritySet 1

define INCLUDE_uxTaskPriorityGet 1

define INCLUDE_vTaskDelete 1

define INCLUDE_vTaskCleanUpResources 1

define INCLUDE_vTaskSuspend 1

define INCLUDE_vTaskDelayUntil 1

define INCLUDE_vTaskDelay 1

… ~~~ thanks in advance Fausto

vApplicationStackOverflowHook

I would definitely not expect a stack overflow with those settings as your tasks do not allocate any stack variables or call any functions. When does the stack overflow occur? Do the tasks ever start? Which compiler are you using and what is the optimization set to?

vApplicationStackOverflowHook

You are getting a link error saying you haven;t defined vApplicationStackOverflowHook but you have configured FreeRTOS to call it because you have set configCHECKFORSTACK_OVERFLOW to 2. You need to define the function vApplicationStackOverflowHook. If you program is being written in C++, it also needs to be declared inside an extern “C” block, or it won’t have the right name.

vApplicationStackOverflowHook

Hi I m using System Workbench of ST. The compiler is Ac6 STM32 MCU GCC. As you can understand, i’m new with FreeRTOS and for me some names are unknown.

vApplicationStackOverflowHook

the appear in the file task,c in the void vTaskSwitchContext( void ) when the fucntion calls the function taskCHECKFORSTACKOVERFLOW() compiler : undefined reference to vApplicationStackOverflowHook’. if i set configCHECKFORSTACKOVERFLOW to 0, i have error of RAM: ~~~ d:/openstm32/plugins/fr.ac6.mcu.externaltools.arm-none.win321.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: STM32HelloWorld.elf section .bss' will not fit in regionRAM’ d:/openstm32/plugins/fr.ac6.mcu.externaltools.arm-none.win321.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: region `RAM’ overflowed by 13736 bytes collect2.exe: error: ld returned 1 exit status makefile:38: recipe for target ‘STM32HelloWorld.elf’ failed make: *** [STM32_HelloWorld.elf] Error 1 ~~~

vApplicationStackOverflowHook

As Richard D said, if you want to use stack overflowing (which you definitely should during development) then YOU need to implement vApplicationStackOverflowHook(). Anything that starts “Application” is the responsibility of the application writer. First link: https://www.google.com/search?q=vApplicationStackOverflowHook Also as Richard D says, the second error you are getting is that you are trying to allocate 13KBytes more RAM than the linker script part says you have available – so you need to reduce the RAM (this is nothing to do with FreeRTOS by the way, but reducing the size of the heap allocated to FreeRTOS may be all you need to do). https://www.freertos.org/Documentation/RTOS_book.html