Compare commits

3 Commits
main ... pierre

Author SHA1 Message Date
Pierre Barbier
0133f7439a We fast as fuck with osThreadFlagsSet/Wait 2026-05-29 11:33:37 +02:00
Pierre Barbier
fa1792d6d6 Using xTaskNotifyFromISR is kinda slow 2026-05-29 11:10:08 +02:00
Pierre Barbier
070f37548f borked 2026-05-29 10:34:14 +02:00
8 changed files with 289 additions and 142 deletions

File diff suppressed because one or more lines are too long

View File

@@ -30,8 +30,6 @@ set(MX_Application_Src
set(STM32_Drivers_Src
${CMAKE_CURRENT_SOURCE_DIR}/../Common/Src/system_stm32h7xx_dualcore_boot_cm4_cm7.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c
@@ -47,6 +45,8 @@ set(STM32_Drivers_Src
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c
)
# Drivers Midllewares

View File

@@ -51,9 +51,7 @@ void HardFault_Handler(void);
void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void TIM2_IRQHandler(void);
/* USER CODE BEGIN EFP */

View File

@@ -5,6 +5,8 @@
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "FreeRTOS.h"
#include "cmsis_os2.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
@@ -13,10 +15,12 @@
#include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_gpio.h"
#include "stm32h7xx_hal_tim.h"
#include "task.h"
#include <stdint.h>
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
typedef StaticTask_t osStaticThreadDef_t;
/* USER CODE BEGIN PTD */
/* USER CODE END PTD */
@@ -47,6 +51,25 @@
TIM_HandleTypeDef htim2;
/* Definitions for defaultTask */
osThreadId_t defaultTaskHandle;
const osThreadAttr_t defaultTask_attributes = {
.name = "defaultTask",
.stack_size = 128 * 4,
.priority = (osPriority_t) osPriorityNormal,
};
/* Definitions for TimeCH */
osThreadId_t TimeCHHandle;
uint32_t TimeCHBuffer[ 128 ];
osStaticThreadDef_t TimeCHControlBlock;
const osThreadAttr_t TimeCH_attributes = {
.name = "TimeCH",
.cb_mem = &TimeCHControlBlock,
.cb_size = sizeof(TimeCHControlBlock),
.stack_mem = &TimeCHBuffer[0],
.stack_size = sizeof(TimeCHBuffer),
.priority = (osPriority_t) osPriorityRealtime7,
};
/* USER CODE BEGIN PV */
volatile uint8_t trig_flag = 0;
volatile uint32_t trig_value = 0;
@@ -57,6 +80,9 @@ void SystemClock_Config(void);
static void MPU_Config(void);
static void MX_GPIO_Init(void);
static void MX_TIM2_Init(void);
void StartDefaultTask(void *argument);
void TellTime(void *argument);
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
@@ -66,7 +92,11 @@ static void MX_TIM2_Init(void);
void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) {
if (htim->Instance == TIM2 && htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1) {
trig_value = HAL_TIM_ReadCapturedValue(htim, TIM_CHANNEL_1);
trig_flag = 1;
//trig_flag = 1;
//xTaskNotifyFromISR(TimeCHHandle,trig_value,eSetValueWithOverwrite,NULL);
TimeCHBuffer[0]=trig_value;
osThreadFlagsSet(TimeCHHandle,0x01);
}
}
@@ -76,7 +106,8 @@ void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) {
* @brief The application entry point.
* @retval int
*/
int main(void) {
int main(void)
{
/* USER CODE BEGIN 1 */
@@ -85,7 +116,7 @@ int main(void) {
#if defined(DUAL_CORE_BOOT_SYNC_SEQUENCE)
int32_t timeout;
#endif /* DUAL_CORE_BOOT_SYNC_SEQUENCE */
/* USER CODE END Boot_Mode_Sequence_0 */
/* USER CODE END Boot_Mode_Sequence_0 */
/* MPU Configuration--------------------------------------------------------*/
MPU_Config();
@@ -100,11 +131,10 @@ int main(void) {
Error_Handler();
}
#endif /* DUAL_CORE_BOOT_SYNC_SEQUENCE */
/* USER CODE END Boot_Mode_Sequence_1 */
/* USER CODE END Boot_Mode_Sequence_1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick.
*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
@@ -131,7 +161,7 @@ int main(void) {
Error_Handler();
}
#endif /* DUAL_CORE_BOOT_SYNC_SEQUENCE */
/* USER CODE END Boot_Mode_Sequence_2 */
/* USER CODE END Boot_Mode_Sequence_2 */
/* USER CODE BEGIN SysInit */
@@ -146,6 +176,45 @@ int main(void) {
SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
/* USER CODE END 2 */
/* Init scheduler */
osKernelInitialize();
/* USER CODE BEGIN RTOS_MUTEX */
/* add mutexes, ... */
/* USER CODE END RTOS_MUTEX */
/* USER CODE BEGIN RTOS_SEMAPHORES */
/* add semaphores, ... */
/* USER CODE END RTOS_SEMAPHORES */
/* USER CODE BEGIN RTOS_TIMERS */
/* start timers, add new ones, ... */
/* USER CODE END RTOS_TIMERS */
/* USER CODE BEGIN RTOS_QUEUES */
/* add queues, ... */
/* USER CODE END RTOS_QUEUES */
/* Create the thread(s) */
/* creation of defaultTask */
defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);
/* creation of TimeCH */
TimeCHHandle = osThreadNew(TellTime, NULL, &TimeCH_attributes);
/* USER CODE BEGIN RTOS_THREADS */
/* add threads, ... */
/* USER CODE END RTOS_THREADS */
/* USER CODE BEGIN RTOS_EVENTS */
/* add events, ... */
/* USER CODE END RTOS_EVENTS */
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1) {
@@ -168,7 +237,8 @@ int main(void) {
* @brief System Clock Configuration
* @retval None
*/
void SystemClock_Config(void) {
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
@@ -180,8 +250,7 @@ void SystemClock_Config(void) {
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);
while (!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {
}
while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
@@ -198,15 +267,16 @@ void SystemClock_Config(void) {
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_3;
RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
RCC_OscInitStruct.PLL.PLLFRACN = 0;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
/** Initializes the CPU, AHB and APB buses clocks
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK |
RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2 |
RCC_CLOCKTYPE_D3PCLK1 | RCC_CLOCKTYPE_D1PCLK1;
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
|RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2;
@@ -215,7 +285,8 @@ void SystemClock_Config(void) {
RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
{
Error_Handler();
}
}
@@ -225,7 +296,8 @@ void SystemClock_Config(void) {
* @param None
* @retval None
*/
static void MX_TIM2_Init(void) {
static void MX_TIM2_Init(void)
{
/* USER CODE BEGIN TIM2_Init 0 */
@@ -244,31 +316,37 @@ static void MX_TIM2_Init(void) {
htim2.Init.Period = 4294967295;
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV4;
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
if (HAL_TIM_Base_Init(&htim2) != HAL_OK) {
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
{
Error_Handler();
}
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) {
if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK)
{
Error_Handler();
}
if (HAL_TIM_IC_Init(&htim2) != HAL_OK) {
if (HAL_TIM_IC_Init(&htim2) != HAL_OK)
{
Error_Handler();
}
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) {
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
{
Error_Handler();
}
sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI;
sConfigIC.ICPrescaler = TIM_ICPSC_DIV1;
sConfigIC.ICFilter = 0;
if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK) {
if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN TIM2_Init 2 */
HAL_TIM_IC_Start_IT(&htim2, TIM_CHANNEL_1);
/* USER CODE END TIM2_Init 2 */
}
/**
@@ -276,7 +354,8 @@ static void MX_TIM2_Init(void) {
* @param None
* @retval None
*/
static void MX_GPIO_Init(void) {
static void MX_GPIO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
/* USER CODE BEGIN MX_GPIO_Init_1 */
@@ -305,9 +384,52 @@ static void MX_GPIO_Init(void) {
/* USER CODE END 4 */
/* MPU Configuration */
/* USER CODE BEGIN Header_StartDefaultTask */
/**
* @brief Function implementing the defaultTask thread.
* @param argument: Not used
* @retval None
*/
/* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void *argument)
{
/* USER CODE BEGIN 5 */
/* Infinite loop */
uint32_t t = 0;
for(;;)
{
//SEGGER_RTT_printf(0, "%lu\n\r",__HAL_TIM_GET_COUNTER(&htim2)-t);
//t=__HAL_TIM_GET_COUNTER(&htim2);
//osDelay(1000);
}
/* USER CODE END 5 */
}
void MPU_Config(void) {
/* USER CODE BEGIN Header_TellTime */
/**
* @brief Function implementing the TimeCH thread.
* @param argument: Not used
* @retval None
*/
/* USER CODE END Header_TellTime */
void TellTime(void *argument)
{
/* USER CODE BEGIN TellTime */
/* Infinite loop */
uint32_t ulvalue;
for(;;)
{
//xTaskNotifyWait(0,0,&ulvalue,portMAX_DELAY);
osThreadFlagsWait(0x01,osFlagsWaitAny,osWaitForever);
SEGGER_RTT_printf(0, "%lu, %lu\n\r",TimeCHBuffer[0],__HAL_TIM_GET_COUNTER(&htim2));
}
/* USER CODE END TellTime */
}
/* MPU Configuration */
void MPU_Config(void)
{
MPU_Region_InitTypeDef MPU_InitStruct = {0};
/* Disables the MPU */
@@ -330,13 +452,15 @@ void MPU_Config(void) {
HAL_MPU_ConfigRegion(&MPU_InitStruct);
/* Enables the MPU */
HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
}
/**
* @brief This function is executed in case of error occurrence.
* @retval None
*/
void Error_Handler(void) {
void Error_Handler(void)
{
/* USER CODE BEGIN Error_Handler_Debug */
/* User can add his own implementation to report the HAL error return state */
__disable_irq();
@@ -352,7 +476,8 @@ void Error_Handler(void) {
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t *file, uint32_t line) {
void assert_failed(uint8_t *file, uint32_t line)
{
/* USER CODE BEGIN 6 */
/* User can add his own implementation to report the file name and line
number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file,

View File

@@ -69,6 +69,8 @@ void HAL_MspInit(void)
__HAL_RCC_SYSCFG_CLK_ENABLE();
/* System interrupt init*/
/* PendSV_IRQn interrupt configuration */
HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0);
/* USER CODE BEGIN MspInit 1 */
@@ -104,7 +106,7 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* TIM2 interrupt Init */
HAL_NVIC_SetPriority(TIM2_IRQn, 0, 0);
HAL_NVIC_SetPriority(TIM2_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(TIM2_IRQn);
/* USER CODE BEGIN TIM2_MspInit 1 */

View File

@@ -20,6 +20,8 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32h7xx_it.h"
#include "FreeRTOS.h"
#include "task.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -138,19 +140,6 @@ void UsageFault_Handler(void)
}
}
/**
* @brief This function handles System service call via SWI instruction.
*/
void SVC_Handler(void)
{
/* USER CODE BEGIN SVCall_IRQn 0 */
/* USER CODE END SVCall_IRQn 0 */
/* USER CODE BEGIN SVCall_IRQn 1 */
/* USER CODE END SVCall_IRQn 1 */
}
/**
* @brief This function handles Debug monitor.
*/
@@ -164,19 +153,6 @@ void DebugMon_Handler(void)
/* USER CODE END DebugMonitor_IRQn 1 */
}
/**
* @brief This function handles Pendable request for system service.
*/
void PendSV_Handler(void)
{
/* USER CODE BEGIN PendSV_IRQn 0 */
/* USER CODE END PendSV_IRQn 0 */
/* USER CODE BEGIN PendSV_IRQn 1 */
/* USER CODE END PendSV_IRQn 1 */
}
/**
* @brief This function handles System tick timer.
*/
@@ -186,6 +162,14 @@ void SysTick_Handler(void)
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
#if (INCLUDE_xTaskGetSchedulerState == 1 )
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
{
#endif /* INCLUDE_xTaskGetSchedulerState */
xPortSysTickHandler();
#if (INCLUDE_xTaskGetSchedulerState == 1 )
}
#endif /* INCLUDE_xTaskGetSchedulerState */
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */

View File

@@ -13,12 +13,17 @@ set(MX_Include_Dirs
${CMAKE_CURRENT_SOURCE_DIR}/Core/Inc
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Inc
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Inc/Legacy
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/include
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/CMSIS/RTOS2/Include
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/CMSIS/Device/ST/STM32H7xx/Include
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/CMSIS/Include
)
# STM32CubeMX generated application sources
set(MX_Application_Src
${CMAKE_CURRENT_SOURCE_DIR}/Core/Src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/Core/Src/freertos.c
${CMAKE_CURRENT_SOURCE_DIR}/Core/Src/stm32h7xx_it.c
${CMAKE_CURRENT_SOURCE_DIR}/Core/Src/stm32h7xx_hal_msp.c
${CMAKE_CURRENT_SOURCE_DIR}/Core/Src/sysmem.c
@@ -30,8 +35,6 @@ set(MX_Application_Src
set(STM32_Drivers_Src
${CMAKE_CURRENT_SOURCE_DIR}/../Common/Src/system_stm32h7xx_dualcore_boot_cm4_cm7.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c
@@ -47,10 +50,25 @@ set(STM32_Drivers_Src
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c
${CMAKE_CURRENT_SOURCE_DIR}/../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c
)
# Drivers Midllewares
set(FreeRTOS_Src
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/portable/Common/mpu_wrappers_v2.c
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/croutine.c
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/list.c
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/queue.c
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/tasks.c
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/timers.c
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c
${CMAKE_CURRENT_SOURCE_DIR}/../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
)
# Link directories setup
set(MX_LINK_DIRS
@@ -59,7 +77,7 @@ set(MX_LINK_DIRS
set (MX_LINK_LIBS
STM32_Drivers
${TOOLCHAIN_LINK_LIBRARIES}
FreeRTOS
)
@@ -72,6 +90,11 @@ add_library(STM32_Drivers OBJECT)
add_library(STM32_Drivers OBJECT)
target_sources(STM32_Drivers PRIVATE ${STM32_Drivers_Src})
target_link_libraries(STM32_Drivers PUBLIC stm32cubemx)
# Create FreeRTOS static library
add_library(FreeRTOS OBJECT)
target_sources(FreeRTOS PRIVATE ${FreeRTOS_Src})
target_link_libraries(FreeRTOS PUBLIC stm32cubemx)
# Add STM32CubeMX generated application sources to the project

View File

@@ -7,6 +7,10 @@ CORTEX_M7.default_mode_Activation=1
CortexM4.IPs=CORTEX_M4\:I,FATFS_M4\:I,FREERTOS_M4\:I,IWDG2\:I,OPENAMP_M4\:I,PDM2PCM_M4\:I,PWR,RCC,RESMGR_UTILITY,SYS_M4\:I,USB_DEVICE_M4\:I,USB_HOST_M4\:I,VREFBUF,WWDG2\:I,GPIO,DMA,BDMA,MDMA,NVIC2\:I
CortexM7.IPs=CORTEX_M7\:I,FATFS_M7\:I,FREERTOS_M7\:I,IWDG1\:I,OPENAMP_M7\:I,PDM2PCM_M7\:I,PWR\:I,RCC\:I,RESMGR_UTILITY\:I,SYS\:I,USB_DEVICE_M7\:I,USB_HOST_M7\:I,VREFBUF\:I,WWDG1\:I,GPIO\:I,DMA\:I,BDMA\:I,MDMA\:I,NVIC1\:I,DEBUG\:I,TIM2\:I
CortexM7.Pins=PI12
FREERTOS_M7.FootprintOK=true
FREERTOS_M7.IPParameters=Tasks01,configENABLE_FPU,FootprintOK
FREERTOS_M7.Tasks01=defaultTask,24,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL;TimeCH,55,128,TellTime,Default,NULL,Static,TimeCHBuffer,TimeCHControlBlock
FREERTOS_M7.configENABLE_FPU=1
File.Version=6
GPIO.groupedBy=Group By Peripherals
KeepUserPlacement=false
@@ -17,44 +21,49 @@ Mcu.ContextNb=2
Mcu.Family=STM32H7
Mcu.IP0=CORTEX_M4
Mcu.IP1=CORTEX_M7
Mcu.IP2=NVIC1
Mcu.IP3=NVIC2
Mcu.IP4=RCC
Mcu.IP5=SYS_M4
Mcu.IP6=SYS
Mcu.IP7=TIM2
Mcu.IPNb=8
Mcu.IP2=FREERTOS_M7
Mcu.IP3=NVIC1
Mcu.IP4=NVIC2
Mcu.IP5=RCC
Mcu.IP6=SYS_M4
Mcu.IP7=SYS
Mcu.IP8=TIM2
Mcu.IPNb=9
Mcu.Name=STM32H747XIHx
Mcu.Package=TFBGA240
Mcu.Pin0=PA14 (JTCK/SWCLK)
Mcu.Pin1=PC15-OSC32_OUT (OSC32_OUT)
Mcu.Pin10=VP_TIM2_VS_ClockSourceINT
Mcu.Pin10=VP_SYS_M4_VS_Systick
Mcu.Pin11=VP_TIM2_VS_ClockSourceINT
Mcu.Pin2=PC14-OSC32_IN (OSC32_IN)
Mcu.Pin3=PA13 (JTMS/SWDIO)
Mcu.Pin4=PI12
Mcu.Pin5=PH1-OSC_OUT (PH1)
Mcu.Pin6=PH0-OSC_IN (PH0)
Mcu.Pin7=PA0
Mcu.Pin8=VP_SYS_VS_Systick
Mcu.Pin9=VP_SYS_M4_VS_Systick
Mcu.PinsNb=11
Mcu.Pin8=VP_FREERTOS_M7_VS_CMSIS_V2
Mcu.Pin9=VP_SYS_VS_Systick
Mcu.PinsNb=12
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32H747XIHx
MxCube.Version=6.17.0
MxDb.Version=DB.6.0.170
NVIC1.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC1.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC1.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC1.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC1.ForceEnableDMAVector=true
NVIC1.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC1.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC1.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC1.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC1.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC1.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC1.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC1.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false\:false
NVIC1.PriorityGroup=NVIC_PRIORITYGROUP_4
NVIC1.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC1.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
NVIC1.TIM2_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC1.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC1.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false
NVIC1.SavedPendsvIrqHandlerGenerated=true
NVIC1.SavedSvcallIrqHandlerGenerated=true
NVIC1.SavedSystickIrqHandlerGenerated=true
NVIC1.SysTick_IRQn=true\:15\:0\:false\:false\:true\:true\:false\:true\:false
NVIC1.TIM2_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC1.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC2.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC2.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC2.ForceEnableDMAVector=true
@@ -232,6 +241,8 @@ TIM2.Channel-Input_Capture1_from_TI1=TIM_CHANNEL_1
TIM2.ClockDivision=TIM_CLOCKDIVISION_DIV4
TIM2.IPParameters=ClockDivision,Prescaler,Channel-Input_Capture1_from_TI1
TIM2.Prescaler=0
VP_FREERTOS_M7_VS_CMSIS_V2.Mode=CMSIS_V2
VP_FREERTOS_M7_VS_CMSIS_V2.Signal=FREERTOS_M7_VS_CMSIS_V2
VP_SYS_M4_VS_Systick.Mode=SysTick
VP_SYS_M4_VS_Systick.Signal=SYS_M4_VS_Systick
VP_SYS_VS_Systick.Mode=SysTick