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

Problem with vPortStartFirstTask();

Posted by A. Kleist on July 5, 2011
Hi,

I've been working with a project using RTOS, and it has been working great.
But when I'm increasing the size of an array in a task, it ends up in a Reset_Handler when I'm trying to debug :(
- I've tried to change the usStackDepth, without any luck :(

It seems to be the function vPortStartFirstTask(); which causes the Reset_Handler.

I'm using Ride7 to work on a STM32f013 chip.

Hope to get some help from you guys - thanks :)

Best regards



RE: Problem with vPortStartFirstTask();

Posted by Dave on July 5, 2011
If you try and store an array on the stack then the stack will have to be much larger than the size of the array itself. It is best to avoid putting arrays on the stack if the array is more than a few bytes. If the function does not have to be reentrant, then just declare the array static.

RE: Problem with vPortStartFirstTask();

Posted by A. Kleist on July 5, 2011
Oops! My bad! I was a bite too fast on the keys, the array is not declared in the task, buf in a seperate file.
The arrays are accesed by pointers in the tasks.

usart.h
#define bufSize 512


struct bufStruct
{
u16 head;
u16 tail;
u8 buf[bufSize];
};



static struct bufStruct t = { 0, 0, };
static struct bufStruct r = { 0, 0, };


e.g in a task:

struct bufStruct *p = &r;
u8 valueInBuf = p->buf[p->head];



[ 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