Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [11:20] <bdr_tobias> Hi there. I'm having a problem with OpenOCD and an ATSAMD20. I can issue a "at91samd set-security enable" flash lock and, without a power cycle, issue a chip-erase to release the lock again. If I do a full power cycle in between locking and erasing, I'm unable to connect to the target at all anymore and all I get is variations of "Target not examined yet", "Could not initialize the debug port", and "write to DSU CTRL failed". Any ideas would be much appreciated!
- [11:21] <bdr_tobias> Host is a Raspberry Pi and programming, erasing, verifying all works. Here is my config https://pastebin.com/PdYPCRkg
- [11:27] <PaulFertser> bdr_tobias: truncated after "Any i"
- [11:27] <PaulFertser> bdr_tobias: so basically you say you're unable to connect to a locked atsamd20 but you would like to be able to erase such protected devices?
- [11:28] <bdr_tobias> "Any ideas would be much appreciated!" :)
- [11:28] <bdr_tobias> That is the normal behaviour, no?
- [11:28] <bdr_tobias> A lock doesn't allow anything but a mass erase.
- [11:29] <PaulFertser> bdr_tobias: I'm not familiar with this specific controller, I know for some controllers locks are permanent and can't be lifted anyhow.
- [11:29] <bdr_tobias> This is definitely not the case here. I can lock and erase to my hearts content from Atmel Studio with Atmel ICE.
- [11:30] <bdr_tobias> I can lock with OpenOCD, erase from Atmel Studio and everything is fine again.
- [11:30] <PaulFertser> bdr_tobias: have you tried connecting to the target and then doing "reset halt" and then trying the erase?
- [11:31] <bdr_tobias> The problem is that it doesn't connect to the target at all anymore, as far as I can tell. I have tried all kinds of variations of reset, halt, reset halt, all the other reset options I can find, but a "targets" always comes back with "unknown".
- [11:31] <PaulFertser> bdr_tobias: btw, you specify srst but you do not actually enable it in reset_config
- [11:31] <PaulFertser> bdr_tobias: also I notice you're using sysfsgpio driver while on rpi you can use a much faster bcm2835gpio driver.
- [11:32] <bdr_tobias> Do you think these things have something to do with my issue?
- [11:32] <PaulFertser> bdr_tobias: I'm not sure the output of "targets" is important. What exactly do you see if you connect to such a locked target? And what do you see if you perform "reset halt" after that?
- [11:32] <bdr_tobias> What, let me create a log for you.
- [11:32] <bdr_tobias> *Wait
- [11:33] <PaulFertser> bdr_tobias: to reliably reset the target you should be using hardware reset line, I'd guess.
- [11:33] <PaulFertser> bdr_tobias: and since you specify it, it's kinda strange you do not actually use it.
- [11:36] <bdr_tobias> Okay, I will look into this, thanks for the suggestions. Here is the output of the openocd session. I edited in the commands I issued via telnet. https://pastebin.com/uDFjQCjr
- [11:42] <PaulFertser> bdr_tobias: ok, please retry the same with hardware reset enabled
- [11:53] == nighty- [[email protected]] has joined #openocd
- [11:57] <bdr_tobias> Okay, I tried with the following two configs, one using the native bcm driver and one as I had it earlier but still the same results. Maybe I'm doing something severely wrong with the reset config? https://pastebin.com/JV2yYSgd
- [11:59] <PaulFertser> bdr_tobias: you do not need "init" at the end btw. I do not think you should be trying connect_assert_srst, no. Please just try "srst_only" and show how "reset halt" behaves.
- [12:00] <bdr_tobias> Will do, one sec.
- [12:04] <bdr_tobias> https://pastebin.com/JGknxJnp
- [12:05] <bdr_tobias> My old config produces the same.
- [12:06] <bdr_tobias> Maybe the problem is in the at91samdXX.cfg I'm sourcing?
- [12:07] <PaulFertser> bdr_tobias: hm, I suggest you write to the devel mailing list. I hope Tomas Vanek will help.
- [12:13] <bdr_tobias> Okay, that's too bad. Thanks for all your help once again! If there's a way for me to buy you a coffee, let me know!
- [12:14] <PaulFertser> bdr_tobias: sorry can't help much, as this specific microcontroller is not anywhere near me, and so I have no experience with those DSU specific tricks etc. I really hope you get it working soon with Tomas's help.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement