Forum: Mikrocontroller und Digitale Elektronik openocd/jtag: "reset halt" funktioniert nicht richtig


von Sven B. (scummos)


Lesenswert?

Hi,

ich möchte gern mein Board über einen JTAG-Adapter resetten. Das TRST 
ist nicht verbunden, das SRST hängt am ganz normalen ~RESET-Pin des 
Mikrocontrollers (ein LPC4333). Das habe ich auch in OpenOCD so 
konfiguriert, denke ich:
1
reset_config srst_only srst_gates_jtag connect_deassert_srst srst_push_pull
2
adapter_nsrst_assert_width 30
3
adapter_nsrst_delay 30

Wenn ich jetzt openocd starte und dann in gdb ein "monitor reset" mache, 
wird das Board auch resettet, bleibt dann aber im Reset und die 
JTAG-Verbindung bricht anscheinend ab. Unten ist ein Auszug aus dem Log 
von openocd (gestartet mit "openocd -f interface/ftdi/openocd-usb.cfg 
-f target/lpc4350.cfg -f board.cfg -c "init" -d3"), nachdem ich in gdb 
"monitor reset" ausgeführt habe.

Was mir nicht klar ist: kann man mit dem uC über JTAG kommunizieren, 
während der ~RESET-Pin auf Low gezogen ist? Mir scheint openocd versucht 
das, aber eigentlich nahm ich an dass das genau das ist, was ich mit der 
srst_gates_jtag-Option ausschalte ...?

Hat jemand eine Idee was ich falsch mache? Ich versteh auch einfach 
nicht so recht was es tut. Warum zieht es SRST erst auf Low, dann wieder 
High, und dann nochmal Low?

Danke und Gruß,
Sven
1
Debug: 629 14373 gdb_server.c:2670 gdb_input_inner(): received packet: 'qRcmd,72657365742068616c74'
2
Debug: 630 14375 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_reset halt
3
Debug: 631 14375 command.c:145 script_debug(): command - reset ocd_reset halt
4
Debug: 633 14376 target.c:1483 target_call_reset_callbacks(): target reset 2 (halt)
5
Debug: 634 14376 target.c:1483 target_call_reset_callbacks(): target reset 2 (halt)
6
Debug: 635 14376 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target names
7
Debug: 636 14376 command.c:145 script_debug(): command - ocd_target ocd_target names
8
Debug: 637 14377 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m4 invoke-event reset-start
9
Debug: 638 14377 command.c:145 script_debug(): command - ocd_lpc4350.m4 ocd_lpc4350.m4 invoke-event reset-start
10
Debug: 639 14377 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m0 invoke-event reset-start
11
Debug: 640 14377 command.c:145 script_debug(): command - ocd_lpc4350.m0 ocd_lpc4350.m0 invoke-event reset-start
12
Debug: 641 14377 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
13
Debug: 642 14377 command.c:145 script_debug(): command - ocd_transport ocd_transport select
14
Debug: 643 14377 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init-reset
15
Debug: 644 14377 command.c:145 script_debug(): command - ocd_jtag ocd_jtag arp_init-reset
16
Debug: 645 14377 core.c:1505 jtag_init_reset(): Initializing with hard TRST+SRST reset
17
Debug: 646 14377 core.c:726 jtag_add_reset(): SRST line asserted
18
Debug: 647 14377 core.c:743 jtag_add_reset(): JTAG reset with TLR instead of TRST
19
Debug: 648 14377 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
20
Debug: 649 14408 core.c:730 jtag_add_reset(): SRST line released
21
Debug: 650 14438 core.c:1397 jtag_init_inner(): Init JTAG chain
22
Debug: 651 14438 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
23
Debug: 652 14439 core.c:1058 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
24
Debug: 653 14439 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
25
Info : 654 14441 core.c:958 jtag_examine_chain_display(): JTAG tap: lpc4350.m4 tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
26
Info : 655 14441 core.c:958 jtag_examine_chain_display(): JTAG tap: lpc4350.m0 tap/device found: 0x0ba01477 (mfg: 0x23b, part: 0xba01, ver: 0x0)
27
Debug: 656 14441 core.c:1188 jtag_validate_ircapture(): IR capture validation scan
28
Debug: 657 14441 core.c:1246 jtag_validate_ircapture(): lpc4350.m4: IR capture 0x01
29
Debug: 658 14441 core.c:1246 jtag_validate_ircapture(): lpc4350.m0: IR capture 0x01
30
Debug: 659 14441 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
31
Debug: 660 14441 command.c:145 script_debug(): command - ocd_transport ocd_transport select
32
Debug: 661 14441 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m4 cget -chain-position
33
Debug: 662 14441 command.c:145 script_debug(): command - ocd_lpc4350.m4 ocd_lpc4350.m4 cget -chain-position
34
Debug: 663 14441 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled lpc4350.m4
35
Debug: 664 14441 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled lpc4350.m4
36
Debug: 665 14441 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m4 invoke-event examine-start
37
Debug: 666 14441 command.c:145 script_debug(): command - ocd_lpc4350.m4 ocd_lpc4350.m4 invoke-event examine-start
38
Debug: 667 14441 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m4 arp_examine
39
Debug: 668 14441 command.c:145 script_debug(): command - ocd_lpc4350.m4 ocd_lpc4350.m4 arp_examine
40
Debug: 669 14441 arm_adi_v5.c:649 ahbap_debugport_init():  
41
Debug: 670 14441 arm_adi_v5.c:691 ahbap_debugport_init(): DAP: wait CDBGPWRUPACK
42
Debug: 671 14441 arm_adi_v5.h:391 dap_dp_poll_register(): DAP: poll 4, mask 0x0820000000, value 0x20000000
43
Debug: 672 14442 arm_adi_v5.c:698 ahbap_debugport_init(): DAP: wait CSYSPWRUPACK
44
Debug: 673 14442 arm_adi_v5.h:391 dap_dp_poll_register(): DAP: poll 4, mask 0x0880000000, value 0x80000000
45
Debug: 674 14445 arm_adi_v5.c:750 ahbap_debugport_init(): MEM_AP Packed Transfers: enabled
46
Debug: 675 14445 arm_adi_v5.c:761 ahbap_debugport_init(): MEM_AP CFG: large data 0, long address 0, big-endian 0
47
Debug: 676 14445 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m4 invoke-event examine-end
48
Debug: 677 14445 command.c:145 script_debug(): command - ocd_lpc4350.m4 ocd_lpc4350.m4 invoke-event examine-end
49
Debug: 678 14445 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
50
Debug: 679 14445 command.c:145 script_debug(): command - ocd_transport ocd_transport select
51
Debug: 680 14445 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m0 cget -chain-position
52
Debug: 681 14445 command.c:145 script_debug(): command - ocd_lpc4350.m0 ocd_lpc4350.m0 cget -chain-position
53
Debug: 682 14445 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled lpc4350.m0
54
Debug: 683 14445 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled lpc4350.m0
55
Debug: 684 14445 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m0 invoke-event examine-start
56
Debug: 685 14445 command.c:145 script_debug(): command - ocd_lpc4350.m0 ocd_lpc4350.m0 invoke-event examine-start
57
Debug: 686 14445 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m0 arp_examine
58
Debug: 687 14445 command.c:145 script_debug(): command - ocd_lpc4350.m0 ocd_lpc4350.m0 arp_examine
59
Debug: 688 14445 arm_adi_v5.c:649 ahbap_debugport_init():  
60
Debug: 689 14445 arm_adi_v5.c:691 ahbap_debugport_init(): DAP: wait CDBGPWRUPACK
61
Debug: 690 14445 arm_adi_v5.h:391 dap_dp_poll_register(): DAP: poll 4, mask 0x0820000000, value 0x20000000
62
Debug: 691 14446 arm_adi_v5.c:698 ahbap_debugport_init(): DAP: wait CSYSPWRUPACK
63
Debug: 692 14446 arm_adi_v5.h:391 dap_dp_poll_register(): DAP: poll 4, mask 0x0880000000, value 0x80000000
64
Debug: 693 14448 arm_adi_v5.c:750 ahbap_debugport_init(): MEM_AP Packed Transfers: disabled
65
Debug: 694 14449 arm_adi_v5.c:761 ahbap_debugport_init(): MEM_AP CFG: large data 0, long address 0, big-endian 0
66
Debug: 695 14449 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m0 invoke-event examine-end
67
Debug: 696 14449 command.c:145 script_debug(): command - ocd_lpc4350.m0 ocd_lpc4350.m0 invoke-event examine-end
68
Debug: 697 14449 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m4 invoke-event reset-assert-pre
69
Debug: 698 14449 command.c:145 script_debug(): command - ocd_lpc4350.m4 ocd_lpc4350.m4 invoke-event reset-assert-pre
70
Debug: 699 14449 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m0 invoke-event reset-assert-pre
71
Debug: 700 14449 command.c:145 script_debug(): command - ocd_lpc4350.m0 ocd_lpc4350.m0 invoke-event reset-assert-pre
72
Debug: 701 14449 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
73
Debug: 702 14449 command.c:145 script_debug(): command - ocd_transport ocd_transport select
74
Debug: 703 14449 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m4 cget -chain-position
75
Debug: 704 14449 command.c:145 script_debug(): command - ocd_lpc4350.m4 ocd_lpc4350.m4 cget -chain-position
76
Debug: 705 14449 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled lpc4350.m4
77
Debug: 706 14449 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled lpc4350.m4
78
Debug: 707 14449 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m4 arp_reset assert 1
79
Debug: 708 14449 command.c:145 script_debug(): command - ocd_lpc4350.m4 ocd_lpc4350.m4 arp_reset assert 1
80
Debug: 709 14449 target.c:1837 target_free_all_working_areas_restore(): freeing all working areas
81
Debug: 710 14449 cortex_m.c:971 cortex_m_assert_reset(): target->state: halted
82
Debug: 711 14451 core.c:726 jtag_add_reset(): SRST line asserted
83
Debug: 712 14451 cortex_m.c:588 cortex_m_halt(): target->state: reset
84
Debug: 713 14452 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
85
Debug: 714 14452 command.c:145 script_debug(): command - ocd_transport ocd_transport select
86
Debug: 715 14452 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m0 cget -chain-position
87
Debug: 716 14452 command.c:145 script_debug(): command - ocd_lpc4350.m0 ocd_lpc4350.m0 cget -chain-position
88
Debug: 717 14452 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled lpc4350.m0
89
Debug: 718 14452 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled lpc4350.m0
90
Debug: 719 14452 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_lpc4350.m0 arp_reset assert 1
91
Debug: 720 14452 command.c:145 script_debug(): command - ocd_lpc4350.m0 ocd_lpc4350.m0 arp_reset assert 1
92
Debug: 721 14452 target.c:1837 target_free_all_working_areas_restore(): freeing all working areas
93
Debug: 722 14452 cortex_m.c:971 cortex_m_assert_reset(): target->state: reset
94
Warn : 723 14534 adi_v5_jtag.c:252 jtagdp_transaction_endcheck(): Invalid ACK 0 in JTAG-DP transaction
95
User : 724 14534 command.c:546 command_print(): in procedure 'reset' 
96
in procedure 'ocd_bouncer'
97
98
Debug: 725 14534 command.c:628 run_command(): Command failed with error code -4
99
User : 726 14534 command.c:689 command_run_line():

: Bearbeitet durch User
von Sven B. (scummos)


Lesenswert?

Ok, ich bin anscheinend nicht der einzige mit dem Problem: 
https://bgamari.github.io/posts/2013-06-27-lpc43xx-and-openocd.html

Das funktioniert aber trotzdem nicht. Gibt's jemanden der das mal zum 
Laufen gebracht hat?

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.