STM32WB: disable debug lines when not needed

When doing so, do not disbale GPIO clocks as they may be used by other
drivers !

As a result, debug will be disabled by default, but can be enabled by
either modifying code or selecting MBED debug profile.
pull/9814/head
Laurent Meunier 2019-03-26 14:54:18 +01:00
parent 718b16545c
commit a744343931
2 changed files with 3 additions and 5 deletions

View File

@ -810,8 +810,8 @@ void shci_register_io_bus(tSHciIO* fops) {
*/
static void init_debug( void ) {
tr_debug("WB init_debug: ");
#if (CFG_DEBUGGER_SUPPORTED == 1)
tr_debug("ENABLED\r\n");
/* In case of MBED debug profile, configure debugger support */
#if (defined(MBED_DEBUG) || (CFG_DEBUGGER_SUPPORTED == 1))
/**
* Keep debugger enabled while in any low power mode
*/
@ -834,12 +834,10 @@ static void init_debug( void ) {
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();

View File

@ -324,7 +324,7 @@ typedef enum
* keep debugger enabled while in any low power mode when set to 1
* should be set to 0 in production
*/
#define CFG_DEBUGGER_SUPPORTED 1
#define CFG_DEBUGGER_SUPPORTED 0
/**
* When set to 1, the traces are enabled in the BLE services