Ignore:
Timestamp:
Jan 15, 2025, 10:01:55 AM (15 hours ago)
Author:
Zed
Message:

Fixing project.

Location:
ctrl/firmware/Main/CubeMX
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_it.h

    r54 r63  
    5454void DebugMon_Handler(void);
    5555void DMA1_Stream0_IRQHandler(void);
     56void USART3_IRQHandler(void);
    5657void SDMMC1_IRQHandler(void);
    5758void TIM7_IRQHandler(void);
  • ctrl/firmware/Main/CubeMX/Core/Src/gpio.c

    r62 r63  
    156156  HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
    157157
    158   /*Configure GPIO pins : PD11 PD12 PD14 PD15
    159                            PD0 PD1 PD3 PD4
    160                            PD5 PD6 */
    161   GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_14|GPIO_PIN_15
    162                           |GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_3|GPIO_PIN_4
    163                           |GPIO_PIN_5|GPIO_PIN_6;
    164   GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
    165   GPIO_InitStruct.Pull = GPIO_NOPULL;
    166   HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
    167 
    168158  /*Configure GPIO pin : GSM_STATUS_Pin */
    169159  GPIO_InitStruct.Pin = GSM_STATUS_Pin;
     
    171161  GPIO_InitStruct.Pull = GPIO_NOPULL;
    172162  HAL_GPIO_Init(GSM_STATUS_GPIO_Port, &GPIO_InitStruct);
     163
     164  /*Configure GPIO pins : PD14 PD15 PD0 PD1
     165                           PD3 PD4 PD5 PD6 */
     166  GPIO_InitStruct.Pin = GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1
     167                          |GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6;
     168  GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
     169  GPIO_InitStruct.Pull = GPIO_NOPULL;
     170  HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
    173171
    174172  /*Configure GPIO pins : PG2 PG3 PG4 PG5
  • ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_it.c

    r54 r63  
    2323/* Private includes ----------------------------------------------------------*/
    2424/* USER CODE BEGIN Includes */
     25
     26#include "gsm_thread.h"
     27
    2528/* USER CODE END Includes */
    2629
     
    5962extern DMA_HandleTypeDef hdma_spi4_tx;
    6063extern SPI_HandleTypeDef hspi4;
     64extern UART_HandleTypeDef huart3;
    6165extern TIM_HandleTypeDef htim7;
    6266
     
    178182
    179183/**
     184  * @brief This function handles USART3 global interrupt.
     185  */
     186void USART3_IRQHandler(void)
     187{
     188  /* USER CODE BEGIN USART3_IRQn 0 */
     189
     190  /* USER CODE END USART3_IRQn 0 */
     191  HAL_UART_IRQHandler(&huart3);
     192  /* USER CODE BEGIN USART3_IRQn 1 */
     193
     194  /* USER CODE END USART3_IRQn 1 */
     195}
     196
     197/**
    180198  * @brief This function handles SDMMC1 global interrupt.
    181199  */
     
    221239/* USER CODE BEGIN 1 */
    222240
     241void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart)
     242{
     243        if (huart->Instance == USART3) gsmUnitSentData();
     244}
     245
     246//------------------------------------------------------------------------------
     247
    223248/* USER CODE END 1 */
  • ctrl/firmware/Main/CubeMX/Core/Src/usart.c

    r61 r63  
    4949  huart3.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
    5050  huart3.Init.ClockPrescaler = UART_PRESCALER_DIV1;
    51   huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
     51  huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_SWAP_INIT|UART_ADVFEATURE_DMADISABLEONERROR_INIT;
     52  huart3.AdvancedInit.Swap = UART_ADVFEATURE_SWAP_ENABLE;
     53  huart3.AdvancedInit.DMADisableonRxError = UART_ADVFEATURE_DMA_DISABLEONRXERROR;
    5254  if (HAL_UART_Init(&huart3) != HAL_OK)
    5355  {
     
    107109    PD8     ------> USART3_TX
    108110    PD9     ------> USART3_RX
     111    PD11     ------> USART3_CTS
     112    PD12     ------> USART3_RTS
    109113    */
    110     GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9;
     114    GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_11|GPIO_PIN_12;
    111115    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    112116    GPIO_InitStruct.Pull = GPIO_NOPULL;
     
    115119    HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
    116120
     121    /* USART3 interrupt Init */
     122    HAL_NVIC_SetPriority(USART3_IRQn, 0, 0);
     123    HAL_NVIC_EnableIRQ(USART3_IRQn);
    117124  /* USER CODE BEGIN USART3_MspInit 1 */
    118125
     
    135142    PD8     ------> USART3_TX
    136143    PD9     ------> USART3_RX
     144    PD11     ------> USART3_CTS
     145    PD12     ------> USART3_RTS
    137146    */
    138     HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8|GPIO_PIN_9);
     147    HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_11|GPIO_PIN_12);
    139148
     149    /* USART3 interrupt Deinit */
     150    HAL_NVIC_DisableIRQ(USART3_IRQn);
    140151  /* USER CODE BEGIN USART3_MspDeInit 1 */
    141152
  • ctrl/firmware/Main/CubeMX/charger.ioc

    r62 r63  
    5757Mcu.Pin15=PD9
    5858Mcu.Pin16=PD10
    59 Mcu.Pin17=PD13
    60 Mcu.Pin18=PC8
    61 Mcu.Pin19=PC9
     59Mcu.Pin17=PD11
     60Mcu.Pin18=PD12
     61Mcu.Pin19=PD13
    6262Mcu.Pin2=PC15-OSC32_OUT
    63 Mcu.Pin20=PA8
    64 Mcu.Pin21=PA13(JTMS/SWDIO)
    65 Mcu.Pin22=PA14(JTCK/SWCLK)
    66 Mcu.Pin23=PC10
    67 Mcu.Pin24=PC11
    68 Mcu.Pin25=PC12
    69 Mcu.Pin26=PD2
    70 Mcu.Pin27=PD7
    71 Mcu.Pin28=PG9
    72 Mcu.Pin29=PG10
     63Mcu.Pin20=PC8
     64Mcu.Pin21=PC9
     65Mcu.Pin22=PA8
     66Mcu.Pin23=PA13(JTMS/SWDIO)
     67Mcu.Pin24=PA14(JTCK/SWCLK)
     68Mcu.Pin25=PC10
     69Mcu.Pin26=PC11
     70Mcu.Pin27=PC12
     71Mcu.Pin28=PD2
     72Mcu.Pin29=PD7
    7373Mcu.Pin3=PH0-OSC_IN
    74 Mcu.Pin30=PG11
    75 Mcu.Pin31=PG12
    76 Mcu.Pin32=PG13
    77 Mcu.Pin33=PG15
    78 Mcu.Pin34=VP_RTC_VS_RTC_Activate
    79 Mcu.Pin35=VP_SYS_VS_tim7
    80 Mcu.Pin36=VP_MEMORYMAP_VS_MEMORYMAP
    81 Mcu.Pin37=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0
    82 Mcu.Pin38=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0
    83 Mcu.Pin39=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0
     74Mcu.Pin30=PG9
     75Mcu.Pin31=PG10
     76Mcu.Pin32=PG11
     77Mcu.Pin33=PG12
     78Mcu.Pin34=PG13
     79Mcu.Pin35=PG15
     80Mcu.Pin36=VP_RTC_VS_RTC_Activate
     81Mcu.Pin37=VP_SYS_VS_tim7
     82Mcu.Pin38=VP_MEMORYMAP_VS_MEMORYMAP
     83Mcu.Pin39=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0
    8484Mcu.Pin4=PH1-OSC_OUT
     85Mcu.Pin40=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0
     86Mcu.Pin41=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0
    8587Mcu.Pin5=PF15
    8688Mcu.Pin6=PG0
     
    8890Mcu.Pin8=PE7
    8991Mcu.Pin9=PE11
    90 Mcu.PinsNb=40
     92Mcu.PinsNb=42
    9193Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0
    9294Mcu.ThirdPartyNb=1
     
    114116NVIC.TimeBase=TIM7_IRQn
    115117NVIC.TimeBaseIP=TIM7
     118NVIC.USART3_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true\:true
    116119NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
    117120PA13(JTMS/SWDIO).Mode=Serial_Wire
     
    143146PD10.Locked=true
    144147PD10.Signal=GPIO_Output
     148PD11.Locked=true
     149PD11.Signal=USART3_CTS
     150PD12.Locked=true
     151PD12.Signal=USART3_RTS
    145152PD13.GPIOParameters=GPIO_Label
    146153PD13.GPIO_Label=GSM_STATUS
     
    378385STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_IsAnAzureRtosMw=true
    379386STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_SwParameter=InterfacesCcFileOoSystemJjFileXOoSDOointerface\:true;ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport\:true;FileXCcFileOoSystemJjFileXJjCore\:true;ThreadXCcRTOSJjThreadXJjCore\:true;
    380 USART3.IPParameters=VirtualMode-Asynchronous
     387USART3.DMADisableonRxErrorParam=ADVFEATURE_DMA_DISABLEONRXERROR
     388USART3.IPParameters=VirtualMode-Asynchronous,SwapParam,DMADisableonRxErrorParam
     389USART3.SwapParam=ADVFEATURE_SWAP_ENABLE
    381390USART3.VirtualMode-Asynchronous=VM_ASYNC
    382391VP_MEMORYMAP_VS_MEMORYMAP.Mode=CurAppReg
Note: See TracChangeset for help on using the changeset viewer.