cancel
Showing results for 
Search instead for 
Did you mean: 

BLE_HeartRateFreeRTOS on STM32WB55 immediately disconnects from ST-LINK

ADing.1
Associate II

I am using the STM32WB55RG nucleo board and am trying to the BLE_HeartRateFreeRTOS example.

I have installed two binaries on the coprocessor, the FUS and the BLE_Stack_full_fw according the instructions in the release notes. I confirmed with STM32cubeProgrammer that the versions are 1.2.0 and 1.16.0.4 for the FUS and BLE stack, respectively. I think these should be the most up to date versions.

I can build the example no problem, but when I try to run it, it disconnects from ST-LINK. No LEDs are blinking or turned on and no messages are received over the UART connection (not sure if the program does either of these things, though). I can also not see anything advertised using the st BLE toolbox app on my phone.

Using breakpoints to see where the issue occurs, it seems to happen within the call to `MX_APPE_Init()` on line 183 of main.c.

I will investigate and see if I can narrow it down further, but any help would be appreciated.

EDIT: The issue is caused by the function APPD_INIT() that's called from MX_APPE_Init():

void APPD_Init( void )
{
/* USER CODE BEGIN APPD_Init */
#if (CFG_DEBUGGER_SUPPORTED == 1)
  /**
   * Keep debugger enabled while in any low power mode
   */
  HAL_DBGMCU_EnableDBGSleepMode();
  HAL_DBGMCU_EnableDBGStopMode();
 
  /***************** ENABLE DEBUGGER *************************************/
  LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
 
#else
 
 GPIO_InitTypeDef gpio_config = {0};
 
 gpio_config.Pull = GPIO_NOPULL;
 gpio_config.Mode = GPIO_MODE_ANALOG;
 
 gpio_config.Pin = GPIO_PIN_15 | GPIO_PIN_14 | GPIO_PIN_13;
 __HAL_RCC_GPIOA_CLK_ENABLE();
 HAL_GPIO_Init(GPIOA, &gpio_config);
 __HAL_RCC_GPIOA_CLK_DISABLE();
 
 gpio_config.Pin = GPIO_PIN_4 | GPIO_PIN_3;
 __HAL_RCC_GPIOB_CLK_ENABLE();
 HAL_GPIO_Init(GPIOB, &gpio_config);
 __HAL_RCC_GPIOB_CLK_DISABLE();
 
  HAL_DBGMCU_DisableDBGSleepMode();
  HAL_DBGMCU_DisableDBGStopMode();
  HAL_DBGMCU_DisableDBGStandbyMode();
 
#endif /* (CFG_DEBUGGER_SUPPORTED == 1) */
 
#if(CFG_DEBUG_TRACE != 0)
  DbgTraceInit();
#endif
 
  APPD_SetCPU2GpioConfig( );
  APPD_BleDtbCfg( );
 
/* USER CODE END APPD_Init */
  return;
}

Specifically the GPIO configuration that starts on line 16 of the above code (line 192 of the file `app_debug.c` in the example).

This example was written for this board, so I'm not sure what the issue is. Am I not supposed to be running with a debugger?

4 REPLIES 4
Lubos KOUDELKA
ST Employee

Setting debugger GPIOs as analog is done to decrease power consumption, so the example without any modification has lowest possible power consumption in idle (STOP2 mode). Average power consumption further depends on BLE settings.

DS.4
Senior II

Same here,

I opened this post:

https://community.st.com/s/question/0D53W0000263ATaSAM/target-is-not-responding-retrying

Ofcourse ST will not admit of anything or propose a fix.. probably the fix will be in their next release version though, so I will wait...

DS.4
Senior II

Just comment the line, worked for me..

ah216
Associate

Look for CFG_DEBUGGER_SUPPORTED in Core/Inc/app_conf.h and set it to 1. Alternatively, use the MX Configuration tool (Middlewares | STM32_WPAN | Configuration).