cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-55WLJC1: Most Elemental HAL Functions Don't work

MSchn.3
Associate II

Hey guys, I'm Working on the NUCLEO-55WLJC1 Board. My Problem seems very simple but I've been struggling with this for some time now. I want to use HAL_GPIO_TogglePin To toggle a pin, but it has no effect at all. I tried to use HAL_GPIO_WritePin instead, which doesn't work either. So I meassured the Voltage of the Pin and this is how it looks like:0693W000007EKhuQAG.jpgI thought there might be something wrong with HAL_Driver, but since I'm working with the Device Configuration Tool of the STM32ide everything was initialized from the start.

static void MX_GPIO_Init(void)
{
  GPIO_InitTypeDef GPIO_InitStruct = {0};
 
  /* GPIO Ports Clock Enable */
  __HAL_RCC_GPIOA_CLK_ENABLE();
  
 /*Configure GPIO pin : RelayS_Pin */
  GPIO_InitStruct.Pin = RelayS_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  HAL_GPIO_Init(RelayS_GPIO_Port, &GPIO_InitStruct);
 
}

and in the main i do nothing but setting/Toggling this Pin:

int main(void)
{
  /* USER CODE BEGIN 1 */
 
  /* USER CODE END 1 */
 
  /* MCU Configuration--------------------------*/
 
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();
 
  /* USER CODE BEGIN Init */
 
  /* USER CODE END Init */
 
  /* Configure the system clock */
  SystemClock_Config();
  /* USER CODE BEGIN SysInit */
 
  /* USER CODE END SysInit */
 
  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  /* USER CODE BEGIN 2 */
  HAL_GPIO_WritePin(RelayS_GPIO_Port, RelayS_Pin, GPIO_PIN_SET);
 
  /* USER CODE END 2 */
 
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_4);
    HAL_Delay(5000);
    /* USER CODE END WHILE */
 
    /* USER CODE BEGIN 3 */
  }
  /* USER CODE END 3 */
}

I got no clue where i might have gone wrong.

Please Help! Thank You in advance!

1 REPLY 1

Read out and check/post content of the related GPIO registers.

Check that you are measuring on the correct pin.

JW