diff --git a/.mxproject b/.mxproject index 2ea9b3c..06ab073 100644 --- a/.mxproject +++ b/.mxproject @@ -2,44 +2,46 @@ LibFiles=Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_crc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_crc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Middlewares\Third_Party\FreeRTOS\Source\include\croutine.h;Middlewares\Third_Party\FreeRTOS\Source\include\deprecated_definitions.h;Middlewares\Third_Party\FreeRTOS\Source\include\event_groups.h;Middlewares\Third_Party\FreeRTOS\Source\include\FreeRTOS.h;Middlewares\Third_Party\FreeRTOS\Source\include\list.h;Middlewares\Third_Party\FreeRTOS\Source\include\message_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_prototypes.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h;Middlewares\Third_Party\FreeRTOS\Source\include\portable.h;Middlewares\Third_Party\FreeRTOS\Source\include\projdefs.h;Middlewares\Third_Party\FreeRTOS\Source\include\queue.h;Middlewares\Third_Party\FreeRTOS\Source\include\semphr.h;Middlewares\Third_Party\FreeRTOS\Source\include\stack_macros.h;Middlewares\Third_Party\FreeRTOS\Source\include\StackMacros.h;Middlewares\Third_Party\FreeRTOS\Source\include\stream_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\task.h;Middlewares\Third_Party\FreeRTOS\Source\include\timers.h;Middlewares\Third_Party\FreeRTOS\Source\include\atomic.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.h;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_crc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_crc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Middlewares\Third_Party\FreeRTOS\Source\include\croutine.h;Middlewares\Third_Party\FreeRTOS\Source\include\deprecated_definitions.h;Middlewares\Third_Party\FreeRTOS\Source\include\event_groups.h;Middlewares\Third_Party\FreeRTOS\Source\include\FreeRTOS.h;Middlewares\Third_Party\FreeRTOS\Source\include\list.h;Middlewares\Third_Party\FreeRTOS\Source\include\message_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_prototypes.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h;Middlewares\Third_Party\FreeRTOS\Source\include\portable.h;Middlewares\Third_Party\FreeRTOS\Source\include\projdefs.h;Middlewares\Third_Party\FreeRTOS\Source\include\queue.h;Middlewares\Third_Party\FreeRTOS\Source\include\semphr.h;Middlewares\Third_Party\FreeRTOS\Source\include\stack_macros.h;Middlewares\Third_Party\FreeRTOS\Source\include\StackMacros.h;Middlewares\Third_Party\FreeRTOS\Source\include\stream_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\task.h;Middlewares\Third_Party\FreeRTOS\Source\include\timers.h;Middlewares\Third_Party\FreeRTOS\Source\include\atomic.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.h;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f407xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\system_stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h; [PreviousUsedCubeIDEFiles] -SourceFiles=Core\Src\main.c;Core\Src\gpio.c;Core\Src\freertos.c;Core\Src\adc.c;Core\Src\can.c;Core\Src\crc.c;Core\Src\i2c.c;Core\Src\rng.c;Core\Src\spi.c;Core\Src\tim.c;Core\Src\usart.c;Core\Src\stm32f4xx_it.c;Core\Src\stm32f4xx_hal_msp.c;Core\Src\stm32f4xx_hal_timebase_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Core\Src\system_stm32f4xx.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Core\Src\system_stm32f4xx.c;;;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c; +SourceFiles=Core\Src\main.c;Core\Src\gpio.c;Core\Src\freertos.c;Core\Src\adc.c;Core\Src\can.c;Core\Src\crc.c;Core\Src\dma.c;Core\Src\i2c.c;Core\Src\rng.c;Core\Src\spi.c;Core\Src\tim.c;Core\Src\usart.c;Core\Src\stm32f4xx_it.c;Core\Src\stm32f4xx_hal_msp.c;Core\Src\stm32f4xx_hal_timebase_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Core\Src\system_stm32f4xx.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Core\Src\system_stm32f4xx.c;;;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c; HeaderPath=Drivers\STM32F4xx_HAL_Driver\Inc;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy;Middlewares\Third_Party\FreeRTOS\Source\include;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F;Drivers\CMSIS\Device\ST\STM32F4xx\Include;Drivers\CMSIS\Include;Core\Inc; CDefines=USE_HAL_DRIVER;STM32F407xx;USE_HAL_DRIVER;USE_HAL_DRIVER; [PreviousGenFiles] AdvancedFolderStructure=true -HeaderFileListSize=13 +HeaderFileListSize=14 HeaderFiles#0=..\Core\Inc\gpio.h HeaderFiles#1=..\Core\Inc\FreeRTOSConfig.h HeaderFiles#2=..\Core\Inc\adc.h HeaderFiles#3=..\Core\Inc\can.h HeaderFiles#4=..\Core\Inc\crc.h -HeaderFiles#5=..\Core\Inc\i2c.h -HeaderFiles#6=..\Core\Inc\rng.h -HeaderFiles#7=..\Core\Inc\spi.h -HeaderFiles#8=..\Core\Inc\tim.h -HeaderFiles#9=..\Core\Inc\usart.h -HeaderFiles#10=..\Core\Inc\stm32f4xx_it.h -HeaderFiles#11=..\Core\Inc\stm32f4xx_hal_conf.h -HeaderFiles#12=..\Core\Inc\main.h +HeaderFiles#5=..\Core\Inc\dma.h +HeaderFiles#6=..\Core\Inc\i2c.h +HeaderFiles#7=..\Core\Inc\rng.h +HeaderFiles#8=..\Core\Inc\spi.h +HeaderFiles#9=..\Core\Inc\tim.h +HeaderFiles#10=..\Core\Inc\usart.h +HeaderFiles#11=..\Core\Inc\stm32f4xx_it.h +HeaderFiles#12=..\Core\Inc\stm32f4xx_hal_conf.h +HeaderFiles#13=..\Core\Inc\main.h HeaderFolderListSize=1 HeaderPath#0=..\Core\Inc HeaderFiles=; -SourceFileListSize=14 +SourceFileListSize=15 SourceFiles#0=..\Core\Src\gpio.c SourceFiles#1=..\Core\Src\freertos.c SourceFiles#2=..\Core\Src\adc.c SourceFiles#3=..\Core\Src\can.c SourceFiles#4=..\Core\Src\crc.c -SourceFiles#5=..\Core\Src\i2c.c -SourceFiles#6=..\Core\Src\rng.c -SourceFiles#7=..\Core\Src\spi.c -SourceFiles#8=..\Core\Src\tim.c -SourceFiles#9=..\Core\Src\usart.c -SourceFiles#10=..\Core\Src\stm32f4xx_it.c -SourceFiles#11=..\Core\Src\stm32f4xx_hal_msp.c -SourceFiles#12=..\Core\Src\stm32f4xx_hal_timebase_tim.c -SourceFiles#13=..\Core\Src\main.c +SourceFiles#5=..\Core\Src\dma.c +SourceFiles#6=..\Core\Src\i2c.c +SourceFiles#7=..\Core\Src\rng.c +SourceFiles#8=..\Core\Src\spi.c +SourceFiles#9=..\Core\Src\tim.c +SourceFiles#10=..\Core\Src\usart.c +SourceFiles#11=..\Core\Src\stm32f4xx_it.c +SourceFiles#12=..\Core\Src\stm32f4xx_hal_msp.c +SourceFiles#13=..\Core\Src\stm32f4xx_hal_timebase_tim.c +SourceFiles#14=..\Core\Src\main.c SourceFolderListSize=1 SourcePath#0=..\Core\Src SourceFiles=; diff --git a/Core/Inc/stm32f4xx_it.h b/Core/Inc/stm32f4xx_it.h index 21bc8b3..43190c1 100644 --- a/Core/Inc/stm32f4xx_it.h +++ b/Core/Inc/stm32f4xx_it.h @@ -57,9 +57,11 @@ void CAN1_RX0_IRQHandler(void); void CAN1_RX1_IRQHandler(void); void CAN1_SCE_IRQHandler(void); void TIM1_TRG_COM_TIM11_IRQHandler(void); +void USART1_IRQHandler(void); void USART3_IRQHandler(void); void TIM6_DAC_IRQHandler(void); void TIM7_IRQHandler(void); +void DMA2_Stream2_IRQHandler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ diff --git a/Core/Inc/usart.h b/Core/Inc/usart.h index 7b84d11..7395fb9 100644 --- a/Core/Inc/usart.h +++ b/Core/Inc/usart.h @@ -29,7 +29,7 @@ extern "C" { #include "main.h" /* USER CODE BEGIN Includes */ - +extern DMA_HandleTypeDef hdma_usart1_rx; /* USER CODE END Includes */ extern UART_HandleTypeDef huart1; diff --git a/Core/Src/dma.c b/Core/Src/dma.c index a942cde..3ed0a94 100644 --- a/Core/Src/dma.c +++ b/Core/Src/dma.c @@ -40,15 +40,12 @@ void MX_DMA_Init(void) { /* DMA controller clock enable */ - __HAL_RCC_DMA1_CLK_ENABLE(); + __HAL_RCC_DMA2_CLK_ENABLE(); /* DMA interrupt init */ - /* DMA1_Stream5_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(DMA1_Stream5_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(DMA1_Stream5_IRQn); - /* DMA1_Stream6_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(DMA1_Stream6_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(DMA1_Stream6_IRQn); + /* DMA2_Stream2_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(DMA2_Stream2_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(DMA2_Stream2_IRQn); } diff --git a/Core/Src/main.c b/Core/Src/main.c index cc9193a..dc30bda 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -22,6 +22,7 @@ #include "adc.h" #include "can.h" #include "crc.h" +#include "dma.h" #include "i2c.h" #include "rng.h" #include "spi.h" @@ -98,6 +99,7 @@ int main(void) /* Initialize all configured peripherals */ MX_GPIO_Init(); + MX_DMA_Init(); MX_USART1_UART_Init(); MX_TIM3_Init(); MX_CRC_Init(); diff --git a/Core/Src/stm32f4xx_it.c b/Core/Src/stm32f4xx_it.c index 9b07d37..208c50c 100644 --- a/Core/Src/stm32f4xx_it.c +++ b/Core/Src/stm32f4xx_it.c @@ -59,6 +59,8 @@ extern CAN_HandleTypeDef hcan1; extern TIM_HandleTypeDef htim1; extern TIM_HandleTypeDef htim6; extern TIM_HandleTypeDef htim7; +extern DMA_HandleTypeDef hdma_usart1_rx; +extern UART_HandleTypeDef huart1; extern UART_HandleTypeDef huart3; extern TIM_HandleTypeDef htim11; @@ -236,6 +238,20 @@ void TIM1_TRG_COM_TIM11_IRQHandler(void) } /** + * @brief This function handles USART1 global interrupt. + */ +void USART1_IRQHandler(void) +{ + /* USER CODE BEGIN USART1_IRQn 0 */ + + /* USER CODE END USART1_IRQn 0 */ + HAL_UART_IRQHandler(&huart1); + /* USER CODE BEGIN USART1_IRQn 1 */ + + /* USER CODE END USART1_IRQn 1 */ +} + +/** * @brief This function handles USART3 global interrupt. */ void USART3_IRQHandler(void) @@ -277,6 +293,20 @@ void TIM7_IRQHandler(void) /* USER CODE END TIM7_IRQn 1 */ } +/** + * @brief This function handles DMA2 stream2 global interrupt. + */ +void DMA2_Stream2_IRQHandler(void) +{ + /* USER CODE BEGIN DMA2_Stream2_IRQn 0 */ + + /* USER CODE END DMA2_Stream2_IRQn 0 */ + HAL_DMA_IRQHandler(&hdma_usart1_rx); + /* USER CODE BEGIN DMA2_Stream2_IRQn 1 */ + + /* USER CODE END DMA2_Stream2_IRQn 1 */ +} + /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ diff --git a/Core/Src/tim.c b/Core/Src/tim.c index 9c53f14..8015c61 100644 --- a/Core/Src/tim.c +++ b/Core/Src/tim.c @@ -52,7 +52,7 @@ void MX_TIM1_Init(void) htim1.Init.Period = 9999; htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim1.Init.RepetitionCounter = 0; - htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; if (HAL_TIM_Base_Init(&htim1) != HAL_OK) { Error_Handler(); @@ -121,9 +121,9 @@ void MX_TIM2_Init(void) htim2.Instance = TIM2; htim2.Init.Prescaler = 0; htim2.Init.CounterMode = TIM_COUNTERMODE_UP; - htim2.Init.Period = 4294967295; + htim2.Init.Period = 65535; htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; if (HAL_TIM_PWM_Init(&htim2) != HAL_OK) { Error_Handler(); diff --git a/Core/Src/usart.c b/Core/Src/usart.c index bf00911..ad5c71f 100644 --- a/Core/Src/usart.c +++ b/Core/Src/usart.c @@ -26,6 +26,7 @@ UART_HandleTypeDef huart1; UART_HandleTypeDef huart3; +DMA_HandleTypeDef hdma_usart1_rx; /* USART1 init function */ @@ -40,7 +41,7 @@ void MX_USART1_UART_Init(void) /* USER CODE END USART1_Init 1 */ huart1.Instance = USART1; - huart1.Init.BaudRate = 1000000; + huart1.Init.BaudRate = 921600; huart1.Init.WordLength = UART_WORDLENGTH_8B; huart1.Init.StopBits = UART_STOPBITS_1; huart1.Init.Parity = UART_PARITY_NONE; @@ -110,6 +111,28 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) GPIO_InitStruct.Alternate = GPIO_AF7_USART1; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + /* USART1 DMA Init */ + /* USART1_RX Init */ + hdma_usart1_rx.Instance = DMA2_Stream2; + hdma_usart1_rx.Init.Channel = DMA_CHANNEL_4; + hdma_usart1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_usart1_rx.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_usart1_rx.Init.MemInc = DMA_MINC_ENABLE; + hdma_usart1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; + hdma_usart1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; + hdma_usart1_rx.Init.Mode = DMA_NORMAL; + hdma_usart1_rx.Init.Priority = DMA_PRIORITY_LOW; + hdma_usart1_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; + if (HAL_DMA_Init(&hdma_usart1_rx) != HAL_OK) + { + Error_Handler(); + } + + __HAL_LINKDMA(uartHandle,hdmarx,hdma_usart1_rx); + + /* USART1 interrupt Init */ + HAL_NVIC_SetPriority(USART1_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(USART1_IRQn); /* USER CODE BEGIN USART1_MspInit 1 */ /* USER CODE END USART1_MspInit 1 */ @@ -160,6 +183,11 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle) */ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10); + /* USART1 DMA DeInit */ + HAL_DMA_DeInit(uartHandle->hdmarx); + + /* USART1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(USART1_IRQn); /* USER CODE BEGIN USART1_MspDeInit 1 */ /* USER CODE END USART1_MspDeInit 1 */ diff --git a/README.md b/README.md index f9b0e1c..1162182 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,16 @@ ref:https://iflytop1.feishu.cn/wiki/PbUHwG2o6ikWagkmsiqcTFwAnjp -// 电机通道编号 -#define MOTOR_SPI hspi1 -#define TMC5130_MOTOR_NUM 1 -#define MOTOR0_CSN PA4 -#define MOTOR0_ENN PB7 -#define MOTOR1_SPI_MODE_SELECT PB4 +``` -#define ID0 PC0 -#define ID1 PC1 -#define ID2 PC2 -#define ID3 PC3 -#define ID4 PC4 +加热片测试: + 1. 板子输出信号: + PE9 -->TEC1_IN1-->R50 + PE10-->TEC1_IN2-->R51 + PB2 -->TEC1_SLEEP-->R53 -// 调试串口 -#define DEBUG_UART huart1 -// 调试指示灯 -#define DEBUG_LIGHT_GPIO PE2 -// 微秒延迟定时器,注意该延时定时器需要按照以下文档进行配置 -// http://192.168.1.3:3000/zwikipedia/iflytop_wikipedia/src/branch/master/doc/stm32cubemx_us_timer.md -#define DELAY_US_TIMER htim6 + PE13-->TEC2_IN1-->R80 + PE14-->TEC2_IN2-->R81 + PB13-->TEC2_SLEEP->R83 + 2. -// 步进电机 -#define STEPPER_MOTOR_ZERO_SENSOR SENSOR_INT0 -#define STEPPER_MOTOR_FORWARD_SENSOR SENSOR_INT8 -#define STEPPER_MOTOR_BACKWARD_SENSOR SENSOR_INT9 - -#define SENSOR_INT0 PD0 -#define SENSOR_INT1 PD1 -#define SENSOR_INT2 PD2 -#define SENSOR_INT3 PD3 -#define SENSOR_INT4 PD4 -#define SENSOR_INT5 PD5 -#define SENSOR_INT6 PD6 -#define SENSOR_INT7 PD7 -#define SENSOR_INT8 PD8 -#define SENSOR_INT9 PD9 - ---------------------------------------------------- -1. 支持位置限制逻辑 -2. 支持获取当前坐标逻辑 -3. 支持记录当前点作为逻辑点逻辑 -4. 支持flash保存参数逻辑 \ No newline at end of file +``` \ No newline at end of file diff --git a/a8000_temperature_ctl.ioc b/a8000_temperature_ctl.ioc index 9f47017..01031ab 100644 --- a/a8000_temperature_ctl.ioc +++ b/a8000_temperature_ctl.ioc @@ -21,6 +21,18 @@ CAN1.RFLM=ENABLE CAN1.SJW=CAN_SJW_3TQ CAN1.TTCM=ENABLE CAN1.TXFP=DISABLE +Dma.Request0=USART1_RX +Dma.RequestsNb=1 +Dma.USART1_RX.0.Direction=DMA_PERIPH_TO_MEMORY +Dma.USART1_RX.0.FIFOMode=DMA_FIFOMODE_DISABLE +Dma.USART1_RX.0.Instance=DMA2_Stream2 +Dma.USART1_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.USART1_RX.0.MemInc=DMA_MINC_ENABLE +Dma.USART1_RX.0.Mode=DMA_NORMAL +Dma.USART1_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.USART1_RX.0.PeriphInc=DMA_PINC_DISABLE +Dma.USART1_RX.0.Priority=DMA_PRIORITY_LOW +Dma.USART1_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode FREERTOS.FootprintOK=true FREERTOS.IPParameters=Tasks01,FootprintOK,configUSE_NEWLIB_REENTRANT,configUSE_RECURSIVE_MUTEXES,configUSE_COUNTING_SEMAPHORES,configRECORD_STACK_HIGH_ADDRESS,configENABLE_FPU FREERTOS.Tasks01=defaultTask,-3,1024,StartDefaultTask,As weak,NULL,Dynamic,NULL,NULL @@ -38,22 +50,23 @@ Mcu.CPN=STM32F407VET6 Mcu.Family=STM32F4 Mcu.IP0=ADC1 Mcu.IP1=CAN1 -Mcu.IP10=TIM1 -Mcu.IP11=TIM2 -Mcu.IP12=TIM3 -Mcu.IP13=TIM6 -Mcu.IP14=TIM7 -Mcu.IP15=USART1 -Mcu.IP16=USART3 +Mcu.IP10=SYS +Mcu.IP11=TIM1 +Mcu.IP12=TIM2 +Mcu.IP13=TIM3 +Mcu.IP14=TIM6 +Mcu.IP15=TIM7 +Mcu.IP16=USART1 +Mcu.IP17=USART3 Mcu.IP2=CRC -Mcu.IP3=FREERTOS -Mcu.IP4=I2C1 -Mcu.IP5=NVIC -Mcu.IP6=RCC -Mcu.IP7=RNG -Mcu.IP8=SPI1 -Mcu.IP9=SYS -Mcu.IPNb=17 +Mcu.IP3=DMA +Mcu.IP4=FREERTOS +Mcu.IP5=I2C1 +Mcu.IP6=NVIC +Mcu.IP7=RCC +Mcu.IP8=RNG +Mcu.IP9=SPI1 +Mcu.IPNb=18 Mcu.Name=STM32F407V(E-G)Tx Mcu.Package=LQFP100 Mcu.Pin0=PH0-OSC_IN @@ -100,6 +113,7 @@ NVIC.CAN1_RX0_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.CAN1_RX1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.CAN1_SCE_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.CAN1_TX_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true +NVIC.DMA2_Stream2_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false NVIC.ForceEnableDMAVector=true NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false @@ -117,6 +131,7 @@ NVIC.TIM6_DAC_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.TIM7_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.TimeBase=TIM1_TRG_COM_TIM11_IRQn NVIC.TimeBaseIP=TIM11 +NVIC.USART1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.USART3_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false PA1.Locked=true @@ -203,7 +218,7 @@ ProjectManager.ToolChainLocation= ProjectManager.UAScriptAfterPath= ProjectManager.UAScriptBeforePath= ProjectManager.UnderRoot=true -ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_TIM3_Init-TIM3-false-HAL-true,5-MX_CRC_Init-CRC-false-HAL-true,6-MX_RNG_Init-RNG-false-HAL-true,7-MX_TIM7_Init-TIM7-false-HAL-true,8-MX_SPI1_Init-SPI1-false-HAL-true,9-MX_TIM6_Init-TIM6-false-HAL-true,10-MX_TIM1_Init-TIM1-false-HAL-true,11-MX_CAN1_Init-CAN1-false-HAL-true,12-MX_USART3_UART_Init-USART3-false-HAL-true,13-MX_I2C1_Init-I2C1-false-HAL-true,14-MX_ADC1_Init-ADC1-false-HAL-true,15-MX_TIM2_Init-TIM2-false-HAL-true +ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_TIM3_Init-TIM3-false-HAL-true,6-MX_CRC_Init-CRC-false-HAL-true,7-MX_RNG_Init-RNG-false-HAL-true,8-MX_TIM7_Init-TIM7-false-HAL-true,9-MX_SPI1_Init-SPI1-false-HAL-true,10-MX_TIM6_Init-TIM6-false-HAL-true,11-MX_TIM1_Init-TIM1-false-HAL-true,12-MX_CAN1_Init-CAN1-false-HAL-true,13-MX_USART3_UART_Init-USART3-false-HAL-true,14-MX_I2C1_Init-I2C1-false-HAL-true,15-MX_ADC1_Init-ADC1-false-HAL-true,16-MX_TIM2_Init-TIM2-false-HAL-true RCC.48MHZClocksFreq_Value=48000000 RCC.AHBFreq_Value=144000000 RCC.APB1CLKDivider=RCC_HCLK_DIV4 @@ -268,15 +283,18 @@ SPI1.Direction=SPI_DIRECTION_2LINES SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler SPI1.Mode=SPI_MODE_MASTER SPI1.VirtualType=VM_MASTER +TIM1.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE TIM1.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1 TIM1.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3 -TIM1.IPParameters=Period,Prescaler,Channel-PWM Generation1 CH1,Channel-PWM Generation3 CH3 +TIM1.IPParameters=Period,Prescaler,Channel-PWM Generation1 CH1,Channel-PWM Generation3 CH3,AutoReloadPreload TIM1.Period=9999 TIM1.Prescaler=143 +TIM2.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE TIM2.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2 TIM2.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3 TIM2.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4 -TIM2.IPParameters=Channel-PWM Generation3 CH3,Channel-PWM Generation4 CH4,Channel-PWM Generation2 CH2 +TIM2.IPParameters=Channel-PWM Generation3 CH3,Channel-PWM Generation4 CH4,Channel-PWM Generation2 CH2,AutoReloadPreload,Period +TIM2.Period=65535 TIM3.IPParameters=Prescaler,Period TIM3.Period=9999 TIM3.Prescaler=71 @@ -284,7 +302,7 @@ TIM6.IPParameters=Prescaler TIM6.Prescaler=71 TIM7.IPParameters=Prescaler TIM7.Prescaler=81 -USART1.BaudRate=1000000 +USART1.BaudRate=921600 USART1.IPParameters=VirtualMode,BaudRate USART1.VirtualMode=VM_ASYNC USART3.BaudRate=9600 diff --git a/sdk b/sdk index c3bc465..95bf191 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit c3bc4650b57bfa179a136532d3c40c7a2c682eee +Subproject commit 95bf1917c6b821b815a92bdb5c3d983759c92453 diff --git a/usrc/main.cpp b/usrc/main.cpp index cfadae8..1420a49 100644 --- a/usrc/main.cpp +++ b/usrc/main.cpp @@ -5,7 +5,6 @@ #include "sdk\components\flash\zsimple_flash.hpp" #include "sdk\components\zcancmder\zcanreceiver.hpp" #include "sdk\components\zcancmder_module\zcan_basic_order_module.hpp" -#include "sdk\components\zprotocols\zcancmder_v2\protocol_parser.hpp" // #include "sdk\components\flash\znvs.hpp" // @@ -16,6 +15,14 @@ #include "sdk\components\water_cooling_temperature_control_module\water_cooling_temperature_control_module_factory.cpp" #include "sdk\components\water_cooling_temperature_control_module\water_cooling_temperature_control_module_factory.hpp" +// cancmder basic +#include "sdk\components\cmdscheduler\cmd_scheduler_v2.hpp" +#include "sdk\components\hardware\uart\zuart_dma_receiver.hpp" +#include "sdk\components\zcancmder\zcan_board_module.hpp" +#include "sdk\components\zprotocol_helper\micro_computer_module_device_script_cmder_paser.hpp" +#include "sdk\components\zprotocols\zcancmder_v2\protocol_parser.hpp" +#include "sdk\components\zprotocols\zcancmder_v2\zmodule_device_manager.hpp" +// #define TAG "main" using namespace iflytop; using namespace std; @@ -25,8 +32,14 @@ extern "C" { void StartDefaultTask(void const* argument) { umain(); } } -static ZCanCmder g_zcanCmder; -static ZIProtocolParser g_ziProtocolParser; +// static ZCanCmder g_zcanCmder; +// static ZIProtocolParser g_ziProtocolParser; + +static ZCanCmder g_zcanCmder; +static ZIProtocolParser g_ziProtocolParser; +static ZModuleDeviceManager g_zModuleDeviceManager; +static MicroComputerModuleDeviceScriptCmderPaser g_zModuleDeviceScriptCmderPaser; +static uint32_t g_deviceId = 0; uint8_t getId() { static bool init = false; @@ -47,47 +60,32 @@ uint8_t getId() { return id; } -void umain() { - chip_cfg_t chipcfg; - chipcfg.us_dleay_tim = &DELAY_US_TIMER; - chipcfg.tim_irq_scheduler_tim = &TIM_IRQ_SCHEDULER_TIMER; - chipcfg.huart = &DEBUG_UART; - chipcfg.debuglight = DEBUG_LIGHT_GPIO; - - chip_init(&chipcfg); - - zos_cfg_t zoscfg; - zos_init(&zoscfg); - - uint8_t deviceId = getId(); - ZLOGI(TAG, "motorId:%d", deviceId); - - if (deviceId == 0) { - ZLOGE(TAG, "motorId can't be 0"); - chip_set_error(); - while (true) { - } - } - +void initcfg() { +/** + * @brief 初始化配置,系统中需要配置都需要在这里进行初始化 + */ #if 0 - /******************************************************************************* - * NVSINIT * - *******************************************************************************/ - ZNVS::ins().initialize(IFLYTOP_NVS_CONFIG_FLASH_SECTOR); - { - static I_StepMotorCtrlModule::flash_config_t cfg; - StepMotorCtrlModule::create_default_cfg(cfg); - ZNVS::ins().alloc_config(MOTOR_CFG_FLASH_MARK, (uint8_t*)&cfg, sizeof(cfg)); - } - ZNVS::ins().init_config(); - + static I_StepMotorCtrlModule::flash_config_t cfg; + StepMotorCtrlModule::create_default_cfg(cfg); + ZNVS::ins().alloc_config(MOTOR_CFG_FLASH_MARK, (uint8_t*)&cfg, sizeof(cfg)); #endif +} +void initmodule() { +#define TIMER2_FREQ 1000 +#define TIMER1_FREQ 1000 +#define HEART_SHAFT false /******************************************************************************* * 风扇配置 * *******************************************************************************/ PWMSpeedCtrlModule::config_t fan0cfg = { - .fanCtrlTim = &htim2, + .pwm_cfg = + { + .name = "fan0pwmtimer", + .htim = &htim2, + .freq = TIMER2_FREQ, + .polarity = true, + }, .nfan = 2, .fan0Channel = {3, 0, 0, 0}, .fanFBGpioCfg = @@ -97,11 +95,23 @@ void umain() { }, .fanPowerGpioCfg = { - {.pin = PC4, .mode = ZGPIO::kMode_nopull, .mirror = false}, + { + .pin = PC4, + .mode = ZGPIO::kMode_nopull, + .mirror = false, + }, }, + .enablefbcheck = true, + .enableTrace = true, }; PWMSpeedCtrlModule::config_t fan1cfg = { - .fanCtrlTim = &htim2, + .pwm_cfg = + { + .name = "fan1pwmtimer", + .htim = &htim2, + .freq = TIMER2_FREQ, + .polarity = true, + }, .nfan = 2, .fan0Channel = {4, 0, 0, 0}, .fanFBGpioCfg = @@ -111,15 +121,28 @@ void umain() { }, .fanPowerGpioCfg = { - {.pin = PC5, .mode = ZGPIO::kMode_nopull, .mirror = false}, + { + .pin = PC5, + .mode = ZGPIO::kMode_nopull, + .mirror = false, + }, }, + .enablefbcheck = true, + .enableTrace = true, }; /******************************************************************************* * 水泵配置 * *******************************************************************************/ PWMSpeedCtrlModule::config_t pumpcfg = { - .fanCtrlTim = &htim2, + .pwm_cfg = + { + .name = "pumptime", + .htim = &htim2, + .freq = TIMER2_FREQ, + .polarity = true, + .calltrace = true, + }, .nfan = 1, .fan0Channel = {2, 0, 0, 0}, .fanFBGpioCfg = @@ -128,27 +151,48 @@ void umain() { }, .fanPowerGpioCfg = { - {.pin = PC2, .mode = ZGPIO::kMode_nopull, .mirror = false}, + { + .pin = PC2, + .mode = ZGPIO::kMode_nopull, + .mirror = false, + .log_when_setstate = true, + + }, }, + .enablefbcheck = false, + .enableTrace = true, }; DRV8710::config_t peltier_config0 = { - .tim = &htim1, - .in1_chnannel_index = 1, - .in2 = PE10, + .pwm_cfg = + { + .name = "peltier0_pwm", + .htim = &htim1, + .freq = TIMER1_FREQ, + .polarity = true, + }, + .in1_chnannel_index = 1, // PE9 + .in2 = PE11, .nsleep = PB2, .nfault = PB3, - .shaft = false, + .shaft = HEART_SHAFT, + .enableTrace = true, }; DRV8710::config_t peltier_config1 = { - .tim = &htim1, - .in1_chnannel_index = 3, + .pwm_cfg = + { + .name = "peltier1_pwm", + .htim = &htim1, + .freq = TIMER1_FREQ, + .polarity = true, + }, + .in1_chnannel_index = 3, // PE13 .in2 = PE14, .nsleep = PB13, .nfault = PB14, - .shaft = false, - + .shaft = HEART_SHAFT, + .enableTrace = true, }; static TMP117 temp[4]; @@ -158,49 +202,101 @@ void umain() { static DRV8710 peltier0; static DRV8710 peltier1; - static WaterCoolingTemperatureControlModule waterCoolingTemperatureControlModule; - - fan0.initialize(&fan0cfg, true); - fan1.initialize(&fan1cfg, true); - pump.initialize(&pumpcfg, false); - peltier0.initialize(&peltier_config0); - peltier1.initialize(&peltier_config1); - temp[0].initializate(&hi2c1, TMP117::ID0); temp[1].initializate(&hi2c1, TMP117::ID1); temp[2].initializate(&hi2c1, TMP117::ID2); temp[3].initializate(&hi2c1, TMP117::ID3); - WaterCoolingTemperatureControlModule::config_t temp_ctrl_config; - waterCoolingTemperatureControlModule.createDefaultConfig(&temp_ctrl_config); + fan0.initialize(&fan0cfg); + fan1.initialize(&fan1cfg); + pump.initialize(&pumpcfg); + peltier0.initialize(&peltier_config0); + peltier1.initialize(&peltier_config1); - WaterCoolingTemperatureControlModule::hardwared_config_t hardwared_config = // - { - .temperature_sensor = {&temp[0], &temp[1], &temp[2], &temp[3]}, - .fanTable = {&fan0, &fan1}, - .pump = &pump, - .peltier_ctrl = {&peltier0, &peltier1}, - .ext_input = - { - {PC6, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true}, - {PC7, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true}, - }, - .ext_output = - { - {PD0, ZGPIO::kMode_nopull, false, false}, - } // - }; + { + /** + * @brief 板子本身模块初始化 + */ + static ZCanBoardModule::hardware_config_t cfg = { + .input = + { + {PC6, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true}, + {PC7, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true}, + }, + .output = + { + {PD0, ZGPIO::kMode_nopull, false, false}, + } // + }; + static ZCanBoardModule boardmodule; + boardmodule.initialize(g_deviceId, &cfg); + g_ziProtocolParser.registerModule(&boardmodule); + g_zModuleDeviceManager.registerModule(&boardmodule); + } - waterCoolingTemperatureControlModule.initialize(deviceId, &temp_ctrl_config, &hardwared_config); + { + /******************************************************************************* + * 控温模块初始化 * + *******************************************************************************/ + static WaterCoolingTemperatureControlModule waterCoolingTemperatureControlModule; + static WaterCoolingTemperatureControlModule::config_t temp_ctrl_config; + waterCoolingTemperatureControlModule.createDefaultConfig(&temp_ctrl_config); + WaterCoolingTemperatureControlModule::hardwared_config_t hardwared_config = // + { + .temperature_sensor = {&temp[0], &temp[1], &temp[2], &temp[3]}, + .fanTable = {&fan0, &fan1}, + .pump = &pump, + .peltier_ctrl = {&peltier0, &peltier1}, + }; - auto zcanCmder_cfg = g_zcanCmder.createCFG(deviceId); - g_zcanCmder.init(zcanCmder_cfg); + waterCoolingTemperatureControlModule.initialize(g_deviceId + 1, &temp_ctrl_config, &hardwared_config); + g_zModuleDeviceManager.registerModule(&waterCoolingTemperatureControlModule); + g_ziProtocolParser.registerModule(&waterCoolingTemperatureControlModule); + } +} +void umain() { + chip_cfg_t chipcfg; + chipcfg.us_dleay_tim = &DELAY_US_TIMER; + chipcfg.tim_irq_scheduler_tim = &TIM_IRQ_SCHEDULER_TIMER; + chipcfg.huart = &DEBUG_UART; + chipcfg.debuglight = DEBUG_LIGHT_GPIO; + + chip_init(&chipcfg); + + zos_cfg_t zoscfg; + zos_init(&zoscfg); + + g_deviceId = getId() * 10; + ZLOGI(TAG, "motorId:%d", g_deviceId); + /******************************************************************************* + * NVSINIT * + *******************************************************************************/ + ZNVS::ins().initialize(IFLYTOP_NVS_CONFIG_FLASH_SECTOR); + initcfg(); + ZNVS::ins().init_config(); + + auto zcanCmder_cfg = g_zcanCmder.createCFG(g_deviceId); + g_zcanCmder.init(zcanCmder_cfg); g_ziProtocolParser.initialize(&g_zcanCmder); - g_ziProtocolParser.registerModule(&waterCoolingTemperatureControlModule); + static ZUARTDmaReceiver dmaUartReceiver; + static CmdSchedulerV2 cmder; + ZUARTDmaReceiver::hardware_config_t cfg = { + .huart = &DEBUG_UART, + .dma_rx = &DEBUG_UART_DMA, + .rxbuffersize = 1024, + .rxovertime_ms = 10, + }; + dmaUartReceiver.initialize(&cfg); + cmder.initialize(&dmaUartReceiver); + g_zModuleDeviceManager.initialize(nullptr); + g_zModuleDeviceScriptCmderPaser.initialize(&cmder, &g_zModuleDeviceManager); + + initmodule(); while (true) { OSDefaultSchduler::getInstance()->loop(); g_zcanCmder.loop(); + cmder.schedule(); } -}; +} diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 8313014..6f258e1 100644 --- a/usrc/project_configs.h +++ b/usrc/project_configs.h @@ -1,9 +1,10 @@ #pragma once -#define VERSION "v1.0.0" -#define MANUFACTURER "http://www.iflytop.com/" -#define PROJECT_NAME "a8000_temperature_ctrl" -#define DEBUG_UART huart1 +#define VERSION "v1.0.0" +#define MANUFACTURER "http://www.iflytop.com/" +#define PROJECT_NAME "a8000_temperature_ctrl" +#define DEBUG_UART huart1 +#define DEBUG_UART_DMA hdma_usart1_rx #define DEBUG_LIGHT_GPIO PE2 #define DELAY_US_TIMER htim6 // US延时定时器 @@ -13,13 +14,12 @@ #define IFLYTOP_ENABLE_OS 1 #define IFLYTOP_PREEMPTPRIORITY_DEFAULT 5 - /****************************************FLASH***************************************/ #define IFLYTOP_NVS_CONFIG_FLASH_SECTOR 8 /*********************************************************************************/ // MOTOR1 -#define TMC_MOTOR_SPI hspi1 +#define TMC_MOTOR_SPI hspi1 #define TMC5130_MOTOR_NUM 1 #define MOTOR0_CSN PA4 #define MOTOR0_ENN PB7