I have 2 tasks (threads):
thread 1: toggle the blue led.
thread 2: is receiving NMEA sentences with UART2 and transmit the UART2 output throw the UART3 channel.
I have configured the FREERTOS according to your instructions (with the blink01/02 example).
but when the threads start to run I get “HardFault_Handler” error…
I tried to search online for solutions and I see you keep saying to follow those links:
Besides defining configASSERT you should also enable stack overflow checking for development/debugging.
Using assertions can help to catch a number of HardFaults with the possibility to trace back and identify the problem.
Having configASSERT defined (in FreeRTOSConfig.h as documented) makes debugging a lot easier by stopping the debugger if the application hangs. If the hang is caused by an assertion, the application is halted in the forever loop usually the last part of the assertion code (as in example 2) and check the call stack for the cause of the assertion.
Except fatal application programming bugs the main reasons for application crashes are
stack overflows (see above)
wrong interrupt priorities for certain ports/MCUs e.g. with Cortex-M CPUs
STM32 (which one ?) comes with Cortex-M CPUs and the choosen interrupt priorities have to match configMAX_SYSCALL_INTERRUPT_PRIORITY in your FreeRTOSConfig.h
See RTOS for ARM Cortex-M and mabe also this pretty good picture for details.