/*!
    \file    change log.txt
    \brief   change log for GD32H7xx demo

    \version 2025-02-19, V2.1.0, demo for GD32H7xx
*/

/*
    Copyright (c) 2024, GigaDevice Semiconductor Inc.

    Redistribution and use in source and binary forms, with or without modification, 
are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this 
       list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright notice, 
       this list of conditions and the following disclaimer in the documentation 
       and/or other materials provided with the distribution.
    3. Neither the name of the copyright holder nor the names of its contributors 
       may be used to endorse or promote products derived from this software without 
       specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
OF SUCH DAMAGE.
*/

******************* V2.1.0 2025-02-17 ******************************************************************************************
______________________Common______________________________________________________________________________________________
1. Update the Firmware to V1.4.0
2. Update schematic and User Guide
3. Update IAR project format(modify default .board/mac/ddf/icf linker path)

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/29_Touch__Draw/Software/bsp_i2c_touch.c
fix reason:
Bug fix
V2.0.1:
static void i2c_delay(void)
{
    __IO uint32_t i;
    for(i = 0; i < 5 * 10; i++);
}
V2.1.0:
static void i2c_delay(void)
{
    __IO uint32_t i;
    for(i = 0; i < 5 * 100; i++);
}

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/19_Can__Network/main.c
fix reason:
Bug fix
V2.0.1:
void can_gpio_config(void)
{
    /* configure CAN1 and CAN2 clock source */
    rcu_can_clock_config(IDX_CAN1, RCU_CANSRC_APB2_DIV2);
    rcu_can_clock_config(IDX_CAN2, RCU_CANSRC_APB2_DIV2);
    /* enable CAN clock */
    rcu_periph_clock_enable(RCU_CAN1);
    rcu_periph_clock_enable(RCU_CAN2);
    /* enable CAN port clock */
    rcu_periph_clock_enable(RCU_GPIOB);
    rcu_periph_clock_enable(RCU_GPIOF);
    ......
}
V2.1.0:
void can_gpio_config(void)
{
    /* configure CAN1 and CAN2 clock source */
    rcu_can_clock_config(IDX_CAN1, RCU_CANSRC_APB2);
    rcu_can_clock_config(IDX_CAN2, RCU_CANSRC_APB2);
    /* enable CAN clock */
    rcu_periph_clock_enable(RCU_CAN1);
    rcu_periph_clock_enable(RCU_CAN2);
    /* enable CAN port clock */
    rcu_periph_clock_enable(RCU_GPIOB);
    rcu_periph_clock_enable(RCU_GPIOF);
    ......
}

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/25_DCI_OV2640/main.c
fix reason:
Bug fix
V2.0.1:
    /* DMA interrupt and channel enable */
    dma_interrupt_enable(DMA1, DMA_CH7, DMA_CHXCTL_FTFIE);
V2.1.0:
    /* DMA interrupt and channel enable */
    dma_interrupt_enable(DMA1, DMA_CH7, DMA_INT_FTF);



******************* V2.0.1 2024-10-28 ******************************************************************************************
______________________Common______________________________________________________________________________________________
Update User Guide to Rev2.1
__________________________________________________________________________________________________________________________

______________________27_USB_Device_________________________________________________________________________________________________
Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/28_USB_Host/Host_HID/readme.txt
fix reason:
Adapt to gd32h7xx_eval_2.0 board
V2.0.0:
    JP70 must be fit to USB1_C.
    JP68, JP69 must be fit to USART.
V2.0.1:
    JP70 must be fit to USB.
    JP68 must be fit to USART.

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/28_USB_Host/Host_MSC/readme.txt
fix reason:
Adapt to gd32h7xx_eval_2.0 board
V2.0.0:
    JP70 must be fit to USB.
    JP68, JP69 must be fit to USART.
V2.0.1:
    JP70 must be fit to USB.
    JP68 must be fit to USART
__________________________________________________________________________________________________________________________

******************* V2.0.0 2024-09-27 ******************************************************************************************
______________________Common______________________________________________________________________________________________
Fix file:
gd32h7xx_it.c
fix reason:
add FPU_IRQHandler function
V1.2.0:
none
V2.0.0:
/*!
    \brief      this function handles FPU exception
    \param[in]  none
    \param[out] none
    \retval     none
*/
void FPU_IRQHandler(void)
{
    /* if FPU exception occurs, go to infinite loop */
    while(1) {
    }
}

Fix file:
gd32h7xx_it.h
fix reason:
add the definition of FPU_IRQHandler function
V1.2.0:
none
V2.0.0:
/* this function handles FPU exception */
void FPU_IRQHandler(void);

Fix file:
all files containing the printf retarget function
fix reason:
Modify the printf retarget function, add the eclipse gcc environment usage
V1.2.0:
/* retarget the C library printf function to the USART */
int fputc(int ch, FILE *f)
{
    usart_data_transmit(EVAL_COM, (uint8_t)ch);
    while(RESET == usart_flag_get(EVAL_COM, USART_FLAG_TBE));

    return ch;
}
V2.0.0:
#ifdef GD_ECLIPSE_GCC
/* retarget the C library printf function to the USART, in Eclipse GCC environment */
int __io_putchar(int ch)
{
    usart_data_transmit(EVAL_COM, (uint8_t) ch );
    while(RESET == usart_flag_get(EVAL_COM, USART_FLAG_TBE));
    return ch;
}
#else
/* retarget the C library printf function to the USART */
int fputc(int ch, FILE *f)
{
    usart_data_transmit(EVAL_COM, (uint8_t)ch);
    while(RESET == usart_flag_get(EVAL_COM, USART_FLAG_TBE));

    return ch;
}
#endif /* GD_ECLIPSE_GCC */
__________________________________________________________________________________________________________________________

______________________CAN_________________________________________________________________________________________________
Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/19_CAN_Network/main.c
fix reason:
Adapt to gd32h7xx_eval_2.0 board
V1.2.0:
        if(0U == gd_eval_key_state_get(KEY_WAKEUP)) {
            delay_1ms(100U);
            if(0U == gd_eval_key_state_get(KEY_WAKEUP)) {
                /* transmit message */
                can_mailbox_config(CAN2, 1U, &transmit_message);

                printf("\r\nCAN2 transmit data: \r\n");
                for(i = 0U; i < transmit_message.data_bytes; i++) {
                    printf("%02x ", tx_data[i]);
                }

                /* waiting for the WAKEUP key up */
                while(0U == gd_eval_key_state_get(KEY_WAKEUP));
            }
V2.0.0:
        /* test whether the WAKEUP key is pressed */
        if(1U == gd_eval_key_state_get(KEY_WAKEUP)) {
            delay_1ms(100U);
            if(1U == gd_eval_key_state_get(KEY_WAKEUP)) {
                /* transmit message */
                can_mailbox_config(CAN2, 1U, &transmit_message);

                printf("\r\nCAN2 transmit data: \r\n");
                for(i = 0U; i < transmit_message.data_bytes; i++) {
                    printf("%02x ", tx_data[i]);
                }
                /* waiting for the WAKEUP key up */
                while(1U == gd_eval_key_state_get(KEY_WAKEUP));
            }
        }

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/19_CAN_Network/main.c
fix reason:
Adapt to gd32h7xx_eval_2.0 board
V1.2.0
void can_gpio_config(void)
{
    /* configure CAN1 and CAN2 clock source */
    rcu_can_clock_config(IDX_CAN1, RCU_CANSRC_APB2_DIV2);
    rcu_can_clock_config(IDX_CAN2, RCU_CANSRC_APB2_DIV2);
    /* enable CAN clock */
    rcu_periph_clock_enable(RCU_CAN1);
    rcu_periph_clock_enable(RCU_CAN2);
    /* enable CAN port clock */
    rcu_periph_clock_enable(RCU_GPIOB);
    rcu_periph_clock_enable(RCU_GPIOD);
    rcu_periph_clock_enable(RCU_GPIOF);

    /* configure CAN1_RX GPIO */
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_5);
    gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_5);
    gpio_af_set(GPIOB, GPIO_AF_9, GPIO_PIN_5);
    /* configure CAN1_TX GPIO */
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_6);
    gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_6);
    gpio_af_set(GPIOB, GPIO_AF_9, GPIO_PIN_6);

    /* configure CAN2_RX GPIO */
    gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_12);
    gpio_mode_set(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_12);
    gpio_af_set(GPIOD, GPIO_AF_5, GPIO_PIN_12);
    /* configure CAN2_TX GPIO */
    gpio_output_options_set(GPIOF, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_7);
    gpio_mode_set(GPIOF, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_7);
    gpio_af_set(GPIOF, GPIO_AF_2, GPIO_PIN_7);
}
V2.0.0:
void can_gpio_config(void)
{
    /* configure CAN1 and CAN2 clock source */
    rcu_can_clock_config(IDX_CAN1, RCU_CANSRC_APB2_DIV2);
    rcu_can_clock_config(IDX_CAN2, RCU_CANSRC_APB2_DIV2);
    /* enable CAN clock */
    rcu_periph_clock_enable(RCU_CAN1);
    rcu_periph_clock_enable(RCU_CAN2);
    /* enable CAN port clock */
    rcu_periph_clock_enable(RCU_GPIOB);
    rcu_periph_clock_enable(RCU_GPIOF);

    /* configure CAN1_RX GPIO */
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_5);
    gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_5);
    gpio_af_set(GPIOB, GPIO_AF_9, GPIO_PIN_5);
    /* configure CAN1_TX GPIO */
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_13);
    gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_13);
    gpio_af_set(GPIOB, GPIO_AF_9, GPIO_PIN_13);

    /* configure CAN2_RX GPIO */
    gpio_output_options_set(GPIOF, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_6);
    gpio_mode_set(GPIOF, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_6);
    gpio_af_set(GPIOF, GPIO_AF_2, GPIO_PIN_6);
    /* configure CAN2_TX GPIO */
    gpio_output_options_set(GPIOF, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_7);
    gpio_mode_set(GPIOF, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_7);
    gpio_af_set(GPIOF, GPIO_AF_2, GPIO_PIN_7);
}
__________________________________________________________________________________________________________________________

__________________________________________________________________________________________________________________________

______________________DCI_________________________________________________________________________________________________
Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/25_DCI_OV2640/main.c
fix reason:
bug fix
V1.2.0:
    /* configure PLL2 to generate TLI clock 25MHz/25*186/3 = 62MHz */
    rcu_pll_input_output_clock_range_config(IDX_PLL2, RCU_PLL2RNG_1M_2M, RCU_PLL2VCO_150M_420M);
    if(ERROR == rcu_pll2_config(25, 186, 3, 3, 3)) {
        while(1) {
        }
    }
V2.0.0
    /* configure PLL2 to generate TLI clock 25MHz/25*120/3 = 40MHz */
    rcu_pll_input_output_clock_range_config(IDX_PLL2, RCU_PLL2RNG_1M_2M, RCU_PLL2VCO_150M_420M);
    if(ERROR == rcu_pll2_config(25, 120, 3, 3, 3)) {
        while(1) {
        }
    }

../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/25_DCI_OV2640/Soft_Drive/dci_ov2640.c
fix reason:
bug fix
V1.2.0:
    rcu_ckout0_config(RCU_CKOUT0SRC_HXTAL, RCU_CKOUT0_DIV2);
V2.0.0
    rcu_ckout0_config(RCU_CKOUT0SRC_HXTAL, RCU_CKOUT0_DIV3);

../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/25_DCI_OV2640/Soft_Drive/dci_ov2640.c
fix reason:
bug fix
V1.2.0:
    gpio_mode_set(GPIOE, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_3);
    gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_3);
    gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_7);
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_7);

    gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_4);
    gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_4);

    /* configure  DCI_D0(PC6), DCI_D1(PH10) DCI_D2(PC8), DCI_D3(PC9), DCI_D4(PE4), DCI_D5(PB6), DCI_D6(PE5), DCI_D7(PE6) */
    gpio_af_set(GPIOC, GPIO_AF_13, GPIO_PIN_6);
    gpio_af_set(GPIOC, GPIO_AF_13, GPIO_PIN_8);
    gpio_af_set(GPIOC, GPIO_AF_13, GPIO_PIN_9);
    gpio_af_set(GPIOB, GPIO_AF_13, GPIO_PIN_6);
    gpio_af_set(GPIOE, GPIO_AF_13, GPIO_PIN_4);
    gpio_af_set(GPIOE, GPIO_AF_13, GPIO_PIN_5);
    gpio_af_set(GPIOE, GPIO_AF_13, GPIO_PIN_6);
    gpio_af_set(GPIOH, GPIO_AF_13, GPIO_PIN_10);

    gpio_mode_set(GPIOH, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_10);
    gpio_output_options_set(GPIOH, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_10);

    gpio_mode_set(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_6);
    gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_6);
    gpio_mode_set(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_9);
    gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_9);
    gpio_mode_set(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_8);
    gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_8);
    gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_6);
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_6);

    gpio_mode_set(GPIOE, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_4);
    gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_4);
    gpio_mode_set(GPIOE, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_5);
    gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_5);
    gpio_mode_set(GPIOE, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_6);
    gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_6);
V2.0.0:
    gpio_mode_set(GPIOE, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_3);
    gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_3);
    gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_7);
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_7);

    gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_4);
    gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_4);

    /* configure  DCI_D0(PC6), DCI_D1(PH10) DCI_D2(PC8), DCI_D3(PC9), DCI_D4(PE4), DCI_D5(PB6), DCI_D6(PE5), DCI_D7(PE6) */
    gpio_af_set(GPIOC, GPIO_AF_13, GPIO_PIN_6);
    gpio_af_set(GPIOC, GPIO_AF_13, GPIO_PIN_8);
    gpio_af_set(GPIOC, GPIO_AF_13, GPIO_PIN_9);
    gpio_af_set(GPIOB, GPIO_AF_13, GPIO_PIN_6);
    gpio_af_set(GPIOE, GPIO_AF_13, GPIO_PIN_4);
    gpio_af_set(GPIOE, GPIO_AF_13, GPIO_PIN_5);
    gpio_af_set(GPIOE, GPIO_AF_13, GPIO_PIN_6);
    gpio_af_set(GPIOH, GPIO_AF_13, GPIO_PIN_10);

    gpio_mode_set(GPIOH, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_10);
    gpio_output_options_set(GPIOH, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_10);

    gpio_mode_set(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_6);
    gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_6);
    gpio_mode_set(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_9);
    gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_9);
    gpio_mode_set(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_8);
    gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_8);
    gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_6);
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_6);

    gpio_mode_set(GPIOE, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_4);
    gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_4);
    gpio_mode_set(GPIOE, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_5);
    gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_5);
    gpio_mode_set(GPIOE, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_6);
    gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_85MHZ, GPIO_PIN_6);
__________________________________________________________________________________________________________________________

__________________________________________________________________________________________________________________________

______________________EXMC________________________________________________________________________________________________
Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/16_EXMC_SDRAM/main.c
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/17_EXMC_SDRAM_DeepSleep/main.c
fix reason:
bug fix
V1.2.0
#define BUFFER_SIZE                ((uint32_t)0x0400)
#define WRITE_READ_ADDR            ((uint32_t)0x0000)
V2.0.0
#define BUFFER_SIZE                ((uint32_t)0x8000)
#define WRITE_READ_ADDR            ((uint32_t)0x7FFF00)

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/16_EXMC_SDRAM/main.c
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/17_EXMC_SDRAM_DeepSleep/main.c
fix reason:
bug fix
V1.2.0
    exmc_sdram_command_parameter_struct     sdram_command_init_struct;
    uint16_t i = 0;

    /* initialize LEDs */
    gd_eval_led_init(LED1);
    gd_eval_led_init(LED2);
V2.0.0
    exmc_sdram_command_parameter_struct     sdram_command_init_struct;
    uint16_t i = 0;

    /* enable the CPU cache */
    cache_enable();
    /* configure MPU */
    mpu_config();

    /* initialize LEDs */
    gd_eval_led_init(LED1);
    gd_eval_led_init(LED2);

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/16_EXMC_SDRAM/main.c
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/17_EXMC_SDRAM_DeepSleep/main.c
fix reason:
bug fix
V1.2.0
void cache_enable(void)
{
    /* enable I-Cache */
    SCB_EnableICache();

    /* enable D-Cache */
    SCB_EnableDCache();
}
V2.0.0
static void cache_enable(void)
{
    /* enable I-Cache and D-Cache */
    SCB_EnableICache();
    SCB_EnableDCache();
}

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/16_EXMC_SDRAM/main.c
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/17_EXMC_SDRAM_DeepSleep/main.c
fix reason:
bug fix
V1.2.0
none
V2.0.0
/*!
    \brief      configure the MPU attributes
    \param[in]  none
    \param[out] none
    \retval     none
*/
static void mpu_config(void)
{
    mpu_region_init_struct mpu_init_struct;
    mpu_region_struct_para_init(&mpu_init_struct);

    /* disable the MPU */
    ARM_MPU_Disable();
    ARM_MPU_SetRegion(0, 0);
    
    /* configure the MPU attributes for Reserved, no access */
    mpu_init_struct.region_base_address  = 0x0;
    mpu_init_struct.region_size          = MPU_REGION_SIZE_4GB;
    mpu_init_struct.access_permission    = MPU_AP_NO_ACCESS;
    mpu_init_struct.access_bufferable    = MPU_ACCESS_NON_BUFFERABLE;
    mpu_init_struct.access_cacheable     = MPU_ACCESS_NON_CACHEABLE;
    mpu_init_struct.access_shareable     = MPU_ACCESS_SHAREABLE;
    mpu_init_struct.region_number        = MPU_REGION_NUMBER0;
    mpu_init_struct.subregion_disable    = 0x87;
    mpu_init_struct.instruction_exec     = MPU_INSTRUCTION_EXEC_NOT_PERMIT;
    mpu_init_struct.tex_type             = MPU_TEX_TYPE0;
    mpu_region_config(&mpu_init_struct);
    mpu_region_enable();
    
    /* configure the MPU attributes for SDRAM */
    mpu_init_struct.region_base_address  = 0xC0000000;
    mpu_init_struct.region_size          = MPU_REGION_SIZE_32MB;
    mpu_init_struct.access_permission    = MPU_AP_FULL_ACCESS;
    mpu_init_struct.access_bufferable    = MPU_ACCESS_NON_BUFFERABLE;
    mpu_init_struct.access_cacheable     = MPU_ACCESS_CACHEABLE;
    mpu_init_struct.access_shareable     = MPU_ACCESS_NON_SHAREABLE;
    mpu_init_struct.region_number        = MPU_REGION_NUMBER1;
    mpu_init_struct.subregion_disable    = 0x0;
    mpu_init_struct.instruction_exec     = MPU_INSTRUCTION_EXEC_NOT_PERMIT;
    mpu_init_struct.tex_type             = MPU_TEX_TYPE0;
    mpu_region_config(&mpu_init_struct);
    mpu_region_enable();
    
    /* enable the MPU */
    ARM_MPU_Enable(MPU_MODE_PRIV_DEFAULT);
}
__________________________________________________________________________________________________________________________


______________________OSPI________________________________________________________________________________________________
Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/15_OSPI_Octal_Flash/Soft_Drive/gd25x512me.c
fix reason:
modify the OSPI function pin for gd32h7xx_eval_2.0 board
V1.2.0:
    /* enable OSPIM and GPIO clock */
    rcu_periph_clock_enable(RCU_OSPIM);
    rcu_periph_clock_enable(RCU_GPIOA);
    rcu_periph_clock_enable(RCU_GPIOB);
    rcu_periph_clock_enable(RCU_GPIOC);
    rcu_periph_clock_enable(RCU_GPIOD);
    rcu_periph_clock_enable(RCU_GPIOE);

    /* configure OSPIM GPIO pin:
           OSPIM_P0_IO0(PD11)
           OSPIM_P0_IO1(PC10)
           OSPIM_P0_IO2(PE2)
           OSPIM_P0_IO3(PD13)
           OSPIM_P0_IO4(PD4)
           OSPIM_P0_IO5(PD5)
           OSPIM_P0_IO6(PD6)
           OSPIM_P0_IO7(PD7)
           OSPIM_P0_CLK(PA3)
           OSPIM_P0_NCS(PB10) */

    gpio_af_set(GPIOA, GPIO_AF_12, GPIO_PIN_3);
    gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_3);
    gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_3);

    gpio_af_set(GPIOB, GPIO_AF_9, GPIO_PIN_10);
    gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_10);
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_10);

    gpio_af_set(GPIOC, GPIO_AF_9, GPIO_PIN_10);
    gpio_mode_set(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_10);
    gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_10);

    gpio_af_set(GPIOD, GPIO_AF_10, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
    gpio_mode_set(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
    gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);

    gpio_af_set(GPIOD, GPIO_AF_9, GPIO_PIN_11 | GPIO_PIN_13);
    gpio_mode_set(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_11 | GPIO_PIN_13);
    gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_11 | GPIO_PIN_13);

    gpio_af_set(GPIOE, GPIO_AF_9, GPIO_PIN_2);
    gpio_mode_set(GPIOE, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_2);
    gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_2);

    /* enable SCK, CSN, IO[3:0] and IO[7:4] for OSPIM port0 */
    ospim_port_sck_config(OSPIM_PORT0, OSPIM_PORT_SCK_ENABLE);
    ospim_port_csn_config(OSPIM_PORT0, OSPIM_PORT_CSN_ENABLE);
    ospim_port_io3_0_config(OSPIM_PORT0, OSPIM_IO_LOW_ENABLE);
    ospim_port_io7_4_config(OSPIM_PORT0, OSPIM_IO_HIGH_ENABLE);
V2.0.0:
    /* enable OSPIM and GPIO clock */
    rcu_periph_clock_enable(RCU_OSPIM);
    rcu_periph_clock_enable(RCU_GPIOA);
    rcu_periph_clock_enable(RCU_GPIOB);
    rcu_periph_clock_enable(RCU_GPIOD);

        /* configure OSPIM GPIO pin:
           OSPIM_P0_IO0(PD11) AF9
           OSPIM_P0_IO1(PD12) AF9
           OSPIM_P0_IO2(PA3)  AF6
           OSPIM_P0_IO3(PD13) AF9
           OSPIM_P0_IO4(PD4)  AF10
           OSPIM_P0_IO5(PD5)  AF10
           OSPIM_P0_IO6(PD6)  AF10
           OSPIM_P0_IO7(PD7)  AF10
           OSPIM_P0_CLK(PB2)  AF9
           OSPIM_P0_NCS(PB6)  AF10  */

        gpio_af_set(GPIOB, GPIO_AF_9, GPIO_PIN_2);
        gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_2);
        gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_2);

        gpio_af_set(GPIOA, GPIO_AF_6, GPIO_PIN_3);
        gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_3);
        gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_3);

        gpio_af_set(GPIOD, GPIO_AF_10, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
        gpio_mode_set(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
        gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);

        gpio_af_set(GPIOD, GPIO_AF_9, GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13);
        gpio_mode_set(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13);
        gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13);

        gpio_af_set(GPIOB, GPIO_AF_10, GPIO_PIN_6);
        gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_6);
        gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_100_220MHZ, GPIO_PIN_6);

        /* enable SCK, CSN, IO[3:0] and IO[7:4] for OSPIM port0 */
        ospim_port_sck_config(OSPIM_PORT0, OSPIM_PORT_SCK_ENABLE);
        ospim_port_csn_config(OSPIM_PORT0, OSPIM_PORT_CSN_ENABLE);
        ospim_port_io3_0_config(OSPIM_PORT0, OSPIM_IO_LOW_ENABLE);
        ospim_port_io7_4_config(OSPIM_PORT0, OSPIM_IO_HIGH_ENABLE);
__________________________________________________________________________________________________________________________


______________________SDIO________________________________________________________________________________________________
Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/18_SDIO_SDCardTest/main.c
fix reason:
bug fix
V1.2.0:
void card_info_get(void)
{
    uint8_t sd_spec, sd_spec3, sd_spec4, sd_security;
    uint32_t block_count, block_size;
    uint16_t temp_ccc;
    printf("\r\n Card information:");
    sd_spec = (sd_scr[1] & 0x0F000000) >> 24;
    sd_spec3 = (sd_scr[1] & 0x00008000) >> 15;
    sd_spec4 = (sd_scr[1] & 0x00000400) >> 10;
    if(2 == sd_spec) {
        if(1 == sd_spec3) {
            if(1 == sd_spec4) {
                printf("\r\n## Card version 4.xx ##");
            } else {
                printf("\r\n## Card version 3.0x ##");
            }
        } else {
            printf("\r\n## Card version 2.00 ##");
        }
    } else if(1 == sd_spec) {
        printf("\r\n## Card version 1.10 ##");
    } else if(0 == sd_spec) {
        printf("\r\n## Card version 1.0x ##");
    }

    sd_security = (sd_scr[1] & 0x00700000) >> 20;
    if(2 == sd_security) {
        printf("\r\n## security v1.01 ##");
    } else if(3 == sd_security) {
        printf("\r\n## security v2.00 ##");
    } else if(4 == sd_security) {
        printf("\r\n## security v3.00 ##");
    }

    block_count = (sd_cardinfo.card_csd.c_size + 1) * 1024;
    block_size = 512;
    printf("\r\n## Device size is %dKB ##", sd_card_capacity_get());
    printf("\r\n## Block size is %dB ##", block_size);
    printf("\r\n## Block count is %d ##", block_count);

    if(sd_cardinfo.card_csd.read_bl_partial) {
        printf("\r\n## Partial blocks for read allowed ##");
    }
    if(sd_cardinfo.card_csd.write_bl_partial) {
        printf("\r\n## Partial blocks for write allowed ##");
    }
    temp_ccc = sd_cardinfo.card_csd.ccc;
    printf("\r\n## CardCommandClasses is: %x ##", temp_ccc);
    if((SD_CCC_BLOCK_READ & temp_ccc) && (SD_CCC_BLOCK_WRITE & temp_ccc)) {
        printf("\r\n## Block operation supported ##");
    }
    if(SD_CCC_ERASE & temp_ccc) {
        printf("\r\n## Erase supported ##");
    }
    if(SD_CCC_WRITE_PROTECTION & temp_ccc) {
        printf("\r\n## Write protection supported ##");
    }
    if(SD_CCC_LOCK_CARD & temp_ccc) {
        printf("\r\n## Lock unlock supported ##");
    }
    if(SD_CCC_APPLICATION_SPECIFIC & temp_ccc) {
        printf("\r\n## Application specific supported ##");
    }
    if(SD_CCC_IO_MODE & temp_ccc) {
        printf("\r\n## I/O mode supported ##");
    }
    if(SD_CCC_SWITCH & temp_ccc) {
        printf("\r\n## Switch function supported ##");
    }
}
V2.0.0:
void card_info_get(void)
{
    uint8_t sd_spec, sd_spec3, sd_spec4, sd_security;
    uint32_t block_count, block_size, sd_capacity;
    uint16_t temp_ccc;
    printf("\r\n Card information:");
    sd_spec = (sd_scr[1] & 0x0F000000) >> 24;
    sd_spec3 = (sd_scr[1] & 0x00008000) >> 15;
    sd_spec4 = (sd_scr[1] & 0x00000400) >> 10;
    if(2 == sd_spec) {
        if(1 == sd_spec3) {
            if(1 == sd_spec4) {
                printf("\r\n## Card version 4.xx ##");
            } else {
                printf("\r\n## Card version 3.0x ##");
            }
        } else {
            printf("\r\n## Card version 2.00 ##");
        }
    } else if(1 == sd_spec) {
        printf("\r\n## Card version 1.10 ##");
    } else if(0 == sd_spec) {
        printf("\r\n## Card version 1.0x ##");
    }

    sd_security = (sd_scr[1] & 0x00700000) >> 20;
    if(2 == sd_security) {
        printf("\r\n## security v1.01 ##");
    } else if(3 == sd_security) {
        printf("\r\n## security v2.00 ##");
    } else if(4 == sd_security) {
        printf("\r\n## security v3.00 ##");
    }

    block_size = 512U;
    sd_capacity = sd_card_capacity_get();
    block_count = sd_capacity * 2U;
    printf("\r\n## Device size is %dKB ##", sd_capacity);
    printf("\r\n## Block size is %dB ##", block_size);
    printf("\r\n## Block count is %d ##", block_count);

    if(sd_cardinfo.card_csd.read_bl_partial) {
        printf("\r\n## Partial blocks for read allowed ##");
    }
    if(sd_cardinfo.card_csd.write_bl_partial) {
        printf("\r\n## Partial blocks for write allowed ##");
    }
    temp_ccc = sd_cardinfo.card_csd.ccc;
    printf("\r\n## CardCommandClasses is: %x ##", temp_ccc);
    if((SD_CCC_BLOCK_READ & temp_ccc) && (SD_CCC_BLOCK_WRITE & temp_ccc)) {
        printf("\r\n## Block operation supported ##");
    }
    if(SD_CCC_ERASE & temp_ccc) {
        printf("\r\n## Erase supported ##");
    }
    if(SD_CCC_WRITE_PROTECTION & temp_ccc) {
        printf("\r\n## Write protection supported ##");
    }
    if(SD_CCC_LOCK_CARD & temp_ccc) {
        printf("\r\n## Lock unlock supported ##");
    }
    if(SD_CCC_APPLICATION_SPECIFIC & temp_ccc) {
        printf("\r\n## Application specific supported ##");
    }
    if(SD_CCC_IO_MODE & temp_ccc) {
        printf("\r\n## I/O mode supported ##");
    }
    if(SD_CCC_SWITCH & temp_ccc) {
        printf("\r\n## Switch function supported ##");
    }
}
__________________________________________________________________________________________________________________________

__________________________________________________________________________________________________________________________

______________________TLI_________________________________________________________________________________________________
Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/24_TLI_IPA/main.c
fix reason:
bug fix
V1.2.0
    gpio_af_set(GPIOE, GPIO_AF_14, GPIO_PIN_15);
V1.2.0
    gpio_af_set(GPIOE, GPIO_AF_10, GPIO_PIN_15);

__________________________________________________________________________________________________________________________

__________________________________________________________________________________________________________________________

_____________________USBFS________________________________________________________________________________________________
Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/28_USB_Host/Host_HID/inc/usb_conf.h
fix reason:
bug fix
V1.2.0:
#define USB_SOF_OUTPUT                        1U
V2.0.0:
#define USB_SOF_OUTPUT                        0U

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/28_USB_Host/Host_HID/inc/gd32h7xx_it.c
fix reason:
bug fix
V1.2.0:
none
V2.0.0:
#if USB_LOW_POWER

/*!
    \brief      this function handles external line 0 interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void EXTI0_IRQHandler(void)
{
    if(RESET != exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE)) {
        if(1U == usb_host_hid.suspend_flag) {
            usb_host_hid.suspend_flag = 0U;
            usb_host_hid.wakeup_mode = GENERAL_WAKEUP; /* general wakeup mode */

            /* configure system clock */
            resume_mcu_clk();

            usb_rcu_config();

#ifdef USE_USB_HS
    #ifdef USE_USBHS0
        pllusb_rcu_config(USBHS0);
    #elif defined USE_USBHS1
        pllusb_rcu_config(USBHS1);
    #else
    #endif
#endif /* USE_USB_HS */
        }

        /* clear the EXTI line pending bit */
        exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE);
    }
}

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/27_USB_Device/CDC_ACM/src/gd32h7xx_usb_hw.c
fix reason:
bug fix
V1.2.0:
#include "drv_usb_regs.h"
V2.0.0
none

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/27_USB_Device/CDC_ACM/src/gd32h7xx_usb_hw.c
fix reason:
bug fix
V1.2.0:
#ifdef USE_ULPI_PHY
    rcu_periph_clock_enable(RCU_ULPI);
#endif /* USE_ULPI_PHY */
V2.0.0
#ifdef USE_ULPI_PHY
#ifdef USE_USBHS0
    rcu_periph_clock_enable(RCU_USBHS0ULPI);
#endif

#ifdef USE_USBHS1
    rcu_periph_clock_enable(RCU_USBHS1ULPI);
#endif
#endif /* USE_ULPI_PHY */

#ifdef USE_ULPI_PHY
#ifdef USE_USBHS0
    rcu_periph_clock_enable(RCU_USBHS0ULPI);
#endif

#ifdef USE_USBHS1
    rcu_periph_clock_enable(RCU_USBHS1ULPI);
#endif
#endif /* USE_ULPI_PHY */

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/27_USB_Device/HID_Keyboard/src/gd32h7xx_it.c
fix reason:
bug fix
V1.2.0:
    \brief      this function handles SysTick exception
    \param[in]  none
    \param[out] none
    \retval     none
*/
void SysTick_Handler(void)
{
}

/*!
    \brief      this function handles USBHS interrupt
    \param[in]  none
    \param[out] none
    \retval     none
*/
#ifdef USE_USBHS0

void USBHS0_IRQHandler (void)
{
    usbd_isr (&hid_keyboard);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1

void USBHS1_IRQHandler (void)
{
    usbd_isr (&hid_keyboard);
}

#endif /* USE_USBHS1 */

/*!
    \brief      this function handles EXTI0_IRQ Handler
    \param[in]  none
    \param[out] none
    \retval     none
*/
void EXTI0_IRQHandler(void)
{
    if (exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE) != RESET) {
        if (hid_keyboard.dev.pm.dev_remote_wakeup) {
            resume_mcu_clk();

            #ifndef USE_IRC48M
                rcu_usb48m_clock_config(IDX_USBHS0, RCU_USB48MSRC_PLL0R);
            #else
                /* enable IRC48M clock */
                rcu_osci_on(RCU_IRC48M);

                /* wait till IRC48M is ready */
                while (SUCCESS != rcu_osci_stab_wait(RCU_IRC48M)) {
                }

                rcu_ck48m_clock_config(RCU_CK48MSRC_IRC48M);
            #endif /* USE_IRC48M */

            rcu_periph_clock_enable(RCU_USBHS0);

            usb_clock_active(&hid_keyboard);

            usb_rwkup_set(&hid_keyboard);

            /* add delay time */
            for(__IO uint16_t i = 0; i < 1000; i++){
                for(__IO uint16_t i = 0; i < 200; i++);
            }

            usb_rwkup_reset(&hid_keyboard);

            hid_keyboard.dev.cur_status = hid_keyboard.dev.backup_status;

            hid_keyboard.dev.pm.dev_remote_wakeup = 0U;
        }

        /* clear the EXTI line pending bit */
        exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE);
    }
}

/*!
    \brief      this function handles USBHS wakeup interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
#ifdef USE_USBHS0

void USBHS0_WKUP_IRQHandler(void)
{
    if (hid_keyboard.bp.low_power) {
        resume_mcu_clk();

        rcu_periph_clock_enable(RCU_USBHS0);

        #ifndef USE_IRC48M
           rcu_usb48m_clock_config(IDX_USBHS0, RCU_USB48MSRC_PLL0R);
        #else
            /* enable IRC48M clock */
            rcu_osci_on(RCU_IRC48M);

            /* wait till IRC48M is ready */
            while (SUCCESS != rcu_osci_stab_wait(RCU_IRC48M)) {
            }

            rcu_ck48m_clock_config(RCU_CK48MSRC_IRC48M);
        #endif /* USE_IRC48M */

        rcu_periph_clock_enable(RCU_USBHS0);

        usb_clock_active(&hid_keyboard);
    }

    exti_interrupt_flag_clear(EXTI_31);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1

void USBHS1_WKUP_IRQHandler(void)
{
    if (hid_keyboard.bp.low_power) {
        resume_mcu_clk();

        #ifndef USE_IRC48M
            rcu_usb48m_clock_config(IDX_USBHS0, RCU_USB48MSRC_PLL0R);
        #else
            /* enable IRC48M clock */
            rcu_osci_on(RCU_IRC48M);

            /* wait till IRC48M is ready */
            while (SUCCESS != rcu_osci_stab_wait(RCU_IRC48M)) {
            }

            rcu_ck48m_clock_config(RCU_CK48MSRC_IRC48M);
        #endif /* USE_IRC48M */

        rcu_periph_clock_enable(RCU_USBHS1);

        usb_clock_active(&hid_keyboard);
    }

    exti_interrupt_flag_clear(EXTI_32);
}

#endif /* USE_USBHS1 */

#ifdef USB_DEDICATED_EP1_ENABLED

/*!
    \brief      this function handles USB dedicated endpoint 1 OUT interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
#ifdef USE_USBHS0

void USBHS0_EP1_OUT_IRQHandler (void)
{
    usbd_int_dedicated_ep1out(&hid_keyboard);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1

void USBHS1_EP1_OUT_IRQHandler (void)
{
    usbd_int_dedicated_ep1out(&hid_keyboard);
}

#endif /* USE_USBHS1 */

/*!
    \brief      this function handles USB dedicated endpoint 1 IN interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
#ifdef USE_USBHS0

void USBHS0_EP1_IN_IRQHandler (void)
{
    usbd_int_dedicated_ep1in(&hid_keyboard);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1

void USBHS1_EP1_IN_IRQHandler (void)
{
    usbd_int_dedicated_ep1in(&hid_keyboard);
}

#endif /* USE_USBHS1 */

#endif /* USB_DEDICATED_EP1_ENABLED */

/*!
    \brief      this function handles Timer2 update interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void TIMER2_IRQHandler(void)
{
    usb_timer_irq();
}
V2.0.0
    \brief      this function handles EXTI0_IRQ Handler
    \param[in]  none
    \param[out] none
    \retval     none
*/
void EXTI0_IRQHandler(void)
{
    if (exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE) != RESET) {
        if (hid_keyboard.dev.pm.dev_remote_wakeup) {
            resume_mcu_clk();

            #ifndef USE_IRC48M
                rcu_usb48m_clock_config(IDX_USBHS0, RCU_USB48MSRC_PLL0R);
            #else
                /* enable IRC48M clock */
                rcu_osci_on(RCU_IRC48M);

                /* wait till IRC48M is ready */
                while(SUCCESS != rcu_osci_stab_wait(RCU_IRC48M)) {
                }

                rcu_ck48m_clock_config(RCU_CK48MSRC_IRC48M);
            #endif /* USE_IRC48M */

            rcu_periph_clock_enable(RCU_USBHS0);

            usb_clock_active(&hid_keyboard);

            usb_rwkup_set(&hid_keyboard);

            /* add delay time */
            for(__IO uint16_t i = 0; i < 1000; i++){
                for(__IO uint16_t i = 0; i < 200; i++);
            }

            usb_rwkup_reset(&hid_keyboard);

            hid_keyboard.dev.cur_status = hid_keyboard.dev.backup_status;

            hid_keyboard.dev.pm.dev_remote_wakeup = 0U;
        }

        /* clear the EXTI line pending bit */
        exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE);
    }
}

/*!
    \brief      this function handles Timer2 update interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void TIMER2_IRQHandler(void)
{
    usb_timer_irq();
}

#ifdef USE_USBHS0
/*!
    \brief      this function handles USBHS0 interrupt
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS0_IRQHandler(void)
{
    usbd_isr(&hid_keyboard);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1
/*!
    \brief      this function handles USBHS1 interrupt
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS1_IRQHandler(void)
{
    usbd_isr(&hid_keyboard);
}

#endif /* USE_USBHS1 */

#ifdef USE_USBHS0
/*!
    \brief      this function handles USBHS0 wakeup interrupt request
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS0_WKUP_IRQHandler(void)
{
    if(hid_keyboard.bp.low_power) {
        resume_mcu_clk();

        rcu_periph_clock_enable(RCU_USBHS0);

        #ifndef USE_IRC48M
           rcu_usb48m_clock_config(IDX_USBHS0, RCU_USB48MSRC_PLL0R);
        #else
            /* enable IRC48M clock */
            rcu_osci_on(RCU_IRC48M);

            /* wait till IRC48M is ready */
            while(SUCCESS != rcu_osci_stab_wait(RCU_IRC48M)) {
            }

            rcu_ck48m_clock_config(RCU_CK48MSRC_IRC48M);
        #endif /* USE_IRC48M */

        usb_clock_active(&hid_keyboard);
    }

    exti_interrupt_flag_clear(EXTI_31);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1
/*!
    \brief      this function handles USBHS1 wakeup interrupt request
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS1_WKUP_IRQHandler(void)
{
    if(hid_keyboard.bp.low_power) {
        resume_mcu_clk();

        #ifndef USE_IRC48M
            rcu_usb48m_clock_config(IDX_USBHS0, RCU_USB48MSRC_PLL0R);
        #else
            /* enable IRC48M clock */
            rcu_osci_on(RCU_IRC48M);

            /* wait till IRC48M is ready */
            while(SUCCESS != rcu_osci_stab_wait(RCU_IRC48M)) {
            }

            rcu_ck48m_clock_config(RCU_CK48MSRC_IRC48M);
        #endif /* USE_IRC48M */

        rcu_periph_clock_enable(RCU_USBHS1);

        usb_clock_active(&hid_keyboard);
    }

    exti_interrupt_flag_clear(EXTI_32);
}

#endif /* USE_USBHS1 */

#ifdef USB_DEDICATED_EP1_ENABLED

#ifdef USE_USBHS0
/*!
    \brief      this function handles USBHS0 dedicated endpoint 1 OUT interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS0_EP1_OUT_IRQHandler(void)
{
    usbd_int_dedicated_ep1out(&hid_keyboard);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1
/*!
    \brief      this function handles USBHS1 dedicated endpoint 1 OUT interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS1_EP1_OUT_IRQHandler(void)
{
    usbd_int_dedicated_ep1out(&hid_keyboard);
}

#endif /* USE_USBHS1 */

#ifdef USE_USBHS0
/*!
    \brief      this function handles USBHS0 dedicated endpoint 1 IN interrupt request
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS0_EP1_IN_IRQHandler(void)
{
    usbd_int_dedicated_ep1in(&hid_keyboard);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1
/*!
    \brief      this function handles USBHS1 dedicated endpoint 1 IN interrupt request
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS1_EP1_IN_IRQHandler(void)
{
    usbd_int_dedicated_ep1in(&hid_keyboard);
}

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/28_USB_Host/Host_HID/src/gd32h7xx_it.c
fix reason:
bug fix
V1.2.0:
/*!
    \brief      this function handles USBHS interrupt
    \param[in]  none
    \param[out] none
    \retval     none
*/
#ifdef USE_USBHS0

void USBHS0_IRQHandler (void)
{
    usbh_isr (&hid_host_core);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1

void USBHS1_IRQHandler (void)
{
    usbh_isr (&hid_host_core);
}

#endif /* USE_USBHS1 */

#if USB_LOW_POWER

/*!
    \brief      this function handles external line 0 interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void EXTI0_IRQHandler(void)
{
    if (RESET != exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE)) {
        if (1U == usb_host_hid.suspend_flag) {
            usb_host_hid.suspend_flag = 0;
            usb_host_hid.wakeup_mode = 1; /* general wakeup mode */

            /* configure system clock */
            resume_mcu_clk();

            usb_rcu_config();

#ifdef USE_USB_HS
    #ifdef USE_USBHS0
        pllusb_rcu_config(USBHS0);
    #elif defined USE_USBHS1
        pllusb_rcu_config(USBHS1);
    #else
    #endif
#endif /* USE_USB_HS */
        }

        /* clear the EXTI line pending bit */
        exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE);
    }
}

#endif /* USB_LOW_POWER */

/*!
    \brief      this function handles USBHS wakeup interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
#ifdef USE_USBHS0

void USBHS0_WKUP_IRQHandler(void)
{
    if (1U == usb_host_hid.suspend_flag) {
        usb_host_hid.suspend_flag = 0;

        /* configure system clock */
        resume_mcu_clk();

        usb_rcu_config();

        usb_host_hid.wakeup_mode = 2; /* remote wakeup mode */

#ifdef USE_USB_HS
            /* configure usb clock */
            pllusb_rcu_config(USBHS0);
#endif /* USE_USB_HS */
    }

    exti_interrupt_flag_clear(EXTI_31);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1

void USBHS1_WKUP_IRQHandler(void)
{
    if (1U == usb_host_hid.suspend_flag) {
        usb_host_hid.suspend_flag = 0;
        usb_host_hid.wakeup_mode = 2; /* remote wakeup mode */

        /* configure system clock */
        resume_mcu_clk();

        usb_rcu_config();

#ifdef USE_USB_HS
            /* configure usb clock */
            pllusb_rcu_config(USBHS1);
#endif /* USE_USB_HS */
    }

    exti_interrupt_flag_clear(EXTI_32);
}

#endif /* USE_USBHS1 */

/*!
    \brief      this function handles Timer2 update interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void TIMER2_IRQHandler(void)
{
    usb_timer_irq();
}
V2.0.0：
/*!
    \brief      this function handles Timer2 update interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void TIMER2_IRQHandler(void)
{
    usb_timer_irq();
}

#ifdef USE_USBHS0
/*!
    \brief      this function handles USBHS0 interrupt
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS0_IRQHandler(void)
{
    usbh_isr(&hid_host_core);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1
/*!
    \brief      this function handles USBHS1 interrupt
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS1_IRQHandler(void)
{
    usbh_isr(&hid_host_core);
}

#endif /* USE_USBHS1 */

#ifdef USE_USBHS0
/*!
    \brief      this function handles USBHS0 wakeup interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS0_WKUP_IRQHandler(void)
{
    if(1U == usb_host_hid.suspend_flag) {
        usb_host_hid.suspend_flag = 0U;

        /* configure system clock */
        resume_mcu_clk();

        usb_rcu_config();

        usb_host_hid.wakeup_mode = REMOTE_WAKEUP; /* remote wakeup mode */

#ifdef USE_USB_HS
        /* configure usb clock */
        pllusb_rcu_config(USBHS0);
#endif /* USE_USB_HS */
    }

    exti_interrupt_flag_clear(EXTI_31);
}

#endif /* USE_USBHS0 */

#ifdef USE_USBHS1
/*!
    \brief      this function handles USBHS1 wakeup interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void USBHS1_WKUP_IRQHandler(void)
{
    if(1U == usb_host_hid.suspend_flag) {
        usb_host_hid.suspend_flag = 0U;
        usb_host_hid.wakeup_mode = REMOTE_WAKEUP; /* remote wakeup mode */

        /* configure system clock */
        resume_mcu_clk();

        usb_rcu_config();

#ifdef USE_USB_HS
        /* configure usb clock */
        pllusb_rcu_config(USBHS1);
#endif /* USE_USB_HS */
    }

    exti_interrupt_flag_clear(EXTI_32);
}

#endif /* USE_USBHS1 */

#if USB_LOW_POWER

/*!
    \brief      this function handles external line 0 interrupt request.
    \param[in]  none
    \param[out] none
    \retval     none
*/
void EXTI0_IRQHandler(void)
{
    if(RESET != exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE)) {
        if(1U == usb_host_hid.suspend_flag) {
            usb_host_hid.suspend_flag = 0U;
            usb_host_hid.wakeup_mode = GENERAL_WAKEUP; /* general wakeup mode */

            /* configure system clock */
            resume_mcu_clk();

            usb_rcu_config();

#ifdef USE_USB_HS
    #ifdef USE_USBHS0
        pllusb_rcu_config(USBHS0);
    #elif defined USE_USBHS1
        pllusb_rcu_config(USBHS1);
    #else
    #endif
#endif /* USE_USB_HS */
        }

        /* clear the EXTI line pending bit */
        exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE);
    }
}

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/28_USB_Host/Host_HID/src/usbh_usr.c
fix reason:
bug fix
V1.2.0:
#include "usbh_usr.h"
#include "usbh_hid_core.h"
#include "usbh_hid_mouse.h"
V2.0.0
#include "usbh_usr.h"
#include "usbh_hid_core.h"
#include "usbh_standard_hid.h"

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/28_USB_Host/Host_HID/src/usbh_usr.c
fix reason:
bug fix
V1.2.0:
void usbh_user_configuration_descavailable(usb_desc_config *cfg_desc,
                                           usb_desc_itf *itf_desc,
                                           usb_desc_ep *ep_desc)
{
    usb_desc_itf *id = itf_desc;

    if (0x08U == (*id).bInterfaceClass) {
        LCD_UsrLog("> Mass storage device connected.\r\n");
    } else if (0x03U == (*id).bInterfaceClass) {
        LCD_UsrLog("> HID device connected.\r\n");
    }
}
V2.0.0
void usbh_user_configuration_descavailable(usb_desc_config *cfg_desc, \
                                           usb_desc_itf *itf_desc, \
                                           usb_desc_ep *ep_desc)
{
    usb_desc_itf *id = itf_desc;

    if(0x08U == (*id).bInterfaceClass) {
        LCD_UsrLog("> Mass storage device connected.\r\n");
    } else if(0x03U == (*id).bInterfaceClass) {
        LCD_UsrLog("> HID device connected.\r\n");
    } else {
        LCD_UsrLog("> Unknown device connected.\r\n");
    }
}

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/28_USB_Host/Host_HID/src/usbh_usr.c
fix reason:
bug fix
V1.2.0:
usbh_user_status usbh_user_userinput(void)
{
    usbh_user_status usbh_usr_status = USBH_USER_NO_RESP;

#if USB_LOW_POWER
    gd_eval_key_init(KEY_WAKEUP, KEY_MODE_EXTI);

    if (usb_host_hid.suspend_flag){
        LCD_UsrLog("\n> Pls press Tamper key to make the USB host enter the suspended state.\n");
        LCD_UsrLog("\n> To wake up the USB host, pls press WAKEUP key (General wakeup).\n");

        if(usb_host_hid.dev_supp_remote_wkup){
            LCD_UsrLog("> Or operate device (Remote wakeup).\n");
        }

        /* wait for Tamper key pressed */
        while(SET == gd_eval_key_state_get(KEY_TAMPER));
    } else {
        if (usb_host_hid.wakeup_mode == 1) {
            usb_host_hid.wakeup_mode = 0;
            LCD_UsrLog("> General wakeup success.\r\n");
        } else if (usb_host_hid.wakeup_mode == 2) {
            usb_host_hid.wakeup_mode = 0;
            LCD_UsrLog("> Remote wakeup success.\r\n");
        } else {
        }
    }

#ifdef USE_LCD
    lcd_text_color_set(LCD_COLOR_RED);
    lcd_vertical_string_display(LCD_HINT_LINE0, 0, (uint8_t *)"---------------------------------------");
    lcd_text_color_set(LCD_COLOR_GREEN);
    lcd_vertical_string_display(LCD_HINT_LINE1, 0, (uint8_t *)"To start the HID class operations:  ");
    lcd_vertical_string_display(LCD_HINT_LINE2, 0, (uint8_t *)"Press User Key...             ");
#endif /* USE_LCD */

#endif /* USB_LOW_POWER */

    /*Key Tamper is in polling mode to detect user action */
    if(RESET == gd_eval_key_state_get(KEY_TAMPER)){
        usbh_usr_status = USBH_USER_RESP_OK;
    }

    return usbh_usr_status;
}
V2.0.0
usbh_user_status usbh_user_userinput(void)
{
    usbh_user_status usbh_usr_status = USR_IN_NO_RESP;

#if USB_LOW_POWER
    gd_eval_key_init(KEY_WAKEUP, KEY_MODE_EXTI);

    if(usb_host_hid.suspend_flag) {
        LCD_UsrLog("\n> Pls press Tamper key to make the USB host enter the suspended state.\n");
        LCD_UsrLog("\n> To wake up the USB host, pls press WAKEUP key (General wakeup).\n");

        if(usb_host_hid.dev_supp_remote_wkup) {
            LCD_UsrLog("> Or operate device (Remote wakeup).\n");
        }

        /* wait for Tamper key pressed */
        while(SET == gd_eval_key_state_get(KEY_TAMPER));
    } else {
        if(GENERAL_WAKEUP == usb_host_hid.wakeup_mode) {
            usb_host_hid.wakeup_mode = NORMAL_WORK;
            LCD_UsrLog("> General wakeup success.\r\n");
        } else if(REMOTE_WAKEUP == usb_host_hid.wakeup_mode) {
            usb_host_hid.wakeup_mode = NORMAL_WORK;
            LCD_UsrLog("> Remote wakeup success.\r\n");
        } else {
        }
    }

#ifdef USE_LCD
    lcd_text_color_set(LCD_COLOR_RED);
    lcd_vertical_string_display(LCD_HINT_LINE0, 0, (uint8_t *)"---------------------------------------");
    lcd_text_color_set(LCD_COLOR_GREEN);
    lcd_vertical_string_display(LCD_HINT_LINE1, 0, (uint8_t *)"To start the HID class operations:  ");
    lcd_vertical_string_display(LCD_HINT_LINE2, 0, (uint8_t *)"Press User Key...             ");
#endif /* USE_LCD */

#endif /* USB_LOW_POWER */

    /*Key Tamper is in polling mode to detect user action */
    if(RESET == gd_eval_key_state_get(KEY_TAMPER)){
        usbh_usr_status = USR_IN_RESP_OK;
    }

    return usbh_usr_status;
}

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/28_USB_Host/Host_HID/src/usbh_usr.c
fix reason:
bug fix
V1.2.0:
#include <string.h>
#include "usbh_usr.h"
#include "drv_usb_hw.h"
#include "usbh_msc_core.h"
#include "usbh_msc_scsi.h"
#include "usbh_msc_bbb.h"
#include "ff.h"
V2.0.0
#include "usbh_usr.h"
#include "drv_usb_hw.h"
#include "usbh_msc_core.h"
#include "ff.h"

#include <string.h>

Fix file:
../GD32H7xx_Demo_Suites/GD32H759I_EVAL_Demo_Suites/Projects/28_USB_Host/Host_HID/src/usbh_usr.c
fix reason:
bug fix
V1.2.0:
        gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO);
        gd_eval_key_init(KEY_WAKEUP, KEY_MODE_GPIO);
        gd_eval_key_init(KEY_USER, KEY_MODE_GPIO);

#endif /* USE_ULPI_PHY */
        gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO);
        gd_eval_key_init(KEY_WAKEUP, KEY_MODE_GPIO);
none
__________________________________________________________________________________________________________________________

