Changeset 64 for ctrl/firmware/Main/CubeMX
- Timestamp:
- Jan 15, 2025, 4:04:20 PM (9 hours ago)
- Location:
- ctrl/firmware/Main/CubeMX
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_it.h
r63 r64 54 54 void DebugMon_Handler(void); 55 55 void DMA1_Stream0_IRQHandler(void); 56 void DMA1_Stream1_IRQHandler(void); 57 void DMA1_Stream2_IRQHandler(void); 56 58 void USART3_IRQHandler(void); 57 59 void SDMMC1_IRQHandler(void); -
ctrl/firmware/Main/CubeMX/Core/Src/app_threadx.c
r61 r64 82 82 /* USER CODE BEGIN App_ThreadX_Init */ 83 83 84 // Allocate the stack for mainthread84 // Allocate the stack for key thread 85 85 ret = tx_byte_allocate(byte_pool, &keys_thread_pointer, KEYS_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 86 86 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } 87 87 88 88 char* scan_keys_thread_name = "Scan Keys Thread"; 89 ret = tx_thread_create(&scan_keys_thread_ptr, scan_keys_thread_name, scanKeysThread, 0x0001, 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 90 if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", scan_keys_thread_name); return ret; } 91 91 92 92 93 93 // Allocate the stack for gsm thread 94 94 ret = tx_byte_allocate(byte_pool, &gsm_thread_pointer, GSM_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 95 95 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } -
ctrl/firmware/Main/CubeMX/Core/Src/dma.c
r47 r64 47 47 HAL_NVIC_SetPriority(DMA1_Stream0_IRQn, 0, 0); 48 48 HAL_NVIC_EnableIRQ(DMA1_Stream0_IRQn); 49 /* DMA1_Stream1_IRQn interrupt configuration */ 50 HAL_NVIC_SetPriority(DMA1_Stream1_IRQn, 0, 0); 51 HAL_NVIC_EnableIRQ(DMA1_Stream1_IRQn); 52 /* DMA1_Stream2_IRQn interrupt configuration */ 53 HAL_NVIC_SetPriority(DMA1_Stream2_IRQn, 0, 0); 54 HAL_NVIC_EnableIRQ(DMA1_Stream2_IRQn); 49 55 50 56 } -
ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_it.c
r63 r64 62 62 extern DMA_HandleTypeDef hdma_spi4_tx; 63 63 extern SPI_HandleTypeDef hspi4; 64 extern DMA_HandleTypeDef hdma_usart3_rx; 65 extern DMA_HandleTypeDef hdma_usart3_tx; 64 66 extern UART_HandleTypeDef huart3; 65 67 extern TIM_HandleTypeDef htim7; … … 182 184 183 185 /** 186 * @brief This function handles DMA1 stream1 global interrupt. 187 */ 188 void DMA1_Stream1_IRQHandler(void) 189 { 190 /* USER CODE BEGIN DMA1_Stream1_IRQn 0 */ 191 192 /* USER CODE END DMA1_Stream1_IRQn 0 */ 193 HAL_DMA_IRQHandler(&hdma_usart3_rx); 194 /* USER CODE BEGIN DMA1_Stream1_IRQn 1 */ 195 196 /* USER CODE END DMA1_Stream1_IRQn 1 */ 197 } 198 199 /** 200 * @brief This function handles DMA1 stream2 global interrupt. 201 */ 202 void DMA1_Stream2_IRQHandler(void) 203 { 204 /* USER CODE BEGIN DMA1_Stream2_IRQn 0 */ 205 206 /* USER CODE END DMA1_Stream2_IRQn 0 */ 207 HAL_DMA_IRQHandler(&hdma_usart3_tx); 208 /* USER CODE BEGIN DMA1_Stream2_IRQn 1 */ 209 210 /* USER CODE END DMA1_Stream2_IRQn 1 */ 211 } 212 213 /** 184 214 * @brief This function handles USART3 global interrupt. 185 215 */ … … 239 269 /* USER CODE BEGIN 1 */ 240 270 241 void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart)242 {243 if (huart->Instance == USART3) gsmUnitSentData();244 }245 246 271 //------------------------------------------------------------------------------ 247 272 273 void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size) 274 { 275 if (huart->Instance == USART3) gsmUnitSentData(Size); 276 } 277 278 //------------------------------------------------------------------------------ 279 280 /*void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart) 281 { 282 //if (huart->Instance == USART3) gsmUnitSentData(); 283 }*/ 284 285 //------------------------------------------------------------------------------ 286 248 287 /* USER CODE END 1 */ -
ctrl/firmware/Main/CubeMX/Core/Src/usart.c
r63 r64 26 26 27 27 UART_HandleTypeDef huart3; 28 DMA_HandleTypeDef hdma_usart3_rx; 29 DMA_HandleTypeDef hdma_usart3_tx; 28 30 29 31 /* USART3 init function */ … … 119 121 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); 120 122 123 /* USART3 DMA Init */ 124 /* USART3_RX Init */ 125 hdma_usart3_rx.Instance = DMA1_Stream1; 126 hdma_usart3_rx.Init.Request = DMA_REQUEST_USART3_RX; 127 hdma_usart3_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; 128 hdma_usart3_rx.Init.PeriphInc = DMA_PINC_DISABLE; 129 hdma_usart3_rx.Init.MemInc = DMA_MINC_ENABLE; 130 hdma_usart3_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; 131 hdma_usart3_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; 132 hdma_usart3_rx.Init.Mode = DMA_CIRCULAR; 133 hdma_usart3_rx.Init.Priority = DMA_PRIORITY_LOW; 134 hdma_usart3_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; 135 if (HAL_DMA_Init(&hdma_usart3_rx) != HAL_OK) 136 { 137 Error_Handler(); 138 } 139 140 __HAL_LINKDMA(uartHandle,hdmarx,hdma_usart3_rx); 141 142 /* USART3_TX Init */ 143 hdma_usart3_tx.Instance = DMA1_Stream2; 144 hdma_usart3_tx.Init.Request = DMA_REQUEST_USART3_TX; 145 hdma_usart3_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; 146 hdma_usart3_tx.Init.PeriphInc = DMA_PINC_DISABLE; 147 hdma_usart3_tx.Init.MemInc = DMA_MINC_ENABLE; 148 hdma_usart3_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; 149 hdma_usart3_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; 150 hdma_usart3_tx.Init.Mode = DMA_NORMAL; 151 hdma_usart3_tx.Init.Priority = DMA_PRIORITY_HIGH; 152 hdma_usart3_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; 153 if (HAL_DMA_Init(&hdma_usart3_tx) != HAL_OK) 154 { 155 Error_Handler(); 156 } 157 158 __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart3_tx); 159 121 160 /* USART3 interrupt Init */ 122 161 HAL_NVIC_SetPriority(USART3_IRQn, 0, 0); … … 147 186 HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_11|GPIO_PIN_12); 148 187 188 /* USART3 DMA DeInit */ 189 HAL_DMA_DeInit(uartHandle->hdmarx); 190 HAL_DMA_DeInit(uartHandle->hdmatx); 191 149 192 /* USART3 interrupt Deinit */ 150 193 HAL_NVIC_DisableIRQ(USART3_IRQn); -
ctrl/firmware/Main/CubeMX/charger.ioc
r63 r64 8 8 CORTEX_M7.default_mode_Activation=1 9 9 Dma.Request0=SPI4_TX 10 Dma.RequestsNb=1 10 Dma.Request1=USART3_RX 11 Dma.Request2=USART3_TX 12 Dma.RequestsNb=3 11 13 Dma.SPI4_TX.0.Direction=DMA_MEMORY_TO_PERIPH 12 14 Dma.SPI4_TX.0.EventEnable=DISABLE … … 27 29 Dma.SPI4_TX.0.SyncRequestNumber=1 28 30 Dma.SPI4_TX.0.SyncSignalID=NONE 31 Dma.USART3_RX.1.Direction=DMA_PERIPH_TO_MEMORY 32 Dma.USART3_RX.1.EventEnable=DISABLE 33 Dma.USART3_RX.1.FIFOMode=DMA_FIFOMODE_DISABLE 34 Dma.USART3_RX.1.Instance=DMA1_Stream1 35 Dma.USART3_RX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE 36 Dma.USART3_RX.1.MemInc=DMA_MINC_ENABLE 37 Dma.USART3_RX.1.Mode=DMA_CIRCULAR 38 Dma.USART3_RX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE 39 Dma.USART3_RX.1.PeriphInc=DMA_PINC_DISABLE 40 Dma.USART3_RX.1.Polarity=HAL_DMAMUX_REQ_GEN_RISING 41 Dma.USART3_RX.1.Priority=DMA_PRIORITY_LOW 42 Dma.USART3_RX.1.RequestNumber=1 43 Dma.USART3_RX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,SignalID,Polarity,RequestNumber,SyncSignalID,SyncPolarity,SyncEnable,EventEnable,SyncRequestNumber 44 Dma.USART3_RX.1.SignalID=NONE 45 Dma.USART3_RX.1.SyncEnable=DISABLE 46 Dma.USART3_RX.1.SyncPolarity=HAL_DMAMUX_SYNC_NO_EVENT 47 Dma.USART3_RX.1.SyncRequestNumber=1 48 Dma.USART3_RX.1.SyncSignalID=NONE 49 Dma.USART3_TX.2.Direction=DMA_MEMORY_TO_PERIPH 50 Dma.USART3_TX.2.EventEnable=DISABLE 51 Dma.USART3_TX.2.FIFOMode=DMA_FIFOMODE_DISABLE 52 Dma.USART3_TX.2.Instance=DMA1_Stream2 53 Dma.USART3_TX.2.MemDataAlignment=DMA_MDATAALIGN_BYTE 54 Dma.USART3_TX.2.MemInc=DMA_MINC_ENABLE 55 Dma.USART3_TX.2.Mode=DMA_NORMAL 56 Dma.USART3_TX.2.PeriphDataAlignment=DMA_PDATAALIGN_BYTE 57 Dma.USART3_TX.2.PeriphInc=DMA_PINC_DISABLE 58 Dma.USART3_TX.2.Polarity=HAL_DMAMUX_REQ_GEN_RISING 59 Dma.USART3_TX.2.Priority=DMA_PRIORITY_HIGH 60 Dma.USART3_TX.2.RequestNumber=1 61 Dma.USART3_TX.2.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,SignalID,Polarity,RequestNumber,SyncSignalID,SyncPolarity,SyncEnable,EventEnable,SyncRequestNumber 62 Dma.USART3_TX.2.SignalID=NONE 63 Dma.USART3_TX.2.SyncEnable=DISABLE 64 Dma.USART3_TX.2.SyncPolarity=HAL_DMAMUX_SYNC_NO_EVENT 65 Dma.USART3_TX.2.SyncRequestNumber=1 66 Dma.USART3_TX.2.SyncSignalID=NONE 29 67 File.Version=6 30 68 GPIO.groupedBy=Group By Peripherals … … 99 137 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false 100 138 NVIC.DMA1_Stream0_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true\:true 139 NVIC.DMA1_Stream1_IRQn=true\:0\:0\:false\:false\:true\:true\:false\:true\:true 140 NVIC.DMA1_Stream2_IRQn=true\:0\:0\:false\:false\:true\:true\:false\:true\:true 101 141 NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false 102 142 NVIC.ForceEnableDMAVector=true … … 371 411 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileOoSystemJjInterfaces_Checked=true 372 412 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileXCcFileOoSystemJjFileXJjCore=true 373 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,ThreadXCcRTOSJjThreadXJjCore,ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport,FileXCcFileOoSystemJjFileXJjCore,InterfacesCcFileOoSystemJjFileXOoSDOointerface 413 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,ThreadXCcRTOSJjThreadXJjCore,ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport,FileXCcFileOoSystemJjFileXJjCore,InterfacesCcFileOoSystemJjFileXOoSDOointerface,TX_APP_MSG_QUEUE_CREATION,TX_MSG_QUEUE_NAME,TX_NB_MSG 374 414 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.InterfacesCcFileOoSystemJjFileXOoSDOointerface=true 375 415 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.RTOSJjThreadX_Checked=true … … 377 417 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_GENERATE_INIT_CODE=false 378 418 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_MEM_POOL_SIZE=8192 419 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_MSG_QUEUE_CREATION=1 379 420 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_ENABLE_STACK_CHECKING=1 380 421 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_LOW_POWER=1 422 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_MSG_QUEUE_NAME=gsm queue 423 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_NB_MSG=512 381 424 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_NO_FILEX_POINTER=1 382 425 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_TIMER_TICKS_PER_SECOND=1000
Note: See TracChangeset
for help on using the changeset viewer.