|
| 1 | +/* SPDX-License-Identifier: MIT */ |
| 2 | +/* |
| 3 | + * FreeRTOS configuration for QEMU Xilinx Zynq-7000 (Cortex-A9) |
| 4 | + * |
| 5 | + * Based on the FreeRTOS official Zynq QEMU Demo configuration, |
| 6 | + * adapted for rt-claw embedded AI assistant platform. |
| 7 | + */ |
| 8 | + |
| 9 | +#ifndef FREERTOS_CONFIG_H |
| 10 | +#define FREERTOS_CONFIG_H |
| 11 | + |
| 12 | +#include "xparameters.h" |
| 13 | + |
| 14 | +/*----------------------------------------------------------- |
| 15 | + * Application-specific definitions |
| 16 | + *----------------------------------------------------------*/ |
| 17 | + |
| 18 | +/* Scheduling */ |
| 19 | +#define configUSE_PREEMPTION 1 |
| 20 | +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 |
| 21 | +#define configUSE_TICKLESS_IDLE 0 |
| 22 | +#define configCPU_CLOCK_HZ 100000000UL |
| 23 | +#define configTICK_RATE_HZ 1000 |
| 24 | +#define configMAX_PRIORITIES 8 |
| 25 | +#define configMINIMAL_STACK_SIZE 256 |
| 26 | +#define configMAX_TASK_NAME_LEN 16 |
| 27 | +#define configIDLE_SHOULD_YIELD 1 |
| 28 | + |
| 29 | +/* Memory */ |
| 30 | +#define configTOTAL_HEAP_SIZE (512 * 1024) |
| 31 | +#define configSUPPORT_STATIC_ALLOCATION 0 |
| 32 | +#define configSUPPORT_DYNAMIC_ALLOCATION 1 |
| 33 | + |
| 34 | +/* Data types */ |
| 35 | +#define configUSE_16_BIT_TICKS 0 |
| 36 | +#define configTASK_RETURN_ADDRESS NULL |
| 37 | + |
| 38 | +/* Hooks */ |
| 39 | +#define configUSE_IDLE_HOOK 0 |
| 40 | +#define configUSE_TICK_HOOK 0 |
| 41 | +#define configCHECK_FOR_STACK_OVERFLOW 2 |
| 42 | +#define configUSE_MALLOC_FAILED_HOOK 1 |
| 43 | + |
| 44 | +/* Synchronization */ |
| 45 | +#define configUSE_MUTEXES 1 |
| 46 | +#define configUSE_RECURSIVE_MUTEXES 1 |
| 47 | +#define configUSE_COUNTING_SEMAPHORES 1 |
| 48 | +#define configQUEUE_REGISTRY_SIZE 8 |
| 49 | + |
| 50 | +/* Software timers */ |
| 51 | +#define configUSE_TIMERS 1 |
| 52 | +#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES - 1) |
| 53 | +#define configTIMER_QUEUE_LENGTH 10 |
| 54 | +#define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 2) |
| 55 | + |
| 56 | +/* Trace and stats */ |
| 57 | +#define configUSE_TRACE_FACILITY 1 |
| 58 | +#define configGENERATE_RUN_TIME_STATS 0 |
| 59 | +#define configUSE_STATS_FORMATTING_FUNCTIONS 0 |
| 60 | + |
| 61 | +/* Co-routines (unused) */ |
| 62 | +#define configUSE_CO_ROUTINES 0 |
| 63 | +#define configMAX_CO_ROUTINE_PRIORITIES 2 |
| 64 | + |
| 65 | +/* FPU support: all tasks save/restore FPU context */ |
| 66 | +#define configUSE_TASK_FPU_SUPPORT 2 |
| 67 | + |
| 68 | +/* QEMU marker */ |
| 69 | +#define configUSING_QEMU 1 |
| 70 | + |
| 71 | +/*----------------------------------------------------------- |
| 72 | + * Optional function inclusion |
| 73 | + *----------------------------------------------------------*/ |
| 74 | + |
| 75 | +#define INCLUDE_vTaskPrioritySet 1 |
| 76 | +#define INCLUDE_uxTaskPriorityGet 1 |
| 77 | +#define INCLUDE_vTaskDelete 1 |
| 78 | +#define INCLUDE_vTaskCleanUpResources 1 |
| 79 | +#define INCLUDE_vTaskSuspend 1 |
| 80 | +#define INCLUDE_vTaskDelayUntil 1 |
| 81 | +#define INCLUDE_vTaskDelay 1 |
| 82 | +#define INCLUDE_xTimerPendFunctionCall 1 |
| 83 | +#define INCLUDE_eTaskGetState 1 |
| 84 | + |
| 85 | +/*----------------------------------------------------------- |
| 86 | + * Zynq-7000 GIC (Generic Interrupt Controller) configuration |
| 87 | + *----------------------------------------------------------*/ |
| 88 | + |
| 89 | +#define configINTERRUPT_CONTROLLER_BASE_ADDRESS XPAR_PS7_SCUGIC_0_DIST_BASEADDR |
| 90 | +#define configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET (-0xf00) |
| 91 | +#define configUNIQUE_INTERRUPT_PRIORITIES 32 |
| 92 | +#define configMAX_API_CALL_INTERRUPT_PRIORITY 18 |
| 93 | + |
| 94 | +/*----------------------------------------------------------- |
| 95 | + * Tick interrupt setup (provided by platform port) |
| 96 | + *----------------------------------------------------------*/ |
| 97 | + |
| 98 | +void vConfigureTickInterrupt(void); |
| 99 | +#define configSETUP_TICK_INTERRUPT() vConfigureTickInterrupt() |
| 100 | + |
| 101 | +void vClearTickInterrupt(void); |
| 102 | +#define configCLEAR_TICK_INTERRUPT() vClearTickInterrupt() |
| 103 | + |
| 104 | +/*----------------------------------------------------------- |
| 105 | + * Assert and debug |
| 106 | + *----------------------------------------------------------*/ |
| 107 | + |
| 108 | +void vAssertCalled(const char *pcFile, unsigned long ulLine); |
| 109 | +#define configASSERT(x) \ |
| 110 | + do { \ |
| 111 | + if ((x) == 0) { \ |
| 112 | + vAssertCalled(__FILE__, __LINE__); \ |
| 113 | + } \ |
| 114 | + } while (0) |
| 115 | + |
| 116 | +#endif /* FREERTOS_CONFIG_H */ |
0 commit comments