)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000843,"name":"Michael Schwingen","email":"michael@schwingen.org","username":"mschwingen2"},"change_message_id":"4aea56f862cc9b5b99769cd06ec0ece617e52418","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"178551b9_d16159d1","updated":"2021-09-15 18:48:48.000000000","message":"\u003e Patch Set 2:\n\u003e \n\u003e good, then try again with srst_gates_jtag\n\nThat works, while connect_assert_srst does not work.\n","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"bc0480ad34f7c57534df294372871e5540274145","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"6f103147_832965c0","updated":"2021-09-07 17:21:10.000000000","message":"I\u0027m sorry, I didn\u0027t notified you about the issue detected by Tomas.","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"40c27fa12c94b91f70cca64afed863c76b25370a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"6e498faa_4defe136","updated":"2021-09-05 21:39:32.000000000","message":"Im\u0027 not sure if this the correct way to solve the crash.\nBTW, could you elaborate on how you got the crash ?\n\nbefore the usage of core_info there is a check on target_examination\nso theoritically if core_info is not set then target_was_examined should return false\nthus means the error is in cortex_m_examine, and target-\u003eexamined should be set to true only after setting correctly core_info","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000843,"name":"Michael Schwingen","email":"michael@schwingen.org","username":"mschwingen2"},"change_message_id":"df2dd66997dc59e1322dd78a1810be021d1de17f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"1c98948a_638541d8","updated":"2021-09-15 18:50:38.000000000","message":"Ok, I\u0027ll drop this patch from my patch set now, since the root cause seems to be addressed.","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"d9e591a0e5b9fdafe11776afe6bcf1aa07aa1590","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"a008d5dc_b17a42d0","updated":"2021-09-05 21:52:38.000000000","message":"what do you think about this ?","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000843,"name":"Michael Schwingen","email":"michael@schwingen.org","username":"mschwingen2"},"change_message_id":"95f4b2f94e7b0dd2794724964a611d89bed86289","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"9301d91b_29706366","in_reply_to":"17264e1e_d49f3fcf","updated":"2021-09-07 17:42:13.000000000","message":"OK, this looks better - I get the exact same behavior with and without the patch, except the crash is gone if CPUID can\u0027t be read.","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"bc0480ad34f7c57534df294372871e5540274145","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"17264e1e_d49f3fcf","in_reply_to":"27a22320_df57022e","updated":"2021-09-07 17:21:10.000000000","message":"correct, there is checken and egg issue detected by Tomas, and #6548 was fixed accordingly (please check Patchset 3 : https://review.openocd.org/c/openocd/+/6548/3)","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000843,"name":"Michael Schwingen","email":"michael@schwingen.org","username":"mschwingen2"},"change_message_id":"c73f890cd57dd43349f84dae69c9218535a17462","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"27a22320_df57022e","in_reply_to":"524c0120_9518ef24","updated":"2021-09-07 17:09:28.000000000","message":"I don\u0027t understand. Without your patch, the target works fine with the current reset configuration. As soon as I apply #6548, I get \"Target not examined yet\", regardless of reset configuration.","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000843,"name":"Michael Schwingen","email":"michael@schwingen.org","username":"mschwingen2"},"change_message_id":"dc6e978764158bd016e57cd31d63443e10e038c1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"d2f6974c_65c8886c","in_reply_to":"58786d6e_f0a9f71b","updated":"2021-09-06 17:56:36.000000000","message":"It does not crash, but it does not work also - I get multiple \"Target not examined yet\" messages.\n\nI am calling openocd with\n\nsrc/openocd -d3 -s tcl/ -f gd32e230-cmsis.cfg -c \"program /home/rincewind/workspace/ARM/gd32_blink/obj/blink_gdlib/debug/test1.elf reset exit\"\n\nwith config file\nsource [find interface/cmsis-dap.cfg]\ntransport select swd\nsource [find target/gd32e23x.cfg]\n\nadapter srst delay 500\nreset_config none\nreset_config srst_only\n#reset_config srst_nogate\n#reset_config connect_assert_srst\n\n\n(and if I activate \"reset_config connect_assert_srst\" it even fails with current master - this used to work before.)\n\n-d3 log with your patch applied (edited to fit gerrit space restrictions):\n\nDebug: 39 2 command.c:201 script_debug(): command - swd newdap gd32e23x cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x0bb11477\nDebug: 40 2 tcl.c:566 jim_newtap_cmd(): Creating New Tap, Chip: gd32e23x, Tap: cpu, Dotted: gd32e23x.cpu, 8 params\nDebug: 41 2 core.c:1482 jtag_tap_init(): Created Tap: gd32e23x.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0\nDebug: 42 2 command.c:201 script_debug(): command - dap create gd32e23x.dap -chain-position gd32e23x.cpu\nDebug: 43 2 command.c:201 script_debug(): command - target create gd32e23x.cpu cortex_m -endian little -dap gd32e23x.dap\nDebug: 44 2 command.c:335 register_command(): command \u0027tpiu\u0027 is already registered\nDebug: 45 2 command.c:335 register_command(): command \u0027rtt\u0027 is already registered\nDebug: 46 2 command.c:201 script_debug(): command - gd32e23x.cpu configure -work-area-phys 0x20000000 -work-area-size 0x1000 -work-area-backup 0\nDebug: 47 2 target.c:2200 target_free_all_working_areas_restore(): freeing all working areas\nDebug: 48 2 target.c:2200 target_free_all_working_areas_restore(): freeing all working areas\nDebug: 49 2 target.c:2200 target_free_all_working_areas_restore(): freeing all working areas\nDebug: 50 2 command.c:201 script_debug(): command - flash bank gd32e23x.flash gd32 0x08000000 0 0 0 gd32e23x.cpu\nDebug: 51 2 tcl.c:1317 handle_flash_bank_command(): \u0027gd32\u0027 driver usage field missing\nDebug: 52 3 command.c:201 script_debug(): command - adapter speed 1000\nDebug: 53 3 core.c:1816 jtag_config_khz(): handle jtag khz\nDebug: 54 3 core.c:1779 adapter_khz_to_speed(): convert khz to interface specific speed value\nDebug: 55 3 core.c:1779 adapter_khz_to_speed(): convert khz to interface specific speed value\nDebug: 56 3 command.c:201 script_debug(): command - adapter srst delay 100\nDebug: 57 3 command.c:201 script_debug(): command - reset_config srst_nogate\nDebug: 58 3 command.c:201 script_debug(): command - transport select\nDebug: 59 3 command.c:201 script_debug(): command - expr  [ string first \"hla\" $_TRANSPORT ] !\u003d -1 \nDebug: 60 3 command.c:201 script_debug(): command - cortex_m reset_config sysresetreq\nDebug: 61 3 command.c:201 script_debug(): command - gd32e23x.cpu configure -event examine-end  gd32e23x_default_examine_end \nDebug: 62 3 command.c:201 script_debug(): command - gd32e23x.cpu configure -event reset-start  gd32e23x_default_reset_start \nDebug: 63 3 command.c:201 script_debug(): command - gd32e23x.cpu configure -event reset-init  gd32e23x_default_reset_init \nDebug: 64 3 command.c:201 script_debug(): command - adapter srst delay 500\nDebug: 65 3 command.c:201 script_debug(): command - reset_config none\nDebug: 66 3 command.c:201 script_debug(): command - reset_config srst_only\nDebug: 67 3 command.c:201 script_debug(): command - gd32e23x.cpu configure -event gdb-attach \n  reset halt\n\nDebug: 68 3 command.c:201 script_debug(): command - gd32e23x.cpu configure -event gdb-detach \n    resume\n\nDebug: 69 3 command.c:201 script_debug(): command - gd32e23x.cpu configure -event reset-init \n#       mww 0x40053000 0x02\n\nDebug: 70 3 command.c:201 script_debug(): command - init\nDebug: 71 3 command.c:201 script_debug(): command - target init\nDebug: 72 3 command.c:201 script_debug(): command - target names\nDebug: 73 3 command.c:201 script_debug(): command - gd32e23x.cpu cget -event gdb-flash-erase-start\nDebug: 74 3 command.c:201 script_debug(): command - gd32e23x.cpu configure -event gdb-flash-erase-start reset init\nDebug: 75 3 command.c:201 script_debug(): command - gd32e23x.cpu cget -event gdb-flash-write-end\nDebug: 76 3 command.c:201 script_debug(): command - gd32e23x.cpu configure -event gdb-flash-write-end reset halt\nDebug: 77 3 command.c:201 script_debug(): command - gd32e23x.cpu cget -event gdb-attach\nDebug: 78 3 target.c:1656 handle_target_init_command(): Initializing targets...\nDebug: 79 3 semihosting_common.c:99 semihosting_common_init():  \nDebug: 80 11 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x0bda:0x0181: Access denied (insufficient permissions)\nDebug: 81 11 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x8087:0x0024: Access denied (insufficient permissions)\nDebug: 82 11 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x1d6b:0x0002: Access denied (insufficient permissions)\nDebug: 83 11 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x0b95:0x1790: Access denied (insufficient permissions)\nDebug: 84 11 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x05e3:0x0616: Access denied (insufficient permissions)\nDebug: 85 11 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x1d6b:0x0003: Access denied (insufficient permissions)\nDebug: 86 11 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x05e3:0x0610: Access denied (insufficient permissions)\nDebug: 87 11 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x1d6b:0x0002: Access denied (insufficient permissions)\nDebug: 88 11 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0xceeb:0x0007: Access denied (insufficient permissions)\nDebug: 89 11 cmsis_dap_usb_bulk.c:162 cmsis_dap_usb_open(): found product string of 0x28e9:0x058f \u0027CMSIS-DAP\u0027\nDebug: 90 11 cmsis_dap_usb_bulk.c:182 cmsis_dap_usb_open(): enumerating interfaces of 0x28e9:0x058f\nDebug: 91 12 cmsis_dap_usb_bulk.c:229 cmsis_dap_usb_open(): found interface 0 string \u0027CMSIS-DAP GD32\u0027\nDebug: 92 12 cmsis_dap_usb_bulk.c:249 cmsis_dap_usb_open(): skipping interface 0, endpoint[0] is not bulk out\nDebug: 93 12 cmsis_dap_usb_bulk.c:182 cmsis_dap_usb_open(): enumerating interfaces of 0x0409:0x005a\nDebug: 94 12 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x1784:0x000b: Access denied (insufficient permissions)\nDebug: 95 12 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x05e3:0x0608: Access denied (insufficient permissions)\nDebug: 96 12 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x8087:0x0024: Access denied (insufficient permissions)\nDebug: 97 12 cmsis_dap_usb_bulk.c:117 cmsis_dap_usb_open(): could not open device 0x1d6b:0x0002: Access denied (insufficient permissions)\nInfo : 98 85 cmsis_dap.c:1039 cmsis_dap_get_caps_info(): CMSIS-DAP: SWD  supported\nInfo : 99 85 cmsis_dap.c:1039 cmsis_dap_get_caps_info(): CMSIS-DAP: JTAG supported\nInfo : 100 85 cmsis_dap.c:1039 cmsis_dap_get_caps_info(): CMSIS-DAP: Atomic commands supported\nInfo : 101 85 cmsis_dap.c:1039 cmsis_dap_get_caps_info(): CMSIS-DAP: Test domain timer supported\nInfo : 102 87 cmsis_dap.c:1016 cmsis_dap_get_version_info(): CMSIS-DAP: FW Version \u003d 2.0.0\nInfo : 103 91 cmsis_dap.c:1163 cmsis_dap_swd_open(): CMSIS-DAP: Interface Initialised (SWD)\nDebug: 104 95 cmsis_dap.c:1245 cmsis_dap_init(): CMSIS-DAP: Packet Count \u003d 64\nDebug: 105 95 cmsis_dap.c:1248 cmsis_dap_init(): Allocating FIFO for 3 pending packets\nInfo : 106 97 cmsis_dap.c:1078 cmsis_dap_get_status(): SWCLK/TCK \u003d 1 SWDIO/TMS \u003d 1 TDI \u003d 1 TDO \u003d 1 nTRST \u003d 0 nRESET \u003d 1\nInfo : 107 107 cmsis_dap.c:1299 cmsis_dap_init(): CMSIS-DAP: Interface ready\nDebug: 108 107 core.c:1779 adapter_khz_to_speed(): convert khz to interface specific speed value\nDebug: 109 107 core.c:1783 adapter_khz_to_speed(): have interface set up\nDebug: 110 109 core.c:1779 adapter_khz_to_speed(): convert khz to interface specific speed value\nDebug: 111 109 core.c:1783 adapter_khz_to_speed(): have interface set up\nInfo : 112 109 core.c:1559 adapter_init(): clock speed 1000 kHz\nDebug: 113 109 openocd.c:143 handle_init_command(): Debug Adapter init complete\nDebug: 114 109 command.c:201 script_debug(): command - transport init\nDebug: 115 109 transport.c:230 handle_transport_init(): handle_transport_init\nDebug: 116 109 command.c:201 script_debug(): command - dap init\nDebug: 117 109 arm_dap.c:107 dap_init_all(): Initializing all DAPs ...\nDebug: 118 113 cmsis_dap.c:1112 cmsis_dap_swd_switch_seq(): JTAG-to-SWD\nInfo : 119 119 adi_v5_swd.c:148 swd_connect(): SWD DPIDR 0x0bf11477\nDebug: 120 121 arm_adi_v5.c:668 dap_dp_init(): gd32e23x.dap\nDebug: 121 121 arm_adi_v5.c:700 dap_dp_init(): DAP: wait CDBGPWRUPACK\nDebug: 122 121 arm_adi_v5.h:532 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000\nDebug: 123 123 arm_adi_v5.c:708 dap_dp_init(): DAP: wait CSYSPWRUPACK\nDebug: 124 123 arm_adi_v5.h:532 dap_dp_poll_register(): DAP: poll 4, mask 0x80000000, value 0x80000000\nDebug: 125 125 cmsis_dap.c:820 cmsis_dap_swd_write_from_queue(): refusing to enable sticky overrun detection\nDebug: 126 127 openocd.c:160 handle_init_command(): Examining targets...\nDebug: 127 127 target.c:1844 target_call_event_callbacks(): target event 19 (examine-start) for core gd32e23x.cpu\nDebug: 128 639 arm_adi_v5.c:953 dap_find_ap(): No AHB3-AP found\nDebug: 129 641 arm_adi_v5.c:941 dap_find_ap(): Found AHB5-AP at AP index: 0 (IDR\u003d0x04770025)\nDebug: 130 645 arm_adi_v5.c:815 mem_ap_init(): MEM_AP Packed Transfers: disabled\nDebug: 131 645 arm_adi_v5.c:826 mem_ap_init(): MEM_AP CFG: large data 0, long address 0, big-endian 0\nError: 132 645 target.c:2613 target_read_u32(): Target not examined yet\nDebug: 133 645 target.c:1844 target_call_event_callbacks(): target event 20 (examine-fail) for core gd32e23x.cpu\nWarn : 134 645 target.c:801 target_examine(): target gd32e23x.cpu examination failed\nDebug: 135 645 openocd.c:162 handle_init_command(): target examination failed\nDebug: 136 645 command.c:201 script_debug(): command - flash init\nDebug: 138 645 tcl.c:1387 handle_flash_init_command(): Initializing flash devices...\nDebug: 139 645 command.c:201 script_debug(): command - nand init\nDebug: 140 645 tcl.c:498 handle_nand_init_command(): Initializing NAND devices...\nDebug: 141 645 command.c:201 script_debug(): command - pld init\nDebug: 142 645 pld.c:206 handle_pld_init_command(): Initializing PLDs...\nDebug: 143 645 command.c:201 script_debug(): command - tpiu init\nInfo : 144 645 gdb_server.c:3537 gdb_target_start(): starting gdb server for gd32e23x.cpu on 3333\nInfo : 145 645 server.c:312 add_service(): Listening on port 3333 for gdb connections\nDebug: 146 645 command.c:201 script_debug(): command - reset init\nDebug: 147 645 target.c:1862 target_call_reset_callbacks(): target reset 3 (init)\nDebug: 148 646 command.c:201 script_debug(): command - expr [catch {ocd_process_reset_inner $MODE} result] \u003d\u003d 0\nDebug: 149 646 command.c:201 script_debug(): command - target names\nDebug: 150 646 command.c:201 script_debug(): command - gd32e23x.cpu invoke-event reset-start\nDebug: 151 646 target.c:4823 target_handle_event(): target(0): gd32e23x.cpu (cortex_m) event: 9 (reset-start) action:  gd32e23x_default_reset_start \nDebug: 152 646 command.c:201 script_debug(): command - adapter speed 1000\nDebug: 153 646 core.c:1816 jtag_config_khz(): handle jtag khz\nDebug: 154 646 core.c:1779 adapter_khz_to_speed(): convert khz to interface specific speed value\nDebug: 155 646 core.c:1783 adapter_khz_to_speed(): have interface set up\nDebug: 156 648 core.c:1779 adapter_khz_to_speed(): convert khz to interface specific speed value\nDebug: 157 648 core.c:1783 adapter_khz_to_speed(): have interface set up\nDebug: 158 648 command.c:201 script_debug(): command - transport select\nDebug: 159 648 command.c:201 script_debug(): command - expr  [ string first \"jtag\" $_TRANSPORT ] !\u003d -1 \nDebug: 160 648 command.c:201 script_debug(): command - transport select\nDebug: 161 648 command.c:201 script_debug(): command - expr  [ string first \"jtag\" $_TRANSPORT ] !\u003d -1 \nDebug: 162 648 command.c:201 script_debug(): command - gd32e23x.cpu invoke-event examine-start\nDebug: 163 648 command.c:201 script_debug(): command - gd32e23x.cpu arp_examine allow-defer\nDebug: 164 1160 arm_adi_v5.c:953 dap_find_ap(): No AHB3-AP found\nDebug: 165 1162 arm_adi_v5.c:941 dap_find_ap(): Found AHB5-AP at AP index: 0 (IDR\u003d0x04770025)\nDebug: 166 1166 arm_adi_v5.c:815 mem_ap_init(): MEM_AP Packed Transfers: disabled\nDebug: 167 1166 arm_adi_v5.c:826 mem_ap_init(): MEM_AP CFG: large data 0, long address 0, big-endian 0\nError: 168 1166 target.c:2613 target_read_u32(): Target not examined yet\nDebug: 169 1166 command.c:201 script_debug(): command - gd32e23x.cpu invoke-event examine-fail\nDebug: 171 1166 command.c:201 script_debug(): command - gd32e23x.cpu invoke-event reset-assert-pre\nDebug: 172 1166 command.c:201 script_debug(): command - transport select\nDebug: 173 1166 command.c:201 script_debug(): command - expr  [ string first \"jtag\" $_TRANSPORT ] !\u003d -1 \nDebug: 174 1166 command.c:201 script_debug(): command - gd32e23x.cpu arp_reset assert 1\nDebug: 175 1166 target.c:2200 target_free_all_working_areas_restore(): freeing all working areas\nDebug: 176 1166 cortex_m.c:1161 cortex_m_assert_reset(): target-\u003estate: unknown\nDebug: 177 1168 core.c:639 adapter_system_reset(): SRST line asserted\nError: 178 1168 cortex_m.c:1184 cortex_m_assert_reset(): Target not examined, will not halt after reset!\nDebug: 179 1168 command.c:201 script_debug(): command - gd32e23x.cpu invoke-event reset-assert-post\nDebug: 180 1168 command.c:201 script_debug(): command - gd32e23x.cpu invoke-event reset-deassert-pre\nDebug: 181 1168 command.c:201 script_debug(): command - transport select\nDebug: 182 1168 command.c:201 script_debug(): command - expr  [ string first \"jtag\" $_TRANSPORT ] !\u003d -1 \nDebug: 183 1168 command.c:201 script_debug(): command - gd32e23x.cpu arp_reset deassert 1\nDebug: 184 1168 target.c:2200 target_free_all_working_areas_restore(): freeing all working areas\nDebug: 185 1168 cortex_m.c:1312 cortex_m_deassert_reset(): target-\u003estate: unknown\nDebug: 186 1170 core.c:643 adapter_system_reset(): SRST line released\nDebug: 188 1674 command.c:201 script_debug(): command - gd32e23x.cpu invoke-event reset-deassert-post\nDebug: 189 1674 command.c:201 script_debug(): command - transport select\nDebug: 190 1674 command.c:201 script_debug(): command - expr  [ string first \"jtag\" $_TRANSPORT ] !\u003d -1 \nDebug: 191 1674 command.c:201 script_debug(): command - gd32e23x.cpu was_examined\nDebug: 192 1674 command.c:201 script_debug(): command - gd32e23x.cpu examine_deferred\nDebug: 193 1674 command.c:201 script_debug(): command - gd32e23x.cpu arp_waitstate halted 1000\nDebug: 194 1674 command.c:201 script_debug(): command - gd32e23x.cpu curstate\nDebug: 195 1674 command.c:591 run_command(): Command \u0027reset\u0027 failed with error code -4\nDebug: 196 1674 command.c:201 script_debug(): command - echo ** Unable to reset target **\nUser : 197 1674 command.c:729 jim_echo(): ** Unable to reset target **\nDebug: 198 1674 command.c:201 script_debug(): command - shutdown error\nUser : 199 1674 server.c:759 handle_shutdown_command(): shutdown command invoked\nDebug: 200 1674 command.c:591 run_command(): Command \u0027shutdown\u0027 failed with error code -4\nUser : 201 1674 command.c:654 command_run_line(): \nDebug: 202 1674 target.c:2200 target_free_all_working_areas_restore(): freeing all working areas\nDebug: 203 1679 cmsis_dap.c:1122 cmsis_dap_swd_switch_seq(): SWD-to-JTAG","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000843,"name":"Michael Schwingen","email":"michael@schwingen.org","username":"mschwingen2"},"change_message_id":"59da91b7a8a0273a69869102fea699b189c27d0b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"cadbc5cf_dfd5ed0e","in_reply_to":"6e498faa_4defe136","updated":"2021-09-06 08:57:39.000000000","message":"That happened after updating to current master, using my out-of-tree GD32 config files - I fixed it by changing the reset configuration, but wanted to avoid the segmentation fault.\n\nWhat happened is that at startup of openocd, in cortex-m.c, the read from 0xe000ed00 returned \"0\", and from there the error propagated up.\n\nWhat is interesting is that this did not happen with my old openocd (based on 4c00f96fc2e32397da5b46ca3428a992333548da) using the same config file.\n\nUnfortunately, I did not save the log file. I\u0027ll see if I can get back to that state.","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"21774e981f7410a83f4f816815ad723dbfcabe5f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"58786d6e_f0a9f71b","in_reply_to":"cadbc5cf_dfd5ed0e","updated":"2021-09-06 13:40:13.000000000","message":"coudl you check if this change solves you issue ?\nhttps://review.openocd.org/c/openocd/+/6548","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"35661aa7f3843529abcbd42d451309d3a42087ed","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"524c0120_9518ef24","in_reply_to":"d2f6974c_65c8886c","updated":"2021-09-06 19:22:50.000000000","message":"well, if we fail to read CPUID, the examine should fail and any further operation should fail as well.\nthe issue here, is why you can\u0027t read the CPUI, maybe your system when is reset the jtag clock is down !\ncould yopu try \nreset_config srst_gates_jtag\nif this do not work for you then try to defer the examination of your target using \n\"-defer-examine\"","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"}],"src/target/cortex_m.c":[{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"414c4384c318ae3aabf9dd6ca36d57fd3c517dac","unresolved":true,"context_lines":[{"line_number":2057,"context_line":"\t}"},{"line_number":2058,"context_line":""},{"line_number":2059,"context_line":"\tif (!target_was_examined(target)) {"},{"line_number":2060,"context_line":"\t\ttarget_set_examined(target);"},{"line_number":2061,"context_line":""},{"line_number":2062,"context_line":"\t\t/* Read from Device Identification Registers */"},{"line_number":2063,"context_line":"\t\tretval \u003d target_read_u32(target, CPUID, \u0026cpuid);"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"9e1add98_25c8cc48","line":2060,"range":{"start_line":2060,"start_character":2,"end_line":2060,"end_character":30},"updated":"2021-09-05 21:45:29.000000000","message":"IMO, this call should be moved after examination real success","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"4b958777697edcfc82b4303bf2ae16818dab3a87","unresolved":true,"context_lines":[{"line_number":2057,"context_line":"\t}"},{"line_number":2058,"context_line":""},{"line_number":2059,"context_line":"\tif (!target_was_examined(target)) {"},{"line_number":2060,"context_line":"\t\ttarget_set_examined(target);"},{"line_number":2061,"context_line":""},{"line_number":2062,"context_line":"\t\t/* Read from Device Identification Registers */"},{"line_number":2063,"context_line":"\t\tretval \u003d target_read_u32(target, CPUID, \u0026cpuid);"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"3b9a2219_c7fe3fba","line":2060,"range":{"start_line":2060,"start_character":2,"end_line":2060,"end_character":30},"in_reply_to":"85fa8bb0_08496505","updated":"2021-09-06 13:29:50.000000000","message":"Antonio, I have started to change this but, I have noticed an odd usage of examined flag target.c, handle_target function, where it sets examined to true even if target_examine_one() fails.\nI will preview my change as RFC and discuss on top of it.","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b50a69207a02fe620bd04005961409cf8c12ffca","unresolved":true,"context_lines":[{"line_number":2057,"context_line":"\t}"},{"line_number":2058,"context_line":""},{"line_number":2059,"context_line":"\tif (!target_was_examined(target)) {"},{"line_number":2060,"context_line":"\t\ttarget_set_examined(target);"},{"line_number":2061,"context_line":""},{"line_number":2062,"context_line":"\t\t/* Read from Device Identification Registers */"},{"line_number":2063,"context_line":"\t\tretval \u003d target_read_u32(target, CPUID, \u0026cpuid);"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"85fa8bb0_08496505","line":2060,"range":{"start_line":2060,"start_character":2,"end_line":2060,"end_character":30},"in_reply_to":"9e1add98_25c8cc48","updated":"2021-09-05 22:03:54.000000000","message":"Or move it in the caller and call it only if the target\u0027s examination returns ERROR_OK.\nToday it\u0027s widely spread across targets, but should be centralized and only some specific case should call it directly","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"}],"src/target/target.c":[{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"d9e591a0e5b9fdafe11776afe6bcf1aa07aa1590","unresolved":true,"context_lines":[{"line_number":735,"context_line":"{"},{"line_number":736,"context_line":"\ttarget_call_event_callbacks(target, TARGET_EVENT_EXAMINE_START);"},{"line_number":737,"context_line":""},{"line_number":738,"context_line":"\tint retval \u003d target-\u003etype-\u003eexamine(target);"},{"line_number":739,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":740,"context_line":"\t\ttarget_call_event_callbacks(target, TARGET_EVENT_EXAMINE_FAIL);"},{"line_number":741,"context_line":"\t\treturn retval;"},{"line_number":742,"context_line":"\t}"},{"line_number":743,"context_line":""},{"line_number":744,"context_line":"\ttarget_call_event_callbacks(target, TARGET_EVENT_EXAMINE_END);"},{"line_number":745,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"0dc3b8a3_5711c7fd","line":742,"range":{"start_line":738,"start_character":1,"end_line":742,"end_character":2},"updated":"2021-09-05 21:52:38.000000000","message":"also a global examination failure watch could be added here\n\n\tif (retval !\u003d ERROR_OK) {\n\t\ttarget-\u003eexamined \u003d false;\n\t\ttarget_call_event_callback(...);\n\t\treturn retval;\n\t}","commit_id":"e8515fa9190e345303add9033a91e904ad6b9cfe"}]}
