proteus 与 keil 联调

proteus 与 keil 联调

参考 https://blog.csdn.net/baibai_csdn/article/details/108837311

参考 https://blog.csdn.net/qq_40877663/article/details/92797343

下载 http://www.keil.com/files/uc51/c51v959.EXE

下载 http://www.keil.com/files/eval/MDK518.EXE

下载 http://downloads.labcenter.co.uk/vdmagdi.exe

下载 https://blog-assets.oss-cn-shanghai.aliyuncs.com/5392/a18fa67e67a455b713a69cadb7a82fad2b1e0aad.pdf

 

即使不使用以上所说的参数设置,依然可以实现正确的串口通信,无乱码。ISP的波特率设置在仿真中并不是取决于编写的代码,而是取决于STM32芯片的外部晶振频率参数设置。对于STM32F401芯片,ISP的波特率在数值上应该要等于STM32F401的外部晶振频率的4800倍,即403200/84 = 4800;而对于STM32F103芯片,这个比值变为1200,即86400/72 = 1200

代码设置的波特率必须是9600,否则,仿真会报错,另外,本文只针对标准库编程,HAL库编程按代码里设定的波特率设置即可。

在用proteus 仿真 stm32f103c6串口时,发现stm32主频不能超过55MHz,参见proteus的 sample project,我把倍频系数设为6,同时仿真主频需设为倍频系数*8M(晶振频率),串口波特率不受限制。

proteus仿真串口前必读事项
1、    proteus Virtual Terminal 串口波特率没有限制(推荐9600;)
2、    但对于倍频系数 RCC_PLLMul_*,*的取值似乎只能是6以下,否则Virtual Terminal显示乱码。
在sys.c中设置(洋桃电子例程;野火似乎没把设置RCC频率程序单列出来)
/*设置PLL时钟源及倍频系数*/   
        RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_5); //RCC_PLLMul_x(枚举2~16)是倍频值。当HSE=8MHZ,RCC_PLLMul_9时PLLCLK=72MHZ   
3、    双击proteus原理图中stm32元件,载入*.elf文件时,弹出如图2的窗口,频率必须设为8MHz* RCC_PLLMul_*,其中*<=6, 8MHz为stm32f103c6的外接晶振频率(proteus仿真库没有stm32f103c8)

 

 

Proteus 系统设置

 

D:\Keil_v5\TOOLS.INI ( 红色为 vdmagdi 增加的内容  )

[UV2]
ORGANIZATION="lsgxeva"
NAME="eva", "lsgx"
EMAIL="admin@lsgxeva.com"
ARMSEL=1
USERTE=1
TOOL_VARIANT=mdk_std
RTEPATH="D:\Keil_v5\ARM\PACK"
[ARM]
PATH="D:\Keil_v5\ARM\"
VERSION=5.18
PATH1="C:\GNU Tools ARM Embedded\4.9 2015q2\"
TOOLPREFIX=arm-none-eabi-
CPUDLL0=SARM.DLL(TDRV0,TDRV4,TDRV5,TDRV8,TDRV15)                                                          # Drivers for ARM7/9 devices
CPUDLL1=SARMCM3.DLL(TDRV1,TDRV2,TDRV3,TDRV4,TDRV6,TDRV7,TDRV9,TDRV10,TDRV11,TDRV12,TDRV13,TDRV14,TDRV15)  # Drivers for Cortex-M devices
CPUDLL2=SARMCR4.DLL(TDRV6,TDRV15)                                                                         # Drivers for Cortex-R4 devices
BOOK0=HLP\RELEASE_NOTES.HTM("Release Notes",GEN)
BOOK1=HLP\ARMTOOLS.chm("Complete User's Guide Selection",C)
TDRV0=BIN\UL2ARM.DLL("ULINK2/ME ARM Debugger")
TDRV1=BIN\UL2CM3.DLL("ULINK2/ME Cortex Debugger")
TDRV2=BIN\ABLSTCM.dll("Altera Blaster Cortex Debugger")
TDRV3=BIN\lmidk-agdi.dll("Stellaris ICDI")
TDRV4=Signum\SigUV3Arm.dll("Signum Systems JTAGjet")
TDRV5=Segger\JLTAgdi.dll("J-LINK / J-TRACE ARM")
TDRV6=Segger\JL2CM3.dll("J-LINK / J-TRACE Cortex")
TDRV7=BIN\ULP2CM3.DLL("ULINK Pro Cortex Debugger")
TDRV8=BIN\ULP2ARM.DLL("ULINK Pro ARM Debugger")
TDRV9=NULink\Nu_Link.dll("NULink Debugger")
TDRV10=SiLabs\SLAB_CM_Keil.dll("SiLabs UDA Debugger")
TDRV11=STLink\ST-LINKIII-KEIL_SWO.dll ("ST-Link Debugger")
TDRV12=BIN\CMSIS_AGDI.dll("CMSIS-DAP Debugger")
TDRV13=BIN\DbgFM.DLL("Fast Models Debugger")
TDRV14=PEMicro\Pemicro_ArmCortexInterface.dll("PEMicro Debugger")
TDRV15=BIN\VDMARM.DLL ("Proteus VSM Simulator")
BOOK2=HLP\VDMAGDI.HLP ("Proteus VSM AGDI Driver")
DELDRVPKG0=ULINK\UninstallULINK.exe("ULINK Pro Driver V1.0")
LIC0=BUURY-IEX7U-UHJ8H-W3E43-TR57A-KSXDC
[ARMADS]
PATH="D:\Keil_v5\ARM\"
PATH1=".\ARMCC\bin\"
CPUDLL0=SARM.DLL(TDRV0,TDRV4,TDRV5,TDRV8,TDRV15)                                                          # Drivers for ARM7/9 devices
CPUDLL1=SARMCM3.DLL(TDRV1,TDRV2,TDRV3,TDRV4,TDRV6,TDRV7,TDRV9,TDRV10,TDRV11,TDRV12,TDRV13,TDRV14,TDRV15)  # Drivers for Cortex-M devices
CPUDLL2=SARMCR4.DLL(TDRV6,TDRV15)                                                                         # Drivers for Cortex-R4 devices
BOOK0=HLP\mdk5-getting-started.pdf("MDK-ARM Getting Started (PDF)",GEN)
BOOK1=HLP\mdk5-getting-started_jp.pdf("MDK-ARM Getting Started (Japanese/PDF)",GEN)
BOOK2=HLP\RELEASE_NOTES.HTM("Release Notes",GEN)
BOOK3=HLP\ARMTOOLS.chm("Complete User's Guide Selection",C)
BOOK4=HLP\DUI0592E_02_mdk_getting_started_guide.pdf("ARM Compiler Getting Started Guide v5.06 for µVision (PDF)",GEN)
BOOK5=HLP\DUI0375G_02_mdk_armcc_user_guide.pdf("ARM Compiler v5.06 for µVision (PDF)",GEN)
BOOK6=HLP\DUI0377G_02_mdk_armlink_user_guide.pdf("ARM Linker v5.06 for µVision (PDF)",GEN)
BOOK7=HLP\DUI0378G_02_mdk_libraries_user_guide.pdf("ARM Libraries and Floating Point Support Guide v5.06 for µVision (PDF)",GEN)
BOOK8=HLP\DUI0379G_02_mdk_armasm_user_guide.pdf("ARM Assembler User Guide v5.06 for µVision (PDF)",GEN)
BOOK9=HLP\DUI0459F_02_mdk_fromelf_user_guide.pdf("Using the fromelf Image Converter v5.06 for µVision (PDF)",GEN)
BOOK10=HLP\DUI0590E_02_mdk_armar_user_guide.pdf("Creating Static Software Libraries with armar v5.06 for µVision (PDF)",GEN)
BOOK11=HLP\DUI0591E_02_mdk_errors_and_warnings_reference_guide.pdf("ARM Compiler Error and Warnings Reference Guide v5.06 for µVision (PDF)",GEN)
BOOK12=HLP\DUI0593E_02_mdk_migration_compatibility_guide.pdf("ARM Migration and Compatibility Guide v5.06 for µVision (PDF)",GEN)
TDRV0=BIN\UL2ARM.DLL("ULINK2/ME ARM Debugger")
TDRV1=BIN\UL2CM3.DLL("ULINK2/ME Cortex Debugger")
TDRV2=BIN\ABLSTCM.dll("Altera Blaster Cortex Debugger")
TDRV3=BIN\lmidk-agdi.dll("Stellaris ICDI")
TDRV4=Signum\SigUV3Arm.dll("Signum Systems JTAGjet")
TDRV5=Segger\JLTAgdi.dll("J-LINK / J-TRACE ARM")
TDRV6=Segger\JL2CM3.dll("J-LINK / J-TRACE Cortex")
TDRV7=BIN\ULP2CM3.DLL("ULINK Pro Cortex Debugger")
TDRV8=BIN\ULP2ARM.DLL("ULINK Pro ARM Debugger")
TDRV9=NULink\Nu_Link.dll("NULink Debugger")
TDRV10=SiLabs\SLAB_CM_Keil.dll("SiLabs UDA Debugger")
TDRV11=STLink\ST-LINKIII-KEIL_SWO.dll ("ST-Link Debugger")
TDRV12=BIN\CMSIS_AGDI.dll("CMSIS-DAP Debugger")
TDRV13=BIN\DbgFM.DLL("Fast Models Debugger")
TDRV14=PEMicro\Pemicro_ArmCortexInterface.dll("PEMicro Debugger")
TDRV15=BIN\VDMARM.DLL ("Proteus VSM Simulator")
BOOK13=HLP\VDMAGDI.HLP ("Proteus VSM AGDI Driver")
RTOS0=Dummy.DLL("Dummy")
RTOS1=VARTXARM.DLL ("RTX Kernel")
ARMCCPATH0="ARMCC" ("V5.06u1 (build 61)")
DELDRVPKG0=ULINK\UninstallULINK.exe("ULINK Pro Driver V1.0")
[C51]
PATH="D:\Keil_v5\C51\"
VERSION=V9.59
BOOK0=HLP\Release_Notes.htm("Release Notes",GEN)
BOOK1=HLP\C51TOOLS.chm("Complete User's Guide Selection",C)
TDRV0=BIN\MON51.DLL ("Keil Monitor-51 Driver")
TDRV1=BIN\ISD51.DLL ("Keil ISD51 In-System Debugger")
TDRV2=BIN\MON390.DLL ("MON390: Dallas Contiguous Mode")
TDRV3=BIN\LPC2EMP.DLL ("LPC900 EPM Emulator/Programmer")
TDRV4=BIN\UL2UPSD.DLL ("ST-uPSD ULINK Driver")
TDRV5=BIN\UL2XC800.DLL ("Infineon XC800 ULINK Driver")
TDRV6=BIN\MONADI.DLL ("ADI Monitor Driver")
TDRV7=BIN\DAS2XC800.DLL ("Infineon DAS Client for XC800")
TDRV8=BIN\UL2LPC9.DLL ("NXP LPC95x ULINK Driver")
TDRV9=BIN\JLinkEFM8.dll ("J-Link / J-Trace EFM8 Driver")
TDRV10=BIN\VDM51.DLL ("Proteus VSM Simulator")
BOOK2=HLP\VDMAGDI.HLP ("Proteus VSM AGDI Driver")
RTOS0=Dummy.DLL("Dummy")
RTOS1=RTXTINY.DLL ("RTX-51 Tiny")
RTOS2=RTX51.DLL ("RTX-51 Full")
LIC0=SDJT4-FM3RX-B2ILG-V2D72-RQ76I-6L05G
[KARM]
TDRV0=BIN\VDMARM.DLL ("Proteus VSM Simulator")
BOOK0=HLP\VDMAGDI.HLP ("Proteus VSM AGDI Driver")

 

Keil工程目标调试选项 ( Proteus VSM Simulator )

 

============ End

 

posted @ 2021-01-25 10:09  lsgxeva  阅读(1120)  评论(0编辑  收藏  举报