Quality RTOS & Embedded Software

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


FreeRTOS cannot start up.

Posted by *anonymous on October 25, 2011

Dear FreeRTOS support,

I've made a stripped down program with the RTOS for the processor PIC32MX320F128H with a blinking LED for a test.

However, it refuses to start at all. Is there any thing I need to put inside for a bare essential RTOS to work?


Here's the code:

#include <p32xxxx.h>
#include <system.h>
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "croutine.h"
#include "timers.h"
void UART1_Init();
void UART1_putc(unsigned char);
void UART1_puts(unsigned char*);
static void prvSetupHardware( void );
static void prvCheckTask( void *pvParameters ) __attribute__((noreturn));
static void vLEDTask(void* pvParameters);
const portTickType smallDelay = 500 / portTICK_RATE_MS;
unsigned long i = 0;
int main()
	xTaskCreate(vLEDTask, "LED", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );
	return 0;
void UART1_Init()
	U1BRG = 77;
	U1MODE = 0x8008;
	U1STAbits.UTXEN = 1;
	U1STAbits.URXEN = 1;
void UART1_putc(unsigned char inputc)
	U1TXREG = inputc;
void UART1_puts(unsigned char* string)
static void prvSetupHardware( void )
	AD1PCFG = 0xFFFF;                //All pins as Digital
    DDPCONbits.JTAGEN = 0;           //Disable the JTAG port
	TRISE = 0x0000;
	PORTE = 0x0000;
	PMCONbits.ON = 0;
static void vLEDTask(void* pvParameters)
		PORTEbits.RE0 ^= 1;

The LEDTask is to toggle the LED for each second, but it didn't even start.

Thanks for the support.

FreeRTOS cannot start up.

Posted by richardbarry on October 25, 2011

Did you start with the preconfigured demo provided in the FreeRTOS download, or create this from scratch?
Are the UART functions in the above code ever called in your stripped down demo?
How do you know it is not starting?  If you step through the code in the debugger, how far does it get?  What happens?
Have you tried your LED accessing code without the RTOS, or from main() before the RTOS is started?


FreeRTOS cannot start up.

Posted by *anonymous on October 25, 2011

Hello there,

Thanks for your prompt reply.

I create this from scratch, and adding the FreeRTOS includes and Cs to the project.

The UART functions are not called. It will be used later if I manage to start the RTOS successfully.

The debugger didn't get through anything else. I suspect it's not even working.

I tried the "accessing LED code" and it works well. Only thing is getting the RTOS started is a real challenge to me. I will not give up though, it's a learning process. :)

Thanks for the help.

FreeRTOS cannot start up.

Posted by *anonymous on October 25, 2011

Apologies for double posting. Can't edit the previous post.

Apparently I simulated it, but when I put a breakpoint on "PORTEbits.RE0 ^= 1;", the MPLAB SIM just runs and runs without ever halting on that place.

When I placed a breakpoint on the "return 0", it immediately points on that.

Is it some stack overflow error according to the documentations?


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

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

Latest News

Meet Richard Barry and learn what's new in the FreeRTOS project at Embedded World 2019

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner