Quality RTOS & Embedded Software

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


8052 port gives incorrect scheduler operation

Posted by adam on July 9, 2008

I'm trying to port FreeRTOS to the Analog Devices ADuC847. It's a pretty standard 8052 core so I was hoping that once I had the vTaskStartScheduler function passing then the chip would burst into fully coherent life.

Below I have attached my main function and the only other modifications were removing SFRPAGE references in the port file and changing the timer register names.

When I run this the timer interrupt runs correctly (which is why I'm not posting the prvSetupTimerInterrupt changes) however the scheduler appears to completely ignore the TaskDelay function, toggling an output pin shows the function to enter and exit faster than the timer2 tick speed.

Internally the tick count even seems to be blocked by the uxSchedulerSuspended signal which is confusing my little non-embedded brain some.

I'm guessing there's some sort of confusion in the scheduler: has anyone here seen such a problem?

Many Thanks



#include "FreeRTOS.h"
#include "task.h"

#define byte unsigned char

static void vLEDFlashTask( void * );

void main( void )
xTaskCreate( vLEDFlashTask, "LEDx", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );


static void vLEDFlashTask( void *pvParameters )
(void) pvParameters;
vTaskDelay( 100 );
P0 &= ~(0x40);
vTaskDelay( 100 );
P0 |= 0x40;

byte _sdcc_external_startup ( void )
PSW &= ~(0x18); /* Register bank 0 */
EA = 0; /* Disable interrupts */
CFG84x |= 0x01; /* Extended stack diabled, Internal XRAM mapped to lower 2k of external address space */
return 0;

RE: 8052 port gives incorrect scheduler operation

Posted by woops_ on July 9, 2008
Is it possible that the 8051 is resetting over and over?

RE: 8052 port gives incorrect scheduler opera

Posted by adam on July 9, 2008
No, I have some startup port signals in the real code which I don't see making it off the chip.

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

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

Latest News

Version 10.1.0 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