mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
bootloader: Add support for early bootloader pin config.
* For pins such as OSC or ULPI enable.
This commit is contained in:
parent
e03f42985f
commit
4fa4ff6524
@ -15,6 +15,18 @@ extern void SystemClock_Config();
|
|||||||
|
|
||||||
void HAL_MspInit()
|
void HAL_MspInit()
|
||||||
{
|
{
|
||||||
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
|
GPIO_InitStructure.Pull = GPIO_PULLUP;
|
||||||
|
GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
|
||||||
|
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
|
|
||||||
|
#if defined(OMV_BOOTLDR_OSCEN_PIN)
|
||||||
|
OMV_BOOTLDR_OSCEN_CLK_ENABLE();
|
||||||
|
GPIO_InitStructure.Pin = OMV_BOOTLDR_OSCEN_PIN;
|
||||||
|
HAL_GPIO_Init(OMV_BOOTLDR_OSCEN_PORT, &GPIO_InitStructure);
|
||||||
|
HAL_GPIO_WritePin(OMV_BOOTLDR_OSCEN_PORT, OMV_BOOTLDR_OSCEN_PIN, GPIO_PIN_SET);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Set the system clock
|
// Set the system clock
|
||||||
SystemClock_Config();
|
SystemClock_Config();
|
||||||
|
|
||||||
@ -27,24 +39,35 @@ void HAL_MspInit()
|
|||||||
__GPIOC_CLK_ENABLE();
|
__GPIOC_CLK_ENABLE();
|
||||||
__GPIOD_CLK_ENABLE();
|
__GPIOD_CLK_ENABLE();
|
||||||
__GPIOE_CLK_ENABLE();
|
__GPIOE_CLK_ENABLE();
|
||||||
|
#ifdef OMV_ENABLE_GPIO_BANK_F
|
||||||
#if defined (STM32F769xx)
|
|
||||||
__GPIOF_CLK_ENABLE();
|
__GPIOF_CLK_ENABLE();
|
||||||
|
#endif
|
||||||
|
#ifdef OMV_ENABLE_GPIO_BANK_G
|
||||||
__GPIOG_CLK_ENABLE();
|
__GPIOG_CLK_ENABLE();
|
||||||
|
#endif
|
||||||
|
#ifdef OMV_ENABLE_GPIO_BANK_H
|
||||||
__GPIOH_CLK_ENABLE();
|
__GPIOH_CLK_ENABLE();
|
||||||
|
#endif
|
||||||
|
#ifdef OMV_ENABLE_GPIO_BANK_I
|
||||||
__GPIOI_CLK_ENABLE();
|
__GPIOI_CLK_ENABLE();
|
||||||
|
#endif
|
||||||
|
#ifdef OMV_ENABLE_GPIO_BANK_J
|
||||||
__GPIOJ_CLK_ENABLE();
|
__GPIOJ_CLK_ENABLE();
|
||||||
|
#endif
|
||||||
|
#ifdef OMV_ENABLE_GPIO_BANK_K
|
||||||
__GPIOK_CLK_ENABLE();
|
__GPIOK_CLK_ENABLE();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GPIO_InitTypeDef GPIO_InitStructure;
|
|
||||||
GPIO_InitStructure.Pull = GPIO_PULLUP;
|
|
||||||
GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
|
|
||||||
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
|
|
||||||
|
|
||||||
GPIO_InitStructure.Pin = OMV_BOOTLDR_LED_PIN;
|
GPIO_InitStructure.Pin = OMV_BOOTLDR_LED_PIN;
|
||||||
HAL_GPIO_Init(OMV_BOOTLDR_LED_PORT, &GPIO_InitStructure);
|
HAL_GPIO_Init(OMV_BOOTLDR_LED_PORT, &GPIO_InitStructure);
|
||||||
HAL_GPIO_WritePin(OMV_BOOTLDR_LED_PORT, OMV_BOOTLDR_LED_PIN, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(OMV_BOOTLDR_LED_PORT, OMV_BOOTLDR_LED_PIN, GPIO_PIN_SET);
|
||||||
|
|
||||||
|
#if defined(OMV_BOOTLDR_USBEN_PIN)
|
||||||
|
OMV_BOOTLDR_USBEN_CLK_ENABLE();
|
||||||
|
GPIO_InitStructure.Pin = OMV_BOOTLDR_USBEN_PIN;
|
||||||
|
HAL_GPIO_Init(OMV_BOOTLDR_USBEN_PORT, &GPIO_InitStructure);
|
||||||
|
HAL_GPIO_WritePin(OMV_BOOTLDR_USBEN_PORT, OMV_BOOTLDR_USBEN_PIN, GPIO_PIN_SET);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OMV_QSPIF_LAYOUT)
|
#if defined(OMV_QSPIF_LAYOUT)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user