20170803~20170804

1.

这几天主要解决调试中出现的一个错,下载程序,提示找不到JTAG,然后自己把JTAG驱动软件卸载,重新安装;

2.

把驱动安装好后,下载进去,下载成功后,紧接着又报了一堆错,如下:
Build target ‘Target 1’
linking…
Program Size: Code=22840 RO-data=408 RW-data=256 ZI-data=5800
FromELF: creating hex file…
After Build - User command #1: fromelf –bin –output COS.bin COS.axf
After Build - User command #2: bin2mif.exe
“.\obj\COS.axf” - 0 Errors, 0 Warning(s).
Load “D:\YingQi\iccf070用户开发包\demo_HID\prj\obj\COS.axf”
Set JLink Project File to “D:\YingQi\iccf070用户开发包\demo_HID\prj\JLinkSettings.ini”
* JLink Info: Device “CORTEX-M0” selected (0 KB flash, 0 KB RAM).

DLL: V4.74b, compiled Aug 19 2013 23:26:44
Firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46
Hardware: V8.00
S/N : 12345678
Feature(s) : RDI,FlashDL,FlashBP,JFlash,GDBFull

  • JLink Info: Found SWD-DP with ID 0x0BB11477
  • JLink Info: FPUnit: 4 code (BP) slots and 0 literal slots
  • JLink Info: Found Cortex-M0 r0p0, Little endian.
    ROMTableAddr = 0xE00FF003

Target info:

Device: Cortex-M0
VTarget = 3.196V
State of Pins:
TCK: 0, TDI: 0, TDO: 0, TMS: 1, TRES: 1, TRST: 1
Hardware-Breakpoints: 4
Software-Breakpoints: 8192
Watchpoints: 2
JTAG speed: 2000 kHz

Full Chip Erase Done.
Programming Done.
***JLink Error: Can not read register 15 (R15) while CPU is running
**JLink Warning: CPU could not be halted
***JLink Error: Could not read memory location 0x20000000 when trying to clear soft RAM BP
Could not start CPU core. (ErrorCode: -2)
Contents mismatch at: 00000000H (Flash=AAH Required=A8H) !
Contents mismatch at: 00000001H (Flash=AAH Required=17H) !
Contents mismatch at: 00000002H (Flash=AAH Required=00H) !
Contents mismatch at: 00000003H (Flash=AAH Required=20H) !
Contents mismatch at: 00000004H (Flash=AAH Required=81H) !
Contents mismatch at: 00000005H (Flash=AAH Required=01H) !
Contents mismatch at: 00000006H (Flash=AAH Required=00H) !
Contents mismatch at: 00000007H (Flash=AAH Required=00H) !
Contents mismatch at: 00000008H (Flash=AAH Required=5DH) !
Contents mismatch at: 00000009H (Flash=AAH Required=03H) !
Contents mismatch at: 0000000AH (Flash=AAH Required=00H) !
Contents mismatch at: 0000000BH (Flash=AAH Required=00H) !
Contents mismatch at: 0000000CH (Flash=AAH Required=41H) !
Contents mismatch at: 0000000DH (Flash=AAH Required=03H) !
Contents mismatch at: 0000000EH (Flash=AAH Required=00H) !
Contents mismatch at: 0000000FH (Flash=AAH Required=00H) !
Contents mismatch at: 00000010H (Flash=AAH Required=00H) !
Contents mismatch at: 00000011H (Flash=AAH Required=00H) !
Contents mismatch at: 00000012H (Flash=AAH Required=00H) !
Contents mismatch at: 00000013H (Flash=AAH Required=00H) !
Contents mismatch at: 00000014H (Flash=AAH Required=00H) !
Contents mismatch at: 00000015H (Flash=AAH Required=00H) !
Contents mismatch at: 00000016H (Flash=AAH Required=00H) !
Contents mismatch at: 00000017H (Flash=AAH Required=00H) !
Contents mismatch at: 00000018H (Flash=AAH Required=00H) !
Contents mismatch at: 00000019H (Flash=AAH Required=00H) !
Contents mismatch at: 0000001AH (Flash=AAH Required=00H) !
Contents mismatch at: 0000001BH (Flash=AAH Required=00H) !
Contents mismatch at: 0000001CH (Flash=AAH Required=00H) !
Contents mismatch at: 0000001DH (Flash=AAH Required=00H) !
Contents mismatch at: 0000001EH (Flash=AAH Required=00H) !
Contents mismatch at: 0000001FH (Flash=AAH Required=00H) !
Contents mismatch at: 00000020H (Flash=AAH Required=00H) !
Contents mismatch at: 00000021H (Flash=AAH Required=00H) !
Contents mismatch at: 00000022H (Flash=AAH Required=00H) !
Contents mismatch at: 00000023H (Flash=AAH Required=00H) !
Contents mismatch at: 00000024H (Flash=AAH Required=00H) !
Contents mismatch at: 00000025H (Flash=AAH Required=00H) !
Contents mismatch at: 00000026H (Flash=AAH Required=00H) !
Contents mismatch at: 00000027H (Flash=AAH Required=00H) !
Contents mismatch at: 00000028H (Flash=AAH Required=00H) !
Contents mismatch at: 00000029H (Flash=AAH Required=00H) !
Contents mismatch at: 0000002AH (Flash=AAH Required=00H) !
Contents mismatch at: 0000002BH (Flash=AAH Required=00H) !
Contents mismatch at: 0000002CH (Flash=AAH Required=8FH) !
Contents mismatch at: 0000002DH (Flash=AAH Required=01H) !
Contents mismatch at: 0000002EH (Flash=AAH Required=00H) !
Contents mismatch at: 0000002FH (Flash=AAH Required=00H) !
Contents mismatch at: 00000030H (Flash=AAH Required=00H) !
Contents mismatch at: 00000031H (Flash=AAH Required=00H) !
Contents mismatch at: 00000032H (Flash=AAH Required=00H) !
Contents mismatch at: 00000033H (Flash=AAH Required=00H) !
Contents mismatch at: 00000034H (Flash=AAH Required=00H) !
Contents mismatch at: 00000035H (Flash=AAH Required=00H) !
Contents mismatch at: 00000036H (Flash=AAH Required=00H) !
Contents mismatch at: 00000037H (Flash=AAH Required=00H) !
Contents mismatch at: 00000038H (Flash=AAH Required=91H) !
Contents mismatch at: 00000039H (Flash=AAH Required=01H) !
Contents mismatch at: 0000003AH (Flash=AAH Required=00H) !
Contents mismatch at: 0000003BH (Flash=AAH Required=00H) !
Contents mismatch at: 0000003CH (Flash=AAH Required=93H) !
Contents mismatch at: 0000003DH (Flash=AAH Required=01H) !
Contents mismatch at: 0000003EH (Flash=AAH Required=00H) !
Contents mismatch at: 0000003FH (Flash=AAH Required=00H) !
Contents mismatch at: 00000040H (Flash=AAH Required=3FH) !
Contents mismatch at: 00000041H (Flash=AAH Required=03H) !
Contents mismatch at: 00000042H (Flash=AAH Required=00H) !
Contents mismatch at: 00000043H (Flash=AAH Required=00H) !
Contents mismatch at: 00000044H (Flash=AAH Required=E5H) !
Contents mismatch at: 00000045H (Flash=AAH Required=07H) !
Contents mismatch at: 00000046H (Flash=AAH Required=00H) !
Contents mismatch at: 00000047H (Flash=AAH Required=00H) !
Contents mismatch at: 00000048H (Flash=AAH Required=A1H) !
Contents mismatch at: 00000049H (Flash=AAH Required=01H) !
Contents mismatch at: 0000004AH (Flash=AAH Required=00H) !
Contents mismatch at: 0000004BH (Flash=AAH Required=00H) !
Contents mismatch at: 0000004CH (Flash=AAH Required=00H) !
Contents mismatch at: 0000004DH (Flash=AAH Required=00H) !
Contents mismatch at: 0000004EH (Flash=AAH Required=00H) !
Contents mismatch at: 0000004FH (Flash=AAH Required=00H) !
Contents mismatch at: 00000050H (Flash=AAH Required=00H) !
Contents mismatch at: 00000051H (Flash=AAH Required=00H) !
Contents mismatch at: 00000052H (Flash=AAH Required=00H) !
Contents mismatch at: 00000053H (Flash=AAH Required=00H) !
Contents mismatch at: 00000054H (Flash=AAH Required=BFH) !
Contents mismatch at: 00000055H (Flash=AAH Required=04H) !
Contents mismatch at: 00000056H (Flash=AAH Required=00H) !
Contents mismatch at: 00000057H (Flash=AAH Required=00H) !
Contents mismatch at: 00000058H (Flash=AAH Required=E7H) !
Contents mismatch at: 00000059H (Flash=AAH Required=34H) !
Contents mismatch at: 0000005AH (Flash=AAH Required=00H) !
Contents mismatch at: 0000005BH (Flash=AAH Required=00H) !
Contents mismatch at: 0000005CH (Flash=AAH Required=0DH) !
Contents mismatch at: 0000005DH (Flash=AAH Required=18H) !
Contents mismatch at: 0000005EH (Flash=AAH Required=00H) !
Contents mismatch at: 0000005FH (Flash=AAH Required=00H) !
Contents mismatch at: 00000060H (Flash=AAH Required=5FH) !
Contents mismatch at: 00000061H (Flash=AAH Required=03H) !
Contents mismatch at: 00000062H (Flash=AAH Required=00H) !
Contents mismatch at: 00000063H (Flash=AAH Required=00H) !
Too many errors to display !
***JLink Error: Could not read memory location 0x20000000 when trying to clear soft RAM BP
反复检查,结果是下载配置的问题,下载配置中的Verify前不能勾选,结果勾选上了,导致报错一堆,如下图所示:
20170803~20170804_第1张图片
把Verify前面的选型去掉即可,错误就解决了。

3.

下载程序时,JTAG插上之后,连接成功与否,直接查看下图中标红的选型就可以,如果连接成功,会找到Options-Debug-Settings配置项中的下列标红的部分,连接不成功,就找不到这个选项,如下图所示:
20170803~20170804_第2张图片

4

这次这个错误因为JTAG折腾了两天,期间还猜想着是别的错误,可能原因还有:(1)电源坏了,供电不足,可以用万用表测测电压,测芯片电压和JTAG电压供电是否正常,再考虑其它的因素,如果电源供电不正常,其它的一切都是白搭;(2)检查工程配置配置和Jlink配置,检查Options配置选择是否配置正确;(3)检查JTAG是否断路;(4)有时不小心点错,JTAG会固件升级,查看JTAG是否固件升级,如果升级,STM32有相应的回到原来版本的文档,自己可以查阅相应手册。

5 自己JTAG仿真不太熟悉,有时间多加练习。

6 在STM32程序中,程序中用到某个寄存器的名字时,可以直接用,不需要定义,如UART->CFG;

这就是这两天的收获总结。

你可能感兴趣的:(学习总结)