Closed johnldean closed 3 years ago
Actually, I was looking back at some old comment threads from when I was doing my initial testing on this, it looks like the issue doesn't occur when using the most recent edbg build, but if I used and older version of edbg that I had forked, I had issues. In any case though, initializing at the beginning doesn't sound like a bad thing, unless I am missing something,
Seems that not having this here was a bug. I was able to use free-dap to program a samd21 with the same70 without any changes (besides pin configs) a few months ago when I was testing it with the same70 explained dev board, but recently when trying to use a same70 on a custom board, I ran into issues where it would hit the dummy handler if I try to connect to a target device when no target is connected.
looks like the line
dap_swd_write(dap_req_get_byte(), sz);
segfaults, becausedap_swd_write
was uninitialized.How this ever worked for me a few months ago, I'm not sure. It might be that when a target board is properly connected, a different code path executes where
dap_init
is called beforedap_swd_write
. In my recent testing, I didn't actually have a target connected. Addingdap_init()
to main fixes this issue.