# TACOS This is the Trajectory Analysis Control OS (TACOS) that serves as a starting point for developing TACOS-based projects, by implementing threads in the App directory. TACOS is a subset of the features provided by ALPAKA. In particular, TACOS consists of the STM32-specific components of sta-core, rtos-2 and rtos2-utils. ## Setting Up TACOS Add this as a library an existing CubeIDE project using FreeRTOS. Generally, we advise you to add it as a submodule. Make sure that you add the include paths for Tacos, i.e. sta-core and rtos2-utils, to the project with the following steps: ``` Properties -> C/C++ General -> Paths and Symbols -> Includes -> GNU C -> Add... Properties -> C/C++ General -> Paths and Symbols -> Includes -> GNU C++ -> Add... Properties -> C/C++ General -> Paths and Symbols -> Source Location -> Add Folder... ``` Create a new thread via the project's IOC and call `startALPAKA()` from this thread. If your thread is called `defaultTask`, the corresponding function `StartDefaultTask` generated in `Core/Src/freertos.c` should look like this: ``` void StartDefaultTask(void *argument) { /* USER CODE BEGIN StartDefaultTask */ extern void startALPAKA(void *); startALPAKA(argument); /* Infinite loop */ for(;;) { osDelay(1); } /* USER CODE END StartDefaultTask */ } ``` ## Configuring TACOS In order to use TACOS, you need to provide a configuration file in the path `sta/config.hpp`. The following code is an example for a TACOS-project using default configuration: ``` #ifndef INC_STA_CONFIG_HPP_ #define INC_STA_CONFIG_HPP_ // Use the STM32F411 microprocessor. #include // Doesn't really do too much right now. Has to be added for successful compilation. #define STA_PRINTF_USE_STDLIB // Enable debug serial output and assertions. #define STA_ASSERT_FORCE #define STA_DEBUGGING_ENABLED // Settings for the rtos-utils #define STA_RTOS_SYSTEM_EVENTS_ENABLE // #define STA_RTOS_SYSTEM_WATCHDOG_ENABLE // #define STA_RTOS_WATCHDOG_ENABLE // Uses the default configuration for TACOS. #include #endif /* INC_STA_CONFIG_HPP_ */ ``` PS: For not officially supported chips use this as the include: ``` #include #define STA_MCU_LITTLE_ENDIAN #define STA_PLATFORM_STM32 ```