### CMake Project and Variable Setup Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Drivers/CMSIS/DSP/Examples/ARM/arm_signal_converge_example/CMakeLists.txt Initializes the CMake build system, sets the project name and version, and defines the ROOT and DSP paths. ROOT is expected to be provided via the command line when using CMake. ```cmake cmake_minimum_required (VERSION 3.14) project (arm_signal_convergence_example VERSION 0.1) # Needed to include the configBoot module # Define the path to CMSIS-DSP (ROOT is defined on command line when using cmake) set(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..) set(DSP ${ROOT}/CMSIS/DSP) # Add DSP folder to module path list(APPEND CMAKE_MODULE_PATH ${DSP}) ``` -------------------------------- ### CMake Project Setup and Library Inclusion Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Drivers/CMSIS/DSP/Examples/ARM/arm_graphic_equalizer_example/CMakeLists.txt Initializes the CMake project, defines the project name and version, and sets up paths for the CMSIS-DSP library. It then adds the DSP library directory to the module path for inclusion. ```cmake cmake_minimum_required (VERSION 3.14) project (arm_graphic_equalizer_example VERSION 0.1) # Needed to include the configBoot module # Define the path to CMSIS-DSP (ROOT is defined on command line when using cmake) set(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..) set(DSP ${ROOT}/CMSIS/DSP) # Add DSP folder to module path list(APPEND CMAKE_MODULE_PATH ${DSP}) ``` -------------------------------- ### CMake Project Setup and CMSIS-DSP Configuration Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Drivers/CMSIS/DSP/Examples/ARM/arm_fft_bin_example/CMakeLists.txt This snippet sets up the basic CMake project, defines the project name and version, and configures the path to the CMSIS-DSP library. It assumes the ROOT directory is provided via the command line and adds the DSP directory to the CMAKE_MODULE_PATH for module discovery. ```cmake cmake_minimum_required (VERSION 3.14) project (arm_fft_bin_example VERSION 0.1) # Needed to include the configBoot module # Define the path to CMSIS-DSP (ROOT is defined on command line when using cmake) set(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..) set(DSP ${ROOT}/CMSIS/DSP) # Add DSP folder to module path list(APPEND CMAKE_MODULE_PATH ${DSP}) ``` -------------------------------- ### CMake Project Setup and CMSIS-DSP Integration Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Drivers/CMSIS/DSP/Examples/ARM/arm_matrix_example/CMakeLists.txt Configures the CMake build system for the ARM matrix example. It sets the minimum required CMake version, defines the project name and version, locates and includes the CMSIS-DSP library, and adds it as a subdirectory for building. ```cmake cmake_minimum_required (VERSION 3.14) project (arm_matrix_example VERSION 0.1) # Needed to include the configBoot module # Define the path to CMSIS-DSP (ROOT is defined on command line when using cmake) set(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..) set(DSP ${ROOT}/CMSIS/DSP) # Add DSP folder to module path list(APPEND CMAKE_MODULE_PATH ${DSP}) add_subdirectory(../../../Source bin_dsp) ``` -------------------------------- ### Initialize FileX and Create FAT File System Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Projects/NUCLEO-U5A5ZJ-Q/Applications/FileX/Fx_File_Edit_Standalone/readme.html This C code demonstrates the initialization of the FileX system and the creation of a FAT file system on an SRAM disk. It involves calling MX_FileX_Init() to format the memory and open the SRAM disk driver, resulting in a FAT32 compatible file system with 512-byte sectors. ```c MX_FileX_Init(); // The SRAM-Disk driver is opened and the memory is formatted as FAT32. ``` -------------------------------- ### Initialize RTC Date and Time (C) Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Projects/NUCLEO-U575ZI-Q/Examples_LL/RTC/RTC_TimeStamp_Init/README.md Configures the initial date and time for the RTC peripheral. This involves calling LL_RTC_DATE_Config() and LL_RTC_TIME_Config() with the desired values. This function ensures the RTC starts with a valid time and date. ```c /* USER CODE BEGIN RTC_Init 1 */ /* USER CODE END RTC_Init 1 */ /** Initialize RTC Only */ RTC_InitStruct.HourFormat = LL_RTC_HOURFORMAT_24; // LL_RTC_HOURFORMAT_12 or LL_RTC_HOURFORMAT_24 RTC_InitStruct.AsynchPrediv = 127; // Value between 0 and 0x7F (default is 127) RTC_InitStruct.SynchPrediv = 255; // Value between 0 and 0x7FFF (default is 255) if (LL_RTC_Init(RTC, &RTC_InitStruct) != SUCCESS) { Error_Handler(); } /* USER CODE BEGIN RTC_Init 2 */ /* USER CODE END RTC_Init 2 */ /* USER CODE BEGIN FD */ /* Set the Date: Tuesday 24 December 2019 */ LL_RTC_DATE_Config(RTC, LL_RTC_DAY_OF_WEEK_TUESDAY, 24, 12, 19); /* Set the Time: 10:30:00 */ LL_RTC_TIME_Config(RTC, 10, 30, 00, LL_RTC_TIME_CALIB_OFF); /* USER CODE END FD */ ``` -------------------------------- ### FileX Media Format API Usage Hint Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Projects/NUCLEO-U5A5ZJ-Q/Applications/FileX/Fx_File_Edit_Standalone/readme.html This note provides a hint regarding the `fx_media_format()` API, emphasizing the importance of understanding all its parameters to correctly generate a valid file system. This is crucial for robust file system implementation. ```c /* When calling the fx_media_format() API, it is highly recommended to understand all the parameters used by the API to correctly generate a valid filesystem. */ ``` -------------------------------- ### CMake Project Setup and Library Inclusion Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Drivers/CMSIS/DSP/Examples/ARM/arm_variance_example/CMakeLists.txt Configures the CMake build environment, sets project version, defines paths to the CMSIS-DSP library, and adds the library to the module path. It then includes the CMSIS-DSP subdirectory for compilation. ```cmake cmake_minimum_required (VERSION 3.14) project (arm_variance_example VERSION 0.1) # Needed to include the configBoot module # Define the path to CMSIS-DSP (ROOT is defined on command line when using cmake) set(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..) set(DSP ${ROOT}/CMSIS/DSP) # Add DSP folder to module path list(APPEND CMAKE_MODULE_PATH ${DSP}) ########### # # CMSIS DSP # add_subdirectory(../../../Source bin_dsp) ``` -------------------------------- ### ThreadX Initialization and Configuration Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Projects/STM32U5x9J-DK/Applications/USBX/Ux_Host_HUB_HID_MSC/readme.html This section outlines key ThreadX initialization and configuration aspects. It highlights the use of Systick, interrupt handling during kernel startup, and the recommended tx_application_define() function for resource creation. ```c // In tx_initialize_low_level.S (for MDK-ARM) LDR r1, =|Image$$RW_IRAM1$$ZI$$Limit| // In tx_user.h (example re-configuration) #define TX_TIMER_TICKS_PER_SECOND 100 // In tx_initialize_low_level.S (to enable dynamic memory) // ... modification to enable USE_DYNAMIC_MEMORY_ALLOCATION flag ... // Application entry point VOID tx_application_define(VOID *first_unused_memory) { // Create ThreadX resources here (threads, semaphores, etc.) // Avoid system API calls (HAL, BSP) within this function. } ``` -------------------------------- ### ThreadX Initialization and Configuration Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Projects/STM32U575I-EV/Applications/FileX/FX_IAP/IAP_main/README.md This section outlines key ThreadX configuration points and usage recommendations. It highlights the mandatory use of a separate TIM for the HAL time base when Systick is used by ThreadX, the default tick rate, interrupt handling during kernel startup, and the recommended use of tx_application_define() for resource creation. ```C/Assembly // Mandatory: HAL uses a separate TIM IP for time base if Systick is used by ThreadX. // Default ThreadX ticks/sec: 100. Reconfigurable in tx_user.h (TX_TIMER_TICKS_PER_SECOND) and tx_initialize_low_level.S. // ThreadX disables interrupts during kernel start-up. System calls (HAL) should be at app start or in thread entry. // Use tx_application_define() for creating ThreadX resources (threads, semaphores, etc.). Avoid system API calls within it. // For dynamic memory allocation, modify linker scripts and enable USE_DYNAMIC_MEMORY_ALLOCATION flag in tx_initialize_low_level.S. ``` -------------------------------- ### Flash Web Content Binary using STM32Programmer CLI Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Projects/B-U585I-IOT02A/Applications/NetXDuo/Nx_WebServer/README.md This command flashes the 'web_demo.bin' file to the OctoSPI NOR Flash memory at address 0x70000000. It requires the STM32CubeProgrammer CLI to be installed and specifies an external loader for the MX25LM51245G flash chip. Ensure to replace '' with the actual installation directory. ```bash /STM32_Programmer_CLI.exe -c port=swd -w "Web_Content/web_demo.bin" 0x70000000 -v -el "/STM32CubeProgrammer/bin/ExternalLoader/MX25LM51245G_STM32U585I-IOT02A.stldr" ``` -------------------------------- ### CSS Icon Component Styling Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Projects/STM32U5G9J-DK2/Applications/ThreadX/Tx_Thread_Creation/readme.html Styles for generic icon components using `span` elements with class names starting with 'icon-'. It sets display properties, size, and background image for icons. Includes modifiers for secondary and inverse color schemes, and a specific example for an alert icon. ```css span[class^='icon-'] {display: inline-block;height: 1em;width: 1em;vertical-align: -0.125em;background-size: contain;margin: 0 calc(var(--universal-margin) / 4); }.span[class^='icon-'].secondary {-webkit-filter: invert(25%);filter: invert(25%); }.span[class^='icon-'].inverse {-webkit-filter: invert(100%);filter: invert(100%); }span.icon-alert {background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/cir ``` -------------------------------- ### CMake Project Setup and Library Inclusion Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Drivers/CMSIS/DSP/Examples/ARM/arm_sin_cos_example/CMakeLists.txt Configures the CMake build system for the project, including setting the minimum version, project name, and including the CMSIS-DSP library. It defines paths to the CMSIS-DSP root directory and adds it to the module path for CMake to find. ```cmake cmake_minimum_required (VERSION 3.14) project (arm_sin_cos_example VERSION 0.1) # Needed to include the configBoot module # Define the path to CMSIS-DSP (ROOT is defined on command line when using cmake) set(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..) set(DSP ${ROOT}/CMSIS/DSP) # Add DSP folder to module path list(APPEND CMAKE_MODULE_PATH ${DSP}) add_subdirectory(../../../Source bin_dsp) ``` -------------------------------- ### ThreadX Initialization and Resource Creation (C) Source: https://github.com/stmicroelectronics/stm32cubeu5/blob/main/Projects/NUCLEO-U545RE-Q/Applications/ThreadX/Tx_LowPower/README.md Defines the main entry point for the ThreadX application, responsible for creating initial threads and semaphores. It sets up the MainThread with a specific priority and preemption threshold, and a semaphore with an initial count of 0. This function is called by ThreadX during kernel startup. ```c VOID tx_application_define(VOID *first_unused_memory) { /* Initialize the thread control block */ tx_thread_create(&MainThread, "MainThread", tx_application_thread_entry, 0, thread_stack_memory, TX_THREAD_STACK_SIZE, 10, 10, TX_NO_TIME_SLICE, TX_AUTO_START); /* Initialize the semaphore control block */ tx_semaphore_create(&Semaphore, "Semaphore", 0); /* Initialize the Low Power Enter function */ TX_LOW_POWER_USER_ENTER = App_ThreadX_LowPower_Enter; /* Initialize the Low Power Exit function */ TX_LOW_POWER_USER_EXIT = App_ThreadX_LowPower_Exit; } ```