Skip to main content
Graduate
February 4, 2025
Solved

Setting GPIO high does not work

  • February 4, 2025
  • 1 reply
  • 485 views

I have created my first PCB with a STM32C011F6P6 on it, but I am not able to measure a GPIO I set high from my testpoint.

I am setting PB6 high the following way:

DavidL__0-1738698244667.pngDavidL__1-1738698255326.png

I flashed the code to the MCU via the cube ide and it told me that everything went fine.

This is what cubemx generated for the gpio init:

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, GPIO_PIN_6, GPIO_PIN_RESET);

 /*Configure GPIO pin : PB6 */
 GPIO_InitStruct.Pin = GPIO_PIN_6;
 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);

/* USER CODE BEGIN MX_GPIO_Init_2 */
/* USER CODE END MX_GPIO_Init_2 */
}

I have it wired the following way:

DavidL__2-1738698326294.png

Where PB6 is exposed through a test point. Measuring the voltage at that test point, or directly on the leg of the chip tells me that it is connected to GND though, instead of being set high.

Am I missing something?

    This topic has been closed for replies.
    Best answer by DavidL_

    There was a short on the test point to GND.

    1 reply

    DavidL_AuthorAnswer
    Graduate
    February 4, 2025

    There was a short on the test point to GND.