cancel
Showing results for 
Search instead for 
Did you mean: 

How to use PA15 (JTDI) as a GPIO

Romain1
Associate III

On a custom board, the RED_LED is connected to PA15, which is pulled-up by default (JTDI).

The pin has been set to Push-Pull Output GPIO in CubeMX and is initialized to 0.

The STM32WB55CGUx was experiencing random resets, until this particular IO was set to 1, line 34 in the code below.

Now the code runs fine and is stable.

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 */
  //SysTick_Config(32000/0);
 
  /* USER CODE END SysInit */
 
  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_ADC1_Init();
  MX_SPI1_Init();
  MX_TIM1_Init();
  MX_TIM2_Init();
  MX_USART1_UART_Init();
  MX_RF_Init();
  MX_RTC_Init();
  /* USER CODE BEGIN 2 */
  HAL_GPIO_WritePin(LED_RED_GPIO_Port, LED_RED_Pin, GPIO_PIN_SET);
  HAL_UART_Transmit(&huart1, (uint8_t*)"Hello World\n", 12, 1000);
  /* USER CODE END 2 */
 
  /* Init code for STM32_WPAN */
  APPE_Init();
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
	  UTIL_SEQ_Run(UTIL_SEQ_DEFAULT);
    /* USER CODE END WHILE */
 
    /* USER CODE BEGIN 3 */
	  HAL_GPIO_WritePin(LED_BLUE_GPIO_Port, LED_BLUE_Pin, GPIO_PIN_SET);
	  HAL_Delay(5);
	  HAL_GPIO_WritePin(LED_BLUE_GPIO_Port, LED_BLUE_Pin, GPIO_PIN_RESET);
	  HAL_Delay(100);
  }
  /* USER CODE END 3 */
}

Using STM32CubeIDE v1.0.3.

Flashing the board using SWD (SWDIO/SWCLK), not using JTDI.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Setting PA15 high or low should not reset the chip. Gotta be something else happening here. Custom board? Is PA15 connected to anything besides the LED?

You should probably upgrade STM32CubeIDE to 1.3 as well.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
TDK
Guru

Setting PA15 high or low should not reset the chip. Gotta be something else happening here. Custom board? Is PA15 connected to anything besides the LED?

You should probably upgrade STM32CubeIDE to 1.3 as well.

If you feel a post has answered your question, please click "Accept as Solution".
Romain1
Associate III

The issue manifests itself when CPU2/radio is active... Commenting out APPE_Init and UTIL_SEQ_Run makes the MCU runs fine.

Using STM32CubeIDE v1.3.0, sorry for the typo.

AHame
Associate II

I'm having the exact same issue on a custom board using the same STM32WB55 module. This is probably not a coincidence.

It's been a couple years, any update on this? The reset line and PA15 lines are not even close to each other so I don't think it is the custom board at fault here.

@TDK​