From a182558ff39ee1544f13283b67f80bf62d0425b8 Mon Sep 17 00:00:00 2001 From: Malavika Sajikumar Date: Wed, 24 Apr 2019 11:24:38 -0700 Subject: [PATCH] AWAKE signal turned on at system init for SDP-K1 board. - Setting AWAKE signal high in the SystemInit() to ensure VIO supply to daughter boards through SDP and Arduino connectors. --- .../TARGET_SDP_K1/system_clock.c | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/TARGET_SDP_K1/system_clock.c b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/TARGET_SDP_K1/system_clock.c index 6f32f4659d..960053c87c 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/TARGET_SDP_K1/system_clock.c +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/TARGET_SDP_K1/system_clock.c @@ -1,7 +1,7 @@ /* mbed Microcontroller Library -* Copyright (c) 2006-2019 ARM Limited +* Copyright (c) 2006-2017 ARM Limited * SPDX-License-Identifier: Apache-2.0 - +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -58,6 +58,7 @@ uint8_t SetSysClock_PLL_HSE(uint8_t bypass); uint8_t SetSysClock_PLL_HSI(void); #endif /* ((CLOCK_SOURCE) & USE_PLL_HSI) */ +static void TurnOnAwakeSignal(void); /** * @brief Setup the microcontroller system @@ -102,6 +103,7 @@ void SystemInit(void) SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; /* Vector Table Relocation in Internal FLASH */ #endif + TurnOnAwakeSignal(); } @@ -274,3 +276,27 @@ uint8_t SetSysClock_PLL_HSI(void) return 1; // OK } #endif /* ((CLOCK_SOURCE) & USE_PLL_HSI) */ + +/** + * @brief Sets F469 "Awake" signal (PK3 pin) to turn on daughterboard power supplies + * @param None + * @retval None + * + */ +static void TurnOnAwakeSignal(void) +{ + GPIO_InitTypeDef GPIO_InitStruct; + + /* Enable peripheral clock */ + __HAL_RCC_GPIOK_CLK_ENABLE(); + + /* GPIO Configuration */ + GPIO_InitStruct.Pin = GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOK, &GPIO_InitStruct); + + /* Enable AWAKE pin */ + HAL_GPIO_WritePin(GPIOK, GPIO_PIN_3, GPIO_PIN_SET); +}