forked from achamaikin/CCSModuleSW30Web
board rev2 support, added heater support
This commit is contained in:
+41
-34
@@ -6,7 +6,7 @@ ADC1.Channel-3\#ChannelRegularConversion=ADC_CHANNEL_9
|
|||||||
ADC1.Channel-4\#ChannelRegularConversion=ADC_CHANNEL_TEMPSENSOR
|
ADC1.Channel-4\#ChannelRegularConversion=ADC_CHANNEL_TEMPSENSOR
|
||||||
ADC1.Channel-5\#ChannelRegularConversion=ADC_CHANNEL_VREFINT
|
ADC1.Channel-5\#ChannelRegularConversion=ADC_CHANNEL_VREFINT
|
||||||
ADC1.ExternalTrigConv=ADC_EXTERNALTRIGCONV_T3_TRGO
|
ADC1.ExternalTrigConv=ADC_EXTERNALTRIGCONV_T3_TRGO
|
||||||
ADC1.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,NbrOfConversionFlag,master,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,Rank-3\#ChannelRegularConversion,Channel-3\#ChannelRegularConversion,SamplingTime-3\#ChannelRegularConversion,Rank-4\#ChannelRegularConversion,Channel-4\#ChannelRegularConversion,SamplingTime-4\#ChannelRegularConversion,Rank-5\#ChannelRegularConversion,Channel-5\#ChannelRegularConversion,SamplingTime-5\#ChannelRegularConversion,NbrOfConversion,ExternalTrigConv
|
ADC1.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,NbrOfConversionFlag,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,Rank-3\#ChannelRegularConversion,Channel-3\#ChannelRegularConversion,SamplingTime-3\#ChannelRegularConversion,Rank-4\#ChannelRegularConversion,Channel-4\#ChannelRegularConversion,SamplingTime-4\#ChannelRegularConversion,Rank-5\#ChannelRegularConversion,Channel-5\#ChannelRegularConversion,SamplingTime-5\#ChannelRegularConversion,NbrOfConversion,ExternalTrigConv,master
|
||||||
ADC1.NbrOfConversion=6
|
ADC1.NbrOfConversion=6
|
||||||
ADC1.NbrOfConversionFlag=1
|
ADC1.NbrOfConversionFlag=1
|
||||||
ADC1.Rank-0\#ChannelRegularConversion=1
|
ADC1.Rank-0\#ChannelRegularConversion=1
|
||||||
@@ -143,46 +143,47 @@ Mcu.Pin25=PB11
|
|||||||
Mcu.Pin26=PD13
|
Mcu.Pin26=PD13
|
||||||
Mcu.Pin27=PD14
|
Mcu.Pin27=PD14
|
||||||
Mcu.Pin28=PD15
|
Mcu.Pin28=PD15
|
||||||
Mcu.Pin29=PA9
|
Mcu.Pin29=PC9
|
||||||
Mcu.Pin3=OSC_OUT
|
Mcu.Pin3=OSC_OUT
|
||||||
Mcu.Pin30=PA10
|
Mcu.Pin30=PA9
|
||||||
Mcu.Pin31=PA13
|
Mcu.Pin31=PA10
|
||||||
Mcu.Pin32=PA14
|
Mcu.Pin32=PA13
|
||||||
Mcu.Pin33=PA15
|
Mcu.Pin33=PA14
|
||||||
Mcu.Pin34=PC10
|
Mcu.Pin34=PA15
|
||||||
Mcu.Pin35=PC11
|
Mcu.Pin35=PC10
|
||||||
Mcu.Pin36=PC12
|
Mcu.Pin36=PC11
|
||||||
Mcu.Pin37=PD0
|
Mcu.Pin37=PC12
|
||||||
Mcu.Pin38=PD1
|
Mcu.Pin38=PD0
|
||||||
Mcu.Pin39=PD2
|
Mcu.Pin39=PD1
|
||||||
Mcu.Pin4=PC2
|
Mcu.Pin4=PC2
|
||||||
Mcu.Pin40=PD3
|
Mcu.Pin40=PD2
|
||||||
Mcu.Pin41=PD4
|
Mcu.Pin41=PD3
|
||||||
Mcu.Pin42=PD5
|
Mcu.Pin42=PD4
|
||||||
Mcu.Pin43=PD6
|
Mcu.Pin43=PD5
|
||||||
Mcu.Pin44=PD7
|
Mcu.Pin44=PD6
|
||||||
Mcu.Pin45=PB3
|
Mcu.Pin45=PD7
|
||||||
Mcu.Pin46=PB4
|
Mcu.Pin46=PB3
|
||||||
Mcu.Pin47=PB5
|
Mcu.Pin47=PB4
|
||||||
Mcu.Pin48=PB6
|
Mcu.Pin48=PB5
|
||||||
Mcu.Pin49=PB7
|
Mcu.Pin49=PB6
|
||||||
Mcu.Pin5=PC3
|
Mcu.Pin5=PC3
|
||||||
Mcu.Pin50=PB8
|
Mcu.Pin50=PB7
|
||||||
Mcu.Pin51=PB9
|
Mcu.Pin51=PB8
|
||||||
Mcu.Pin52=PE1
|
Mcu.Pin52=PB9
|
||||||
Mcu.Pin53=VP_ADC1_TempSens_Input
|
Mcu.Pin53=PE1
|
||||||
Mcu.Pin54=VP_ADC1_Vref_Input
|
Mcu.Pin54=VP_ADC1_TempSens_Input
|
||||||
Mcu.Pin55=VP_CRC_VS_CRC
|
Mcu.Pin55=VP_ADC1_Vref_Input
|
||||||
Mcu.Pin56=VP_RTC_VS_RTC_Activate
|
Mcu.Pin56=VP_CRC_VS_CRC
|
||||||
Mcu.Pin57=VP_SYS_VS_Systick
|
Mcu.Pin57=VP_RTC_VS_RTC_Activate
|
||||||
Mcu.Pin58=VP_TIM3_VS_ClockSourceINT
|
Mcu.Pin58=VP_SYS_VS_Systick
|
||||||
Mcu.Pin59=VP_TIM3_VS_no_output1
|
Mcu.Pin59=VP_TIM3_VS_ClockSourceINT
|
||||||
Mcu.Pin6=PA1
|
Mcu.Pin6=PA1
|
||||||
Mcu.Pin60=VP_TIM4_VS_ClockSourceINT
|
Mcu.Pin60=VP_TIM3_VS_no_output1
|
||||||
|
Mcu.Pin61=VP_TIM4_VS_ClockSourceINT
|
||||||
Mcu.Pin7=PA2
|
Mcu.Pin7=PA2
|
||||||
Mcu.Pin8=PA3
|
Mcu.Pin8=PA3
|
||||||
Mcu.Pin9=PA4
|
Mcu.Pin9=PA4
|
||||||
Mcu.PinsNb=61
|
Mcu.PinsNb=62
|
||||||
Mcu.ThirdPartyNb=0
|
Mcu.ThirdPartyNb=0
|
||||||
Mcu.UserConstants=
|
Mcu.UserConstants=
|
||||||
Mcu.UserName=STM32F107VCTx
|
Mcu.UserName=STM32F107VCTx
|
||||||
@@ -306,6 +307,8 @@ PC10.Signal=USART3_TX
|
|||||||
PC11.Locked=true
|
PC11.Locked=true
|
||||||
PC11.Mode=Asynchronous
|
PC11.Mode=Asynchronous
|
||||||
PC11.Signal=USART3_RX
|
PC11.Signal=USART3_RX
|
||||||
|
PC12.GPIOParameters=GPIO_Label
|
||||||
|
PC12.GPIO_Label=HEATER
|
||||||
PC12.Mode=Asynchronous
|
PC12.Mode=Asynchronous
|
||||||
PC12.Signal=UART5_TX
|
PC12.Signal=UART5_TX
|
||||||
PC14-OSC32_IN.Mode=LSE-External-Oscillator
|
PC14-OSC32_IN.Mode=LSE-External-Oscillator
|
||||||
@@ -329,6 +332,10 @@ PC5.GPIOParameters=GPIO_Label
|
|||||||
PC5.GPIO_Label=LOCK_B
|
PC5.GPIO_Label=LOCK_B
|
||||||
PC5.Locked=true
|
PC5.Locked=true
|
||||||
PC5.Signal=GPIO_Output
|
PC5.Signal=GPIO_Output
|
||||||
|
PC9.GPIOParameters=GPIO_Label
|
||||||
|
PC9.GPIO_Label=LED_DATA
|
||||||
|
PC9.Locked=true
|
||||||
|
PC9.Signal=GPIO_Output
|
||||||
PD0.Locked=true
|
PD0.Locked=true
|
||||||
PD0.Mode=CAN_Activate
|
PD0.Mode=CAN_Activate
|
||||||
PD0.Signal=CAN1_RX
|
PD0.Signal=CAN1_RX
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
@@ -87,8 +87,12 @@ void ED_Delay(uint32_t Delay);
|
|||||||
#define DBG5_GPIO_Port GPIOB
|
#define DBG5_GPIO_Port GPIOB
|
||||||
#define DBG4_Pin GPIO_PIN_11
|
#define DBG4_Pin GPIO_PIN_11
|
||||||
#define DBG4_GPIO_Port GPIOB
|
#define DBG4_GPIO_Port GPIOB
|
||||||
|
#define LED_DATA_Pin GPIO_PIN_9
|
||||||
|
#define LED_DATA_GPIO_Port GPIOC
|
||||||
#define RELAY_CC_Pin GPIO_PIN_15
|
#define RELAY_CC_Pin GPIO_PIN_15
|
||||||
#define RELAY_CC_GPIO_Port GPIOA
|
#define RELAY_CC_GPIO_Port GPIOA
|
||||||
|
#define HEATER_Pin GPIO_PIN_12
|
||||||
|
#define HEATER_GPIO_Port GPIOC
|
||||||
#define RELAY_DC_Pin GPIO_PIN_3
|
#define RELAY_DC_Pin GPIO_PIN_3
|
||||||
#define RELAY_DC_GPIO_Port GPIOD
|
#define RELAY_DC_GPIO_Port GPIOD
|
||||||
#define USART2_DIR_Pin GPIO_PIN_4
|
#define USART2_DIR_Pin GPIO_PIN_4
|
||||||
|
|||||||
Executable → Regular
@@ -75,7 +75,26 @@ uint8_t GetBoardTemp(void){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Force PC12 (HEATER) as GPIO output via CRH/ODR, overriding UART5 MspInit.
|
||||||
|
* CubeMX assigns PC12 to UART5_TX; on the board it drives the heater relay.
|
||||||
|
*/
|
||||||
|
static void Heater_PinForceOutput(void)
|
||||||
|
{
|
||||||
|
const uint32_t pin_cfg = GPIO_SPEED_FREQ_LOW; /* MODE=10, CNF=00: GP output PP, 2 MHz */
|
||||||
|
|
||||||
|
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||||
|
|
||||||
|
MODIFY_REG(HEATER_GPIO_Port->CRH,
|
||||||
|
(GPIO_CRH_MODE12 | GPIO_CRH_CNF12),
|
||||||
|
(pin_cfg << GPIO_CRH_MODE12_Pos));
|
||||||
|
|
||||||
|
HEATER_GPIO_Port->BSRR = (uint32_t)HEATER_Pin << 16U;
|
||||||
|
}
|
||||||
|
|
||||||
void Init_Peripheral(){
|
void Init_Peripheral(){
|
||||||
|
Heater_PinForceOutput();
|
||||||
|
HAL_GPIO_WritePin(HEATER_GPIO_Port, HEATER_Pin, GPIO_PIN_RESET);
|
||||||
HAL_ADCEx_Calibration_Start(&hadc1);
|
HAL_ADCEx_Calibration_Start(&hadc1);
|
||||||
ADC_ScanStart();
|
ADC_ScanStart();
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -38,7 +38,8 @@ void MX_GPIO_Init(void)
|
|||||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||||
|
|
||||||
/*Configure GPIO pin Output Level */
|
/*Configure GPIO pin Output Level */
|
||||||
HAL_GPIO_WritePin(GPIOC, DBG1_Pin|RELAY_CP_Pin|LOCK_A_Pin|LOCK_B_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(GPIOC, DBG1_Pin|RELAY_CP_Pin|LOCK_A_Pin|LOCK_B_Pin
|
||||||
|
|LED_DATA_Pin, GPIO_PIN_RESET);
|
||||||
|
|
||||||
/*Configure GPIO pin Output Level */
|
/*Configure GPIO pin Output Level */
|
||||||
HAL_GPIO_WritePin(GPIOA, DBG2_Pin|DBG3_Pin|RELAY_CC_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(GPIOA, DBG2_Pin|DBG3_Pin|RELAY_CC_Pin, GPIO_PIN_RESET);
|
||||||
@@ -60,8 +61,8 @@ void MX_GPIO_Init(void)
|
|||||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||||
HAL_GPIO_Init(DBG1_GPIO_Port, &GPIO_InitStruct);
|
HAL_GPIO_Init(DBG1_GPIO_Port, &GPIO_InitStruct);
|
||||||
|
|
||||||
/*Configure GPIO pins : RELAY_CP_Pin LOCK_A_Pin LOCK_B_Pin */
|
/*Configure GPIO pins : RELAY_CP_Pin LOCK_A_Pin LOCK_B_Pin LED_DATA_Pin */
|
||||||
GPIO_InitStruct.Pin = RELAY_CP_Pin|LOCK_A_Pin|LOCK_B_Pin;
|
GPIO_InitStruct.Pin = RELAY_CP_Pin|LOCK_A_Pin|LOCK_B_Pin|LED_DATA_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;
|
||||||
|
|||||||
+3
-3
@@ -151,10 +151,10 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
|
|||||||
PC12 ------> UART5_TX
|
PC12 ------> UART5_TX
|
||||||
PD2 ------> UART5_RX
|
PD2 ------> UART5_RX
|
||||||
*/
|
*/
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_12;
|
GPIO_InitStruct.Pin = HEATER_Pin;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
HAL_GPIO_Init(HEATER_GPIO_Port, &GPIO_InitStruct);
|
||||||
|
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_2;
|
GPIO_InitStruct.Pin = GPIO_PIN_2;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||||
@@ -345,7 +345,7 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
|
|||||||
PC12 ------> UART5_TX
|
PC12 ------> UART5_TX
|
||||||
PD2 ------> UART5_RX
|
PD2 ------> UART5_RX
|
||||||
*/
|
*/
|
||||||
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_12);
|
HAL_GPIO_DeInit(HEATER_GPIO_Port, HEATER_Pin);
|
||||||
|
|
||||||
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_2);
|
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_2);
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
+3733
-3727
File diff suppressed because it is too large
Load Diff
+23355
-23297
File diff suppressed because it is too large
Load Diff
+1788
-1786
File diff suppressed because it is too large
Load Diff
+3734
-3727
File diff suppressed because it is too large
Load Diff
@@ -2,12 +2,13 @@
|
|||||||
../Core/Src/board.c:47:9:RELAY_Read 1
|
../Core/Src/board.c:47:9:RELAY_Read 1
|
||||||
../Core/Src/board.c:52:9:IN_ReadInput 8
|
../Core/Src/board.c:52:9:IN_ReadInput 8
|
||||||
../Core/Src/board.c:74:9:GetBoardTemp 1
|
../Core/Src/board.c:74:9:GetBoardTemp 1
|
||||||
../Core/Src/board.c:78:6:Init_Peripheral 1
|
../Core/Src/board.c:82:13:Heater_PinForceOutput 1
|
||||||
../Core/Src/board.c:95:7:pt1000_to_temperature 1
|
../Core/Src/board.c:95:6:Init_Peripheral 1
|
||||||
../Core/Src/board.c:106:7:calculate_NTC_resistance 2
|
../Core/Src/board.c:114:7:pt1000_to_temperature 1
|
||||||
../Core/Src/board.c:121:9:CONN_ReadTemp 4
|
../Core/Src/board.c:125:7:calculate_NTC_resistance 2
|
||||||
../Core/Src/board.c:140:9:GBT_ReadTemp 1
|
../Core/Src/board.c:140:9:CONN_ReadTemp 4
|
||||||
../Core/Src/board.c:144:6:ADC_Select_Channel 2
|
../Core/Src/board.c:159:9:GBT_ReadTemp 1
|
||||||
../Core/Src/board.c:155:9:ADC_TryLock 4
|
../Core/Src/board.c:163:6:ADC_Select_Channel 2
|
||||||
../Core/Src/board.c:171:6:ADC_LockBlocking 2
|
../Core/Src/board.c:174:9:ADC_TryLock 4
|
||||||
../Core/Src/board.c:177:6:ADC_Unlock 2
|
../Core/Src/board.c:190:6:ADC_LockBlocking 2
|
||||||
|
../Core/Src/board.c:196:6:ADC_Unlock 2
|
||||||
|
|||||||
@@ -8,4 +8,4 @@
|
|||||||
../Core/Src/psu_control.c:178:6:PSU_SetVoltageCurrent 5
|
../Core/Src/psu_control.c:178:6:PSU_SetVoltageCurrent 5
|
||||||
../Core/Src/psu_control.c:205:6:PSU_SendCmd 4
|
../Core/Src/psu_control.c:205:6:PSU_SendCmd 4
|
||||||
../Core/Src/psu_control.c:240:6:PSU_ReadWrite 8
|
../Core/Src/psu_control.c:240:6:PSU_ReadWrite 8
|
||||||
../Core/Src/psu_control.c:281:6:PSU_Task 41
|
../Core/Src/psu_control.c:284:6:PSU_Task 41
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ main-build: CCSModuleSW30Web.elf secondary-outputs
|
|||||||
|
|
||||||
# Tool invocations
|
# Tool invocations
|
||||||
CCSModuleSW30Web.elf CCSModuleSW30Web.map: $(OBJS) $(USER_OBJS) /Users/colorbass/STM32CubeIDE/workspace_1.12.0/CCSModuleSW30Web/STM32F107VCTX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
CCSModuleSW30Web.elf CCSModuleSW30Web.map: $(OBJS) $(USER_OBJS) /Users/colorbass/STM32CubeIDE/workspace_1.12.0/CCSModuleSW30Web/STM32F107VCTX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
||||||
arm-none-eabi-gcc -o "CCSModuleSW30Web.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m3 -T"/Users/colorbass/STM32CubeIDE/workspace_1.12.0/CCSModuleSW30Web/STM32F107VCTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="CCSModuleSW30Web.map" -Wl,--gc-sections -Wl,--no-warn-rwx-segments -static --specs=nano.specs -mfloat-abi=soft -mthumb -u _printf_float -Wl,--start-group -lc -lm -Wl,--end-group
|
arm-none-eabi-gcc -o "CCSModuleSW30Web.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m3 -T"/Users/colorbass/STM32CubeIDE/workspace_1.12.0/CCSModuleSW30Web/STM32F107VCTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="CCSModuleSW30Web.map" -Wl,--gc-sections -static --specs=nano.specs -mfloat-abi=soft -mthumb -u _printf_float -Wl,--start-group -lc -lm -Wl,--end-group
|
||||||
@echo 'Finished building target: $@'
|
@echo 'Finished building target: $@'
|
||||||
@echo ' '
|
@echo ' '
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user