From 8586dec7b57c034f6a46bdfefc6ed2ce8504bb80 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Fri, 30 Aug 2013 18:05:16 +0000 Subject: [PATCH] Continue work on XCM1200 Keil demo. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2009 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../FreeRTOSConfig.h | 6 +- .../{ParTest.c => ParTest_XMC1200.c} | 2 +- .../RTOSDemo.uvopt | 352 +++++++-- .../RTOSDemo.uvproj | 679 +++++++++++++++++- .../{ => System_Keil}/startup_XMC1300.s | 0 .../System_Keil/system_XMC1100.c | 99 +++ .../System_Keil/system_XMC1200.c | 99 +++ .../{ => System_Keil}/system_XMC1300.c | 0 .../main-blinky.c | 18 +- .../main-full.c | 24 +- .../main.c | 12 +- 11 files changed, 1181 insertions(+), 110 deletions(-) rename FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/{ParTest.c => ParTest_XMC1200.c} (97%) rename FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/{ => System_Keil}/startup_XMC1300.s (100%) create mode 100644 FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/system_XMC1100.c create mode 100644 FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/system_XMC1200.c rename FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/{ => System_Keil}/system_XMC1300.c (100%) diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/FreeRTOSConfig.h index 9078de778..0ee780c82 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/FreeRTOSConfig.h @@ -83,19 +83,19 @@ extern uint32_t SystemCoreClock; #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 1 +#define configUSE_TICK_HOOK 0 #define configCPU_CLOCK_HZ ( SystemCoreClock ) #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 6500 ) ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 3000 ) ) #define configMAX_TASK_NAME_LEN ( 5 ) #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 #define configUSE_MUTEXES 1 #define configQUEUE_REGISTRY_SIZE 8 -#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configCHECK_FOR_STACK_OVERFLOW 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_MALLOC_FAILED_HOOK 1 #define configUSE_APPLICATION_TASK_TAG 0 diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/ParTest.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/ParTest_XMC1200.c similarity index 97% rename from FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/ParTest.c rename to FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/ParTest_XMC1200.c index fbad4ad47..aa2ba14b7 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/ParTest.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/ParTest_XMC1200.c @@ -71,7 +71,7 @@ #include "task.h" /* Hardware includes. */ -#include +#include /* Standard demo include. */ #include "partest.h" diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/RTOSDemo.uvopt b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/RTOSDemo.uvopt index 465ee288d..7669131c2 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/RTOSDemo.uvopt +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/RTOSDemo.uvopt @@ -73,7 +73,7 @@ 1 0 - 1 + 0 255 @@ -158,24 +158,202 @@ UL2CM3(-O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0XMC1300_200 -FL032000 -FS010001000 - - + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + XMC1200 + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + + 0 + Data Sheet + DATASHTS\Infineon\XMC1200\xmc1100_ds.pdf + + + 1 + User Manual + DATASHTS\Infineon\XMC1200\xmc1100_ds.pdf + + + 2 + Technical Reference Manual + datashts\arm\cortex_m0\r0p0\DDI0432C_CORTEX_M0_R0P0_TRM.PDF + + + 3 + Generic User Guide + datashts\arm\cortex_m0\r0p0\DUI0497A_CORTEX_M0_R0P0_GENERIC_UG.PDF + + + + SARMCM3.DLL + + DARMCM1.DLL + -pCM0 + SARMCM3.DLL + + TARMCM1.DLL + -pCM0 + + + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 7 + + + + + + + + + + + Segger\JL2CM3.dll + + + 0 - 0 - 132 - 1 -
0
- 0 - 0 - 0 - 0 - 0 - 0 - C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_M0_Infineon_Boot_Kits_IAR_Keil\startup_XMC1300.s - - -
-
+ DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0) + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U591005602 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(0BB11477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO7 -FD20000000 -FC800 -FN1 -FF0XMC1200_200 -FS010001000 -FL032000 + + + 0 + DLGDARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + -T0 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0XMC1200_200 -FS010001000 -FL032000) + + + + + + 0 + 1 + uxCriticalNesting + + 0 @@ -219,16 +397,16 @@ 1 1 - 2 + 1 0 0 0 0 - 130 - 132 + 1 + 1 0 - .\startup_XMC1300.s - startup_XMC1300.s + .\System_Keil\system_XMC1300.c + system_XMC1300.c 0 0 @@ -240,11 +418,27 @@ 0 0 0 - 0 - 0 + 1 + 1 0 - .\system_XMC1300.c - system_XMC1300.c + .\System_Keil\system_XMC1100.c + system_XMC1100.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 0 + .\System_Keil\system_XMC1200.c + system_XMC1200.c 0 0 @@ -258,14 +452,14 @@ 0 2 - 3 + 4 1 0 0 0 0 - 0 - 0 + 346 + 369 0 ..\..\Source\timers.c timers.c @@ -274,14 +468,14 @@ 2 - 4 + 5 1 0 0 0 0 - 0 - 0 + 150 + 198 0 ..\..\Source\list.c list.c @@ -290,14 +484,14 @@ 2 - 5 + 6 1 0 0 0 0 - 1242 - 1259 + 0 + 0 0 ..\..\Source\queue.c queue.c @@ -306,14 +500,14 @@ 2 - 6 + 7 1 0 0 0 0 - 0 - 0 + 1824 + 1847 0 ..\..\Source\tasks.c tasks.c @@ -322,14 +516,14 @@ 2 - 7 + 8 1 0 0 - 9 + 0 0 - 265 - 279 + 291 + 292 0 ..\..\Source\portable\RVDS\ARM_CM0\port.c port.c @@ -338,7 +532,7 @@ 2 - 8 + 9 1 0 0 @@ -360,32 +554,16 @@ 0 0 0 - - 3 - 9 - 1 - 0 - 0 - 9 - 0 - 115 - 134 - 0 - .\ParTest.c - ParTest.c - 0 - 0 - 3 10 1 0 0 - 42 + 0 0 - 73 - 94 + 112 + 122 0 .\main.c main.c @@ -398,10 +576,10 @@ 1 0 0 - 44 + 0 0 - 203 - 128 + 186 + 194 0 .\main-blinky.c main-blinky.c @@ -414,10 +592,10 @@ 5 0 0 - 0 + 41 0 - 0 - 0 + 74 + 98 0 .\FreeRTOSConfig.h FreeRTOSConfig.h @@ -430,10 +608,10 @@ 1 0 0 - 36 + 0 0 - 293 - 311 + 0 + 0 0 .\main-full.c main-full.c @@ -446,16 +624,32 @@ 2 0 0 - 5 + 14 0 - 142 - 143 + 0 + 0 0 .\RegTest.s RegTest.s 0 0 + + 3 + 15 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 0 + .\ParTest_XMC1200.c + ParTest_XMC1200.c + 0 + 0 + @@ -466,7 +660,7 @@ 0 4 - 15 + 16 1 0 0 @@ -482,7 +676,7 @@ 4 - 16 + 17 1 0 0 @@ -498,7 +692,7 @@ 4 - 17 + 18 1 0 0 @@ -514,7 +708,7 @@ 4 - 18 + 19 1 0 0 diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/RTOSDemo.uvproj b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/RTOSDemo.uvproj index 3fea34439..0be45b573 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/RTOSDemo.uvproj +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/RTOSDemo.uvproj @@ -393,14 +393,19 @@ System - startup_XMC1300.s - 2 - .\startup_XMC1300.s + system_XMC1300.c + 1 + .\System_Keil\system_XMC1300.c - system_XMC1300.c + system_XMC1100.c 1 - .\system_XMC1300.c + .\System_Keil\system_XMC1100.c + + + system_XMC1200.c + 1 + .\System_Keil\system_XMC1200.c @@ -443,10 +448,625 @@ Demo App Source - ParTest.c + main.c + 1 + .\main.c + + + main-blinky.c 1 - .\ParTest.c + .\main-blinky.c + + FreeRTOSConfig.h + 5 + .\FreeRTOSConfig.h + + + main-full.c + 1 + .\main-full.c + + + RegTest.s + 2 + .\RegTest.s + + + ParTest_XMC1200.c + 1 + .\ParTest_XMC1200.c + + + 2 + 0 + 0 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 11 + + + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + + + + + + + + + + + + + + Common Demo Tasks + + + dynamic.c + 1 + ..\Common\Minimal\dynamic.c + + + recmutex.c + 1 + ..\Common\Minimal\recmutex.c + + + blocktim.c + 1 + ..\Common\Minimal\blocktim.c + + + countsem.c + 1 + ..\Common\Minimal\countsem.c + + + + + + + XMC1200 + 0x4 + ARM-ADS + + + XMC1200-200 + Infineon + IRAM(0x20000000-0x20003FFF) IROM(0x10001000-0x10032FFF) CLOCK(12000000) CPUTYPE("Cortex-M0") + + "STARTUP\Infineon\XMC1200\startup_XMC1200.s" ("Infineon XMC1200 Startup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0XMC1200_200 -FS010001000 -FL032000) + 6777 + XMC1200.h + + + + + + + + + + SFD\Infineon\XMC1200\xmc1200.SFR + 0 + + + + Infineon\XMC1200\ + Infineon\XMC1200\ + + 0 + 0 + 0 + 0 + 1 + + .\Output\ + RTOSDemo + 1 + 0 + 0 + 1 + 1 + .\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + + + SARMCM3.DLL + + DARMCM1.DLL + -pCM0 + SARMCM3.DLL + + TARMCM1.DLL + -pCM0 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + + 0 + 7 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4100 + + 0 + Segger\JL2CM3.dll + "" () + + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M0" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x4000 + + + 1 + 0x10001000 + 0x32000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x10001000 + 0x32000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x4000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + ..\CORTEX_M0_Infineon_Boot_Kits_IAR_Keil;..\..\Source\include;..\..\Source\portable\RVDS\ARM_CM0;..\Common\include + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x10001000 + 0x20000000 + .\Output\RTOSDemo.sct + + + + + + + + + + + System + + + system_XMC1300.c + 1 + .\System_Keil\system_XMC1300.c + + + 2 + 0 + 0 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 11 + + + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + + + + + + + + + + + + system_XMC1100.c + 1 + .\System_Keil\system_XMC1100.c + + + 2 + 0 + 0 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 11 + + + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + + + + + + + + + + + + system_XMC1200.c + 1 + .\System_Keil\system_XMC1200.c + + + + + FreeRTOS source + + + timers.c + 1 + ..\..\Source\timers.c + + + list.c + 1 + ..\..\Source\list.c + + + queue.c + 1 + ..\..\Source\queue.c + + + tasks.c + 1 + ..\..\Source\tasks.c + + + port.c + 1 + ..\..\Source\portable\RVDS\ARM_CM0\port.c + + + heap_4.c + 1 + ..\..\Source\portable\MemMang\heap_4.c + + + + + Demo App Source + main.c 1 @@ -472,6 +1092,51 @@ 2 .\RegTest.s + + ParTest_XMC1200.c + 1 + .\ParTest_XMC1200.c + + + 2 + 0 + 0 + 0 + 0 + 1 + 2 + 2 + 2 + 2 + 11 + + + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + + + + + + + + + + diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/startup_XMC1300.s b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/startup_XMC1300.s similarity index 100% rename from FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/startup_XMC1300.s rename to FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/startup_XMC1300.s diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/system_XMC1100.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/system_XMC1100.c new file mode 100644 index 000000000..99884b3e9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/system_XMC1100.c @@ -0,0 +1,99 @@ +/****************************************************************************** + * @file system_XMC1100.c + * @brief Device specific initialization for the XMC1100-Series according + * to CMSIS + * @version V1.2 + * @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 + * 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. + * + ******************************************************************************/ +/* + * *************************** Change history ******************************** + * V1.2, 13 Dec 2012, PKB : Created change history table + */ + +#include "system_XMC1100.h" +#include + +/*--------------------------------------------------------------------------- + Extern definitions + *--------------------------------------------------------------------------*/ +extern uint32_t AllowClkInitByStartup(void); + +/*---------------------------------------------------------------------------- + Clock Global defines + *----------------------------------------------------------------------------*/ +#define DCO_DCLK 64000000UL + +/*---------------------------------------------------------------------------- + Clock Variable definitions + *----------------------------------------------------------------------------*/ +/*!< System Clock Frequency (Core Clock)*/ +uint32_t SystemCoreClock; + + +/** + * @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, CLKCR; + + CLKCR = SCU_CLOCK -> CLKCR; + + IDIV = (CLKCR & SCU_CLOCK_CLKCR_IDIV_Msk) >> SCU_CLOCK_CLKCR_IDIV_Pos; + + if(IDIV) + { + SystemCoreClock = DCO_DCLK / (2 * IDIV ); + } + else + { + /* Divider bypassed */ + SystemCoreClock = DCO_DCLK; + } +} + diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/system_XMC1200.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/system_XMC1200.c new file mode 100644 index 000000000..5b06bc4c1 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/system_XMC1200.c @@ -0,0 +1,99 @@ +/****************************************************************************** + * @file system_XMC1200.c + * @brief Device specific initialization for the XMC1200-Series according + * to CMSIS + * @version V1.2 + * @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 + * 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. + * + ******************************************************************************/ +/* + * *************************** Change history ******************************** + * V1.2, 13 Dec 2012, PKB : Created change history table + */ + +#include "System_XMC1200.h" +#include + +/*--------------------------------------------------------------------------- + Extern definitions + *--------------------------------------------------------------------------*/ +extern uint32_t AllowClkInitByStartup(void); + +/*---------------------------------------------------------------------------- + Clock Global defines + *----------------------------------------------------------------------------*/ +#define DCO_DCLK 64000000UL + +/*---------------------------------------------------------------------------- + Clock Variable definitions + *----------------------------------------------------------------------------*/ +/*!< System Clock Frequency (Core Clock)*/ +uint32_t SystemCoreClock; + + +/** + * @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, CLKCR; + + CLKCR = SCU_CLOCK -> CLKCR; + + IDIV = (CLKCR & SCU_CLOCK_CLKCR_IDIV_Msk) >> SCU_CLOCK_CLKCR_IDIV_Pos; + + if(IDIV) + { + SystemCoreClock = DCO_DCLK / (2 * IDIV ); + } + else + { + /* Divider bypassed */ + SystemCoreClock = DCO_DCLK; + } +} + diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/system_XMC1300.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/system_XMC1300.c similarity index 100% rename from FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/system_XMC1300.c rename to FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/System_Keil/system_XMC1300.c diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main-blinky.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main-blinky.c index fd925c5a2..c590e4627 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main-blinky.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main-blinky.c @@ -162,12 +162,12 @@ void main_blinky( void ) { /* Start the two tasks as described in the comments at the top of this file. */ - xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */ - ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */ - configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */ - ( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */ - mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */ - NULL ); /* The task handle is not required, so NULL is passed. */ +// xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */ +// ( signed char * ) "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */ +// configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */ +// ( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */ +// mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */ +// NULL ); /* The task handle is not required, so NULL is passed. */ xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL ); @@ -189,6 +189,12 @@ static void prvQueueSendTask( void *pvParameters ) portTickType xNextWakeTime; const unsigned long ulValueToSend = 100UL; +for( ;; ) +{ + vTaskDelay( 100 ); + vParTestToggleLED( 0 ); +} + /* Check the task parameter is as expected. */ configASSERT( ( ( unsigned long ) pvParameters ) == mainQUEUE_SEND_PARAMETER ); diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main-full.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main-full.c index 3f38cd058..09bb24d15 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main-full.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main-full.c @@ -194,10 +194,10 @@ configured). */ const size_t xRegTestStackSize = 25U; /* Create the standard demo tasks */ - vCreateBlockTimeTasks(); - vStartCountingSemaphoreTasks(); - vStartRecursiveMutexTasks(); - vStartDynamicPriorityTasks(); +// vCreateBlockTimeTasks(); +// vStartCountingSemaphoreTasks(); +// vStartRecursiveMutexTasks(); +// vStartDynamicPriorityTasks(); /* Create the register test tasks as described at the top of this file. These are naked functions that don't use any stack. A stack still has @@ -228,18 +228,18 @@ const size_t xRegTestStackSize = 25U; if( xTimer != NULL ) { - xTimerStart( xTimer, mainDONT_BLOCK ); +// xTimerStart( xTimer, mainDONT_BLOCK ); } } /* Create the software timer that performs the 'check' functionality, as described at the top of this file. */ - xTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */ - ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */ - pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */ - ( void * ) 0, /* The ID is not used, so can be set to anything. */ - prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */ - ); +// xTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */ +// ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */ +// pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */ +// ( void * ) 0, /* The ID is not used, so can be set to anything. */ +// prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */ +// ); /* If the software timer was created successfully, start it. It won't actually start running until the scheduler starts. A block time of @@ -247,7 +247,7 @@ const size_t xRegTestStackSize = 25U; time will be ignored because the scheduler has not started yet. */ if( xTimer != NULL ) { - xTimerStart( xTimer, mainDONT_BLOCK ); +// xTimerStart( xTimer, mainDONT_BLOCK ); } /* Start the kernel. From here on, only tasks and interrupts will run. */ diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main.c index 08d2e4e4b..2eccfa9f1 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_Boot_Kits_IAR_Keil/main.c @@ -102,11 +102,18 @@ 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_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. + */ extern void main_blinky( void ); extern void main_full( void ); +/* + * CMSIS clock configuration function. + */ +extern void SystemCoreClockUpdate( void ); + /*-----------------------------------------------------------*/ int main( void ) @@ -132,6 +139,7 @@ int main( void ) static void prvSetupHardware( void ) { + SystemCoreClockUpdate(); vParTestInitialise(); } /*-----------------------------------------------------------*/ -- 2.39.5