NishanthMenon changed the topic of #openocd to: this is the place to discuss all things OpenOCD | Logs: https://libera.irclog.whitequark.org/openocd/
thinkfat_ has quit [Ping timeout: 268 seconds]
thinkfat has joined #openocd
Hawk777 has joined #openocd
jancoow has joined #openocd
nerozero has joined #openocd
borneoa_ has joined #openocd
Hawk777 has quit [Quit: Leaving.]
Haohmaru has joined #openocd
defiant has joined #openocd
kraiskil has joined #openocd
zkrx has quit [Ping timeout: 268 seconds]
zkrx has joined #openocd
zerous has quit [Quit: WeeChat 3.4.1]
kraiskil has quit [Ping timeout: 265 seconds]
wingsorc__ has quit [Ping timeout: 252 seconds]
_olerem has joined #openocd
_olerem has quit [Client Quit]
shoragan has quit [Ping timeout: 240 seconds]
shoragan has joined #openocd
kraiskil has joined #openocd
shoragan has quit [Quit: quit]
shoragan has joined #openocd
shoragan has quit [Client Quit]
shoragan has joined #openocd
shoragan has quit [Ping timeout: 268 seconds]
olerem has quit [Ping timeout: 268 seconds]
olerem has joined #openocd
shoragan has joined #openocd
kraiskil has quit [Quit: Leaving]
tlwoerner_ has quit [Quit: Leaving]
tlwoerner has joined #openocd
wingsorc has joined #openocd
shoragan has quit [Quit: quit]
shoragan has joined #openocd
shoragan has quit [Ping timeout: 246 seconds]
shoragan has joined #openocd
Haohmaru has quit []
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #openocd
JakeSays has quit [Ping timeout: 265 seconds]
JakeSays has joined #openocd
noperator[m] has joined #openocd
nerozero has quit [Ping timeout: 265 seconds]
kkk has joined #openocd
kkk has quit [Client Quit]
kkk4444 has joined #openocd
<kkk4444> Hi all, I have a problem with openocd reset option. I'm using 0.11.0+dev-00561-gdbbac5f11 on Ubuntu 20.04 with following command:
<kkk4444> "/usr/local/bin/openocd" -d3 -f ./openocd.cfg -c "program build_release/file.elf verify reset exit"
<kkk4444> If I use reset argument I get following output, without the reset everything is okay:
<kkk4444> Debug: 1842 1605 hla_target.c:347 hl_assert_reset(): hl_assert_reset
<kkk4444> Debug: 1843 1605 core.c:630 adapter_system_reset(): SRST line asserted
<kkk4444> Debug: 1844 1609 command.c:166 script_debug(): command - stm32wlx.cpu0 invoke-event reset-assert-post
<kkk4444> Debug: 1845 1609 command.c:166 script_debug(): command - stm32wlx.cpu0 invoke-event reset-deassert-pre
<kkk4444> Debug: 1846 1609 command.c:166 script_debug(): command - transport select
<kkk4444> Debug: 1847 1609 command.c:166 script_debug(): command - expr [ string first "jtag" $_TRANSPORT ] != -1
<kkk4444> Debug: 1848 1610 command.c:166 script_debug(): command - stm32wlx.cpu0 arp_reset deassert 0
<kkk4444> Debug: 1849 1610 target.c:2193 target_free_all_working_areas_restore(): freeing all working areas
<kkk4444> Debug: 1850 1610 target.c:1962 print_wa_layout(): 0x20008000-0x20009fff (8192 bytes)
<kkk4444> Debug: 1851 1610 hla_target.c:406 hl_deassert_reset(): hl_deassert_reset
<kkk4444> Debug: 1852 1610 core.c:634 adapter_system_reset(): SRST line released
<kkk4444> Debug: 1853 1711 target.c:1836 target_call_event_callbacks(): target event 3 (resume-start) for core stm32wlx.cpu0
<kkk4444> Debug: 1854 1711 hla_target.c:452 adapter_resume(): adapter_resume 1 0x00000000 0 0
<kkk4444> Debug: 1855 1711 target.c:2193 target_free_all_working_areas_restore(): freeing all working areas
<kkk4444> Debug: 1856 1711 target.c:1962 print_wa_layout(): 0x20008000-0x20009fff (8192 bytes)
<PaulFertser> kkk4444: please do not paste more than 3 lines to a public channel.
<PaulFertser> kkk4444: use some pastebin instead.
<kkk4444> okay
<kkk4444> sorry
<PaulFertser> kkk4444: what debug adapter are you using, do you have srst line connected and what reset_config is used?
<kkk4444> I'm using NUCLEO L476 dev board st-link as my debugger
<kkk4444> here is my reset_config: reset_config srst_only srst_nogate connect_assert_srst
<kkk4444> I see that the problem is: adapter_read_memory 0x08005950 2 1
<kkk4444> When I search for the 0x08005950 address I see that it was previous PC value:
<kkk4444> Why it is trying to restore the PC if the board is reset and it needs some time to start. can I somehow disable this behaviour?
<kkk4444> the target I'm trying to flash is stm32wle5
<PaulFertser> adapter_read_memory just reads memory, not restores anything.
<PaulFertser> kkk4444: please pastebin full -d3 log.
<kkk4444> oh, you are right, my bad
<PaulFertser> kkk4444: hm, you say it printns some error when you add "reset" but probably it's ok and expected if your target firmware puts device to sleep or remaps swd pins.
<kkk4444> that's correct, I remap my swd pins in firmware
<kkk4444> I will check if this is also the wen I don't do it
<PaulFertser> kkk4444: reset means "reset run" but it's still trying to talk to the target before it exits.
<PaulFertser> So a failure there might be expected.
<kkk4444> here is the full log with -d3: https://pastebin.com/7LjQzck5
<PaulFertser> kkk4444: yes, looks like the target can't communicate after reset run, expected if you remap swd pins.
<kkk4444> that's pity, I;m using makefile recipe to flash my board
<kkk4444> something like this:
<kkk4444> flash_release: $(REL_BUILD_DIR)/$(TARGET).elf
<kkk4444>  "/usr/local/bin/openocd" -f ./openocd.cfg -c "program $(REL_BUILD_DIR)/$(TARGET).elf verify reset exit"
<PaulFertser> kkk4444: why do you need "reset" there?
<PaulFertser> To see it running?
<kkk4444> well, I have to reset the board after flashing, I don't want to do it manually
<PaulFertser> kkk4444: ok then, a bit of Tcl should help:
<PaulFertser> -c "set err [catch {program ...}]; if {$err != 0} {shutdown error} else {reset run; shutdown}"
<PaulFertser> kkk4444: ^^ there the program arguments should be without reset and exit.
<PaulFertser> Not tested, but I hope you get the idea.
<kkk4444> okay, I will try it out, thanks
<PaulFertser> You do not actually need that set if you do not need to print the exception, so it can be just -c "if {[catch {program...}] != 0} { ..."
nvmd has joined #openocd
<kkk4444> PaulFertser maybe I'm doing something wrong but reset run; shutdown will throw error anyway
<PaulFertser> kkk4444: it should print an error but does it really return an error exit code?
<kkk4444> this is the recipe I'm using
<kkk4444> flash_debug: $(DBG_BUILD_DIR)/$(TARGET).elf
<kkk4444>  "/usr/local/bin/openocd" -f ./openocd.cfg -c "if {[catch {program $(DBG_BUILD_DIR)/$(TARGET).elf verify}] != 0} {shutdown} else {reset run; shutdown}"
<PaulFertser> kkk4444: what exit code does it produce?
<kkk4444> 1
<PaulFertser> kkk4444: did it run though?
<PaulFertser> (the target after that command)
<PaulFertser> probably it needs to be catch {reset run} then.
<kkk4444> yep
<PaulFertser> btw, your line is missing "error" from shutdown in case verify wasn't successful.
<kkk4444> it run
<PaulFertser> Then I'd try to catch {reset run}
kkk4444 has quit [Ping timeout: 252 seconds]
wingsorc__ has joined #openocd