[F1] Legacy maintenance: Update boot loader request related to… (#8587)

[F1] Legacy maintenance: Update boot loader request related to current
This commit is contained in:
Michael Keller 2019-07-22 01:42:41 +12:00 committed by GitHub
commit 9bf86db4d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 18 deletions

View File

@ -37,8 +37,10 @@ void systemReset(void)
SCB->AIRCR = AIRCR_VECTKEY_MASK | (uint32_t)0x04;
}
void systemResetToBootloader(void)
void systemResetToBootloader(bootloaderRequestType_e requestType)
{
UNUSED(requestType);
// 1FFFF000 -> 20000200 -> SP
// 1FFFF004 -> 1FFFF021 -> PC
@ -46,6 +48,23 @@ void systemResetToBootloader(void)
systemReset();
}
static void checkForBootLoaderRequest(void)
{
void(*bootJump)(void);
if (*((uint32_t *)0x20004FF0) == 0xDEADBEEF) {
*((uint32_t *)0x20004FF0) = 0x0;
__enable_irq();
__set_MSP(*((uint32_t *)0x1FFFF000));
bootJump = (void(*)(void))(*((uint32_t *) 0x1FFFF004));
bootJump();
while (1);
}
}
void enableGPIOPowerUsageAndNoiseReductions(void)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC, ENABLE);
@ -113,20 +132,3 @@ void systemInit(void)
// SysTick
SysTick_Config(SystemCoreClock / 1000);
}
static void checkForBootLoaderRequest(void)
{
void(*bootJump)(void);
if (*((uint32_t *)0x20004FF0) == 0xDEADBEEF) {
*((uint32_t *)0x20004FF0) = 0x0;
__enable_irq();
__set_MSP(*((uint32_t *)0x1FFFF000));
bootJump = (void(*)(void))(*((uint32_t *) 0x1FFFF004));
bootJump();
while (1);
}
}