春风知意 发表于 2022-12-1 16:14

N32G45XVL重映射IO口问题

我把PA13和PA14重映射成了普通IO口,导致没办法烧写程序了,板子是N32G45XV,麻烦帮我看下该如何解决,谢谢

春风知意 发表于 2022-12-1 16:15

重映射部分用的例程代码
void JTAGPortInit(void)
{
    GPIO_InitType GPIO_InitStructure;

    RCC_EnableAPB2PeriphClk(RCC_APB2_PERIPH_AFIO | RCC_APB2_PERIPH_GPIOA | RCC_APB2_PERIPH_GPIOB, ENABLE);
    // Configure PA.13 (JTMS/SWDAT), PA.14 (JTCK/SWCLK) and PA.15 (JTDI) as
    output push-pull
    GPIO_InitStructure.Pin      = GPIO_PIN_13; //| GPIO_PIN_14;                        TX
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_InitStructure.GPIO_Mode= GPIO_Mode_Out_PP;
    GPIO_InitPeripheral(GPIOA, &GPIO_InitStructure);
               
        //
                GPIO_InitStructure.Pin       = GPIO_PIN_14;
                GPIO_InitStructure.GPIO_Mode =         GPIO_Mode_IN_FLOATING;//GPIO_Mode_IPU;
    GPIO_InitPeripheral(USARTx_GPIO, &GPIO_InitStructure);                //初始化       
       
       
       RCC_EnableAPB2PeriphClk(RCC_APB2_PERIPH_AFIO, ENABLE);
   //Disable the Serial Wire and JTAG Debug Port SWJ-DP
                GPIO_ConfigPinRemap(GPIO_RMP_SW_JTAG_DISABLE, ENABLE);

}

sy12138 发表于 2022-12-2 11:46

把boot脚拉高,然后复位下载
页: [1]
查看完整版本: N32G45XVL重映射IO口问题