Fix STM config for Slave v3
This commit is contained in:
		@ -65,12 +65,12 @@ void Error_Handler(void);
 | 
				
			|||||||
#define STAT_LED3_GPIO_Port GPIOC
 | 
					#define STAT_LED3_GPIO_Port GPIOC
 | 
				
			||||||
#define STAT_LED4_Pin GPIO_PIN_3
 | 
					#define STAT_LED4_Pin GPIO_PIN_3
 | 
				
			||||||
#define STAT_LED4_GPIO_Port GPIOC
 | 
					#define STAT_LED4_GPIO_Port GPIOC
 | 
				
			||||||
#define BQ_POWER_ACTIVATE_Pin GPIO_PIN_0
 | 
					#define DCDC_CTRL_Pin GPIO_PIN_0
 | 
				
			||||||
#define BQ_POWER_ACTIVATE_GPIO_Port GPIOB
 | 
					#define DCDC_CTRL_GPIO_Port GPIOB
 | 
				
			||||||
#define BQ_VIO_ACTICATE_Pin GPIO_PIN_1
 | 
					#define BQ_FAULT_N_Pin GPIO_PIN_2
 | 
				
			||||||
#define BQ_VIO_ACTICATE_GPIO_Port GPIOB
 | 
					#define BQ_FAULT_N_GPIO_Port GPIOB
 | 
				
			||||||
#define FAN_CONTROL_Pin GPIO_PIN_9
 | 
					#define FAN_PWM_Pin GPIO_PIN_9
 | 
				
			||||||
#define FAN_CONTROL_GPIO_Port GPIOC
 | 
					#define FAN_PWM_GPIO_Port GPIOC
 | 
				
			||||||
#define BQ_Wakeup_Pin GPIO_PIN_4
 | 
					#define BQ_Wakeup_Pin GPIO_PIN_4
 | 
				
			||||||
#define BQ_Wakeup_GPIO_Port GPIOB
 | 
					#define BQ_Wakeup_GPIO_Port GPIOB
 | 
				
			||||||
/* USER CODE BEGIN Private defines */
 | 
					/* USER CODE BEGIN Private defines */
 | 
				
			||||||
 | 
				
			|||||||
@ -390,42 +390,44 @@ static void MX_GPIO_Init(void) {
 | 
				
			|||||||
  __HAL_RCC_GPIOC_CLK_ENABLE();
 | 
					  __HAL_RCC_GPIOC_CLK_ENABLE();
 | 
				
			||||||
  __HAL_RCC_GPIOA_CLK_ENABLE();
 | 
					  __HAL_RCC_GPIOA_CLK_ENABLE();
 | 
				
			||||||
  __HAL_RCC_GPIOB_CLK_ENABLE();
 | 
					  __HAL_RCC_GPIOB_CLK_ENABLE();
 | 
				
			||||||
  __HAL_RCC_GPIOD_CLK_ENABLE();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /*Configure GPIO pin Output Level */
 | 
					  /*Configure GPIO pin Output Level */
 | 
				
			||||||
  HAL_GPIO_WritePin(GPIOC,
 | 
					  HAL_GPIO_WritePin(
 | 
				
			||||||
                    STAT_LED1_Pin | STAT_LED2_Pin | STAT_LED3_Pin |
 | 
					      GPIOC, STAT_LED1_Pin | STAT_LED2_Pin | STAT_LED3_Pin | STAT_LED4_Pin,
 | 
				
			||||||
                        STAT_LED4_Pin | FAN_CONTROL_Pin,
 | 
					      GPIO_PIN_RESET);
 | 
				
			||||||
                    GPIO_PIN_RESET);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /*Configure GPIO pin Output Level */
 | 
					  /*Configure GPIO pin Output Level */
 | 
				
			||||||
  HAL_GPIO_WritePin(GPIOB,
 | 
					  HAL_GPIO_WritePin(GPIOB, DCDC_CTRL_Pin | BQ_Wakeup_Pin, GPIO_PIN_RESET);
 | 
				
			||||||
                    BQ_POWER_ACTIVATE_Pin | BQ_VIO_ACTICATE_Pin | BQ_Wakeup_Pin,
 | 
					 | 
				
			||||||
                    GPIO_PIN_RESET);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /*Configure GPIO pins : STAT_LED1_Pin STAT_LED2_Pin STAT_LED3_Pin
 | 
					  /*Configure GPIO pins : STAT_LED1_Pin STAT_LED2_Pin STAT_LED3_Pin
 | 
				
			||||||
     STAT_LED4_Pin FAN_CONTROL_Pin */
 | 
					   * STAT_LED4_Pin */
 | 
				
			||||||
  GPIO_InitStruct.Pin = STAT_LED1_Pin | STAT_LED2_Pin | STAT_LED3_Pin |
 | 
					  GPIO_InitStruct.Pin =
 | 
				
			||||||
                        STAT_LED4_Pin | FAN_CONTROL_Pin;
 | 
					      STAT_LED1_Pin | STAT_LED2_Pin | STAT_LED3_Pin | STAT_LED4_Pin;
 | 
				
			||||||
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
 | 
					  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
 | 
				
			||||||
  GPIO_InitStruct.Pull = GPIO_NOPULL;
 | 
					  GPIO_InitStruct.Pull = GPIO_NOPULL;
 | 
				
			||||||
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
 | 
					  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
 | 
				
			||||||
  HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
 | 
					  HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /*Configure GPIO pins : BQ_POWER_ACTIVATE_Pin BQ_VIO_ACTICATE_Pin
 | 
					  /*Configure GPIO pins : DCDC_CTRL_Pin BQ_Wakeup_Pin */
 | 
				
			||||||
   * BQ_Wakeup_Pin */
 | 
					  GPIO_InitStruct.Pin = DCDC_CTRL_Pin | BQ_Wakeup_Pin;
 | 
				
			||||||
  GPIO_InitStruct.Pin =
 | 
					 | 
				
			||||||
      BQ_POWER_ACTIVATE_Pin | BQ_VIO_ACTICATE_Pin | BQ_Wakeup_Pin;
 | 
					 | 
				
			||||||
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
 | 
					  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
 | 
				
			||||||
  GPIO_InitStruct.Pull = GPIO_NOPULL;
 | 
					  GPIO_InitStruct.Pull = GPIO_NOPULL;
 | 
				
			||||||
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
 | 
					  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
 | 
				
			||||||
  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
 | 
					  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /*Configure GPIO pin : PD2 */
 | 
					  /*Configure GPIO pin : BQ_FAULT_N_Pin */
 | 
				
			||||||
  GPIO_InitStruct.Pin = GPIO_PIN_2;
 | 
					  GPIO_InitStruct.Pin = BQ_FAULT_N_Pin;
 | 
				
			||||||
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
 | 
					  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
 | 
				
			||||||
  GPIO_InitStruct.Pull = GPIO_NOPULL;
 | 
					  GPIO_InitStruct.Pull = GPIO_NOPULL;
 | 
				
			||||||
  HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
 | 
					  HAL_GPIO_Init(BQ_FAULT_N_GPIO_Port, &GPIO_InitStruct);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /*Configure GPIO pin : FAN_PWM_Pin */
 | 
				
			||||||
 | 
					  GPIO_InitStruct.Pin = FAN_PWM_Pin;
 | 
				
			||||||
 | 
					  GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
 | 
				
			||||||
 | 
					  GPIO_InitStruct.Pull = GPIO_NOPULL;
 | 
				
			||||||
 | 
					  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
 | 
				
			||||||
 | 
					  GPIO_InitStruct.Alternate = GPIO_AF2_TIM3;
 | 
				
			||||||
 | 
					  HAL_GPIO_Init(FAN_PWM_GPIO_Port, &GPIO_InitStruct);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* USER CODE BEGIN 4 */
 | 
					/* USER CODE BEGIN 4 */
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							@ -1,5 +1,5 @@
 | 
				
			|||||||
##########################################################################################################################
 | 
					##########################################################################################################################
 | 
				
			||||||
# File automatically-generated by tool: [projectgenerator] version: [3.16.0] date: [Thu Jun 09 15:28:10 CEST 2022] 
 | 
					# File automatically-generated by tool: [projectgenerator] version: [3.16.0] date: [Thu Jun 09 23:03:25 CEST 2022] 
 | 
				
			||||||
##########################################################################################################################
 | 
					##########################################################################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ------------------------------------------------
 | 
					# ------------------------------------------------
 | 
				
			||||||
 | 
				
			|||||||
@ -45,21 +45,20 @@ Mcu.Pin17=PA13
 | 
				
			|||||||
Mcu.Pin18=PA14
 | 
					Mcu.Pin18=PA14
 | 
				
			||||||
Mcu.Pin19=PA15
 | 
					Mcu.Pin19=PA15
 | 
				
			||||||
Mcu.Pin2=PC2
 | 
					Mcu.Pin2=PC2
 | 
				
			||||||
Mcu.Pin20=PD2
 | 
					Mcu.Pin20=PB3
 | 
				
			||||||
Mcu.Pin21=PB3
 | 
					Mcu.Pin21=PB4
 | 
				
			||||||
Mcu.Pin22=PB4
 | 
					Mcu.Pin22=PB5
 | 
				
			||||||
Mcu.Pin23=PB5
 | 
					Mcu.Pin23=PB6
 | 
				
			||||||
Mcu.Pin24=PB6
 | 
					Mcu.Pin24=PB7
 | 
				
			||||||
Mcu.Pin25=PB7
 | 
					Mcu.Pin25=VP_SYS_VS_Systick
 | 
				
			||||||
Mcu.Pin26=VP_SYS_VS_Systick
 | 
					 | 
				
			||||||
Mcu.Pin3=PC3
 | 
					Mcu.Pin3=PC3
 | 
				
			||||||
Mcu.Pin4=PA2
 | 
					Mcu.Pin4=PA2
 | 
				
			||||||
Mcu.Pin5=PA3
 | 
					Mcu.Pin5=PA3
 | 
				
			||||||
Mcu.Pin6=PC5
 | 
					Mcu.Pin6=PC5
 | 
				
			||||||
Mcu.Pin7=PB0
 | 
					Mcu.Pin7=PB0
 | 
				
			||||||
Mcu.Pin8=PB1
 | 
					Mcu.Pin8=PB2
 | 
				
			||||||
Mcu.Pin9=PB10
 | 
					Mcu.Pin9=PB10
 | 
				
			||||||
Mcu.PinsNb=27
 | 
					Mcu.PinsNb=26
 | 
				
			||||||
Mcu.ThirdPartyNb=0
 | 
					Mcu.ThirdPartyNb=0
 | 
				
			||||||
Mcu.UserConstants=
 | 
					Mcu.UserConstants=
 | 
				
			||||||
Mcu.UserName=STM32F412RETx
 | 
					Mcu.UserName=STM32F412RETx
 | 
				
			||||||
@ -100,17 +99,17 @@ PA2.Signal=USART2_TX
 | 
				
			|||||||
PA3.Mode=Asynchronous
 | 
					PA3.Mode=Asynchronous
 | 
				
			||||||
PA3.Signal=USART2_RX
 | 
					PA3.Signal=USART2_RX
 | 
				
			||||||
PB0.GPIOParameters=GPIO_Label
 | 
					PB0.GPIOParameters=GPIO_Label
 | 
				
			||||||
PB0.GPIO_Label=BQ_POWER_ACTIVATE
 | 
					PB0.GPIO_Label=DCDC_CTRL
 | 
				
			||||||
PB0.Locked=true
 | 
					PB0.Locked=true
 | 
				
			||||||
PB0.Signal=GPIO_Output
 | 
					PB0.Signal=GPIO_Output
 | 
				
			||||||
PB1.GPIOParameters=GPIO_Label
 | 
					 | 
				
			||||||
PB1.GPIO_Label=BQ_VIO_ACTICATE
 | 
					 | 
				
			||||||
PB1.Locked=true
 | 
					 | 
				
			||||||
PB1.Signal=GPIO_Output
 | 
					 | 
				
			||||||
PB10.Mode=Asynchronous
 | 
					PB10.Mode=Asynchronous
 | 
				
			||||||
PB10.Signal=USART3_TX
 | 
					PB10.Signal=USART3_TX
 | 
				
			||||||
PB13.Mode=CAN_Activate
 | 
					PB13.Mode=CAN_Activate
 | 
				
			||||||
PB13.Signal=CAN2_TX
 | 
					PB13.Signal=CAN2_TX
 | 
				
			||||||
 | 
					PB2.GPIOParameters=GPIO_Label
 | 
				
			||||||
 | 
					PB2.GPIO_Label=BQ_FAULT_N
 | 
				
			||||||
 | 
					PB2.Locked=true
 | 
				
			||||||
 | 
					PB2.Signal=GPIO_Input
 | 
				
			||||||
PB3.Locked=true
 | 
					PB3.Locked=true
 | 
				
			||||||
PB3.Signal=SYS_JTDO-SWO
 | 
					PB3.Signal=SYS_JTDO-SWO
 | 
				
			||||||
PB4.GPIOParameters=GPIO_Label
 | 
					PB4.GPIOParameters=GPIO_Label
 | 
				
			||||||
@ -151,11 +150,9 @@ PC6.Signal=USART6_TX
 | 
				
			|||||||
PC7.Mode=Asynchronous
 | 
					PC7.Mode=Asynchronous
 | 
				
			||||||
PC7.Signal=USART6_RX
 | 
					PC7.Signal=USART6_RX
 | 
				
			||||||
PC9.GPIOParameters=GPIO_Label
 | 
					PC9.GPIOParameters=GPIO_Label
 | 
				
			||||||
PC9.GPIO_Label=FAN_CONTROL
 | 
					PC9.GPIO_Label=FAN_PWM
 | 
				
			||||||
PC9.Locked=true
 | 
					PC9.Locked=true
 | 
				
			||||||
PC9.Signal=GPIO_Output
 | 
					PC9.Signal=S_TIM3_CH4
 | 
				
			||||||
PD2.Locked=true
 | 
					 | 
				
			||||||
PD2.Signal=GPIO_Input
 | 
					 | 
				
			||||||
PinOutPanel.RotationAngle=0
 | 
					PinOutPanel.RotationAngle=0
 | 
				
			||||||
ProjectManager.AskForMigrate=true
 | 
					ProjectManager.AskForMigrate=true
 | 
				
			||||||
ProjectManager.BackupPrevious=false
 | 
					ProjectManager.BackupPrevious=false
 | 
				
			||||||
@ -207,6 +204,8 @@ RCC.VCOI2SInputFreq_Value=1000000
 | 
				
			|||||||
RCC.VCOI2SOutputFreq_Value=192000000
 | 
					RCC.VCOI2SOutputFreq_Value=192000000
 | 
				
			||||||
RCC.VCOInputFreq_Value=2000000
 | 
					RCC.VCOInputFreq_Value=2000000
 | 
				
			||||||
RCC.VCOOutputFreq_Value=100000000
 | 
					RCC.VCOOutputFreq_Value=100000000
 | 
				
			||||||
 | 
					SH.S_TIM3_CH4.0=TIM3_CH4
 | 
				
			||||||
 | 
					SH.S_TIM3_CH4.ConfNb=1
 | 
				
			||||||
USART1.BaudRate=115200
 | 
					USART1.BaudRate=115200
 | 
				
			||||||
USART1.IPParameters=VirtualMode,BaudRate
 | 
					USART1.IPParameters=VirtualMode,BaudRate
 | 
				
			||||||
USART1.VirtualMode=VM_ASYNC
 | 
					USART1.VirtualMode=VM_ASYNC
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user