GPIO Problem with STM32F070RB
Hello everyone,
I am developing a small program with a relay which has a data, power and ground input. This is powered at 5v and I have it connected to the GPIO PA0 output.
My code is as simple as creating a task with FreeRTOS as follows:
void StartDefaultTask(void const * argument)
{
/* USER CODE BEGIN 5 */
/* Infinite loop */
for(;;)
{
HAL_GPIO_WritePin(GPIOA, EV_Pin, 1);
HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
HAL_GPIO_WritePin(GPIOA, EV_Pin, 0);
osDelay(100);
}
/* USER CODE END 5 */
}
The question is that when I run it, the relay turns on but does not change state. It is as if the GPIO output is not working. However the led 2 does flash with the TogglePin function.
Inside my .ioc file I have left everything by default, just changing the pin label to identify it more easily and trying the GPIO Mode option to Output Open Drain but nothing works.
Does anyone know what can happen?
Best regards, thanks.
