stm32f103转到ch32f203的时候,是不是所有的.h文件,所有的.c文件,都要替换掉?

stm32f103转到ch32f203的时候,是不是所有的系统的.h文件,所有的系统的.c文件,都要替换掉?从代码到目录?

include paths也得重新定义?


hardware\Base.c(473): error:  #20: identifier "SysTick_CTRL_CLKSOURCE" is undefined

      SysTick->CTRL &= ~SysTick_CTRL_CLKSOURCE;           //CLK come from HCLK/8

hardware\Base.c(474): error:  #20: identifier "SysTick_CTRL_ENABLE" is undefined

      SysTick->CTRL |= SysTick_CTRL_ENABLE;

hardware\Base.c(491): error:  #20: identifier "SysTick_CTRL_CLKSOURCE" is undefined

      SysTick-> CTRL &= ~SysTick_CTRL_CLKSOURCE;

hardware\Base.c(492): error:  #20: identifier "SysTick_CTRL_ENABLE" is undefined

      SysTick->CTRL |= SysTick_CTRL_ENABLE;

hardware\Base.c(509): error:  #20: identifier "SysTick_CTRL_CLKSOURCE" is undefined

      SysTick-> CTRL &= ~SysTick_CTRL_CLKSOURCE;

hardware\Base.c(510): error:  #20: identifier "SysTick_CTRL_ENABLE" is undefined

      SysTick->CTRL |= SysTick_CTRL_ENABLE;

hardware\Base.c(540): error:  #136: struct ""  has no field "SR"

      do{} while ((IWDG->SR & 0x0003) != 0);

hardware\Base.c(541): error:  #136: struct ""  has no field "KR"

  IWDG->KR = IWDG_WriteAccess_Enable;     //0x5555;//使能对IWDG->PR和IWDG->RLR的写   

hardware\Base.c(542): error:  #136: struct ""  has no field "PR"

    IWDG->PR = prer;                        //LSI/32=(40Khz/(4*2^pre))*PLR    

hardware\Base.c(543): error:  #136: struct ""  has no field "RLR"

    IWDG->RLR = rlr;                        //从加载寄存器 IWDG->RLR  

hardware\Base.c(544): error:  #136: struct ""  has no field "KR"

  IWDG->KR = 0xAAAA;                      //reload   

hardware\Base.c: 0 warnings, 11 errors

compiling main.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

user\main.c: 0 warnings, 1 error

compiling usb_desc.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

hardware\hid\usb_desc.c: 0 warnings, 1 error

compiling usb_endp.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

hardware\hid\usb_endp.c: 0 warnings, 1 error

compiling usb_prop.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

hardware\hid\usb_prop.c: 0 warnings, 1 error

compiling usb_pwr.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

hardware\hid\usb_pwr.c: 0 warnings, 1 error

compiling usb_istr.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

hardware\hid\usb_istr.c: 0 warnings, 1 error

compiling hw_config.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

hardware\hid\hw_config.c: 0 warnings, 1 error

compiling usb_core.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

LIB\src\usbsrc\usb_core.c: 0 warnings, 1 error

compiling usb_init.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

LIB\src\usbsrc\usb_init.c: 0 warnings, 1 error

compiling usb_int.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

LIB\src\usbsrc\usb_int.c: 0 warnings, 1 error

compiling usb_mem.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

LIB\src\usbsrc\usb_mem.c: 0 warnings, 1 error

compiling usb_regs.c...

.\LIB\inc\usbinc\usb_type.h(13): error:  #5: cannot open source input file "debug.h": No such file or directory

  #include "debug.h"

LIB\src\usbsrc\usb_regs.c: 0 warnings, 1 error

".\output\stm32.axf" - 24 Error(s), 0 Warning(s).

Target not created.

Build Time Elapsed:  00:00:06



您好,具体需要根据你用到的外设来看。若你是新开发一个项目,建议你在我们EVT例程的基础上进行开发,若你打算用之前的工程,具体需要根据你用到外设来做改动,某些外设一致,可以不用修改,可直接下载使用;有些外设存在差异,需要你对标准库进行一些移植修改,具体可参考附件FAQ手册,若改动较多,建议你直接在我们EVT工程的基础上进行一个移植,移植改动时需要注意我们寄存器的名称和ST有所不同,我看你的报错可能就是寄存器名称不同以及路径不正确导致的,关于寄存器的写法,具体可参考CH32F203应用手册的寄存器介绍。后面若有问题,可通过邮箱和我沟通(lzs@wch.cn)

CH32F203 应用手册:https://www.wch.cn/downloads/CH32FV2x_V3xRM_PDF.html?

CH32F203 EVT:https://www.wch.cn/downloads/CH32F20xEVT_ZIP.html?

icon_pdf.gifCH32F203 FAQ.PDF



只有登录才能回复,可以选择微信账号登录