update 1.8
This commit is contained in:
@@ -4,24 +4,24 @@
|
||||
* Version : V1.0.0
|
||||
* Date : 2021/06/06
|
||||
* Description : Main program body.
|
||||
*********************************************************************************
|
||||
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
|
||||
* Attention: This software (modified or not) and binary are used for
|
||||
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
|
||||
*******************************************************************************/
|
||||
*********************************************************************************
|
||||
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
|
||||
* Attention: This software (modified or not) and binary are used for
|
||||
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
|
||||
*******************************************************************************/
|
||||
|
||||
/*
|
||||
*@Note
|
||||
IAP upgrade routine:
|
||||
Support serial port and USB for FLASH burning
|
||||
|
||||
1. Use the IAP download tool to realize the download PA0 floating (default pull-up input)
|
||||
2. After downloading the APP, connect PA0 to ground (low level input), and press
|
||||
the reset button to run the APP program.
|
||||
3. The routine needs to install the CH372 driver.
|
||||
Note: FLASH operation keeps the frequency below 100Mhz, it is recommended that the main
|
||||
frequency of IAP be below 100Mhz
|
||||
|
||||
*IAP upgrade routine:
|
||||
*Support serial port and USB for FLASH burning
|
||||
*
|
||||
*1. Use the IAP download tool to realize the download PA0 floating (default pull-up input)
|
||||
*2. After downloading the APP, connect PA0 to ground (low level input), and press
|
||||
*the reset button to run the APP program.
|
||||
*3. The routine needs to install the CH372 driver.
|
||||
*Note: FLASH operation keeps the frequency below 100Mhz, it is recommended that the main
|
||||
*frequency of IAP be below 100Mhz
|
||||
*
|
||||
*/
|
||||
|
||||
#include "debug.h"
|
||||
@@ -49,6 +49,15 @@ void IAP_2_APP(void) {
|
||||
USBOTG_FS->BASE_CTRL |= (1 << 1) | (1 << 2);
|
||||
Delay_Ms(50);
|
||||
printf("jump APP\r\n");
|
||||
GPIO_DeInit(GPIOA);
|
||||
GPIO_DeInit(GPIOB);
|
||||
USART_DeInit(USART3);
|
||||
NVIC_DisableIRQ( USBHD_IRQn );
|
||||
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB, DISABLE);
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, DISABLE);
|
||||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3,DISABLE);
|
||||
RCC_AHBPeriphClockCmd( RCC_AHBPeriph_OTG_FS, DISABLE );
|
||||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USB, DISABLE);
|
||||
Delay_Ms(10);
|
||||
NVIC_EnableIRQ(Software_IRQn);
|
||||
NVIC_SetPendingIRQ(Software_IRQn);
|
||||
@@ -61,9 +70,11 @@ void IAP_2_APP(void) {
|
||||
* @return none
|
||||
*/
|
||||
int main(void) {
|
||||
SystemCoreClockUpdate();
|
||||
Delay_Init();
|
||||
USART_Printf_Init(115200);
|
||||
printf("SystemClk:%d\r\n", SystemCoreClock);
|
||||
printf( "ChipID:%08x\r\n", DBGMCU_GetCHIPID() );
|
||||
|
||||
Set_USBConfig();
|
||||
USB_Init();
|
||||
|
||||
Reference in New Issue
Block a user