nobody wrote on Monday, April 17, 2006:
Richard, I’m using SDCC 2.5.0. The ADuC834 is controller with an 8051-based core and instruction set and integrated adc and dac peripherals. It runs with 12.58 MHz and 12 clock periodes per machine cycle.
I must use the function vPortInitialiseBlocks() in the _sdcc_external_startup() to get the variable
static size_t xNextFreeByte = ( size_t ) 0;
in heap_1.c set correctly.
Best regards
Bernhard
This is the whole program:
#include <ADuC834.h>
/* Standard includes. */
#include <stdlib.h>
#include <stdio.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/*-----------------------------------------------------------*/
/*
* startup configuration of controller
*/
unsigned char _sdcc_external_startup( void)
{
// configure core clock
PLLCON = 0; // core clock = 12.582912 MHz
while ( ( PLLCON & 0x40) == 0 ) ; // wait for PLL to lock
// CFG834 = 0x01; // enable 2k internal XRAM
// configure UART
T3CON = 0x85; // configure timer 3…
T3FD = 0x12; // …for 9600 baud
SCON = 0x52; // configure UART (using timer 3)
vPortInitialiseBlocks();
return 0;
}
/*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/
/*
* use the idle task hook for toggling the LED on port P1.1
*/
void vApplicationIdleHook( void )
{
P1 ^= 0x01;
}
/*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/
/*
* Starts blink task, then starts the scheduler.
*/
void main( void)
{
char ch;
ch = getchar(); // wait for keypress to continue
printf( "\nFreeRTOS Blink Demo\n" );
/* Finally kick off the scheduler. This function should never return. */
/* only use the idle task for tests */
vTaskStartScheduler();
printf( "Should never reach here!!!\n" );
/* Should never reach here as the tasks will now be executing under control
of the scheduler. */
}
/*-----------------------------------------------------------*/