Quality RTOS & Embedded Software

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


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


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

Latest News

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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

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.


Careers

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

Renesas

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