From: Leonardo S. d. S. <leo...@gm...> - 2017-04-04 21:41:08
|
Hello Tomas, Thanks for taking the time to test this. On Tue, Apr 4, 2017 at 1:08 PM, Tomas Vanek <to...@us...> wrote: > On 02.04.2017 17:48, Leonardo Sabino dos Santos wrote: > >> Looking at the NRST line with a scope while OpenOCD starts, without >> connect_assert_srst I see 3 reset pulses of ~60ms; with connect_assert_srst >> I see a single pulse of ~11 ms. >> > It is strange. There should be only one reset pulse. Never mind that. I forgot to mention that I was running OpenOCD inside Eclipse, which starts a gdb session and programs the Flash automatically, so the extra resets must come from that. > Could you add > > $_TARGETNAME configure -event reset-assert-post { mdw 0xe000edfc } > > to your cfg and test again? I suspect write to DEMCR is not effective in > time of SRST deasserting, some > extra SWCLK pulses may solve it. No idea why the problem appears only with > connect_assert_srst. Tested it. It didn't make a difference. Here is the mdw output in case it's relevant (read result is the same with or without connect_assert_srst): Debug: 719 396 cortex_m.c:583 cortex_m_halt(): target->state: reset Debug: 720 396 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm32f1x.cpu invoke-event reset-assert-post Debug: 721 396 command.c:143 script_debug(): command - ocd_stm32f1x.cpu ocd_stm32f1x.cpu invoke-event reset-assert-post Debug: 722 396 target.c:4313 target_handle_event(): target: (0) stm32f1x.cpu (cortex_m) event: 10 (reset-assert-post) action: mdw 0xe000edfc Debug: 723 397 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_mdw 0xe000edfc Debug: 724 397 command.c:143 script_debug(): command - mdw ocd_mdw 0xe000edfc Debug: 726 397 cmsis_dap_usb.c:599 cmsis_dap_swd_run_queue(): Executing 5 queued transactions Debug: 727 397 cmsis_dap_usb.c:622 cmsis_dap_swd_run_queue(): DP write reg 8 0 Debug: 728 397 cmsis_dap_usb.c:622 cmsis_dap_swd_run_queue(): AP write reg 4 e000edfc Debug: 729 397 cmsis_dap_usb.c:622 cmsis_dap_swd_run_queue(): AP write reg 0 a2000022 Debug: 730 398 cmsis_dap_usb.c:622 cmsis_dap_swd_run_queue(): AP read reg c 0 Debug: 731 398 cmsis_dap_usb.c:622 cmsis_dap_swd_run_queue(): DP read reg c 0 Debug: 732 401 cmsis_dap_usb.c:677 cmsis_dap_swd_run_queue(): Read result: 1000501 Debug: 733 401 cmsis_dap_usb.c:677 cmsis_dap_swd_run_queue(): Read result: 1000501 User : 734 401 command.c:544 command_print(): 0xe000edfc: 01000501 This issue could be related to my debug adapter. Maybe you can recommend a good inexpensive CMSIS-DAP adapter? I use a pair of IBDAP from Armstart, very inexpensive and generally work fine, but I guess they were never popular and Armstart seems not to exist anymore (website disappeared and Facebook page completely inactive). Regards, Leonardo |