Changeset 66 for ctrl/firmware/Main/CubeMX
- Timestamp:
- Jan 22, 2025, 11:40:26 AM (4 days ago)
- Location:
- ctrl/firmware/Main/CubeMX
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
ctrl/firmware/Main/CubeMX/Core/Inc/main.h
r62 r66 82 82 #define GSM_STATUS_Pin GPIO_PIN_13 83 83 #define GSM_STATUS_GPIO_Port GPIOD 84 #define FAN_TACHO_Pin GPIO_PIN_6 85 #define FAN_TACHO_GPIO_Port GPIOC 86 #define FAN_PWM_Pin GPIO_PIN_7 87 #define FAN_PWM_GPIO_Port GPIOC 84 88 #define SD_DETECT_Pin GPIO_PIN_8 85 89 #define SD_DETECT_GPIO_Port GPIOA -
ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_it.h
r64 r66 56 56 void DMA1_Stream1_IRQHandler(void); 57 57 void DMA1_Stream2_IRQHandler(void); 58 void TIM3_IRQHandler(void); 58 59 void USART3_IRQHandler(void); 60 void TIM8_CC_IRQHandler(void); 59 61 void SDMMC1_IRQHandler(void); 60 62 void TIM7_IRQHandler(void); -
ctrl/firmware/Main/CubeMX/Core/Src/app_threadx.c
r65 r66 33 33 #include "gsm_thread.h" 34 34 #include "gsm_rx_thread.h" 35 #include "fan_thread.h" 35 36 36 37 /* USER CODE END Includes */ … … 47 48 #define GSM_THREAD_STACK_SIZE_BYTES (1024U) 48 49 #define GSM_RX_THREAD_STACK_SIZE_BYTES (1024U) 50 #define FAN_THREAD_STACK_SIZE_BYTES (512U) 49 51 50 52 /* USER CODE END PD */ … … 61 63 TX_THREAD gsm_thread_ptr; 62 64 TX_THREAD gsm_rx_thread_ptr; 65 TX_THREAD fan_thread_ptr; 63 66 64 67 /* USER CODE END PV */ … … 83 86 VOID *gsm_thread_pointer; 84 87 VOID *gsm_rx_thread_pointer; 88 VOID *fan_thread_pointer; 85 89 86 90 /* USER CODE END App_ThreadX_MEM_POOL */ … … 97 101 98 102 99 // Allocate the stack for gsm thread103 // Allocate the stack for gsm send thread 100 104 ret = tx_byte_allocate(byte_pool, &gsm_thread_pointer, GSM_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 101 105 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } … … 105 109 if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", gsm_thread_name); return ret; } 106 110 107 // Allocate the stack for gsm sendthread111 // Allocate the stack for gsm rx thread 108 112 ret = tx_byte_allocate(byte_pool, &gsm_rx_thread_pointer, GSM_RX_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 109 113 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } 110 114 111 115 char* gsm_rx_thread_name = "GSM RX Thread"; 112 ret = tx_thread_create(&gsm_rx_thread_ptr, gsm_rx_thread_name, gsmRxThread, 0x0001, 116 ret = tx_thread_create(&gsm_rx_thread_ptr, gsm_rx_thread_name, gsmRxThread, 0x0001, gsm_rx_thread_pointer, GSM_RX_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START); 113 117 if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", gsm_rx_thread_name); return ret; } 114 118 119 // Allocate the stack for fan control thread 120 ret = tx_byte_allocate(byte_pool, &fan_thread_pointer, FAN_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 121 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } 122 123 char* fan_thread_name = "FAN Thread"; 124 ret = tx_thread_create(&fan_thread_ptr, fan_thread_name, fanThread, 0x0001, fan_thread_pointer, FAN_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START); 125 if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", fan_thread_name); return ret; } 115 126 116 127 -
ctrl/firmware/Main/CubeMX/Core/Src/gpio.c
r63 r66 88 88 89 89 /*Configure GPIO pins : PC13 PC0 PC1 PC2 90 PC3 PC4 PC5 PC6 91 PC7 */ 90 PC3 PC4 PC5 */ 92 91 GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2 93 |GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6 94 |GPIO_PIN_7; 92 |GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5; 95 93 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 96 94 GPIO_InitStruct.Pull = GPIO_NOPULL; -
ctrl/firmware/Main/CubeMX/Core/Src/main.c
r61 r66 25 25 #include "sdmmc.h" 26 26 #include "spi.h" 27 #include "tim.h" 27 28 #include "usart.h" 28 29 #include "gpio.h" … … 120 121 MX_SDMMC1_SD_Init(); 121 122 MX_USART3_UART_Init(); 123 MX_TIM3_Init(); 124 MX_TIM8_Init(); 122 125 /* USER CODE BEGIN 2 */ 123 126 #undef MX_SDMMC1_SD_Init -
ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_it.c
r65 r66 25 25 26 26 #include "gsm_rx_thread.h" 27 #include "fan_thread.h" 27 28 28 29 /* USER CODE END Includes */ … … 62 63 extern DMA_HandleTypeDef hdma_spi4_tx; 63 64 extern SPI_HandleTypeDef hspi4; 65 extern TIM_HandleTypeDef htim3; 66 extern TIM_HandleTypeDef htim8; 64 67 extern DMA_HandleTypeDef hdma_usart3_rx; 65 68 extern DMA_HandleTypeDef hdma_usart3_tx; … … 212 215 213 216 /** 217 * @brief This function handles TIM3 global interrupt. 218 */ 219 void TIM3_IRQHandler(void) 220 { 221 /* USER CODE BEGIN TIM3_IRQn 0 */ 222 223 /* USER CODE END TIM3_IRQn 0 */ 224 HAL_TIM_IRQHandler(&htim3); 225 /* USER CODE BEGIN TIM3_IRQn 1 */ 226 227 /* USER CODE END TIM3_IRQn 1 */ 228 } 229 230 /** 214 231 * @brief This function handles USART3 global interrupt. 215 232 */ … … 226 243 227 244 /** 245 * @brief This function handles TIM8 capture compare interrupt. 246 */ 247 void TIM8_CC_IRQHandler(void) 248 { 249 /* USER CODE BEGIN TIM8_CC_IRQn 0 */ 250 251 /* USER CODE END TIM8_CC_IRQn 0 */ 252 HAL_TIM_IRQHandler(&htim8); 253 /* USER CODE BEGIN TIM8_CC_IRQn 1 */ 254 255 /* USER CODE END TIM8_CC_IRQn 1 */ 256 } 257 258 /** 228 259 * @brief This function handles SDMMC1 global interrupt. 229 260 */ … … 278 309 //------------------------------------------------------------------------------ 279 310 280 /*void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart)281 { 282 //if (huart->Instance == USART3) gsmUnitSentData();283 } */311 void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) 312 { 313 if (htim->Instance == TIM8) pulseMeasured(); 314 } 284 315 285 316 //------------------------------------------------------------------------------ -
ctrl/firmware/Main/CubeMX/charger.ioc
r65 r66 3 3 CAD.pinconfig= 4 4 CAD.provider= 5 CORTEX_M7.AccessPermission_S-Cortex_Memory_Protection_Unit_Region1_Settings_S=MPU_REGION_FULL_ACCESS6 CORTEX_M7.BaseAddress_S-Cortex_Memory_Protection_Unit_Region1_Settings_S=0x300000007 5 CORTEX_M7.CPU_DCache=Enabled 8 6 CORTEX_M7.CPU_ICache=Enabled 9 CORTEX_M7.DisableExec_S-Cortex_Memory_Protection_Unit_Region1_Settings_S=MPU_INSTRUCTION_ACCESS_DISABLE 10 CORTEX_M7.Enable_S-Cortex_Memory_Protection_Unit_Region1_Settings_S=MPU_REGION_ENABLE 11 CORTEX_M7.IPParameters=default_mode_Activation,CPU_ICache,CPU_DCache,Enable_S-Cortex_Memory_Protection_Unit_Region1_Settings_S,BaseAddress_S-Cortex_Memory_Protection_Unit_Region1_Settings_S,Size_S-Cortex_Memory_Protection_Unit_Region1_Settings_S,AccessPermission_S-Cortex_Memory_Protection_Unit_Region1_Settings_S,DisableExec_S-Cortex_Memory_Protection_Unit_Region1_Settings_S,IsShareable_S-Cortex_Memory_Protection_Unit_Region1_Settings_S 12 CORTEX_M7.IsShareable_S-Cortex_Memory_Protection_Unit_Region1_Settings_S=MPU_ACCESS_SHAREABLE 13 CORTEX_M7.Size_S-Cortex_Memory_Protection_Unit_Region1_Settings_S=MPU_REGION_SIZE_1KB 7 CORTEX_M7.Enable_S-Cortex_Memory_Protection_Unit_Region1_Settings_S=__NULL 8 CORTEX_M7.IPParameters=default_mode_Activation,CPU_ICache,CPU_DCache,Enable_S-Cortex_Memory_Protection_Unit_Region1_Settings_S 14 9 CORTEX_M7.default_mode_Activation=1 15 10 Dma.Request0=SPI4_TX … … 80 75 Mcu.IP0=CORTEX_M7 81 76 Mcu.IP1=DEBUG 82 Mcu.IP10=USART3 77 Mcu.IP10=TIM3 78 Mcu.IP11=TIM8 79 Mcu.IP12=USART3 83 80 Mcu.IP2=DMA 84 81 Mcu.IP3=MEMORYMAP … … 89 86 Mcu.IP8=SPI4 90 87 Mcu.IP9=SYS 91 Mcu.IPNb=1 188 Mcu.IPNb=13 92 89 Mcu.Name=STM32H723ZETx 93 90 Mcu.Package=LQFP144 … … 105 102 Mcu.Pin19=PD13 106 103 Mcu.Pin2=PC15-OSC32_OUT 107 Mcu.Pin20=PC 8108 Mcu.Pin21=PC 9109 Mcu.Pin22=P A8110 Mcu.Pin23=P A13(JTMS/SWDIO)111 Mcu.Pin24=PA 14(JTCK/SWCLK)112 Mcu.Pin25=P C10113 Mcu.Pin26=P C11114 Mcu.Pin27=PC1 2115 Mcu.Pin28=P D2116 Mcu.Pin29=P D7104 Mcu.Pin20=PC6 105 Mcu.Pin21=PC7 106 Mcu.Pin22=PC8 107 Mcu.Pin23=PC9 108 Mcu.Pin24=PA8 109 Mcu.Pin25=PA13(JTMS/SWDIO) 110 Mcu.Pin26=PA14(JTCK/SWCLK) 111 Mcu.Pin27=PC10 112 Mcu.Pin28=PC11 113 Mcu.Pin29=PC12 117 114 Mcu.Pin3=PH0-OSC_IN 118 Mcu.Pin30=P G9119 Mcu.Pin31=P G10120 Mcu.Pin32=PG 11121 Mcu.Pin33=PG1 2122 Mcu.Pin34=PG1 3123 Mcu.Pin35=PG1 5124 Mcu.Pin36= VP_RTC_VS_RTC_Activate125 Mcu.Pin37= VP_SYS_VS_tim7126 Mcu.Pin38=VP_ MEMORYMAP_VS_MEMORYMAP127 Mcu.Pin39=VP_S TMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0115 Mcu.Pin30=PD2 116 Mcu.Pin31=PD7 117 Mcu.Pin32=PG9 118 Mcu.Pin33=PG10 119 Mcu.Pin34=PG11 120 Mcu.Pin35=PG12 121 Mcu.Pin36=PG13 122 Mcu.Pin37=PG15 123 Mcu.Pin38=VP_RTC_VS_RTC_Activate 124 Mcu.Pin39=VP_SYS_VS_tim7 128 125 Mcu.Pin4=PH1-OSC_OUT 129 Mcu.Pin40=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0 130 Mcu.Pin41=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0 126 Mcu.Pin40=VP_TIM3_VS_ClockSourceINT 127 Mcu.Pin41=VP_TIM8_VS_ControllerModeReset 128 Mcu.Pin42=VP_TIM8_VS_ClockSourceINT 129 Mcu.Pin43=VP_MEMORYMAP_VS_MEMORYMAP 130 Mcu.Pin44=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0 131 Mcu.Pin45=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0 132 Mcu.Pin46=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0 131 133 Mcu.Pin5=PF15 132 134 Mcu.Pin6=PG0 … … 134 136 Mcu.Pin8=PE7 135 137 Mcu.Pin9=PE11 136 Mcu.PinsNb=4 2138 Mcu.PinsNb=47 137 139 Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0 138 140 Mcu.ThirdPartyNb=1 … … 159 161 NVIC.SavedSystickIrqHandlerGenerated=true 160 162 NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:true\:false 163 NVIC.TIM3_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true\:true 161 164 NVIC.TIM7_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true 165 NVIC.TIM8_CC_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true\:true 162 166 NVIC.TimeBase=TIM7_IRQn 163 167 NVIC.TimeBaseIP=TIM7 … … 183 187 PC15-OSC32_OUT.Mode=LSE-External-Oscillator 184 188 PC15-OSC32_OUT.Signal=RCC_OSC32_OUT 189 PC6.GPIOParameters=GPIO_PuPd,GPIO_Label 190 PC6.GPIO_Label=FAN_TACHO 191 PC6.GPIO_PuPd=GPIO_PULLUP 192 PC6.Locked=true 193 PC6.Signal=S_TIM8_CH1 194 PC7.GPIOParameters=GPIO_Label 195 PC7.GPIO_Label=FAN_PWM 196 PC7.Locked=true 197 PC7.Signal=S_TIM3_CH2 185 198 PC8.Locked=true 186 199 PC8.Mode=SD_4_bits_Wide_bus … … 315 328 ProjectManager.UAScriptBeforePath= 316 329 ProjectManager.UnderRoot=true 317 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_RTC_Init-RTC-false-HAL-true,5-MX_SPI4_Init-SPI4-false-HAL-true,6-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,7-MX_USART3_UART_Init-USART3-false-HAL-true, 0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true330 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_RTC_Init-RTC-false-HAL-true,5-MX_SPI4_Init-SPI4-false-HAL-true,6-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,7-MX_USART3_UART_Init-USART3-false-HAL-true,8-MX_TIM3_Init-TIM3-false-HAL-true,9-MX_TIM8_Init-TIM8-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true 318 331 RCC.ADCFreq_Value=166666666.66666666 319 332 RCC.AHB12Freq_Value=100000000 … … 400 413 SDMMC1.HardwareFlowControl=SDMMC_HARDWARE_FLOW_CONTROL_ENABLE 401 414 SDMMC1.IPParameters=ClockPowerSave,HardwareFlowControl 415 SH.S_TIM3_CH2.0=TIM3_CH2,PWM Generation2 CH2 416 SH.S_TIM3_CH2.ConfNb=1 417 SH.S_TIM8_CH1.0=TIM8_CH1,Input_Capture1_from_TI1 418 SH.S_TIM8_CH1.1=TIM8_CH1,TriggerSource_TI1FP1 419 SH.S_TIM8_CH1.ConfNb=2 402 420 SPI4.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_4 403 421 SPI4.CalculateBaudRate=6.25 MBits/s … … 417 435 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileOoSystemJjInterfaces_Checked=true 418 436 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileXCcFileOoSystemJjFileXJjCore=true 419 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.IPParameters=TX_APP_MEM_POOL_SIZE,FX_APP_MEM_POOL_SIZE,TX_APP_GENERATE_INIT_CODE,TX_APP_CREATION,TX_ENABLE_STACK_CHECKING,TX_NO_FILEX_POINTER,TX_LOW_POWER,FX_ENABLE_EXFAT,FX_ENABLE_FAULT_TOLERANT,FX_FAULT_TOLERANT,FX_FAULT_TOLERANT_DATA,FX_DRIVER_SD_INIT,TX_TIMER_TICKS_PER_SECOND,T hreadXCcRTOSJjThreadXJjCore,ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport,FileXCcFileOoSystemJjFileXJjCore,InterfacesCcFileOoSystemJjFileXOoSDOointerface,TX_APP_MSG_QUEUE_CREATION,TX_MSG_QUEUE_NAME,TX_NB_MSG437 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.IPParameters=TX_APP_MEM_POOL_SIZE,FX_APP_MEM_POOL_SIZE,TX_APP_GENERATE_INIT_CODE,TX_APP_CREATION,TX_ENABLE_STACK_CHECKING,TX_NO_FILEX_POINTER,TX_LOW_POWER,FX_ENABLE_EXFAT,FX_ENABLE_FAULT_TOLERANT,FX_FAULT_TOLERANT,FX_FAULT_TOLERANT_DATA,FX_DRIVER_SD_INIT,TX_TIMER_TICKS_PER_SECOND,TX_APP_MSG_QUEUE_CREATION,TX_MSG_QUEUE_NAME,TX_NB_MSG,ThreadXCcRTOSJjThreadXJjCore,ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport,FileXCcFileOoSystemJjFileXJjCore,InterfacesCcFileOoSystemJjFileXOoSDOointerface 420 438 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.InterfacesCcFileOoSystemJjFileXOoSDOointerface=true 421 439 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.RTOSJjThreadX_Checked=true … … 434 452 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_IsAnAzureRtosMw=true 435 453 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_SwParameter=InterfacesCcFileOoSystemJjFileXOoSDOointerface\:true;ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport\:true;FileXCcFileOoSystemJjFileXJjCore\:true;ThreadXCcRTOSJjThreadXJjCore\:true; 454 TIM3.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE 455 TIM3.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2 456 TIM3.IPParameters=AutoReloadPreload,Channel-PWM Generation2 CH2,Prescaler,Period,Pulse-PWM Generation2 CH2,OCPolarity_2 457 TIM3.OCPolarity_2=TIM_OCPOLARITY_LOW 458 TIM3.Period=1000 459 TIM3.Prescaler=3 460 TIM3.Pulse-PWM\ Generation2\ CH2=200 461 TIM8.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE 462 TIM8.Channel-Input_Capture1_from_TI1=TIM_CHANNEL_1 463 TIM8.ICPolarity_CH1=TIM_INPUTCHANNELPOLARITY_BOTHEDGE 464 TIM8.IPParameters=Channel-Input_Capture1_from_TI1,ICPolarity_CH1,Prescaler,AutoReloadPreload,Period 465 TIM8.Period=65536 - 1 466 TIM8.Prescaler=32 - 1 436 467 USART3.DMADisableonRxErrorParam=ADVFEATURE_DMA_DISABLEONRXERROR 437 468 USART3.IPParameters=VirtualMode-Asynchronous,SwapParam,DMADisableonRxErrorParam … … 450 481 VP_SYS_VS_tim7.Mode=TIM7 451 482 VP_SYS_VS_tim7.Signal=SYS_VS_tim7 483 VP_TIM3_VS_ClockSourceINT.Mode=Internal 484 VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT 485 VP_TIM8_VS_ClockSourceINT.Mode=Internal 486 VP_TIM8_VS_ClockSourceINT.Signal=TIM8_VS_ClockSourceINT 487 VP_TIM8_VS_ControllerModeReset.Mode=Reset Mode 488 VP_TIM8_VS_ControllerModeReset.Signal=TIM8_VS_ControllerModeReset 452 489 board=custom
Note: See TracChangeset
for help on using the changeset viewer.