Question
stm32 GPIO Configuaration
I am using a pin to Switch on the power supply once the MCU is powered.When powering up the MCU I am getting a Glitch before it turns on the MC
GPIO configuaration is given below. For every output I am getting a glich before it SET from RESET Can anyone help
static void MX_GPIO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
/* USER CODE BEGIN MX_GPIO_Init_1 */
/* USER CODE END MX_GPIO_Init_1 */
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOB, NFC_Pin|SHN_Pin|RL_A_Pin|LedR_Pin
|DPS_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, RL_B_Pin|DA_TX_Pin|LedG_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin : NFC_Pin */
GPIO_InitStruct.Pin = NFC_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(NFC_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : RL_B_Pin LedG_Pin */
GPIO_InitStruct.Pin = RL_B_Pin|LedG_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pin : PA4 */
GPIO_InitStruct.Pin = GPIO_PIN_4;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_PULLUP;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pin : Mains_Pin */
GPIO_InitStruct.Pin = Mains_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(Mains_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pin : SHN_Pin */
GPIO_InitStruct.Pin = SHN_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(SHN_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : RL_A_Pin LedR_Pin */
GPIO_InitStruct.Pin = RL_A_Pin|LedR_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/*Configure GPIO pin : DA_TX_Pin */
GPIO_InitStruct.Pin = DA_TX_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(DA_TX_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pin : LIVE_SENSE_Pin */
GPIO_InitStruct.Pin = LIVE_SENSE_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(LIVE_SENSE_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pin : DPS_Pin */
GPIO_InitStruct.Pin = DPS_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(DPS_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pin : DA_RX_Pin */
GPIO_InitStruct.Pin = DA_RX_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
HAL_GPIO_Init(DA_RX_GPIO_Port, &GPIO_InitStruct);
/* EXTI interrupt init*/
HAL_NVIC_SetPriority(EXTI4_15_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI4_15_IRQn);
