mirror of
https://github.com/ylj2000/DAPLink_X033.git
synced 2026-09-27 06:26:16 +00:00
Add jumptoBL & Remove dap clock *10
This commit is contained in:
@@ -11,6 +11,23 @@ int main(void)
|
||||
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
RCC->APB2PCENR |= RCC_APB2Periph_GPIOA;
|
||||
GPIOA->CFGLR &= ~(0x0F << (4 * 4)); // RST,GPIOA4
|
||||
GPIOA->CFGLR |= 0x08 << (4 * 4);
|
||||
GPIOA->BSHR = 1 << 4;
|
||||
|
||||
for (volatile uint32_t i = 0; i < 100; i++)
|
||||
{
|
||||
__NOP();
|
||||
}
|
||||
|
||||
uint8_t temp = (GPIOA->INDR >> 4) & 0x01;
|
||||
if (temp == 0)
|
||||
{
|
||||
SystemReset_StartMode(Start_Mode_BOOT);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
DAP_Init();
|
||||
DAP_USB_Init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user