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

Initializing RAM on Cygnal/SDCC port to grun

Posted by Nobody/Anonymous on April 14, 2005

I am having to use the IDE to fill RAM with all zeros to get my Cygnal port to run. Any ideas on this would be appreciated

RE: Initializing RAM on Cygnal/SDCC port to grun

Posted by Nobody/Anonymous on April 14, 2005
I remember I had a similar problem after the first run through on the debugger. The first time the memory initialized properly, after that not.

Make sure you are not using the --no-xinit-opt compile time option as this will prevent initialization.

I would suggest trying the silabs.com support forum/email and the SDCC mailing lists. Both are good.

With the latest IDE version I have a problem stepping through code that is not in the main.c file. main.c works fine but other source files don't seem to exist to the debugger. Any ideas on that?

RE: Initializing RAM on Cygnal/SDCC port to run

Posted by Nobody/Anonymous on April 14, 2005

The problem I have is that I can run through the
first part of "main.c" before the RTOS boots just fine, but the tasks will not initialize and run unless I fill the RAM with zeros-- The compiler options are straight from the make file that was with the RTOS files, and have the RAM initialization in them, but they do not initialize all of RAM, just the Variables, and not the XDATA part of RAM which is what I'm filling to get the tasking to run correctly. I Think I could write my own initialization routine that would do this, and it would work, but did not know why this was needed.

RE: Initializing RAM on Cygnal/SDCC port to run

Posted by Richard on April 14, 2005
Have you checked the return value of the task creation function? It is possible that the memory is not being allocated correctly if the memory allocator is not initialised correctly during the startup.

In heap_1.c there is a function vPortInitialiseBlocks() that clears a variable used by the allocator. Try doing the same in the allocator you are using.

Can you tell me the version of SDCC you are using.

Regards.

RE: Initializing RAM on Cygnal/SDCC port to grun

Posted by Nobody/Anonymous on April 14, 2005
I am using SDCC v2.4.0 with FreeRTOS V2.5.4 and IDE V2.3.1

The memory allocator function in Heap_1.c gets called 51 times if Ram is cleared, but only 32 times if not cleared -- the copy stack-ram hangs when the scheduler starts -- Non zero data in Ram must stop the allocation from going to the end of RAM, unless RAM is cleared.


RE: Initializing RAM on Cygnal/SDCC port to grun

Posted by Nobody/Anonymous on April 15, 2005
These are the variables that must be filled to zero manually -- will try and isolate which one causes things to hang. Not sure why the initialization does not work correctly -- ??

/* File private variables. --------------------------------*/
static portSHORT sUsingPreemption = pdFALSE;
static unsigned portSHORT usCurrentNumberOfTasks = ( unsigned portSHORT ) 0;
static volatile portTickType xTickCount = ( portTickType ) 0;/* Modified by tick ISR. */
static unsigned portCHAR ucTopUsedPriority = tskIDLE_PRIORITY;
static volatile unsigned portCHAR ucTopReadyPriority = tskIDLE_PRIORITY;
static signed portCHAR cSchedulerRunning = pdFALSE;
static volatile unsigned portCHAR ucSchedulerSuspended = pdFALSE;
static volatile unsigned portCHAR ucMissedTicks = ( unsigned portCHAR ) 0;

RE: Initializing RAM on Cygnal/SDCC port to run

Posted by Nobody/Anonymous on April 15, 2005

Adding this initialization code seems to clear up the issue -- It is like there is a bug in the compiler that is keeping the static var's from being initialized,
or my compiler install was corrupted somehow, or ??


void vTaskInitialiseVars( void )
{

/* File private variables. --------------------------------*/
sUsingPreemption = pdFALSE;
usCurrentNumberOfTasks = ( unsigned portSHORT ) 0;
xTickCount = ( portTickType ) 0;/* Modified by tick ISR. */
ucTopUsedPriority = tskIDLE_PRIORITY;
ucTopReadyPriority = tskIDLE_PRIORITY;
cSchedulerRunning = pdFALSE;
ucSchedulerSuspended = pdFALSE;
ucMissedTicks = ( unsigned portCHAR ) 0;
}

RE: Initializing RAM on Cygnal/SDCC port to run

Posted by Nobody/Anonymous on April 15, 2005
Thats good ... does this happen the first run with the debugger or just following runs?

RE: Initializing RAM on Cygnal/SDCC port to grun

Posted by Nobody/Anonymous on April 16, 2005
Without the explicit initialization code, The RTOS will not even run on the first run with or without the debugger (except, once in a while -- possibly when the right variable is in the correct range to run) The compiler should initialize the variables, but I'm not sure why it is not doing the initialization at this point.

RE: Initializing RAM on Cygnal/SDCC port to grun

Posted by Nobody/Anonymous on April 22, 2005
Traced it to the compiler -- The SDCC group gave a link to the latest baseline of the compiler. (V2.4.8)


[ 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