Finalise XMC1000 GCC demos.

pull/4/head
Richard Barry 12 years ago
parent 42c0ae6bc8
commit 0e28ee90b6

@ -108,7 +108,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="ParTest_XMC1100.c|Keil_Specific|IAR_Specific" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="ParTest_XMC1300.c|Atollic_Specific/system_XMC1300.c|Atollic_Specific/system_XMC1100.c|ParTest_XMC1100.c|Keil_Specific|IAR_Specific" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@ -161,7 +161,6 @@
</option>
<option id="com.atollic.truestudio.gcc.directories.select.1137802172" name="Include path" superClass="com.atollic.truestudio.gcc.directories.select" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS-Plus-Trace/Include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/CMSIS}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Common_Demo_Source/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Atollic_Specific}&quot;"/>
@ -221,7 +220,120 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="ParTest_XMC1200.c|Keil_Specific|IAR_Specific" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="ParTest_XMC1300.c|Atollic_Specific/system_XMC1300.c|Atollic_Specific/system_XMC1200.c|ParTest_XMC1200.c|Keil_Specific|IAR_Specific" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.atollic.truestudio.exe.debug.2093031755.249740193">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.atollic.truestudio.exe.debug.2093031755.249740193" moduleId="org.eclipse.cdt.core.settings" name="XMC1300">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="com.atollic.truestudio.exe.debug.2093031755.249740193" name="XMC1300" parent="com.atollic.truestudio.exe.debug">
<folderInfo id="com.atollic.truestudio.exe.debug.2093031755.249740193." name="/" resourcePath="">
<toolChain id="com.atollic.truestudio.exe.debug.toolchain.530726270" name="Atollic ARM Tools" superClass="com.atollic.truestudio.exe.debug.toolchain">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.atollic.truestudio.exe.debug.toolchain.platform.2056590101" isAbstract="false" name="Debug platform" superClass="com.atollic.truestudio.exe.debug.toolchain.platform"/>
<builder buildPath="${workspace_loc:/RTOSDemo/Debug}" id="com.atollic.truestudio.mbs.builder1.1264778124" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="com.atollic.truestudio.mbs.builder1">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug"/>
</outputEntries>
</builder>
<tool id="com.atollic.truestudio.exe.debug.toolchain.as.1751036574" name="Assembler" superClass="com.atollic.truestudio.exe.debug.toolchain.as">
<option id="com.atollic.truestudio.common_options.target.fpucore.1731862467" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="None" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.endianess.953282949" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess"/>
<option id="com.atollic.truestudio.common_options.target.mcpu.2135917611" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="XMC1200-T038F0200" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.instr_set.1869516172" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.fpu.348809531" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu"/>
<option id="com.atollic.truestudio.as.symbols.defined.908736628" name="Defined symbols" superClass="com.atollic.truestudio.as.symbols.defined" valueType="definedSymbols">
<listOptionValue builtIn="false" value="XMC1200"/>
</option>
<option id="com.atollic.truestudio.as.general.incpath.1783994901" name="Include path" superClass="com.atollic.truestudio.as.general.incpath" valueType="includePath">
<listOptionValue builtIn="false" value="C:/E/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/Libraries/Device/Infineon/XMC1200_series/Include"/>
<listOptionValue builtIn="false" value="C:/E/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/Libraries/CMSIS/Include"/>
<listOptionValue builtIn="false" value="C:/E/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/src"/>
</option>
<inputType id="com.atollic.truestudio.as.input.1496758304" name="Input" superClass="com.atollic.truestudio.as.input"/>
</tool>
<tool id="com.atollic.truestudio.exe.debug.toolchain.gcc.858841069" name="C Compiler" superClass="com.atollic.truestudio.exe.debug.toolchain.gcc">
<option id="com.atollic.truestudio.common_options.target.mcpu.1114209290" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="XMC1200-T038F0200" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.instr_set.1332039631" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.interwork.1878580429" name="Mix ARM/Thumb" superClass="com.atollic.truestudio.common_options.target.interwork"/>
<option id="com.atollic.truestudio.common_options.target.fpu.968368235" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu"/>
<option id="com.atollic.truestudio.common_options.target.fpucore.626754333" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="None" valueType="enumerated"/>
<option id="com.atollic.truestudio.gcc.symbols.defined.521560007" name="Defined symbols" superClass="com.atollic.truestudio.gcc.symbols.defined" valueType="definedSymbols">
<listOptionValue builtIn="false" value="XMC1200"/>
</option>
<option id="com.atollic.truestudio.gcc.directories.select.1254811424" name="Include path" superClass="com.atollic.truestudio.gcc.directories.select" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS-Plus-Trace/Include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/CMSIS}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Common_Demo_Source/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Atollic_Specific}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/ARM_CM0}&quot;"/>
</option>
<option id="com.atollic.truestudio.common_options.target.endianess.1656266691" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess"/>
<option id="com.atollic.truestudio.gcc.optimization.prep_garbage.451027038" name="Prepare dead code removal" superClass="com.atollic.truestudio.gcc.optimization.prep_garbage" value="true" valueType="boolean"/>
<option id="com.atollic.truestudio.gcc.optimization.prep_data.375243731" name="Prepare dead data removal" superClass="com.atollic.truestudio.gcc.optimization.prep_data" value="true" valueType="boolean"/>
<option id="com.atollic.truestudio.exe.debug.toolchain.gcc.optimization.level.1829991451" name="Optimization Level" superClass="com.atollic.truestudio.exe.debug.toolchain.gcc.optimization.level" value="com.atollic.truestudio.gcc.optimization.level.00" valueType="enumerated"/>
<inputType id="com.atollic.truestudio.gcc.input.280854814" superClass="com.atollic.truestudio.gcc.input"/>
</tool>
<tool id="com.atollic.truestudio.exe.debug.toolchain.ld.38693108" name="C Linker" superClass="com.atollic.truestudio.exe.debug.toolchain.ld">
<option id="com.atollic.truestudio.common_options.target.fpucore.686627226" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="None" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.endianess.1022026713" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess"/>
<option id="com.atollic.truestudio.common_options.target.mcpu.1666309532" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="XMC1200-T038F0200" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.instr_set.516364122" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.fpu.888760625" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu"/>
<option id="com.atollic.truestudio.ld.general.clib.588705902" name="Runtime Library:" superClass="com.atollic.truestudio.ld.general.clib" value="com.atollic.truestudio.ld.general.clib.small" valueType="enumerated"/>
<option id="com.atollic.truestudio.ld.general.scriptfile.1690911151" name="Linker script" superClass="com.atollic.truestudio.ld.general.scriptfile" value="../Atollic_Specific/xmc1000_flash.ld" valueType="string"/>
<option id="com.atollic.truestudio.ld.optimization.do_garbage.356066586" name="Dead code removal" superClass="com.atollic.truestudio.ld.optimization.do_garbage" value="true" valueType="boolean"/>
<inputType id="com.atollic.truestudio.ld.input.1756024312" name="Input" superClass="com.atollic.truestudio.ld.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="com.atollic.truestudio.exe.debug.toolchain.gpp.1782324624" name="C++ Compiler" superClass="com.atollic.truestudio.exe.debug.toolchain.gpp">
<option id="com.atollic.truestudio.gpp.symbols.defined.1105522169" name="Defined symbols" superClass="com.atollic.truestudio.gpp.symbols.defined" valueType="definedSymbols">
<listOptionValue builtIn="false" value="XMC1200"/>
</option>
<option id="com.atollic.truestudio.gpp.directories.select.732411254" name="Include path" superClass="com.atollic.truestudio.gpp.directories.select" valueType="includePath">
<listOptionValue builtIn="false" value="../Libraries/Device/Infineon/XMC1200_series/Include"/>
<listOptionValue builtIn="false" value="../Libraries/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../src"/>
</option>
<option id="com.atollic.truestudio.common_options.target.endianess.551296505" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess"/>
<option id="com.atollic.truestudio.common_options.target.mcpu.1265487939" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="XMC1200-T038F0200" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.instr_set.1009896673" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.fpucore.1008033504" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="None" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.fpu.1943332109" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu"/>
<option id="com.atollic.truestudio.gpp.optimization.prep_garbage.439580231" name="Prepare dead code removal" superClass="com.atollic.truestudio.gpp.optimization.prep_garbage" value="true" valueType="boolean"/>
<option id="com.atollic.truestudio.gpp.optimization.prep_data.482769070" name="Prepare dead data removal" superClass="com.atollic.truestudio.gpp.optimization.prep_data" value="true" valueType="boolean"/>
<option id="com.atollic.truestudio.gpp.optimization.fno_rtti.1372776980" name="Disable RTTI" superClass="com.atollic.truestudio.gpp.optimization.fno_rtti"/>
<option id="com.atollic.truestudio.gpp.optimization.fno_exceptions.1143499286" name="Disable exception handling" superClass="com.atollic.truestudio.gpp.optimization.fno_exceptions"/>
</tool>
<tool id="com.atollic.truestudio.exe.debug.toolchain.ldcc.353137550" name="C++ Linker" superClass="com.atollic.truestudio.exe.debug.toolchain.ldcc">
<option id="com.atollic.truestudio.common_options.target.endianess.730580332" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess"/>
<option id="com.atollic.truestudio.common_options.target.mcpu.1081475641" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="XMC1200-T038F0200" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.instr_set.120039905" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.fpucore.1140122738" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="None" valueType="enumerated"/>
<option id="com.atollic.truestudio.common_options.target.fpu.524901066" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu"/>
<option id="com.atollic.truestudio.ld.general.cclib.91004697" name="Runtime Library:" superClass="com.atollic.truestudio.ld.general.cclib"/>
<option id="com.atollic.truestudio.ldcc.optimization.do_garbage.1808131910" name="Dead code removal" superClass="com.atollic.truestudio.ldcc.optimization.do_garbage" value="true" valueType="boolean"/>
<option id="com.atollic.truestudio.ldcc.general.scriptfile.1259001272" name="Linker script" superClass="com.atollic.truestudio.ldcc.general.scriptfile" value="..\xmc1000_flash.ld" valueType="string"/>
</tool>
<tool id="com.atollic.truestudio.exe.debug.toolchain.secoutput.727461012" name="Other" superClass="com.atollic.truestudio.exe.debug.toolchain.secoutput"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="ParTest_XMC1200.c|Atollic_Specific/system_XMC1200.c|Atollic_Specific/system_XMC1100.c|ParTest_XMC1100.c|Keil_Specific|IAR_Specific" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@ -233,9 +345,11 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="XMC1100"/>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/RTOSDemo"/>
</configuration>
<configuration configurationName="XMC1200"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>

@ -5,6 +5,12 @@ environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755.
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755.115953030/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755.115953030/append=true
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755.115953030/appendContributed=true
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755.249740193/CPATH/delimiter=;
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755.249740193/CPATH/operation=remove
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755.249740193/C_INCLUDE_PATH/delimiter=;
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755.249740193/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755.249740193/append=true
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755.249740193/appendContributed=true
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755/CPATH/delimiter=;
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755/CPATH/operation=remove
environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.2093031755/C_INCLUDE_PATH/delimiter=;
@ -15,6 +21,10 @@ environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755.
environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755.115953030/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755.115953030/append=true
environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755.115953030/appendContributed=true
environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755.249740193/LIBRARY_PATH/delimiter=;
environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755.249740193/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755.249740193/append=true
environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755.249740193/appendContributed=true
environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755/LIBRARY_PATH/delimiter=;
environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.2093031755/append=true

@ -1,7 +1,7 @@
/**
*****************************************************************************
**
** File : startup_XMC1200.s
** File : startup_XMC1300.s
**
** Abstract : This assembler file contains interrupt vector and
** startup code for ARM.

@ -0,0 +1,130 @@
/******************************************************************************
* @file system_XMC1100.c
* @brief Device specific initialization for the XMC1100-Series according
* to CMSIS
* @version V1.4
* @date 01 Feb 2013
*
* @note
* Copyright (C) 2012-2013 Infineon Technologies AG. All rights reserved.
*
* @par
* Infineon Technologies AG (Infineon) is supplying this software for use with
* Infineons 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.
*
******************************************************************************/
/*
* *************************** Change history ********************************
* V1.2, 13 Dec 2012, PKB : Created change history table
* V1.3, 20 Dec 2012, PKB : Fixed SystemCoreClock computation
* V1.3, 01 Feb 2013, PKB : SCU_CLOCK -> SCU_CLK
*/
#include "system_XMC1100.h"
#include <XMC1100.h>
/*---------------------------------------------------------------------------
Extern definitions
*--------------------------------------------------------------------------*/
extern uint32_t AllowClkInitByStartup(void);
/*----------------------------------------------------------------------------
Clock Global defines
*----------------------------------------------------------------------------*/
#define DCO_DCLK 64000000UL
#define DCO_DCLK_MULTIPLIER 16384000UL
#define DCO_DCLK_DIVIDER 9UL
#define MCLK_MHZ 32000000UL
#define KHZ_MULTIPLIER 1000UL
#define FRACBITS 8UL
/*----------------------------------------------------------------------------
Clock Variable definitions
*----------------------------------------------------------------------------*/
/*!< System Clock Frequency (Core Clock) (MCLK on TIMM1) */
uint32_t SystemCoreClock;
/*----------------------------------------------------------------------------
Fixed point math definitions
*----------------------------------------------------------------------------*/
typedef int32_t Q_24_8;
typedef int32_t Q_15_0;
/**
* @brief Setup the microcontroller system.
* @param None
* @retval None
*/
void SystemInit(void)
{
/*
* Clock tree setup by CMSIS routines is allowed only in the absence of DAVE
* Clock app.
*/
if(AllowClkInitByStartup()){
/* Do not change default values of IDIV,FDIV and RTCCLKSEL */
/* ====== Default configuration ======= */
/*
* MCLK = DCO_DCLK
* PCLK = MCLK
* RTC CLK = Standby clock
*/
}
}
/**
* @brief Update SystemCoreClock according to Clock Register Values
* @note -
* @param None
* @retval None
*/
void SystemCoreClockUpdate(void)
{
uint32_t IDIV, FDIV, CLKCR, Clock;
CLKCR = SCU_CLK -> CLKCR;
IDIV = (CLKCR & SCU_CLK_CLKCR_IDIV_Msk) >> SCU_CLK_CLKCR_IDIV_Pos;
FDIV = (CLKCR & SCU_CLK_CLKCR_FDIV_Msk) >> SCU_CLK_CLKCR_FDIV_Pos;
if(IDIV)
{
/* Divider is enabled and used */
if(0 == FDIV)
{
/* No fractional divider, so MCLK = DCO_Clk / (2 * IDIV) */
Clock = MCLK_MHZ / IDIV;
}
else
{
/* Both integer and fractional divider must be considered */
/* 1. IDIV + FDIV/256 */
Q_24_8 FDiv_IDiv_Sum = (IDIV << FRACBITS) + FDIV;
/* 2. Fixed point division Q24.8 / Q9.8 = Q15.0 */
Q_15_0 ClockVal = (DCO_DCLK_MULTIPLIER << FRACBITS)/ FDiv_IDiv_Sum;
Clock = ((uint32_t)ClockVal) * KHZ_MULTIPLIER;
Clock = Clock >> DCO_DCLK_DIVIDER;
}
}
else
{
/* Divider bypassed. Simply divide DCO_DCLK by 2 */
Clock = MCLK_MHZ;
}
/* Finally with the math class over, update SystemCoreClock */
SystemCoreClock = Clock;
}

@ -0,0 +1,55 @@
/******************************************************************************
* @file system_XMC1100.h
* @brief Device specific initialization for the XMC1100-Series according
* to CMSIS
* @version V1.1
* @date 13 Dec 2012
*
* @note
* Copyright (C) 2012-2013 Infineon Technologies AG. All rights reserved.
*
* @par
* Infineon Technologies AG (Infineon) is supplying this software for use with
* Infineons 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.
*
******************************************************************************/
/*
* *************************** Change history ********************************
* V1.1, 13 Dec 2012, PKB : Created change history table, extern reference
*/
#include <stdint.h>
/*----------------------------------------------------------------------------
Clock Variable definitions
*----------------------------------------------------------------------------*/
extern uint32_t SystemCoreClock;
/**
* @brief Setup the microcontroller system.
* Initialize the PLL and update the
* SystemCoreClock variable.
* @param None
* @retval None
*/
void SystemInit(void);
/**
* @brief Update SystemCoreClock according to Clock Register Values
* @note -
* @param None
* @retval None
*/
void SystemCoreClockUpdate(void);

@ -0,0 +1,130 @@
/******************************************************************************
* @file system_XMC1200.c
* @brief Device specific initialization for the XMC1200-Series according
* to CMSIS
* @version V1.4
* @date 01 Feb 2013
*
* @note
* Copyright (C) 2012-2013 Infineon Technologies AG. All rights reserved.
*
* @par
* Infineon Technologies AG (Infineon) is supplying this software for use with
* Infineons 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.
*
******************************************************************************/
/*
* *************************** Change history ********************************
* V1.2, 13 Dec 2012, PKB : Created change history table
* V1.3, 20 Dec 2012, PKB : Fixed SystemCoreClock computation
* V1.4, 01 Feb 2013, PKB : SCU_CLOCK -> SCU_CLK
*/
#include "system_XMC1200.h"
#include <XMC1200.h>
/*---------------------------------------------------------------------------
Extern definitions
*--------------------------------------------------------------------------*/
extern uint32_t AllowClkInitByStartup(void);
/*----------------------------------------------------------------------------
Clock Global defines
*----------------------------------------------------------------------------*/
#define DCO_DCLK 64000000UL
#define DCO_DCLK_MULTIPLIER 16384000UL
#define DCO_DCLK_DIVIDER 9UL
#define MCLK_MHZ 32000000UL
#define KHZ_MULTIPLIER 1000UL
#define FRACBITS 8UL
/*----------------------------------------------------------------------------
Clock Variable definitions
*----------------------------------------------------------------------------*/
/*!< System Clock Frequency (Core Clock) (MCLK on TIMM1) */
uint32_t SystemCoreClock;
/*----------------------------------------------------------------------------
Fixed point math definitions
*----------------------------------------------------------------------------*/
typedef int32_t Q_24_8;
typedef int32_t Q_15_0;
/**
* @brief Setup the microcontroller system.
* @param None
* @retval None
*/
void SystemInit(void)
{
/*
* Clock tree setup by CMSIS routines is allowed only in the absence of DAVE
* Clock app.
*/
if(AllowClkInitByStartup()){
/* Do not change default values of IDIV,FDIV and RTCCLKSEL */
/* ====== Default configuration ======= */
/*
* MCLK = DCO_DCLK
* PCLK = MCLK
* RTC CLK = Standby clock
*/
}
}
/**
* @brief Update SystemCoreClock according to Clock Register Values
* @note -
* @param None
* @retval None
*/
void SystemCoreClockUpdate(void)
{
uint32_t IDIV, FDIV, CLKCR, Clock;
CLKCR = SCU_CLK -> CLKCR;
IDIV = (CLKCR & SCU_CLK_CLKCR_IDIV_Msk) >> SCU_CLK_CLKCR_IDIV_Pos;
FDIV = (CLKCR & SCU_CLK_CLKCR_FDIV_Msk) >> SCU_CLK_CLKCR_FDIV_Pos;
if(IDIV)
{
/* Divider is enabled and used */
if(0 == FDIV)
{
/* No fractional divider, so MCLK = DCO_Clk / (2 * IDIV) */
Clock = MCLK_MHZ / IDIV;
}
else
{
/* Both integer and fractional divider must be considered */
/* 1. IDIV + FDIV/256 */
Q_24_8 FDiv_IDiv_Sum = (IDIV << FRACBITS) + FDIV;
/* 2. Fixed point division Q24.8 / Q9.8 = Q15.0 */
Q_15_0 ClockVal = (DCO_DCLK_MULTIPLIER << FRACBITS)/ FDiv_IDiv_Sum;
Clock = ((uint32_t)ClockVal) * KHZ_MULTIPLIER;
Clock = Clock >> DCO_DCLK_DIVIDER;
}
}
else
{
/* Divider bypassed. Simply divide DCO_DCLK by 2 */
Clock = MCLK_MHZ;
}
/* Finally with the math class over, update SystemCoreClock */
SystemCoreClock = Clock;
}

@ -0,0 +1,55 @@
/******************************************************************************
* @file system_XMC1200.h
* @brief Device specific initialization for the XMC1200-Series according
* to CMSIS
* @version V1.1
* @date 13 Dec 2012
*
* @note
* Copyright (C) 2012-2013 Infineon Technologies AG. All rights reserved.
*
* @par
* Infineon Technologies AG (Infineon) is supplying this software for use with
* Infineons 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.
*
******************************************************************************/
/*
* **************************** Change history *******************************
* V1.1, 13 Dec 2012, PKB : Created this table, added extern and stdint
*/
#include <stdint.h>
/*----------------------------------------------------------------------------
Clock Variable definitions
*----------------------------------------------------------------------------*/
extern uint32_t SystemCoreClock;
/**
* @brief Setup the microcontroller system.
* Initialize the PLL and update the
* SystemCoreClock variable.
* @param None
* @retval None
*/
void SystemInit(void);
/**
* @brief Update SystemCoreClock according to Clock Register Values
* @note -
* @param None
* @retval None
*/
void SystemCoreClockUpdate(void);

@ -0,0 +1,130 @@
/******************************************************************************
* @file system_XMC1300.c
* @brief Device specific initialization for the XMC1300-Series according
* to CMSIS
* @version V1.4
* @date 01 Feb 2013
*
* @note
* Copyright (C) 2012-2013 Infineon Technologies AG. All rights reserved.
*
* @par
* Infineon Technologies AG (Infineon) is supplying this software for use with
* Infineons 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.
*
******************************************************************************/
/*
* *************************** Change history ********************************
* V1.2, 13 Dec 2012, PKB : Created change history table
* V1.3, 20 Dec 2012, PKB : Fixed SystemCoreClock computation
* V1.4, 02 Feb 2013, PKB : SCU_CLOCK -> SCU_CLK
*/
#include "system_XMC1300.h"
#include <XMC1300.h>
/*---------------------------------------------------------------------------
Extern definitions
*--------------------------------------------------------------------------*/
extern uint32_t AllowClkInitByStartup(void);
/*----------------------------------------------------------------------------
Clock Global defines
*----------------------------------------------------------------------------*/
#define DCO_DCLK 64000000UL
#define DCO_DCLK_MULTIPLIER 16384000UL
#define DCO_DCLK_DIVIDER 9UL
#define MCLK_MHZ 32000000UL
#define KHZ_MULTIPLIER 1000UL
#define FRACBITS 8UL
/*----------------------------------------------------------------------------
Clock Variable definitions
*----------------------------------------------------------------------------*/
/*!< System Clock Frequency (Core Clock) (MCLK on TIMM1) */
uint32_t SystemCoreClock;
/*----------------------------------------------------------------------------
Fixed point math definitions
*----------------------------------------------------------------------------*/
typedef int32_t Q_24_8;
typedef int32_t Q_15_0;
/**
* @brief Setup the microcontroller system.
* @param None
* @retval None
*/
void SystemInit(void)
{
/*
* Clock tree setup by CMSIS routines is allowed only in the absence of DAVE
* Clock app.
*/
if(AllowClkInitByStartup()){
/* Do not change default values of IDIV,FDIV and RTCCLKSEL */
/* ====== Default configuration ======= */
/*
* MCLK = DCO_DCLK
* PCLK = MCLK
* RTC CLK = Standby clock
*/
}
}
/**
* @brief Update SystemCoreClock according to Clock Register Values
* @note -
* @param None
* @retval None
*/
void SystemCoreClockUpdate(void)
{
uint32_t IDIV, FDIV, CLKCR, Clock;
CLKCR = SCU_CLK -> CLKCR;
IDIV = (CLKCR & SCU_CLK_CLKCR_IDIV_Msk) >> SCU_CLK_CLKCR_IDIV_Pos;
FDIV = (CLKCR & SCU_CLK_CLKCR_FDIV_Msk) >> SCU_CLK_CLKCR_FDIV_Pos;
if(IDIV)
{
/* Divider is enabled and used */
if(0 == FDIV)
{
/* No fractional divider, so MCLK = DCO_Clk / (2 * IDIV) */
Clock = MCLK_MHZ / IDIV;
}
else
{
/* Both integer and fractional divider must be considered */
/* 1. IDIV + FDIV/256 */
Q_24_8 FDiv_IDiv_Sum = (IDIV << FRACBITS) + FDIV;
/* 2. Fixed point division Q24.8 / Q9.8 = Q15.0 */
Q_15_0 ClockVal = (DCO_DCLK_MULTIPLIER << FRACBITS)/ FDiv_IDiv_Sum;
Clock = ((uint32_t)ClockVal) * KHZ_MULTIPLIER;
Clock = Clock >> DCO_DCLK_DIVIDER;
}
}
else
{
/* Divider bypassed. Simply divide DCO_DCLK by 2 */
Clock = MCLK_MHZ;
}
/* Finally with the math class over, update SystemCoreClock */
SystemCoreClock = Clock;
}

@ -0,0 +1,54 @@
/******************************************************************************
* @file system_XMC1300.h
* @brief Device specific initialization for the XMC1300-Series according
* to CMSIS
* @version V1.1
* @date 13 Dec 2012
*
* @note
* Copyright (C) 2012-2013 Infineon Technologies AG. All rights reserved.
*
* @par
* Infineon Technologies AG (Infineon) is supplying this software for use with
* Infineons 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.
*
******************************************************************************/
/*
* *************************** Change history *********************************
* V1.1, 13 Dec 2012, PKB, Created this table, added extern and stdint
*/
#include <stdint.h>
/*----------------------------------------------------------------------------
Clock Variable definitions
*----------------------------------------------------------------------------*/
extern uint32_t SystemCoreClock;
/**
* @brief Setup the microcontroller system.
* Initialize the PLL and update the
* SystemCoreClock variable.
* @param None
* @retval None
*/
void SystemInit(void);
/**
* @brief Update SystemCoreClock according to Clock Register Values
* @note -
* @param None
* @retval None
*/
void SystemCoreClockUpdate(void);

@ -93,7 +93,7 @@
/* 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 1
#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0
/*-----------------------------------------------------------*/

Loading…
Cancel
Save