cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32G0B1KBU7N] GPIO not working

XD
Associate III

Not sure what is going on, im unable to toggle an IO and im not sure why...

This is a very simply custom board, it uses I2C, CAN and USB. I've configured everything in CubeMX and double checked the pinout and gerber files several times but i can't find anything wrong. I've double checked the voltages on VDD and VDDIO2, both are 3.3V. 

I've tried configuring PD2 as Push-Pull and Open drain with and without pull-up but i get no change on the pin when measuring with my scope.

PD2 is connected to the CAN STBY pin that has an internal pull-up, the pin remains high when the PHY is connected and low when the PHY is disconnected. This would indicate that there is no short on the board and that the electrical part is fine. 

I have physically probed the connections on the board and they are correct.

What am i missing, do i need to configure something else?

 

Below is the minimum CubeMX project. I2C and the EXTI work fine but PD2 does not. 

XD_0-1770115198709.png

XD_1-1770115732101.png

 

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();
  MX_I2C1_Init();
  MX_FDCAN1_Init();
  /* USER CODE BEGIN 2 */

  while(1){

	  HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_2);
	  HAL_Delay(500);

  }
}

 

2 REPLIES 2
Ghofrane GSOURI
ST Employee

Hello @XD 

I'm currently investigating this behavior.I will get back to you ASAP.

It would be useful if you could provide your IOC.

THX

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi @Ghofrane GSOURI , 

 

I have attached the CubeMX file, i can provide the entire CubeIDE project if needed. But It's simply the HAL toggle code in the main loop.