Changeset 61 for ctrl/firmware/Main/CubeMX
- Timestamp:
- Jan 13, 2025, 11:56:09 AM (2 days ago)
- Location:
- ctrl/firmware/Main/CubeMX
- Files:
-
- 6 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ctrl/firmware/Main/CubeMX/Core/Inc/main.h
r58 r61 78 78 #define RST_DISPLAY_Pin GPIO_PIN_15 79 79 #define RST_DISPLAY_GPIO_Port GPIOE 80 #define GSM_PWR_Pin GPIO_PIN_10 81 #define GSM_PWR_GPIO_Port GPIOD 80 82 #define SD_DETECT_Pin GPIO_PIN_8 81 83 #define SD_DETECT_GPIO_Port GPIOA … … 92 94 #define TX2_LED_Pin GPIO_PIN_13 93 95 #define TX2_LED_GPIO_Port GPIOG 96 #define BUZZER_Pin GPIO_PIN_15 97 #define BUZZER_GPIO_Port GPIOG 94 98 95 99 /* USER CODE BEGIN Private defines */ -
ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_hal_conf.h
r54 r61 76 76 /* #define HAL_SWPMI_MODULE_ENABLED */ 77 77 #define HAL_TIM_MODULE_ENABLED 78 /* #define HAL_UART_MODULE_ENABLED */ 78 #define HAL_UART_MODULE_ENABLED 79 79 /* #define HAL_USART_MODULE_ENABLED */ 80 80 /* #define HAL_IRDA_MODULE_ENABLED */ -
ctrl/firmware/Main/CubeMX/Core/Src/app_threadx.c
r58 r61 29 29 30 30 #include "keys_thread.h" 31 #include "gsm_thread.h" 31 32 32 33 /* USER CODE END Includes */ … … 40 41 /* USER CODE BEGIN PD */ 41 42 42 #define MAIN_THREAD_STACK_SIZE_BYTES (1024U) 43 #define KEYS_THREAD_STACK_SIZE_BYTES (1024U) 44 #define GSM_THREAD_STACK_SIZE_BYTES (1024U) 43 45 44 46 /* USER CODE END PD */ … … 53 55 54 56 TX_THREAD scan_keys_thread_ptr; 57 TX_THREAD gsm_thread_ptr; 55 58 56 59 /* USER CODE END PV */ … … 72 75 73 76 TX_BYTE_POOL *byte_pool = (TX_BYTE_POOL*)memory_ptr; 74 VOID *pointer; 77 VOID *keys_thread_pointer; 78 VOID *gsm_thread_pointer; 75 79 76 80 /* USER CODE END App_ThreadX_MEM_POOL */ … … 79 83 80 84 // Allocate the stack for main thread 81 ret = tx_byte_allocate(byte_pool, &pointer, MAIN_THREAD_STACK_SIZE_BYTES, 82 TX_NO_WAIT); 85 ret = tx_byte_allocate(byte_pool, &keys_thread_pointer, KEYS_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 83 86 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } 84 87 85 ret = tx_thread_create(&scan_keys_thread_ptr, "Scan Keys Thread", scanKeysThread, 0x0001, 86 pointer, MAIN_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, 87 TX_NO_TIME_SLICE, TX_AUTO_START); 88 if (ret != TX_SUCCESS) { printf("Cannot create Scan Keys Thread!\n"); return ret; } 88 char* scan_keys_thread_name = "Scan Keys Thread"; 89 ret = tx_thread_create(&scan_keys_thread_ptr, scan_keys_thread_name, scanKeysThread, 0x0001, keys_thread_pointer, KEYS_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START); 90 if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", scan_keys_thread_name); return ret; } 91 92 93 94 ret = tx_byte_allocate(byte_pool, &gsm_thread_pointer, GSM_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 95 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } 96 97 char* gsm_thread_name = "GSM Thread"; 98 ret = tx_thread_create(&gsm_thread_ptr, gsm_thread_name, gsmThread, 0x0001, gsm_thread_pointer, GSM_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START); 99 if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", gsm_thread_name); return ret; } 100 101 89 102 90 103 /* USER CODE END App_ThreadX_Init */ -
ctrl/firmware/Main/CubeMX/Core/Src/gpio.c
r59 r61 65 65 /*Configure GPIO pin Output Level */ 66 66 HAL_GPIO_WritePin(GPIOG, POWER_5V_EN_Pin|POWER_10V_EN_Pin|ERROR_LED_Pin|CHARGE_LED_Pin 67 |RX2_LED_Pin|RX1_LED_Pin|TX2_LED_Pin , GPIO_PIN_RESET);67 |RX2_LED_Pin|RX1_LED_Pin|TX2_LED_Pin|BUZZER_Pin, GPIO_PIN_RESET); 68 68 69 69 /*Configure GPIO pin Output Level */ 70 HAL_GPIO_WritePin( OUTPUT_ON_LED_GPIO_Port,OUTPUT_ON_LED_Pin, GPIO_PIN_RESET);70 HAL_GPIO_WritePin(GPIOD, GSM_PWR_Pin|OUTPUT_ON_LED_Pin, GPIO_PIN_RESET); 71 71 72 72 /*Configure GPIO pins : PE2 PE3 PE4 PE5 … … 141 141 142 142 /*Configure GPIO pins : POWER_5V_EN_Pin POWER_10V_EN_Pin ERROR_LED_Pin CHARGE_LED_Pin 143 RX2_LED_Pin RX1_LED_Pin TX2_LED_Pin */143 RX2_LED_Pin RX1_LED_Pin TX2_LED_Pin BUZZER_Pin */ 144 144 GPIO_InitStruct.Pin = POWER_5V_EN_Pin|POWER_10V_EN_Pin|ERROR_LED_Pin|CHARGE_LED_Pin 145 |RX2_LED_Pin|RX1_LED_Pin|TX2_LED_Pin ;145 |RX2_LED_Pin|RX1_LED_Pin|TX2_LED_Pin|BUZZER_Pin; 146 146 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 147 147 GPIO_InitStruct.Pull = GPIO_NOPULL; … … 149 149 HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); 150 150 151 /*Configure GPIO pins : PD8 PD9 PD10 PD11 152 PD12 PD13 PD14 PD15 153 PD0 PD1 PD3 PD4 154 PD5 PD6 */ 155 GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11 156 |GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15 157 |GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_3|GPIO_PIN_4 158 |GPIO_PIN_5|GPIO_PIN_6; 151 /*Configure GPIO pins : GSM_PWR_Pin OUTPUT_ON_LED_Pin */ 152 GPIO_InitStruct.Pin = GSM_PWR_Pin|OUTPUT_ON_LED_Pin; 153 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 154 GPIO_InitStruct.Pull = GPIO_NOPULL; 155 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; 156 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); 157 158 /*Configure GPIO pins : PD11 PD12 PD13 PD14 159 PD15 PD0 PD1 PD3 160 PD4 PD5 PD6 */ 161 GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14 162 |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_3 163 |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6; 159 164 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 160 165 GPIO_InitStruct.Pull = GPIO_NOPULL; … … 162 167 163 168 /*Configure GPIO pins : PG2 PG3 PG4 PG5 164 PG6 PG7 PG8 PG14 165 PG15 */ 169 PG6 PG7 PG8 PG14 */ 166 170 GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5 167 |GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_14 168 |GPIO_PIN_15; 171 |GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_14; 169 172 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 170 173 GPIO_InitStruct.Pull = GPIO_NOPULL; … … 177 180 HAL_GPIO_Init(SD_DETECT_GPIO_Port, &GPIO_InitStruct); 178 181 179 /*Configure GPIO pin : OUTPUT_ON_LED_Pin */180 GPIO_InitStruct.Pin = OUTPUT_ON_LED_Pin;181 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;182 GPIO_InitStruct.Pull = GPIO_NOPULL;183 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;184 HAL_GPIO_Init(OUTPUT_ON_LED_GPIO_Port, &GPIO_InitStruct);185 186 182 } 187 183 -
ctrl/firmware/Main/CubeMX/Core/Src/main.c
r59 r61 25 25 #include "sdmmc.h" 26 26 #include "spi.h" 27 #include "usart.h" 27 28 #include "gpio.h" 28 29 … … 109 110 110 111 /* USER CODE BEGIN SysInit */ 111 112 #define MX_SDMMC1_SD_Init DoNothing 112 113 /* USER CODE END SysInit */ 113 #define MX_SDMMC1_SD_Init DoNothing 114 114 115 /* Initialize all configured peripherals */ 115 116 MX_GPIO_Init(); … … 118 119 MX_SPI4_Init(); 119 120 MX_SDMMC1_SD_Init(); 121 MX_USART3_UART_Init(); 120 122 /* USER CODE BEGIN 2 */ 121 123 #undef MX_SDMMC1_SD_Init -
ctrl/firmware/Main/CubeMX/charger.ioc
r59 r61 36 36 Mcu.IP0=CORTEX_M7 37 37 Mcu.IP1=DEBUG 38 Mcu.IP10=USART3 38 39 Mcu.IP2=DMA 39 40 Mcu.IP3=MEMORYMAP … … 44 45 Mcu.IP8=SPI4 45 46 Mcu.IP9=SYS 46 Mcu.IPNb=1 047 Mcu.IPNb=11 47 48 Mcu.Name=STM32H723ZETx 48 49 Mcu.Package=LQFP144 … … 53 54 Mcu.Pin12=PE14 54 55 Mcu.Pin13=PE15 55 Mcu.Pin14=P C856 Mcu.Pin15=P C957 Mcu.Pin16=P A858 Mcu.Pin17=P A13(JTMS/SWDIO)59 Mcu.Pin18=P A14(JTCK/SWCLK)60 Mcu.Pin19=P C1056 Mcu.Pin14=PD8 57 Mcu.Pin15=PD9 58 Mcu.Pin16=PD10 59 Mcu.Pin17=PC8 60 Mcu.Pin18=PC9 61 Mcu.Pin19=PA8 61 62 Mcu.Pin2=PC15-OSC32_OUT 62 Mcu.Pin20=P C1163 Mcu.Pin21=P C1264 Mcu.Pin22=P D265 Mcu.Pin23=P D766 Mcu.Pin24=P G967 Mcu.Pin25=P G1068 Mcu.Pin26=P G1169 Mcu.Pin27=PG 1270 Mcu.Pin28=PG1 371 Mcu.Pin29= VP_RTC_VS_RTC_Activate63 Mcu.Pin20=PA13(JTMS/SWDIO) 64 Mcu.Pin21=PA14(JTCK/SWCLK) 65 Mcu.Pin22=PC10 66 Mcu.Pin23=PC11 67 Mcu.Pin24=PC12 68 Mcu.Pin25=PD2 69 Mcu.Pin26=PD7 70 Mcu.Pin27=PG9 71 Mcu.Pin28=PG10 72 Mcu.Pin29=PG11 72 73 Mcu.Pin3=PH0-OSC_IN 73 Mcu.Pin30=VP_SYS_VS_tim7 74 Mcu.Pin31=VP_MEMORYMAP_VS_MEMORYMAP 75 Mcu.Pin32=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0 76 Mcu.Pin33=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0 77 Mcu.Pin34=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0 74 Mcu.Pin30=PG12 75 Mcu.Pin31=PG13 76 Mcu.Pin32=PG15 77 Mcu.Pin33=VP_RTC_VS_RTC_Activate 78 Mcu.Pin34=VP_SYS_VS_tim7 79 Mcu.Pin35=VP_MEMORYMAP_VS_MEMORYMAP 80 Mcu.Pin36=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0 81 Mcu.Pin37=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0 82 Mcu.Pin38=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0 78 83 Mcu.Pin4=PH1-OSC_OUT 79 84 Mcu.Pin5=PF15 … … 82 87 Mcu.Pin8=PE7 83 88 Mcu.Pin9=PE11 84 Mcu.PinsNb=3 589 Mcu.PinsNb=39 85 90 Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0 86 91 Mcu.ThirdPartyNb=1 … … 133 138 PC9.Mode=SD_4_bits_Wide_bus 134 139 PC9.Signal=SDMMC1_D1 140 PD10.GPIOParameters=GPIO_Label 141 PD10.GPIO_Label=GSM_PWR 142 PD10.Locked=true 143 PD10.Signal=GPIO_Output 135 144 PD2.Mode=SD_4_bits_Wide_bus 136 145 PD2.Signal=SDMMC1_CMD … … 139 148 PD7.Locked=true 140 149 PD7.Signal=GPIO_Output 150 PD8.Locked=true 151 PD8.Mode=Asynchronous 152 PD8.Signal=USART3_TX 153 PD9.Locked=true 154 PD9.Mode=Asynchronous 155 PD9.Signal=USART3_RX 141 156 PE11.GPIOParameters=GPIO_Label 142 157 PE11.GPIO_Label=SPI4_NSS_DISPLAY … … 199 214 PG13.Locked=true 200 215 PG13.Signal=GPIO_Output 216 PG15.GPIOParameters=GPIO_Label 217 PG15.GPIO_Label=BUZZER 218 PG15.Locked=true 219 PG15.Signal=GPIO_Output 201 220 PG9.GPIOParameters=GPIO_Label 202 221 PG9.GPIO_Label=ERROR_LED … … 256 275 RCC.DIVM1=5 257 276 RCC.DIVM2=3 258 RCC.DIVM3= 1277 RCC.DIVM3=25 259 278 RCC.DIVN1=40 260 279 RCC.DIVN2=40 261 RCC.DIVN3= 4280 RCC.DIVN3=200 262 281 RCC.DIVP1Freq_Value=100000000 263 282 RCC.DIVP2Freq_Value=166666666.66666666 264 RCC.DIVP3Freq_Value= 50000000283 RCC.DIVP3Freq_Value=100000000 265 284 RCC.DIVQ1=4 266 285 RCC.DIVQ1Freq_Value=50000000 267 286 RCC.DIVQ2=11 268 287 RCC.DIVQ2Freq_Value=30303030.3030303 269 RCC.DIVQ3Freq_Value=50000000 288 RCC.DIVQ3=8 289 RCC.DIVQ3Freq_Value=25000000 270 290 RCC.DIVR1Freq_Value=100000000 271 291 RCC.DIVR2=10 272 292 RCC.DIVR2Freq_Value=33333333.333333332 273 RCC.DIVR3Freq_Value= 50000000293 RCC.DIVR3Freq_Value=100000000 274 294 RCC.FDCANFreq_Value=50000000 275 295 RCC.FMCFreq_Value=100000000 … … 279 299 RCC.I2C123Freq_Value=100000000 280 300 RCC.I2C4Freq_Value=100000000 281 RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVM2,DIVM3,DIVN1,DIVN2,DIVN3,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1,DIVQ1Freq_Value,DIVQ2,DIVQ2Freq_Value,DIVQ3 Freq_Value,DIVR1Freq_Value,DIVR2,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLLFRACN,PLLSourceVirtual,QSPIFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Spi45ClockSelection,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value301 RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVM2,DIVM3,DIVN1,DIVN2,DIVN3,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1,DIVQ1Freq_Value,DIVQ2,DIVQ2Freq_Value,DIVQ3,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLLFRACN,PLLSourceVirtual,QSPIFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Spi45ClockSelection,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578CLockSelection,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value 282 302 RCC.LPTIM1Freq_Value=100000000 283 303 RCC.LPTIM2Freq_Value=100000000 284 304 RCC.LPTIM345Freq_Value=100000000 285 305 RCC.LPUART1Freq_Value=100000000 286 RCC.LTDCFreq_Value= 50000000306 RCC.LTDCFreq_Value=100000000 287 307 RCC.MCO1PinFreq_Value=64000000 288 308 RCC.MCO2PinFreq_Value=100000000 … … 310 330 RCC.TraceFreq_Value=100000000 311 331 RCC.USART16Freq_Value=100000000 312 RCC.USART234578Freq_Value=100000000 332 RCC.USART234578CLockSelection=RCC_USART234578CLKSOURCE_PLL3 333 RCC.USART234578Freq_Value=25000000 313 334 RCC.USBFreq_Value=50000000 314 335 RCC.VCO1OutputFreq_Value=200000000 315 336 RCC.VCO2OutputFreq_Value=333333333.3333333 316 RCC.VCO3OutputFreq_Value= 100000000337 RCC.VCO3OutputFreq_Value=200000000 317 338 RCC.VCOInput1Freq_Value=5000000 318 339 RCC.VCOInput2Freq_Value=8333333.333333333 319 RCC.VCOInput3Freq_Value= 25000000340 RCC.VCOInput3Freq_Value=1000000 320 341 SDMMC1.ClockPowerSave=SDMMC_CLOCK_POWER_SAVE_ENABLE 321 342 SDMMC1.HardwareFlowControl=SDMMC_HARDWARE_FLOW_CONTROL_ENABLE … … 352 373 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_IsAnAzureRtosMw=true 353 374 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_SwParameter=InterfacesCcFileOoSystemJjFileXOoSDOointerface\:true;ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport\:true;FileXCcFileOoSystemJjFileXJjCore\:true;ThreadXCcRTOSJjThreadXJjCore\:true; 375 USART3.IPParameters=VirtualMode-Asynchronous 376 USART3.VirtualMode-Asynchronous=VM_ASYNC 354 377 VP_MEMORYMAP_VS_MEMORYMAP.Mode=CurAppReg 355 378 VP_MEMORYMAP_VS_MEMORYMAP.Signal=MEMORYMAP_VS_MEMORYMAP
Note: See TracChangeset
for help on using the changeset viewer.