From c5d3092806a6eb7652692e11a46253da6f71d454 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Thu, 5 Sep 2013 12:00:04 +0000 Subject: [PATCH] Add build configurations for the XMC4400 and XMC4200 to the Tasking demo project. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2028 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../.cproject | 181 +++++++++++++----- .../RTOSDemo.lsl | 4 + .../Startup/Infineon/XMC4200/system_XMC4200.c | 2 +- .../Startup/Infineon/XMC4400/system_XMC4400.c | 2 +- .../Startup/Infineon/XMC4500/system_XMC4500.c | 2 +- .../main.c | 4 - .../main_blinky.c | 4 - .../main_full.c | 4 - .../system/system_XMC4200.h | 72 +++++++ .../system/system_XMC4400.h | 72 +++++++ .../system/system_XMC4500.h | 114 +++++++++++ 11 files changed, 399 insertions(+), 62 deletions(-) create mode 100644 FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4200.h create mode 100644 FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4400.h create mode 100644 FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4500.h diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/.cproject b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/.cproject index 63a934fca..39f11253b 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/.cproject +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/.cproject @@ -2,7 +2,7 @@ - + @@ -10,7 +10,7 @@ - + @@ -52,6 +53,71 @@ + + + + + + + + TASKING program builder v4.4r1 Build 077 + + + + + + + + + + + + + + + + + + + @@ -60,8 +126,8 @@ TASKING rm v0.0r0 Build 022 - - + + @@ -69,66 +135,64 @@ - - - - - TASKING program builder v4.2r1 Build 063 + TASKING program builder v4.4r1 Build 077 + TASKING rm v0.0r0 Build 022 - - - - - - - - - @@ -138,4 +202,27 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/RTOSDemo.lsl b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/RTOSDemo.lsl index 62f44354c..5fb252ac2 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/RTOSDemo.lsl +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/RTOSDemo.lsl @@ -3,6 +3,10 @@ // #if defined(__PROC_XMC4500X1024__) #include "xmc45xx.lsl" +#elif defined(__PROC_XMC4400X512__) +#include "xmc44xx.lsl" +#elif defined(__PROC_XMC4200X256__) +#include "xmc42xx.lsl" #else #include #endif diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4200/system_XMC4200.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4200/system_XMC4200.c index d2385b4b1..96bf734e5 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4200/system_XMC4200.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4200/system_XMC4200.c @@ -350,7 +350,7 @@ SystemCoreClock = CLOCK_BACK_UP; static int SystemClockSetup(void) { int temp; -unsigned int long VCO; +unsigned int long VCO=0; int stepping_K2DIV; /* this weak function enables DAVE3 clock App usage */ diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4400/system_XMC4400.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4400/system_XMC4400.c index 70162d923..5d8165dee 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4400/system_XMC4400.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4400/system_XMC4400.c @@ -349,7 +349,7 @@ SystemCoreClock = CLOCK_BACK_UP; static int SystemClockSetup(void) { int temp; -unsigned int long VCO; +unsigned int long VCO=0; int stepping_K2DIV; /* this weak function enables DAVE3 clock App usage */ diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4500/system_XMC4500.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4500/system_XMC4500.c index 74ecf74d3..fd0515fbd 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4500/system_XMC4500.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/Startup/Infineon/XMC4500/system_XMC4500.c @@ -347,7 +347,7 @@ SystemCoreClock = CLOCK_BACK_UP; static int SystemClockSetup(void) { int temp; -unsigned int long VCO; +unsigned int long VCO=0; int stepping_K2DIV; /* this weak function enables DAVE3 clock App usage */ diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main.c index 008b75842..0469d1eff 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main.c @@ -92,10 +92,6 @@ #include "FreeRTOS.h" #include "task.h" -/* Hardware includes. */ -#include "XMC4500.h" -#include "System_XMC4500.h" - /* Standard demo includes. */ #include "QueueSet.h" #include "QueueOverwrite.h" diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main_blinky.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main_blinky.c index 25b2fec20..8c0cbe62d 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main_blinky.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main_blinky.c @@ -107,10 +107,6 @@ #include "task.h" #include "semphr.h" -/* Hardware includes. */ -#include "XMC4500.h" -#include "System_XMC4500.h" - /* Priorities at which the tasks are created. */ #define mainQUEUE_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) #define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main_full.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main_full.c index 46e01c9a9..a72c36cb1 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main_full.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/main_full.c @@ -122,10 +122,6 @@ #include "QueueSet.h" #include "QueueOverwrite.h" -/* Hardware includes. */ -#include "XMC4500.h" -#include "System_XMC4500.h" - /* Priorities for the demo application tasks. */ #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2UL ) #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1UL ) diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4200.h b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4200.h new file mode 100644 index 000000000..33d38c1a7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4200.h @@ -0,0 +1,72 @@ +/**************************************************************************//** + * @file system_XMC4200.h + * @brief Header file for the XMC4200-Series systeminit + * + * @version V1.0 + * @date 27. August 2012 + * + * @note + * Copyright (C) 2011 Infineon Technologies AG. All rights reserved. + + * + * @par + * Infineon Technologies AG (Infineon) is supplying this software for use with Infineon’s microcontrollers. + * This file can be freely distributed within development tools that are supporting such microcontrollers. + + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR + * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + * + ******************************************************************************/ + + +#ifndef __SYSTEM_XMC4200_H +#define __SYSTEM_XMC4200_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ + +/** + * Initialize the system + * + * @param none + * @return none + * + * @brief Setup the microcontroller system. + * Initialize the System. + */ +extern void SystemInit (void); + + +/** + * Update SystemCoreClock variable + * + * @param none + * @return none + * + * @brief Updates the SystemCoreClock with current core Clock + * retrieved from cpu registers. + */ +extern void SystemCoreClockUpdate (void); + +/* this weak function enables DAVE3 clock App usage */ +extern uint32_t AllowPLLInitByStartup(void); + + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4400.h b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4400.h new file mode 100644 index 000000000..953e1b099 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4400.h @@ -0,0 +1,72 @@ +/**************************************************************************//** + * @file system_XMC4400.h + * @brief Header file for the XMC4400-Series systeminit + * + * @version V1.0 + * @date 17. August 2012 + * + * @note + * Copyright (C) 2011 Infineon Technologies AG. All rights reserved. + + * + * @par + * Infineon Technologies AG (Infineon) is supplying this software for use with Infineon’s microcontrollers. + * This file can be freely distributed within development tools that are supporting such microcontrollers. + + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR + * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + * + ******************************************************************************/ + + +#ifndef __SYSTEM_XMC4400_H +#define __SYSTEM_XMC4400_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ + +/** + * Initialize the system + * + * @param none + * @return none + * + * @brief Setup the microcontroller system. + * Initialize the System. + */ +extern void SystemInit (void); + + +/** + * Update SystemCoreClock variable + * + * @param none + * @return none + * + * @brief Updates the SystemCoreClock with current core Clock + * retrieved from cpu registers. + */ +extern void SystemCoreClockUpdate (void); + +/* this weak function enables DAVE3 clock App usage */ +extern uint32_t AllowPLLInitByStartup(void); + + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4500.h b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4500.h new file mode 100644 index 000000000..73eb6d590 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Tasking/system/system_XMC4500.h @@ -0,0 +1,114 @@ +/**************************************************************************//** + * @file system_XMC4500.h + * @brief Header file for the XMC4500-Series systeminit + * + * @version V1.6 + * @date 23. October 2012 + * + * @note + * Copyright (C) 2011 Infineon Technologies AG. All rights reserved. + + * + * @par + * Infineon Technologies AG (Infineon) is supplying this software for use with Infineon’s microcontrollers. + * This file can be freely distributed within development tools that are supporting such microcontrollers. + + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR + * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + * + ******************************************************************************/ + + +#ifndef __SYSTEM_XMC4500_H +#define __SYSTEM_XMC4500_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ + +/** + * Initialize the system + * + * @param none + * @return none + * + * @brief Setup the microcontroller system. + * Initialize the System. + */ +extern void SystemInit (void); + + +/** + * Update SystemCoreClock variable + * + * @param none + * @return none + * + * @brief Updates the SystemCoreClock with current core Clock + * retrieved from cpu registers. + */ +extern void SystemCoreClockUpdate (void); + +/* this weak function enables DAVE3 clock App usage */ +extern uint32_t AllowPLLInitByStartup(void); + + +/* clock definitions, do not modify! */ +#define SCU_CLOCK_CRYSTAL 1 + + + +/* + * mandatory clock parameters ************************************************** + */ +/* source for clock generation + * range: SCU_CLOCK_CRYSTAL (crystal or external clock at crystal input) + * mandatory for old system_xmc4500.c files - please do not remove!!! + **************************************************************************************/ + +#define SCU_PLL_CLOCK_INPUT SCU_CLOCK_CRYSTAL +#define CLOCK_OSC_HP 24000000 +#define CLOCK_BACK_UP 24000000 +#define CLOCK_CRYSTAL_FREQUENCY 12000000 +#define SYSTEM_FREQUENCY 120000000 + +/* OSC_HP setup parameters */ +#define OSC_HP_MODE 0 +#define OSCHPWDGDIV 2 + +/* MAIN PLL setup parameters */ + + +#define PLL_K1DIV 1 +#define PLL_K2DIV 3 +#define PLL_PDIV 1 +#define PLL_NDIV 79 + + + +#define PLL_K2DIV_STEP_1 19 //PLL output is 24Mhz +#define PLL_K2DIV_STEP_2 7 //PLL output to 60Mhz +#define PLL_K2DIV_STEP_3 4 //PLL output to 96Mhz + + + +#define USBPLL_PDIV 1 +#define USBPLL_NDIV 15 + + +#ifdef __cplusplus +} +#endif + + +#endif -- 2.39.5