Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 在STM32F765上使用引导加载程序时,J-Link调试器出现问题_C_Eclipse_Debugging_Bootloader_Segger Jlink - Fatal编程技术网

C 在STM32F765上使用引导加载程序时,J-Link调试器出现问题

C 在STM32F765上使用引导加载程序时,J-Link调试器出现问题,c,eclipse,debugging,bootloader,segger-jlink,C,Eclipse,Debugging,Bootloader,Segger Jlink,我正在使用ST的NucleoBoards上的J-Link EDU和STLink调试器进行测试,引导加载程序代码显示为0x8000000,然后跳转到0x8020000,其中显示主应用程序代码。当我使用Jlink EDU时,它不能每次成功地将闪存编程为0x8020000,如果我修改程序并开始调试,Jlink会擦除闪存,但不会成功编程,引导加载程序跳转后,MCU会出现硬故障。现在无论我使用Jlink还是STLINK(转换为Jlink),都会发生这种情况。通常我看到它卡在0xFFFFFE。此时,JLIN

我正在使用ST的NucleoBoards上的J-Link EDU和STLink调试器进行测试,引导加载程序代码显示为0x8000000,然后跳转到0x8020000,其中显示主应用程序代码。当我使用Jlink EDU时,它不能每次成功地将闪存编程为0x8020000,如果我修改程序并开始调试,Jlink会擦除闪存,但不会成功编程,引导加载程序跳转后,MCU会出现硬故障。现在无论我使用Jlink还是STLINK(转换为Jlink),都会发生这种情况。通常我看到它卡在0xFFFFFE。此时,JLINK已擦除应用程序代码,但无法对其进行编程

有趣的是,STlink调试器在转换回来并与openocd一起使用时,在引导加载程序跳转到主应用程序代码并从那里进行调试时没有任何问题

我还发现,如果我用STLink和OpenOCD在0x8020000处编程主应用程序代码,然后切换到JLINK EDU进行调试,只要JLINK没有重新编程,它就可以工作。如果在日志中,我看到JLINK闪烁代码,那么ST在从引导加载程序跳转后崩溃。因此,我肯定认为这与JLINK在调试期间如何擦除和编程ST有关

我还尝试过使用JLINK commander编程,但似乎也失败了。除非我完全擦除芯片

我正在使用System Workbench 2.0和GNU ARM Eclipse插件进行Jlink调试,使用截至目前为止最新的ARM工具链和Jlink 616c。我正在使用STM32F765VI和双银行配置的闪存

为了清晰起见,我还附上了来自JLINK和STLINK的GDB日志。我想使用JLINK进行调试,因为我可以在eclipse中使用SWO控制台,而在OpenOCD中它非常麻烦,所以我想解决它

尝试编程后,JLINK调试失败:

SEGGER J-Link GDB Server V6.16c Command Line Version
JLinkARM.dll V6.16c (DLL compiled Jun 16 2017 18:14:49)

WARNING: Unknown command line parameter -timeout found.
WARNING: Unknown command line parameter 0 found.
-----GDB Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      localhost only
Generate logfile:              off
Verify download:               on
Init regs on start:            on
Silent mode:                   off
Single run mode:               on
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 STM32F765VI
Target interface:              SWD
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V10 compiled Jun 16 2017 16:15:19
Hardware: V10.10
S/N: 260101191
OEM: SEGGER-EDU
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.35 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x51E9FF66)
Read 2 bytes @ address 0x00000000 (Data = 0xFF66)
Target interface speed set to 1000 kHz
Resetting target
Halting target CPU...
...Target halted (PC = 0x080023CC)
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20080000, MSP= 20080000, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 080023CC
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x080023CC (Data = 0xD034F8DF)
Read 2 bytes @ address 0x080023CC (Data = 0xF8DF)
Target interface speed set to 15000 kHz
Flash breakpoints enabled
SWO disabled succesfully.
SWO enabled succesfully.
Read 4 bytes @ address 0x080023CC (Data = 0xD034F8DF)
Read 2 bytes @ address 0x080023CC (Data = 0xF8DF)
Downloading 520 bytes @ address 0x08020000 - Verified OK
Downloading 16064 bytes @ address 0x08020210 - Verified OK
Downloading 16096 bytes @ address 0x080240D0 - Verified OK
Downloading 16048 bytes @ address 0x08027FB0 - Verified OK
Downloading 16112 bytes @ address 0x0802BE60 - Verified OK
Downloading 16096 bytes @ address 0x0802FD50 - Verified OK
Downloading 16112 bytes @ address 0x08033C30 - Verified OK
Downloading 16144 bytes @ address 0x08037B20 - Verified OK
Downloading 16000 bytes @ address 0x0803BA30 - Verified OK
Downloading 15920 bytes @ address 0x0803F8B0 - Verified OK
Downloading 16176 bytes @ address 0x080436E0 - Verified OK
Downloading 16064 bytes @ address 0x08047610 - Verified OK
Downloading 16032 bytes @ address 0x0804B4D0 - Verified OK
Downloading 15696 bytes @ address 0x0804F370 - Verified OK
Downloading 16032 bytes @ address 0x080530C0 - Verified OK
Downloading 16176 bytes @ address 0x08056F60 - Verified OK
Downloading 16064 bytes @ address 0x0805AE90 - Verified OK
Downloading 16064 bytes @ address 0x0805ED50 - Verified OK
Downloading 16128 bytes @ address 0x08062C10 - Verified OK
Downloading 16176 bytes @ address 0x08066B10 - Verified OK
Downloading 16112 bytes @ address 0x0806AA40 - Verified OK
Downloading 16304 bytes @ address 0x0806E930 - Verified OK
Downloading 16272 bytes @ address 0x080728E0 - Verified OK
Downloading 16048 bytes @ address 0x08076870 - Verified OK
Downloading 16080 bytes @ address 0x0807A720 - Verified OK
Downloading 16048 bytes @ address 0x0807E5F0 - Verified OK
Downloading 16048 bytes @ address 0x080824A0 - Verified OK
Downloading 14616 bytes @ address 0x08086350 - Verified OK
Downloading 16144 bytes @ address 0x08089C80 - Verified OK
Downloading 16224 bytes @ address 0x0808DB90 - Verified OK
Downloading 16128 bytes @ address 0x08091AF0 - Verified OK
Downloading 16288 bytes @ address 0x080959F0 - Verified OK
Downloading 16272 bytes @ address 0x08099990 - Verified OK
Downloading 16256 bytes @ address 0x0809D920 - Verified OK
Downloading 14880 bytes @ address 0x080A18A0 - Verified OK
Downloading 8 bytes @ address 0x080A52C0 - Verified OK
Downloading 4 bytes @ address 0x080A52C8 - Verified OK
Downloading 4 bytes @ address 0x080A52CC - Verified OK
Downloading 1068 bytes @ address 0x080A52D0 - Verified OK
Comparing flash   [....................] Done.
Erasing flash     [....................] Done.
Programming flash [....................] Done.
Verifying flash   [....................] Done.
Writing register (PC = 0x08083ED0)
Read 4 bytes @ address 0x08083ED0 (Data = 0xE0032100)
Read 2 bytes @ address 0x08083ED0 (Data = 0x2100)
Read 2 bytes @ address 0x0807BAAE (Data = 0xF44F)
Read 2 bytes @ address 0x0807BAAE (Data = 0xF44F)
Read 2 bytes @ address 0x0807BAFA (Data = 0xF44F)
Read 2 bytes @ address 0x0807BAFA (Data = 0xF44F)
Read 2 bytes @ address 0x08080814 (Data = 0x4B14)
Read 4 bytes @ address 0x08080868 (Data = 0x2002B994)
Read 2 bytes @ address 0x08080814 (Data = 0x4B14)
Read 2 bytes @ address 0x0807BB44 (Data = 0x687B)
Read 2 bytes @ address 0x0807BBB2 (Data = 0xF897)
Resetting target
Halting target CPU...
...Target halted (PC = 0x080023CC)
Read 2 bytes @ address 0x08080814 (Data = 0x4B14)
Read 4 bytes @ address 0x08080868 (Data = 0x2002B994)
Read 2 bytes @ address 0x08080814 (Data = 0x4B14)
Read 4 bytes @ address 0x08080868 (Data = 0x2002B994)
Read 2 bytes @ address 0x08080814 (Data = 0x4B14)
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20080000, MSP= 20080000, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 080023CC
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x080023CC (Data = 0xD034F8DF)
Read 2 bytes @ address 0x080023CC (Data = 0xF8DF)
Setting breakpoint @ address 0x0807BAAE, Size = 2, BPHandle = 0x0001
Setting breakpoint @ address 0x0807BAFA, Size = 2, BPHandle = 0x0002
Setting breakpoint @ address 0x0807BBB2, Size = 2, BPHandle = 0x0003
Setting breakpoint @ address 0x08080814, Size = 2, BPHandle = 0x0004
Starting target CPU...
...Target halted (DBGRQ, PC = 0xFFFFFFFE)
Reading all registers
WARNING: Failed to read memory @ address 0xFFFFFFFE
Removing breakpoint @ address 0x0807BAAE, Size = 2
Removing breakpoint @ address 0x0807BAFA, Size = 2
Removing breakpoint @ address 0x0807BBB2, Size = 2
Removing breakpoint @ address 0x08080814, Size = 2
WARNING: Failed to read memory @ address 0xFFFFFFF4
Reading 64 bytes @ address 0xFFFFFFC0
WARNING: Failed to read memory @ address 0xFFFFFFC0
WARNING: Failed to read memory @ address 0xFFFFFFF0
Reading 64 bytes @ address 0xFFFFFFC0
WARNING: Failed to read memory @ address 0xFFFFFFC0
WARNING: Failed to read memory @ address 0xFFFFFFF0
如果不闪烁,则JLINK调试成功:

SEGGER J-Link GDB Server V6.16c Command Line Version
JLinkARM.dll V6.16c (DLL compiled Jun 16 2017 18:14:49)

WARNING: Unknown command line parameter -timeout found.
WARNING: Unknown command line parameter 0 found.
-----GDB Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      localhost only
Generate logfile:              off
Verify download:               on
Init regs on start:            on
Silent mode:                   off
Single run mode:               on
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 STM32F765VI
Target interface:              SWD
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V10 compiled Jun 16 2017 16:15:19
Hardware: V10.10
S/N: 260101191
OEM: SEGGER-EDU
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.35 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x51E9FF66)
Read 2 bytes @ address 0x00000000 (Data = 0xFF66)
Target interface speed set to 1000 kHz
Resetting target
Halting target CPU...
...Target halted (PC = 0x080023CC)
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20080000, MSP= 20080000, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 080023CC
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x080023CC (Data = 0xD034F8DF)
Read 2 bytes @ address 0x080023CC (Data = 0xF8DF)
Target interface speed set to 15000 kHz
Flash breakpoints enabled
SWO disabled succesfully.
SWO enabled succesfully.
Read 4 bytes @ address 0x080023CC (Data = 0xD034F8DF)
Read 2 bytes @ address 0x080023CC (Data = 0xF8DF)
Downloading 520 bytes @ address 0x08020000 - Verified OK
Downloading 16064 bytes @ address 0x08020210 - Verified OK
Downloading 16096 bytes @ address 0x080240D0 - Verified OK
Downloading 16048 bytes @ address 0x08027FB0 - Verified OK
Downloading 16112 bytes @ address 0x0802BE60 - Verified OK
Downloading 16096 bytes @ address 0x0802FD50 - Verified OK
Downloading 16112 bytes @ address 0x08033C30 - Verified OK
Downloading 16144 bytes @ address 0x08037B20 - Verified OK
Downloading 16000 bytes @ address 0x0803BA30 - Verified OK
Downloading 15920 bytes @ address 0x0803F8B0 - Verified OK
Downloading 16176 bytes @ address 0x080436E0 - Verified OK
Downloading 16064 bytes @ address 0x08047610 - Verified OK
Downloading 16032 bytes @ address 0x0804B4D0 - Verified OK
Downloading 15696 bytes @ address 0x0804F370 - Verified OK
Downloading 16032 bytes @ address 0x080530C0 - Verified OK
Downloading 16176 bytes @ address 0x08056F60 - Verified OK
Downloading 16064 bytes @ address 0x0805AE90 - Verified OK
Downloading 16064 bytes @ address 0x0805ED50 - Verified OK
Downloading 16128 bytes @ address 0x08062C10 - Verified OK
Downloading 16176 bytes @ address 0x08066B10 - Verified OK
Downloading 16112 bytes @ address 0x0806AA40 - Verified OK
Downloading 16304 bytes @ address 0x0806E930 - Verified OK
Downloading 16272 bytes @ address 0x080728E0 - Verified OK
Downloading 16048 bytes @ address 0x08076870 - Verified OK
Downloading 16080 bytes @ address 0x0807A720 - Verified OK
Downloading 16048 bytes @ address 0x0807E5F0 - Verified OK
Downloading 16048 bytes @ address 0x080824A0 - Verified OK
Downloading 14616 bytes @ address 0x08086350 - Verified OK
Downloading 16144 bytes @ address 0x08089C80 - Verified OK
Downloading 16224 bytes @ address 0x0808DB90 - Verified OK
Downloading 16128 bytes @ address 0x08091AF0 - Verified OK
Downloading 16288 bytes @ address 0x080959F0 - Verified OK
Downloading 16272 bytes @ address 0x08099990 - Verified OK
Downloading 16256 bytes @ address 0x0809D920 - Verified OK
Downloading 14880 bytes @ address 0x080A18A0 - Verified OK
Downloading 8 bytes @ address 0x080A52C0 - Verified OK
Downloading 4 bytes @ address 0x080A52C8 - Verified OK
Downloading 4 bytes @ address 0x080A52CC - Verified OK
Downloading 1068 bytes @ address 0x080A52D0 - Verified OK
Comparing flash   [....................] Done.
Verifying flash   [....................] Done.
Writing register (PC = 0x08083ED0)
Read 4 bytes @ address 0x08083ED0 (Data = 0xD034F8DF)
Read 2 bytes @ address 0x08083ED0 (Data = 0xF8DF)
Read 2 bytes @ address 0x08083ED2 (Data = 0xD034)
Read 2 bytes @ address 0x0807BAAE (Data = 0xF44F)
Read 2 bytes @ address 0x0807BAAE (Data = 0xF44F)
Read 2 bytes @ address 0x0807BB44 (Data = 0x687B)
Read 2 bytes @ address 0x0807BBB2 (Data = 0xF897)
Read 2 bytes @ address 0x0807BAFA (Data = 0xF44F)
Read 2 bytes @ address 0x0807BAFA (Data = 0xF44F)
Resetting target
Halting target CPU...
...Target halted (PC = 0x080023CC)
Read 2 bytes @ address 0x08080814 (Data = 0x4B15)
Read 4 bytes @ address 0x0808086C (Data = 0x2002B994)
Read 2 bytes @ address 0x08080814 (Data = 0x4B15)
Read 4 bytes @ address 0x0808086C (Data = 0x2002B994)
Read 2 bytes @ address 0x08080814 (Data = 0x4B15)
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20080000, MSP= 20080000, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 080023CC
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x080023CC (Data = 0xD034F8DF)
Read 2 bytes @ address 0x080023CC (Data = 0xF8DF)
Setting breakpoint @ address 0x0807BAAE, Size = 2, BPHandle = 0x0001
Setting breakpoint @ address 0x0807BAFA, Size = 2, BPHandle = 0x0002
Setting breakpoint @ address 0x0807BBB2, Size = 2, BPHandle = 0x0003
Setting breakpoint @ address 0x08080814, Size = 2, BPHandle = 0x0004
Starting target CPU...
...Breakpoint reached @ address 0x08080814
Reading all registers
Read 4 bytes @ address 0x08080814 (Data = 0x68184B15)
Removing breakpoint @ address 0x0807BAAE, Size = 2
Removing breakpoint @ address 0x0807BAFA, Size = 2
Removing breakpoint @ address 0x0807BBB2, Size = 2
Removing breakpoint @ address 0x08080814, Size = 2
Reading 64 bytes @ address 0x20003A40
Read 4 bytes @ address 0x0802ED40 (Data = 0xB083B480)
Reading 64 bytes @ address 0x200039C0
Read 4 bytes @ address 0x0802ED40 (Data = 0xB083B480)
STLINK成功调试

Open On-Chip Debugger 0.10.0-dev-00278-ga53935e-dirty (2017-05-09-09:25)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 4000 kHz
adapter_nsrst_delay: 100
Info : clock speed 4000 kHz
Info : STLINK v2 JTAG v27 API v2 M v15 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 0.023669
Error: target voltage may be too low for reliable debugging
Info : STM32F765VITx.cpu: hardware has 8 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
STM32F765VITx.cpu: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080023cc msp: 0x20080000
Info : flash size probed value 2048
Info : flash size probed value 2048
STM32F765VITx.cpu: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080023cc msp: 0x20080000
STM32F765VITx.cpu: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080023cc msp: 0x20080000
Info : Padding image section 0 with 8 bytes
Info : Padding image section 1 with 24 bytes
STM32F765VITx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread 
xPSR: 0x61000000 pc: 0x20000084 msp: 0x20080000
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (4290). Workaround: increase "set remotetimeout" in GDB
STM32F765VITx.cpu: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080023cc msp: 0x20080000
JLINK命令失败日志

SEGGER J-Link Commander V6.16c (Compiled Jun 16 2017 18:15:26)
DLL version V6.16c, compiled Jun 16 2017 18:14:49

Connecting to J-Link via USB...O.K.
Firmware: J-Link V10 compiled Jun 16 2017 16:15:19
Hardware version: V10.10
S/N: 260101191
License(s): FlashBP, GDB
OEM: SEGGER-EDU
VTref = 3.348V


Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: STM32F765VI
Type '?' for selection dialog
Device>
Please specify target interface:
  J) JTAG (Default)
  S) SWD
TIF>s
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "STM32F765VI" selected.


Connecting to target via SWD
Found SW-DP with ID 0x5BA02477
Found SW-DP with ID 0x5BA02477
Scanning APs, stopping at first AHB-AP found.
AP[0] IDR: 0x74770001 (AHB-AP)
AHB-AP ROM: 0xE00FD000 (Base addr. of first ROM table)
CPUID reg: 0x411FC270. Implementer code: 0x41 (ARM)
Found Cortex-M7 r1p0, Little endian.
FPUnit: 8 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ E00FD000
ROMTbl[0][0]: E00FE000, CID: B105100D, PID: 000BB4C8 ROM Table
ROMTbl[1] @ E00FE000
ROMTbl[1][0]: E00FF000, CID: B105100D, PID: 000BB4C7 ROM Table
ROMTbl[2] @ E00FF000
ROMTbl[2][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS
ROMTbl[2][1]: E0001000, CID: B105E00D, PID: 000BB002 DWT
ROMTbl[2][2]: E0002000, CID: B105E00D, PID: 000BB00E FPB
ROMTbl[2][3]: E0000000, CID: B105E00D, PID: 000BB001 ITM
ROMTbl[1][1]: E0041000, CID: B105900D, PID: 001BB975 ETM-M7
ROMTbl[0][1]: E0040000, CID: B105900D, PID: 000BB9A9 TPIU-M7
Cache: Separate I- and D-cache.
I-Cache L1: 16 KB, 256 Sets, 32 Bytes/Line, 2-Way
D-Cache L1: 16 KB, 128 Sets, 32 Bytes/Line, 4-Way
Cortex-M7 identified.
J-Link>r
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
Setting AIRCR.SYSRESETREQ
J-Link>loadbin C:\Users\User\workspace_10\DC_Booster_F756\Debug\DC_Booster_F756.bin,0x08020000
Downloading file [C:\Users\User\workspace_10\DC_Booster_F756\Debug\DC_Booster_F756.bin]...
J-Link: Flash download: Flash programming performed for 2 ranges (131072 bytes)
J-Link: Flash download: Total time needed: 6.157s (Prepare: 0.022s, Compare: 0.081s, Erase: 4.931s, Program: 1.116s, Verify: 0.000s, Restore: 0.005s)
J-Link: Flash download: Restarting flash programming due to program error (possibly skipped erasure of half-way erased sector).
J-Link: Flash download: Skip optimizations disabled for second try.
Error while programming flash: Programming failed.
J-Link>verifybin C:\Users\User\workspace_10\DC_Booster_F756\Debug\DC_Booster_F756.bin,0x08020000
Loading binary file C:\Users\User\workspace_10\DC_Booster_F756\Debug\DC_Booster_F756.bin
Reading 546556 bytes data from target memory @ 0x08020000.
Verify failed @ address 0x08065522.
Expected FE read 00J-Link>
SEGGER J-Link Commander V6.16c(编译时间:2017年6月16日18:15:26)
DLL版本V6.16c,编译日期2017年6月16日18:14:49
通过USB连接到J-Link…好的。
固件:J-Link V10已编译2017年6月16日16:15:19
硬件版本:V10.10
序列号:260101191
许可证:FlashBP、GDB
OEM:SEGGER-EDU
VTref=3.348V
键入“连接”以建立目标连接,“?”以获取帮助
J-Link>连接
请指定设备/核心:STM32F765VI
为选择对话框键入“?”
设备>
请指定目标接口:
J) JTAG(默认值)
S) 社署
TIF>s
指定目标接口速度[kHz]:4000千赫
速度>
已选择设备“STM32F765VI”。
通过社会福利署与目标接驳
找到ID为0x5BA02477的SW-DP
找到ID为0x5BA02477的SW-DP
正在扫描AP,在第一次发现AHB-AP时停止。
AP[0]IDR:0x74770001(AHB-AP)
AHB-AP ROM:0xE00FD000(第一个ROM表的基本地址)
CPUID注册码:0x411FC270。实施者代码:0x41(ARM)
发现Cortex-M7 r1p0,小endian。
FPUnit:8个代码(BP)插槽和0个文字插槽
CoreSight组件:
ROMTbl[0]@E00FD000
ROMTbl[0][0]:E00FE000,CID:B105100D,PID:000BB4C8 ROM表
ROMTbl[1]@E00FE000
ROMTbl[1][0]:E00FF000,CID:B105100D,PID:000BB4C7 ROM表
ROMTbl[2]@E00FF000
ROMTbl[2][0]:E000E000,CID:B105E00D,PID:000BB00C SCS
ROMTbl[2][1]:E0001000,CID:B105E00D,PID:000BB002载重吨
ROMTbl[2][2]:E0002000,CID:B105E00D,PID:000BB00E FPB
ROMTbl[2][3]:E0000000,CID:B105E00D,PID:000BB001 ITM
ROMTbl[1][1]:E0041000,CID:B105900D,PID:001BB975 ETM-M7
ROMTbl[0][1]:E0040000,CID:B105900D,PID:000BB9A9 TPIU-M7
缓存:独立的I缓存和D缓存。
I-Cache L1:16 KB,256组,32字节/行,双向
D-Cache L1:16 KB,128组,32字节/行,4路
皮层-M7被鉴定。
J-Link>r
重置延迟:0毫秒
复位类型正常:通过SYSRESETREQ和VECTRESET位复位核心和外围设备。
设置Airr.SYSRESETREQ
J-Link>loadbin C:\Users\User\workspace\u 10\DC\u Booster\u F756\Debug\DC\u Booster\u F756.bin,0x08020000
正在下载文件[C:\Users\User\workspace\u 10\DC\u Booster\u F756\Debug\DC\u Booster\u F756.bin]。。。
J-Link:闪存下载:针对2个范围(131072字节)执行闪存编程
J-Link:Flash下载:所需总时间:6.157s(准备:0.022s,比较:0.081s,擦除:4.931s,程序:1.116s,验证:0.000s,恢复:0.005s)
J-Link:闪存下载:由于程序错误(可能跳过了一半擦除扇区的擦除),重新启动闪存编程。
J-Link:Flash下载:跳过优化,第二次尝试时禁用。
编程闪存时出错:编程失败。
J-Link>verifybin C:\Users\User\workspace\u 10\DC\u Booster\u F756\Debug\DC\u Booster\u F756.bin,0x08020000
正在加载二进制文件C:\Users\User\workspace\u 10\DC\u Booster\u F756\Debug\DC\u Booster\u F756.bin
从目标内存读取546556字节数据@0x08020000。
验证失败@地址0x08065522。
预期FE读取00J链接>

根据第一个日志,在我看来,J-Link删除闪存,然后将其从地址0x0802000编程->无引导加载程序,在0x08000000时无需执行->直接跳转到硬故障(尽管向量表中找不到处理程序,CPU锁定)。我不是J-Link的专家,但我们在类似的工具链中使用它,有以下场景:

  • BSL和应用程序二进制文件通过一个简单的工具组合在一起,并通过J-Link闪存在一起。任何一个都可以通过连接到正在运行的目标进行调试
  • BSL被排除在外,并被“存根”替换,只跳转到应用程序

两者都能完美地工作。

我联系了Segger的同事,他们创建了一个wiki页面,详细介绍了如何解决这个问题。要使Jlink了解STM32F7设备上的双银行配置,必须将Jlink Open Flash loader与包含双银行配置信息的自定义脚本一起使用。完成后,当程序从引导加载程序跳转到主应用程序时,Jlink调试器就没有问题了。以下是让Jlink与STM32F765VI一起工作的步骤,STM32F765VI在双银行中运行