NishanthMenon changed the topic of #openocd to: this is the place to discuss all things OpenOCD | Logs: https://libera.irclog.whitequark.org/openocd/
xorbital has joined #openocd
xorbital has quit [Ping timeout: 268 seconds]
tsal_ has joined #openocd
tsal has quit [Ping timeout: 260 seconds]
MGF_Fabio has joined #openocd
nerozero has joined #openocd
Haohmaru has joined #openocd
<Haohmaru> well, crap, i can't seem to erase a chip
wingsorc has quit [Ping timeout: 272 seconds]
<Haohmaru> Debug: 140 165 command.c:544 run_command(): Command 'atsame5 chip-erase' failed with error code -4
slobodan_ has joined #openocd
slobodan__ has joined #openocd
slobodan_ has quit [Ping timeout: 268 seconds]
<Haohmaru> altho that's for samd2x
<PaulFertser> Haohmaru: why do you need to erase the chip with a special command?
<Haohmaru> guess ;P~
<Haohmaru> there's this so called Security Bit ;P~
<Haohmaru> after setting it - the debugger is pretty much unusable, can't connect, can't read the chip ID, can't debug... can't reflash..
<Haohmaru> the only way to turn it off is via chip erase from the "DSU" peripheral
<PaulFertser> So you have a same5 specific question about how to fully erase it with that security bit set, right?
<PaulFertser> Haohmaru: you should pastebin whole log.
<Haohmaru> there's "atsame5 chip-erase" but ... it doesn't work, basically it fails to write the value into the DSU because.. well, everything fails
<Haohmaru> i also tried to "mwb <address_of_DSU_register> <chip_erase_command>" but that fails the same way
<Haohmaru> the datasheet does mention a "cold plug" thing
<PaulFertser> Haohmaru: you should pastebin whole log.
<Haohmaru> with the "chip-erase" command?
<PaulFertser> Yes
slobodan__ has quit [Read error: Connection reset by peer]
slobodan has joined #openocd
<PaulFertser> Haohmaru: do you have reset line physically connected?
<Haohmaru> of course, it goes to the SWD port
<PaulFertser> Haohmaru: so enable it with "reset_config srst_only" and try adding "reset halt" before chip-erase.
<Haohmaru> something different happened now, a pile of text got printed, but at the end i still see a fail, and the chip isn't erased (it blinks LEDs)
<Haohmaru> i did: ... -c "init" -c "reset_config srst_only" -c "reset halt" -c "atsame5 chip-erase"
<PaulFertser> I need full log
<Haohmaru> hm, since what's currently flashed on does have my bootloader on, i wonder if i can make a firmware that just does the chip erase... seppukko.elf ;P~
<PaulFertser> Haohmaru: do you have reset button there?
<Haohmaru> nope
<Haohmaru> just a pull resistor, maybe also a LPF capacitor
<Haohmaru> lemme see
<Haohmaru> yes, 10k pull up, and 47n capacitor to GND
<Haohmaru> also 1k pull up on SWCLK
<PaulFertser> Haohmaru: try also adding "connect_assert_srst" to reset_config and show the full log, that might give additional hints.
<Haohmaru> -c "init" -c "reset_config srst_only connect_assert_srst" -c "reset halt" -c "atsame5 chip-erase" ?
<PaulFertser> Yes
bvernoux has joined #openocd
<PaulFertser> Haohmaru: reset_config should be before init
<Haohmaru> oh
<PaulFertser> Haohmaru: hm but it used to be better before, now SWD doesn't work at all.
<PaulFertser> While before you were able to read swd id.
<Haohmaru> i can't even tell what's going on *shrug*
<Haohmaru> earlier the chip was getting reset btw
<PaulFertser> Not sure how exactly to help you but the idea should be something along the lines of getting DSU to halt the CPU early by pulling TCK low and then pulsing reset (can be done manually) and then somehow connecting with OpenOCD. Not sure how to talk to DSU without examination though.
<Haohmaru> (the board beeps on init, so i heard it)
<Haohmaru> i'll try making a seppukku.elf
<Haohmaru> but this would only work because i have a bootloader otherwise i can't change the firmware
<Haohmaru> crap, i think it doesn't work from the firmware
<Haohmaru> would the "cmsis_dap_init_samd_cold_plug" thing that is mentioned help? i tried it already but openocd didn't recognize it, afaik i'll have to build openocd with some modifications...
<Haohmaru> hm, would a different debugger make a difference? i still have the Original Atmel ICE at home...?
<PaulFertser> Haohmaru: https://sourceforge.net/p/openocd/mailman/openocd-user/thread/001a01d35dfb$2a3c84a0$7eb58de0$@gmail.com/
<PaulFertser> "You just need to keep SWCLK signal low and pulse reset."
<PaulFertser> Read that thread in full
<Haohmaru> hm, well there's a 1k pull up on the SWCLK (that's how the datasheet tells me to wire it up..)
<Haohmaru> i didn't read too much because it's about SAMD2x
<Haohmaru> wasn't sure if it's related at all
<Haohmaru> maybe if i connect a 470R to GND, with the 1k up it'll make a voltage divider
<Haohmaru> i'm afraid to not fry the debugger
<PaulFertser> Haohmaru: disconnect the debugger pull manually
<PaulFertser> With 0k
<PaulFertser> Or compile OpenOCD with that special cmsis-dap specific command.
<Haohmaru> which thing?
<PaulFertser> I do not see why it shouldn't work.
<Haohmaru> the 1k pull up on SWCLK is on my board,
<PaulFertser> So pull down with 0k
<Haohmaru> yes, altho that way i'll short the debugger's SWCLK pin which i assume is an output
slobodan has quit [Read error: Connection reset by peer]
<Haohmaru> or you mean to do that while the debugger isn't connected
<PaulFertser> 16:05 < PaulFertser> Haohmaru: disconnect the debugger pull manually
slobodan has joined #openocd
<Haohmaru> okay, this is where it'd be handy if i was an octopus ;P~
slobodan has quit [Read error: Connection reset by peer]
slobodan has joined #openocd
slobodan has quit [Remote host closed the connection]
slobodan has joined #openocd
<Haohmaru> so i shorted SWCLK to GND thru 470R, then when i reset the chip - it doesn't start the firmware
<Haohmaru> ...even if i remove the 470R resistor
<Haohmaru> then i plug the debugger - still doesn't run the firmware... but then the commands i tried didn't seem to work
<PaulFertser> Haohmaru: good, it shouldn't be running, it should be "stuck", then just run the command as suggested in the thread, the chip-erase one, without reset.
<Haohmaru> just init and chip-erase, right?
<PaulFertser> Yes
<Haohmaru> doesn't seem to work, still -4
<Haohmaru> and "target not examined.."
<PaulFertser> That was my best idea, sorry.
<Haohmaru> atmel ice won't help, right? it would be the same as far as openocd is concerned?
<Haohmaru> still a "swdap"
merethan has joined #openocd
slobodan has quit [Read error: Connection reset by peer]
slobodan has joined #openocd
jybz has quit [Excess Flood]
jybz has joined #openocd
bvernoux has quit [Read error: Connection reset by peer]
bvernoux has joined #openocd
Haohmaru has quit [Quit: saionara]
gzlb has quit [Ping timeout: 246 seconds]
gzlb has joined #openocd
MGF_Fabio has quit [Ping timeout: 255 seconds]
slobodan has quit [Read error: Connection reset by peer]
slobodan has joined #openocd
slobodan has quit [Read error: Connection reset by peer]
slobodan has joined #openocd
bvernoux_ has joined #openocd
bvernoux has quit [Ping timeout: 240 seconds]
merethan has quit [Ping timeout: 272 seconds]
akaWolf has quit [Quit: leaving]
akaWolf has joined #openocd
slobodan has quit [Ping timeout: 260 seconds]
akaWolf has quit [Quit: leaving]
akaWolf has joined #openocd
wingsorc has joined #openocd
akaWolf has quit [Quit: leaving]
akaWolf has joined #openocd
nerozero has quit [Ping timeout: 268 seconds]
zjason`` has joined #openocd
Guest45 has joined #openocd
Guest45 has quit [Client Quit]
zjason` has quit [Ping timeout: 268 seconds]
MGF_Fabio has joined #openocd
MGF_Fabio has quit [Quit: Konversation terminated!]
MGF_Fabio has joined #openocd
Foxyloxy has quit [Quit: Textual IRC Client: www.textualapp.com]
Foxyloxy has joined #openocd
MGF_Fabio has quit [Quit: Konversation terminated!]
Foxyloxy has quit [Quit: Textual IRC Client: www.textualapp.com]
Foxyloxy has joined #openocd
Foxyloxy has quit [Quit: Textual IRC Client: www.textualapp.com]
bvernoux_ has quit [Quit: Leaving]
Foxyloxy has joined #openocd
vampirefrog has quit [Remote host closed the connection]
xorbital has joined #openocd
xorbital has quit [Ping timeout: 240 seconds]