Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT


FreeRTOS Plus CLI,A Fatal Error Ocured

Posted by huangqilong119 on May 2, 2017


I want to recommend you fix the freertos source code about CLI When I used the 'FreeRTOS Plus CLI' source code, 'UARTCommandConsole.c' to compile. After Linking and download to STM32 platfrom. A fatal error ocured. When I reset the STM32, the welcome information was shown normally via the serial port. However, when I send something to the STM32 via 'XSHELL', the STM32 has not any response. Then I pause the debug, I found my program point is always jump to 'HardFault_Handler'. Many tries, I found that, at the first beginning, the program is run normally, and once sending something, it was halt! Then I check the source code, I found that, at the function 'static void prvUARTCommandConsoleTask( void pvParameters )', there is a call 'xSemaphoreTake( xTxMutex, cmdMAXMUTEX_WAIT )', the error is there. > Because the mutex semaphore 'xTxMutex' is though defined, it was not created before taking and giving. So it's the fatal error to cause the OS halt. If you want to fix it, just add a line'xTxMutex = xSemaphoreCreateMutex();'. And Don't forget change the definetion '#define configUSE_MUTEXES 1' in 'FreeRTOS.h'

Best Regards,



FreeRTOS Plus CLI,A Fatal Error Ocured

Posted by rtel on May 2, 2017

The mutex is created in vUARTCommandConsoleStart().

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS