From 1f9af8ebc0a5e5f8c497bca2864f71b439158a6f Mon Sep 17 00:00:00 2001 From: dario Date: Sat, 7 Dec 2024 13:53:57 +0000 Subject: [PATCH 1/4] README.md aktualisiert --- README.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6195cf9..f04f39c 100644 --- a/README.md +++ b/README.md @@ -84,25 +84,13 @@ In order to use TACOS, you need to provide a configuration file in the path `sta #ifndef INC_STA_CONFIG_HPP_ #define INC_STA_CONFIG_HPP_ -// Using a board with an ASEAG module present. -#define STA_STM32_ASEAG // Use the STM32F407 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_ASSERT_ENABLED #define STA_DEBUGGING_ENABLED -// Enable Features -#define STA_RTOS_SYSTEM_EVENTS_ENABLE -// #define STA_RTOS_SYSTEM_WATCHDOG_ENABLE -// #define STA_RTOS_WATCHDOG_ENABLE -// #define STA_TACOS_WATCHDOG_FREQUENCY 10000 -#define STA_CAN_BUS_ENABLE - // Statemachine settings. #define STA_TACOS_NUM_STATES 3 @@ -118,6 +106,9 @@ PS: For not officially supported chips use this as the include: #define STA_PLATFORM_STM32 ``` +> [!WARNING] +> If you want to use debug printing (enabled using the macro `STA_DEBUGGING_ENABLED`) in a TACOS project, you should also enable float formatting under `Project Settings -> C/C++ Build -> MPU/MCU Settings -> Use float with printf from newlib-nano`. This allows you to format print floats using `STA_DEBUG_PRINTF`. + ### Implementing your own threads Let's create a simple thread that prints "Hello World" every second. First create a new file in the `App/Inc/tasks` folder called `spam_task.hpp`. Then add the following code: @@ -148,6 +139,7 @@ This code defines a new thread that inherits from `TacosThread` and implements t Now create a new file in the `App/Src/tasks` folder called `spam_task.cpp` and add the following code: ```cpp #include +#include namespace tasks { SpamTask::SpamTask() : From 4625d72632e73fe6f58adf2b634a587bacaf8991 Mon Sep 17 00:00:00 2001 From: dario Date: Sat, 7 Dec 2024 14:10:42 +0000 Subject: [PATCH 2/4] README.md aktualisiert --- README.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f04f39c..9de5dce 100644 --- a/README.md +++ b/README.md @@ -99,15 +99,34 @@ In order to use TACOS, you need to provide a configuration file in the path `sta #endif /* INC_STA_CONFIG_HPP_ */ ``` -PS: For not officially supported chips use this as the include: + +> [!WARNING] +> If you want to use debug printing (enabled using the macro `STA_DEBUGGING_ENABLED`) in a TACOS project, you should also enable float formatting under `Project Settings -> C/C++ Build -> MPU/MCU Settings -> Use float with printf from newlib-nano`. This allows you to format print floats using `STA_DEBUG_PRINTF`. If this setting is not enabled, your software will crash when debug printing floats. + +The configuration file shown in the example above initializes the project assuming that you are working on a STM32 Nucleo of type F407. Typically, you are using a different microcontroller, however. In this case you can replace the line ```cpp +#include +``` +with the include +```cpp +#include +``` +So far, only a few chips are officially supported. For not officially supported chips use this as the include: +```cpp +#define STA_STM32_SWD_USART_IDX + #include #define STA_MCU_LITTLE_ENDIAN #define STA_PLATFORM_STM32 ``` +> [!NOTE] +> The definition of `STA_STM32_SWD_USART_IDX` allows you to specify which UART handle to use for debug printing. If undefined, a default handle for Nucleos will be used. You can also add the macro `STA_STM32_ASEAG` instead if you are a cool kid using ASEAG-based hardware. -> [!WARNING] -> If you want to use debug printing (enabled using the macro `STA_DEBUGGING_ENABLED`) in a TACOS project, you should also enable float formatting under `Project Settings -> C/C++ Build -> MPU/MCU Settings -> Use float with printf from newlib-nano`. This allows you to format print floats using `STA_DEBUG_PRINTF`. +> [!WARNING] +> The definition of `STA_STM32_SWD_USART_IDX` has to be placed _before_ the include `cpp #include ` + +> [!WARNING] +> Make sure you actually enable the UART bus in the under `Pinout & Configuration -> Connectivity` in the IOC. ### Implementing your own threads From cda1e75f2b416eea6b5518672157501072c6157e Mon Sep 17 00:00:00 2001 From: dario Date: Sat, 7 Dec 2024 14:12:22 +0000 Subject: [PATCH 3/4] README.md aktualisiert --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9de5dce..114392f 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ So far, only a few chips are officially supported. For not officially supported #define STA_PLATFORM_STM32 ``` > [!NOTE] -> The definition of `STA_STM32_SWD_USART_IDX` allows you to specify which UART handle to use for debug printing. If undefined, a default handle for Nucleos will be used. You can also add the macro `STA_STM32_ASEAG` instead if you are a cool kid using ASEAG-based hardware. +> The definition of `STA_STM32_SWD_USART_IDX` allows you to specify which UART handle to use for debug printing. If undefined, a default handle for Nucleos will be used. You can also add the macro `STA_STM32_ASEAG` instead if you are a cool kid using ASEAG-based hardware 😎. > [!WARNING] > The definition of `STA_STM32_SWD_USART_IDX` has to be placed _before_ the include `cpp #include ` From 91179bd68462cb4e5971c9d818d0fbf092ad87d4 Mon Sep 17 00:00:00 2001 From: dario Date: Thu, 12 Dec 2024 19:49:37 +0000 Subject: [PATCH 4/4] README.md aktualisiert --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 114392f..e0a6447 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ To use TACOS one should implement threads, which fulfill the various roles of th ### Setting up the project -First one must create a new CubeIDE project with FreeRTOS. To avoid doing that however we recommend using the [ioc-collection](https://git.intern.spaceteamaachen.de/ALPAKA/ioc-collection) to get a preconfigured IOC for the STM microcontroller you are using. From here follow the following steps: +First one must create a new CubeIDE project with FreeRTOS. To avoid doing that however we recommend using the [ioc-collection](https://git.spaceteamaachen.de/ALPAKA/ioc-collection) to get a preconfigured IOC for the STM microcontroller you are using. From here follow the following steps: 1. ```Import -> General -> Import an Existing STM32CubeMX Configuration File (.ioc)``` 2. Select the .ioc file from the ioc-collection