Quality RTOS & Embedded Software

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




Loading

FreeRTOS cannot start up.

Posted by The_YongGrand 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?

Thanks.

Here's the code:
#pragma config POSCMOD=XT, FNOSC=PRIPLL
#pragma config FPLLIDIV=DIV_2, FPLLMUL=MUL_18, FPLLODIV=DIV_1
#pragma config FPBDIV=DIV_2, FWDTEN=OFF, CP=OFF, BWP=OFF

#include
#include

#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()
{
prvSetupHardware();
xTaskCreate(vLEDTask, "LED", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );
vTaskStartScheduler();
return 0;
}

void UART1_Init()
{
U1BRG = 77;
U1MODE = 0x8008;
U1STAbits.UTXEN = 1;
U1STAbits.URXEN = 1;
}

void UART1_putc(unsigned char inputc)
{
while(U1STAbits.UTXBF);
U1TXREG = inputc;
}

void UART1_puts(unsigned char* string)
{
while(*string)
UART1_putc(*string++);
}

static void prvSetupHardware( void )
{
AD1PCFG = 0xFFFF; //All pins as Digital
DDPCONbits.JTAGEN = 0; //Disable the JTAG port
SYSTEMConfigPerformance(72000000);
mOSCSetPBDIV(OSC_PB_DIV_2);
INTEnableSystemMultiVectoredInt();
TRISE = 0x0000;
PORTE = 0x0000;
PMCONbits.ON = 0;
}

static void vLEDTask(void* pvParameters)
{
for(;;)
{
PORTEbits.RE0 ^= 1;
vTaskDelay(1000);
}
}


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

Thanks for the support.

RE: FreeRTOS cannot start up.

Posted by Richard 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?

Regards.

RE: FreeRTOS cannot start up.

Posted by The_YongGrand 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.

RE: FreeRTOS cannot start up.

Posted by The_YongGrand 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?

Thanks.


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists