From: richardbarry Date: Tue, 1 Oct 2013 12:47:27 +0000 (+0000) Subject: Finalise XMC4000 GCC demos. X-Git-Tag: V7.5.3~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4da3ed00c46aadc5beee57da056b62328c08f9fa;p=freertos Finalise XMC4000 GCC demos. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2045 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/FreeRTOSConfig.h index 0bfa9aa24..c44fa5b60 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/FreeRTOSConfig.h @@ -82,6 +82,11 @@ #include extern uint32_t SystemCoreClock; +/* The following definition allows the startup files that ship with the IDE +to be used without modification when the chip used includes the PMU CM001 +errata. */ +#define WORKAROUND_PMU_CM001 1 + #define configUSE_PREEMPTION 1 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 #define configUSE_IDLE_HOOK 0 @@ -148,18 +153,21 @@ to all Cortex-M ports, and do not rely on any particular library functions. */ /* !!!! 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) ) - + /* Normal assert() semantics without relying on the provision of an assert.h header file. */ -#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } - +#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } + /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ +#if WORKAROUND_PMU_CM001 == 1 + #define xPortPendSVHandler PendSV_Handler_Veneer +#else + #define xPortPendSVHandler PendSV_Handler +#endif #define vPortSVCHandler SVC_Handler -#define xPortPendSVHandler PendSV_Handler #define xPortSysTickHandler SysTick_Handler - /* Demo application specific settings. */ #if UC_ID == 4502 /* Hardware includes. */ diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4200.s b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4200.s index d84519ba3..dbf86ccdc 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4200.s +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4200.s @@ -106,7 +106,7 @@ __Xmc4200_interrupt_vector_cortex_m: Entry SVC_Handler /* SVCall Handler */ Entry DebugMon_Handler /* Debug Monitor Handler */ .long 0 /* Reserved */ - .long PendSV_Handler /* PendSV Handler */ + Entry PendSV_Handler /* PendSV Handler */ Entry SysTick_Handler /* SysTick Handler */ /* Interrupt Handlers for Service Requests (SR) from XMC4200 Peripherals */ diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4400.s b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4400.s index 2888e9a40..a032c56af 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4400.s +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4400.s @@ -105,7 +105,7 @@ __Xmc4400_interrupt_vector_cortex_m: Entry SVC_Handler /* SVCall Handler */ Entry DebugMon_Handler /* Debug Monitor Handler */ .long 0 /* Reserved */ - .long PendSV_Handler /* PendSV Handler */ + Entry PendSV_Handler /* PendSV Handler */ Entry SysTick_Handler /* SysTick Handler */ /* Interrupt Handlers for Service Requests (SR) from XMC4400 Peripherals */ diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4500.s b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4500.s index 747549dad..19dd991a6 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4500.s +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/Startup/startup_XMC4500.s @@ -118,7 +118,7 @@ __Xmc4500_interrupt_vector_cortex_m: Entry SVC_Handler /* SVCall Handler */ Entry DebugMon_Handler /* Debug Monitor Handler */ .long 0 /* Reserved */ - .long PendSV_Handler /* PendSV Handler */ + Entry PendSV_Handler /* PendSV Handler */ Entry SysTick_Handler /* SysTick Handler */ /* Interrupt Handlers for Service Requests (SR) from XMC4500 Peripherals */ diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/main.c b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/main.c index 51fc7b3ab..6062545cc 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/main.c +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_GCC_Dave/main.c @@ -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 @@ -110,9 +110,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 ); @@ -195,7 +195,7 @@ 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 @@ -211,19 +211,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 ); }