Update XMC4000 tasking project to use latest system files.

This commit is contained in:
Richard Barry
2013-09-05 11:37:44 +00:00
parent 7d92a29d2d
commit 77d817ffaa
12 changed files with 2257 additions and 303 deletions

View File

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.tasking.config.arm.abs.debug.1826238485">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.tasking.config.arm.abs.debug.1826238485" moduleId="org.eclipse.cdt.core.settings" name="Debug">
@ -15,11 +13,11 @@
<configuration artifactExtension="abs" artifactName="RTOSDemo" buildArtefactType="com.tasking.arm.buildArtefactType.elf" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=com.tasking.arm.buildArtefactType.elf" cleanCommand="&quot;${PRODDIR}/bin/rm&quot; -rf" description="" id="com.tasking.config.arm.abs.debug.1826238485" name="Debug" parent="com.tasking.config.arm.abs.debug">
<folderInfo id="com.tasking.config.arm.abs.debug.1826238485." name="/" resourcePath="">
<toolChain id="com.tasking.arm.abs.debug.30340712" name="TASKING VX-toolset for ARM" superClass="com.tasking.arm.abs.debug">
<option id="com.tasking.arm.pluginVersion.2141845622" name="Plugin version" superClass="com.tasking.arm.pluginVersion" value="1.77.0.0" valueType="string"/>
<option id="com.tasking.arm.pluginVersion.2141845622" name="Plugin version" superClass="com.tasking.arm.pluginVersion" value="1.109.0.0" valueType="string"/>
<option id="com.tasking.arm.prodDir.157728853" name="Product directory:" superClass="com.tasking.arm.prodDir" value="${eclipse_home}/.." valueType="string"/>
<option id="com.tasking.arm.cpu.1839436230" name="Processor:" superClass="com.tasking.arm.cpu" value="xmc4500x1024" valueType="string"/>
<targetPlatform archList="all" binaryParser="com.tasking.managedbuilder.TASKING_ELF" id="com.tasking.arm.platform.abs.debug.1822567351" name="Debug" osList="" superClass="com.tasking.arm.platform.abs.debug"/>
<builder buildPath="${workspace_loc:/RTOSDemo/Debug}" id="com.tasking.arm.builder.abs.debug.1973824774" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="TASKING ARM Makefile generator" parallelBuildOn="true" parallelizationNumber="-1" superClass="com.tasking.arm.builder.abs.debug"/>
<builder buildPath="${workspace_loc:/RTOSDemo/Debug}" id="com.tasking.arm.builder.abs.debug.1973824774" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="TASKING ARM Makefile generator" parallelBuildOn="true" parallelizationNumber="unlimited" superClass="com.tasking.arm.builder.abs.debug"/>
<tool id="com.tasking.arm.cc.abs.debug.950672563" name="C/C++ Compiler" superClass="com.tasking.arm.cc.abs.debug">
<option id="com.tasking.arm.cc.pr36858.1857781873" name="workaround for PR36858" superClass="com.tasking.arm.cc.pr36858" value="true" valueType="string"/>
<option id="com.tasking.arm.cc.includePaths.181073230" name="Include paths" superClass="com.tasking.arm.cc.includePaths" valueType="includePath">
@ -30,6 +28,9 @@
</option>
<option id="com.tasking.arm.cc.optimize.1219621169" name="Optimization level:" superClass="com.tasking.arm.cc.optimize" value="com.tasking.arm.cc.optimize.0" valueType="enumerated"/>
<option id="com.tasking.arm.cc.globalTypeChecking.1886266211" name="Perform global type checking on C code" superClass="com.tasking.arm.cc.globalTypeChecking" value="false" valueType="boolean"/>
<option id="com.tasking.arm.cc.definedSymbols.1190877408" superClass="com.tasking.arm.cc.definedSymbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="PART_XMC4500"/>
</option>
<inputType id="com.tasking.arm.cppInputType.1974521058" name="C++" superClass="com.tasking.arm.cppInputType"/>
<inputType id="com.tasking.arm.cpp.cInputType.1635312661" name="C" superClass="com.tasking.arm.cpp.cInputType"/>
<inputType id="com.tasking.arm.cc.msInputType.1200945921" name="MS" superClass="com.tasking.arm.cc.msInputType"/>
@ -55,7 +56,8 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="com.tasking.toolInfo">
<toolInfo>TASKING program builder v4.2r1 Build 063</toolInfo>
<toolInfo>TASKING program builder v4.4r1 Build 077</toolInfo>
<toolInfo>TASKING rm v0.0r0 Build 022</toolInfo>
</storageModule>
</cconfiguration>
<cconfiguration id="com.tasking.config.arm.abs.debug.1826238485.654381753">
@ -70,11 +72,11 @@
<configuration artifactExtension="abs" artifactName="RTOSDemo" buildArtefactType="com.tasking.arm.buildArtefactType.elf" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=com.tasking.arm.buildArtefactType.elf" cleanCommand="&quot;${PRODDIR}/bin/rm&quot; -rf" description="" id="com.tasking.config.arm.abs.debug.1826238485.654381753" name="Optimised" parent="com.tasking.config.arm.abs.debug">
<folderInfo id="com.tasking.config.arm.abs.debug.1826238485.654381753." name="/" resourcePath="">
<toolChain id="com.tasking.arm.abs.debug.88571467" name="TASKING VX-toolset for ARM" superClass="com.tasking.arm.abs.debug">
<option id="com.tasking.arm.pluginVersion.2020974908" name="Plugin version" superClass="com.tasking.arm.pluginVersion" value="1.77.0.0" valueType="string"/>
<option id="com.tasking.arm.pluginVersion.2020974908" name="Plugin version" superClass="com.tasking.arm.pluginVersion" value="1.109.0.0" valueType="string"/>
<option id="com.tasking.arm.prodDir.543770190" name="Product directory:" superClass="com.tasking.arm.prodDir" value="${eclipse_home}/.." valueType="string"/>
<option id="com.tasking.arm.cpu.407790444" name="Processor:" superClass="com.tasking.arm.cpu" value="xmc4500x1024" valueType="string"/>
<targetPlatform archList="all" binaryParser="com.tasking.managedbuilder.TASKING_ELF" id="com.tasking.arm.platform.abs.debug.1538796444" name="Debug" osList="" superClass="com.tasking.arm.platform.abs.debug"/>
<builder buildPath="${workspace_loc:/RTOSDemo/Debug}" id="com.tasking.arm.builder.abs.debug.362325101" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="TASKING ARM Makefile generator" parallelBuildOn="true" parallelizationNumber="-1" superClass="com.tasking.arm.builder.abs.debug"/>
<builder buildPath="${workspace_loc:/RTOSDemo/Debug}" id="com.tasking.arm.builder.abs.debug.362325101" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="TASKING ARM Makefile generator" parallelBuildOn="true" parallelizationNumber="unlimited" superClass="com.tasking.arm.builder.abs.debug"/>
<tool id="com.tasking.arm.cc.abs.debug.2020315503" name="C/C++ Compiler" superClass="com.tasking.arm.cc.abs.debug">
<option id="com.tasking.arm.cc.pr36858.710990228" name="workaround for PR36858" superClass="com.tasking.arm.cc.pr36858" value="true" valueType="string"/>
<option id="com.tasking.arm.cc.includePaths.179492897" name="Include paths" superClass="com.tasking.arm.cc.includePaths" valueType="includePath">
@ -135,4 +137,5 @@
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.tasking.arm.cpplanguage"/>
</project-mappings>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
</cproject>

View File

@ -42,16 +42,12 @@ IF EXIST FreeRTOS_Source Goto END
REM Copy the files that define the common demo tasks.
copy %COMMON_SOURCE%\dynamic.c Common_Demo_Source
copy %COMMON_SOURCE%\BlockQ.c Common_Demo_Source
copy %COMMON_SOURCE%\death.c Common_Demo_Source
copy %COMMON_SOURCE%\blocktim.c Common_Demo_Source
copy %COMMON_SOURCE%\semtest.c Common_Demo_Source
copy %COMMON_SOURCE%\PollQ.c Common_Demo_Source
copy %COMMON_SOURCE%\GenQTest.c Common_Demo_Source
copy %COMMON_SOURCE%\recmutex.c Common_Demo_Source
copy %COMMON_SOURCE%\sp_flop.c Common_Demo_Source
copy %COMMON_SOURCE%\countsem.c Common_Demo_Source
copy %COMMON_SOURCE%\integer.c Common_Demo_Source
copy %COMMON_SOURCE%\QueueSet.c Common_Demo_Source
copy %COMMON_SOURCE%\QueueOverwrite.c Common_Demo_Source
copy %COMMON_SOURCE%\GenQTest.c Common_Demo_Source
REM Copy the common demo file headers.
copy %COMMON_INCLUDE%\*.h Common_Demo_Source\include

View File

@ -85,19 +85,19 @@
* executed from within the IDE! Once it has been executed, re-open or refresh
* the Eclipse project and remove the #error line below.
*/
#error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above.
//#error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above.
#include <stdint.h>
extern uint32_t SystemCoreClock;
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configUSE_TICK_HOOK 1
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 130 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 40960 ) )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 22800 ) )
#define configMAX_TASK_NAME_LEN ( 10 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
@ -110,6 +110,7 @@ extern uint32_t SystemCoreClock;
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configGENERATE_RUN_TIME_STATS 0
#define configUSE_QUEUE_SETS 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
@ -154,11 +155,43 @@ to all Cortex-M ports, and do not rely on any particular library functions. */
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
/* Normal assert() semantics without relying on the provision of an assert.h
header file. */
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ) __asm volatile( "NOP" ); }
/* Demo application specific settings. */
#if defined( PART_XMC4500 )
/* Hardware includes. */
#include "XMC4500.h"
#include "System_XMC4500.h"
/* Configure pin P3.9 for the LED. */
#define configCONFIGURE_LED() ( PORT3->IOCR8 = 0x00008000 )
/* To toggle the single LED */
#define configTOGGLE_LED() ( PORT3->OMR = 0x02000200 )
#elif defined( PART_XMC4400 )
/* Hardware includes. */
#include "XMC4400.h"
#include "System_XMC4200.h"
/* Configure pin P5.2 for the LED. */
#define configCONFIGURE_LED() ( PORT5->IOCR0 = 0x00800000 )
/* To toggle the single LED */
#define configTOGGLE_LED() ( PORT5->OMR = 0x00040004 )
#elif defined( PART_XMC4200 )
/* Hardware includes. */
#include "XMC4200.h"
#include "System_XMC4200.h"
/* Configure pin P2.1 for the LED. */
#define configCONFIGURE_LED() PORT2->IOCR0 = 0x00008000; PORT2->HWSEL &= ~0x0000000cUL
/* To toggle the single LED */
#define configTOGGLE_LED() ( PORT2->OMR = 0x00020002 )
#else
#error Part number not specified in project options
#endif
#endif /* FREERTOS_CONFIG_H */

View File

@ -0,0 +1,118 @@
/*
** @(#)cstart.c 1.9 $E%
**
** Copyright 1997-2013 Altium BV *
**
** DESCRIPTION:
**
** The system startup code initializes the processor's registers
** and the application C variables.
**
*/
#pragma nomisrac
#pragma profiling off /* prevent profiling information on cstart */
#pragma optimize abcefgIJKlopRsUy /* preset optimization level */
#pragma tradeoff 4 /* preset tradeoff level */
#pragma runtime BCMSZ /* disable runtime error checking for cstart */
#pragma warning 750 /* do not warn about unsaved registers */
#pragma section .text=cstart /* use: .text.cstart as the section name */
#include <stdlib.h>
#include <dbg.h>
#define VTOR (*(volatile unsigned int *)0xE000ED08)
#define PREF_FCON (*(volatile unsigned int *)0x58002014)
#define SCU_GCU_PEEN (*(volatile unsigned int *)0x5000413C)
#define SCU_GCU_PEFLAG (*(volatile unsigned int *)0x50004150)
/* In the absence of DAVE code engine, CMSIS SystemInit() must perform clock
tree setup.
This decision routine defined here will always return TRUE.
When overridden by a definition defined in DAVE code engine, this routine
returns FALSE indicating that the code engine has performed the clock setup
*/
#pragma weak AllowPLLInitByStartup
uint32_t AllowPLLInitByStartup( void )
{
return 1;
}
extern unsigned char _lc_ub_stack[];
extern unsigned char _lc_vtor_value[];
#pragma weak exit
#pragma extern _Exit
#pragma extern main
extern int main( int argc, char *argv[] );
extern void SystemInit( void );
extern void __init( void );
#if __PROF_ENABLE__
extern void __prof_init( void );
#endif
#ifdef __POSIX__
extern void * _posix_boot_stack_top;
extern int posix_main( void );
#endif
#ifdef __USE_ARGC_ARGV
#ifndef __ARGCV_BUFSIZE
#define __ARGCV_BUFSIZE 256
#endif
static char argcv[__ARGCV_BUFSIZE];
#endif
void __interrupt() __frame() Reset_Handler( void )
{
/* Set flash wait states to 3 */
PREF_FCON = (PREF_FCON & 0xFFFFFFF0) | 0x00000003;
SCU_GCU_PEFLAG =0xFFFFFFFF; /* Clear existing parity errors if any */
SCU_GCU_PEEN = 0; /* Disable parity */
/*
* Anticipate possible ROM/RAM remapping
* by loading the 'real' program address.
*/
__remap_pc();
/*
* Initialize stack pointer.
*/
__setsp( _lc_ub_stack );
/*
* Call a user function which initializes hardware,
* such as ROM/RAM re-mapping or MMU configuration.
*/
SystemInit();
/*
* Copy initialized sections from ROM to RAM
* and clear uninitialized data sections in RAM.
*/
__init();
__asm( "_cptable_handled:" ); /* symbol may be used by debugger */
/*
* Load VTOR register with the actual vector table
* start address
*/
VTOR = (unsigned int)_lc_vtor_value;
#ifdef __POSIX__
__setsp( _posix_boot_stack_top );
#endif
#if __PROF_ENABLE__
__prof_init();
#endif
#ifdef __POSIX__
exit( posix_main() );
#elif defined __USE_ARGC_ARGV
exit( main( _argcv( argcv, __ARGCV_BUFSIZE ), (char **)argcv ) );
#else
exit( main( 0, NULL ) );
#endif
return;
}

View File

@ -0,0 +1,118 @@
/*
** @(#)cstart.c 1.9 $E%
**
** Copyright 1997-2013 Altium BV *
**
** DESCRIPTION:
**
** The system startup code initializes the processor's registers
** and the application C variables.
**
*/
#pragma nomisrac
#pragma profiling off /* prevent profiling information on cstart */
#pragma optimize abcefgIJKlopRsUy /* preset optimization level */
#pragma tradeoff 4 /* preset tradeoff level */
#pragma runtime BCMSZ /* disable runtime error checking for cstart */
#pragma warning 750 /* do not warn about unsaved registers */
#pragma section .text=cstart /* use: .text.cstart as the section name */
#include <stdlib.h>
#include <dbg.h>
#define VTOR (*(volatile unsigned int *)0xE000ED08)
#define PREF_FCON (*(volatile unsigned int *)0x58002014)
#define SCU_GCU_PEEN (*(volatile unsigned int *)0x5000413C)
#define SCU_GCU_PEFLAG (*(volatile unsigned int *)0x50004150)
/* In the absence of DAVE code engine, CMSIS SystemInit() must perform clock
tree setup.
This decision routine defined here will always return TRUE.
When overridden by a definition defined in DAVE code engine, this routine
returns FALSE indicating that the code engine has performed the clock setup
*/
#pragma weak AllowPLLInitByStartup
uint32_t AllowPLLInitByStartup( void )
{
return 1;
}
extern unsigned char _lc_ub_stack[];
extern unsigned char _lc_vtor_value[];
#pragma weak exit
#pragma extern _Exit
#pragma extern main
extern int main( int argc, char *argv[] );
extern void SystemInit( void );
extern void __init( void );
#if __PROF_ENABLE__
extern void __prof_init( void );
#endif
#ifdef __POSIX__
extern void * _posix_boot_stack_top;
extern int posix_main( void );
#endif
#ifdef __USE_ARGC_ARGV
#ifndef __ARGCV_BUFSIZE
#define __ARGCV_BUFSIZE 256
#endif
static char argcv[__ARGCV_BUFSIZE];
#endif
void __interrupt() __frame() Reset_Handler( void )
{
/* Set flash wait states to 3 */
PREF_FCON = (PREF_FCON & 0xFFFFFFF0) | 0x00000003;
SCU_GCU_PEFLAG =0xFFFFFFFF; /* Clear existing parity errors if any */
SCU_GCU_PEEN = 0; /* Disable parity */
/*
* Anticipate possible ROM/RAM remapping
* by loading the 'real' program address.
*/
__remap_pc();
/*
* Initialize stack pointer.
*/
__setsp( _lc_ub_stack );
/*
* Call a user function which initializes hardware,
* such as ROM/RAM re-mapping or MMU configuration.
*/
SystemInit();
/*
* Copy initialized sections from ROM to RAM
* and clear uninitialized data sections in RAM.
*/
__init();
__asm( "_cptable_handled:" ); /* symbol may be used by debugger */
/*
* Load VTOR register with the actual vector table
* start address
*/
VTOR = (unsigned int)_lc_vtor_value;
#ifdef __POSIX__
__setsp( _posix_boot_stack_top );
#endif
#if __PROF_ENABLE__
__prof_init();
#endif
#ifdef __POSIX__
exit( posix_main() );
#elif defined __USE_ARGC_ARGV
exit( main( _argcv( argcv, __ARGCV_BUFSIZE ), (char **)argcv ) );
#else
exit( main( 0, NULL ) );
#endif
return;
}

View File

@ -1,7 +1,7 @@
/*
** @(#)cstart.c 1.8 $E%
** @(#)cstart.c 1.9 $E%
**
** Copyright 1997-2012 Altium BV *
** Copyright 1997-2013 Altium BV *
**
** DESCRIPTION:
**
@ -17,16 +17,25 @@
#pragma runtime BCMSZ /* disable runtime error checking for cstart */
#pragma warning 750 /* do not warn about unsaved registers */
#pragma section .text=cstart /* use: .text.cstart as the section name */
#pragma alias Reset_Handler = _START /* requirement for CMSIS */
#pragma extern Reset_Handler /* required for mil-linking with CMSIS */
#include <stdlib.h>
#include <dbg.h>
#define VTOR (*(volatile unsigned int *)0xE000ED08)
#define PREF_PCON (*(volatile unsigned int *)0x58004000)
#define SCU_GCU_PEEN (*(volatile unsigned int *)0x5000413C)
#define SCU_GCU_PEFLAG (*(volatile unsigned int *)0x50004150)
/* In the absence of DAVE code engine, CMSIS SystemInit() must perform clock
tree setup.
This decision routine defined here will always return TRUE.
When overridden by a definition defined in DAVE code engine, this routine
returns FALSE indicating that the code engine has performed the clock setup
*/
#pragma weak AllowPLLInitByStartup
uint32_t AllowPLLInitByStartup( void )
{
return 1;
}
extern unsigned char _lc_ub_stack[];
@ -54,11 +63,8 @@ extern int posix_main( void );
static char argcv[__ARGCV_BUFSIZE];
#endif
void __interrupt() __frame() _START( void )
void __interrupt() __frame() Reset_Handler( void )
{
PREF_PCON |= 0x00010000; /* Disable Branch prediction */
SCU_GCU_PEFLAG =0xFFFFFFFF; /* Clear existing parity errors if any */
SCU_GCU_PEEN = 0; /* Disable parity */
/*
* Anticipate possible ROM/RAM remapping

View File

@ -73,9 +73,9 @@
* This file implements the code that is not demo specific, including the
* hardware setup and FreeRTOS hook functions.
*
*
*
* Additional code:
*
*
* This demo does not contain a non-kernel interrupt service routine that
* can be used as an example for application writers to use as a reference.
* Therefore, the framework of a dummy (not installed) handler is provided
@ -96,6 +96,10 @@
#include "XMC4500.h"
#include "System_XMC4500.h"
/* Standard demo includes. */
#include "QueueSet.h"
#include "QueueOverwrite.h"
/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,
or 0 to run the more comprehensive test and demo application. */
#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0
@ -107,9 +111,9 @@ or 0 to run the more comprehensive test and demo application. */
*/
static void prvSetupHardware( void );
/*
/*
* main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.
* main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.
* main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.
*/
extern void main_blinky( void );
extern void main_full( void );
@ -139,13 +143,7 @@ int main( void )
static void prvSetupHardware( void )
{
extern void SystemCoreClockUpdate( void );
/* Ensure SystemCoreClock variable is set. */
SystemCoreClockUpdate();
/* Configure pin P3.9 for the LED. */
PORT3->IOCR8 = 0x00008000;
configCONFIGURE_LED();
/* Ensure all priority bits are assigned as preemption priority bits. */
NVIC_SetPriorityGrouping( 0 );
@ -204,11 +202,22 @@ void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName
void vApplicationTickHook( void )
{
/* This function will be called by each tick interrupt if
/* This function will be called by each tick interrupt if
configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be
added here, but the tick hook is called from an interrupt context, so
code must not attempt to block, and only the interrupt safe FreeRTOS API
functions can be used (those that end in FromISR()). */
#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0
{
/* Write to a queue that is in use as part of the queue set demo to
demonstrate using queue sets from an ISR. */
vQueueSetAccessQueueSetFromISR();
/* Test the ISR safe queue overwrite functions. */
vQueueOverwritePeriodicISRDemo();
}
#endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */
}
/*-----------------------------------------------------------*/
@ -220,19 +229,19 @@ long lHigherPriorityTaskWoken = pdFALSE;
/* Clear the interrupt if necessary. */
Dummy_ClearITPendingBit();
/* This interrupt does nothing more than demonstrate how to synchronise a
task with an interrupt. A semaphore is used for this purpose. Note
lHigherPriorityTaskWoken is initialised to zero. */
xSemaphoreGiveFromISR( xTestSemaphore, &lHigherPriorityTaskWoken );
/* If there was a task that was blocked on the semaphore, and giving the
semaphore caused the task to unblock, and the unblocked task has a priority
higher than the current Running state task (the task that this interrupt
interrupted), then lHigherPriorityTaskWoken will have been set to pdTRUE
internally within xSemaphoreGiveFromISR(). Passing pdTRUE into the
internally within xSemaphoreGiveFromISR(). Passing pdTRUE into the
portEND_SWITCHING_ISR() macro will result in a context switch being pended to
ensure this interrupt returns directly to the unblocked, higher priority,
ensure this interrupt returns directly to the unblocked, higher priority,
task. Passing pdFALSE into portEND_SWITCHING_ISR() has no effect. */
portEND_SWITCHING_ISR( lHigherPriorityTaskWoken );
}

View File

@ -129,9 +129,6 @@ functionality. */
#define mainQUEUE_SEND_PARAMETER ( 0x1111UL )
#define mainQUEUE_RECEIVE_PARAMETER ( 0x22UL )
/* To toggle the single LED */
#define mainTOGGLE_LED() ( PORT3->OMR = 0x02000200 )
/*-----------------------------------------------------------*/
/*
@ -146,11 +143,6 @@ static void prvQueueSendTask( void *pvParameters );
*/
void main_blinky( void );
/*
* The hardware only has a single LED. Simply toggle it.
*/
extern void vMainToggleLED( void );
/*-----------------------------------------------------------*/
/* The queue used by both tasks. */
@ -238,7 +230,7 @@ unsigned long ulReceivedValue;
is it the expected value? If it is, toggle the LED. */
if( ulReceivedValue == 100UL )
{
mainTOGGLE_LED();
configTOGGLE_LED();
ulReceivedValue = 0U;
}
}

View File

@ -75,8 +75,8 @@
******************************************************************************
*
* main_full() creates all the demo application tasks and a software timer, then
* starts the scheduler. The web documentation provides more details of the
* standard demo application tasks, which provide no particular functionality,
* starts the scheduler. The web documentation provides more details of the
* standard demo application tasks, which provide no particular functionality,
* but do provide a good example of how to use the FreeRTOS API.
*
* In addition to the standard demo tasks, the following tasks and tests are
@ -113,16 +113,14 @@
/* Standard demo application includes. */
#include "flop.h"
#include "integer.h"
#include "PollQ.h"
#include "semtest.h"
#include "dynamic.h"
#include "BlockQ.h"
#include "blocktim.h"
#include "countsem.h"
#include "GenQTest.h"
#include "recmutex.h"
#include "death.h"
#include "QueueSet.h"
#include "QueueOverwrite.h"
/* Hardware includes. */
#include "XMC4500.h"
@ -135,9 +133,6 @@
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3UL )
#define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )
/* To toggle the single LED */
#define mainTOGGLE_LED() ( PORT3->OMR = 0x02000200 )
/* A block time of zero simply means "don't block". */
#define mainDONT_BLOCK ( 0UL )
@ -183,17 +178,14 @@ xTimerHandle xCheckTimer = NULL;
/* Start all the other standard demo/test tasks. The have not particular
functionality, but do demonstrate how to use the FreeRTOS API and test the
kernel port. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vStartQueueSetTasks();
vStartQueueOverwriteTask( tskIDLE_PRIORITY );
vStartDynamicPriorityTasks();
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vCreateBlockTimeTasks();
vStartCountingSemaphoreTasks();
vStartGenericQueueTasks( tskIDLE_PRIORITY );
vStartRecursiveMutexTasks();
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartMathTasks( mainFLOP_TASK_PRIORITY );
/* Create the register check tasks, as described at the top of this
file */
xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );
@ -213,11 +205,6 @@ xTimerHandle xCheckTimer = NULL;
xTimerStart( xCheckTimer, mainDONT_BLOCK );
}
/* The set of tasks created by the following function call have to be
created last as they keep account of the number of tasks they expect to see
running. */
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
/* Start the scheduler. */
vTaskStartScheduler();
@ -247,21 +234,11 @@ unsigned long ulErrorFound = pdFALSE;
ulErrorFound = pdTRUE;
}
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
@ -277,21 +254,16 @@ unsigned long ulErrorFound = pdFALSE;
ulErrorFound = pdTRUE;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
if( xAreQueueSetTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
if( xIsQueueOverwriteTaskStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
/* Check that the register test 1 task is still running. */
if( ulLastRegTest1Value == ulRegTest1LoopCounter )
{
@ -309,8 +281,8 @@ unsigned long ulErrorFound = pdFALSE;
/* Toggle the check LED to give an indication of the system status. If
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then
everything is ok. A faster toggle indicates an error. */
mainTOGGLE_LED();
configTOGGLE_LED();
/* Have any errors been latch in ulErrorFound? If so, shorten the
period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.
This will result in an increase in the rate at which mainCHECK_LED
@ -320,7 +292,7 @@ unsigned long ulErrorFound = pdFALSE;
if( lChangedTimerPeriodAlready == pdFALSE )
{
lChangedTimerPeriodAlready = pdTRUE;
/* This call to xTimerChangePeriod() uses a zero block time.
Functions called from inside of a timer callback function must
*never* attempt to block. */
@ -664,6 +636,12 @@ static void vRegTest2Task( void *pvParameters )
" ldr r1, [r0] \n"
" adds r1, r1, #1 \n"
" str r1, [r0] \n"
" \n"
" movs r0, #0x01 \n" /* Yield to increase test coverage. */
" ldr r1, =0xe000ed04 \n" /*NVIC_INT_CTRL */
" lsl r0, r0, #28 \n" /* Shift to PendSV bit */
" str r0, [r1] \n"
" dsb \n"
" pop { r0-r1 } \n"
" \n"
" b reg2_loop \n" /* Start again. */