Fix IAR GCC buid not to use trace (#895)

* Fix IAR GCC build for Qemu MPS2

* Add removed file

* set trace facility to none
This commit is contained in:
alfred gedeon 2022-12-06 10:37:23 -08:00 committed by GitHub
parent 101c263371
commit db1ac5f63f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 50 deletions

View file

@ -39,14 +39,8 @@
* See http://www.freertos.org/a00110.html * See http://www.freertos.org/a00110.html
*----------------------------------------------------------*/ *----------------------------------------------------------*/
#define configUSE_TRACE_FACILITY 1 #define configUSE_TRACE_FACILITY 0
#define configGENERATE_RUN_TIME_STATS 1 #define configGENERATE_RUN_TIME_STATS 0
void vConfigureTimerForRunTimeStats( void );
unsigned long ulGetRunTimeCounterValue( void );
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats( )
#define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue()
#define configUSE_TICKLESS_IDLE 0 #define configUSE_TICKLESS_IDLE 0
#define configUSE_PREEMPTION 1 #define configUSE_PREEMPTION 1
@ -103,7 +97,7 @@ to exclude the API function. */
format the raw data provided by the uxTaskGetSystemState() function in to human format the raw data provided by the uxTaskGetSystemState() function in to human
readable ASCII form. See the notes in the implementation of vTaskList() within readable ASCII form. See the notes in the implementation of vTaskList() within
FreeRTOS/Source/tasks.c for limitations. */ FreeRTOS/Source/tasks.c for limitations. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1 #define configUSE_STATS_FORMATTING_FUNCTIONS 0
#define configKERNEL_INTERRUPT_PRIORITY ( 255 ) /* All eight bits as QEMU doesn't model the priority bits. */ #define configKERNEL_INTERRUPT_PRIORITY ( 255 ) /* All eight bits as QEMU doesn't model the priority bits. */
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!

View file

@ -50,8 +50,6 @@
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "CMSDK_CM3.h"
/* Standard includes. */ /* Standard includes. */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -77,11 +75,6 @@ required UART registers. */
#define UART0_BAUDDIV ( * ( ( ( volatile uint32_t * )( UART0_ADDRESS + 16UL ) ) ) ) #define UART0_BAUDDIV ( * ( ( ( volatile uint32_t * )( UART0_ADDRESS + 16UL ) ) ) )
#define TX_BUFFER_MASK ( 1UL ) #define TX_BUFFER_MASK ( 1UL )
#define TIMER_POSTSCALER ( 8UL )
/* Time at start of day (in ns). */
static volatile unsigned long ulRunTimeOverflowCount = 0U;
/* /*
* main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1. * 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.
@ -108,7 +101,6 @@ void main( void )
/* See https://www.freertos.org/freertos-on-qemu-mps2-an385-model.html for /* See https://www.freertos.org/freertos-on-qemu-mps2-an385-model.html for
instructions. */ instructions. */
/* Hardware initialisation. printf() output uses the UART for IO. */ /* Hardware initialisation. printf() output uses the UART for IO. */
prvUARTInit(); prvUARTInit();
@ -314,37 +306,4 @@ void *malloc( size_t size )
for( ;; ); for( ;; );
} }
/*-----------------------------------------------------------*/
void vConfigureTimerForRunTimeStats( void )
{
/* PCLK / SystemCoreClock is 25MHz, Timer clock is always PCLK */
CMSDK_TIMER0->CTRL &= ~( CMSDK_TIMER_CTRL_EN_Msk );
CMSDK_TIMER0->RELOAD = 0xFFFFFFFF;
/* Enable overflow interrupt and start the timer */
CMSDK_TIMER0->CTRL |= CMSDK_TIMER_CTRL_IRQEN_Msk;
CMSDK_TIMER0->CTRL |= CMSDK_TIMER_CTRL_EN_Msk;
}
/*-----------------------------------------------------------*/
unsigned long ulGetRunTimeCounterValue( void )
{
unsigned long ulTimerValue = CMSDK_TIMER0->RELOAD - CMSDK_TIMER0->VALUE;
/*
* 32 bits will overflow after ~ ( 2**32 / 25000000 ) == 171 seconds,
* So we remove the lower 8 bits and borrow 8 bits from the overflow counter.
*/
ulTimerValue = ( ulTimerValue >> TIMER_POSTSCALER );
/* Add remaining 8 bits from ulRunTimeOverflowCount */
ulTimerValue |= ( ulRunTimeOverflowCount << ( 32UL - TIMER_POSTSCALER ) );
return ulTimerValue;
}