0
\$\begingroup\$

I'm programming an ATSAME51J20 micro on a custom board with a J-link Plus compact programmer using the SWD protocol. It is successful for small programs, but fails more frequently for larger programs. Here is a screen capture of the SWD in action.

enter image description here

The clock signal is in blue, and data is in yellow.

It looks like data is getting clocked in when the data line is in a floating state (as can be seen just to the right of the middle of the screen), which could account for programming the board being unsuccessful. I tried programming a dev board via SWD and didn't see any similar behavior there (and the dev board was programmed successfully every time).

The hardware connection on the custom board is the same as on the SAME54 Xplained Pro dev board, which uses a 1k pullup on the clock line and nothing on the data line.

I'm trying to think of things that could be causing the clock to be clocking in data when the data line isn't being driven high or low.

In the curved signal to the right of the middle of the screen, it seems like something is attempting to drive the data line high curing one of the clock cycles, but it is unsuccessful. Maybe whatever peripheral is responsible for driving the data line on the micro side isn't configured correctly, and thus isn't able to drive the data fully high or fully low?

Anyone have an idea as to what could be causing this?

EDIT: The J-link datasheet states that a 100k pull up is required on the SWDIO line. However the ATSAME datasheet makes not mention of this so I assume it's internal to the chip. It seems like this is supported by the fact that the SWDIO line floats up when it's not being driven, and the fact that the dev board doesn't have an external pull-up, and that one programs successfully.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ Did you connect all the power and ground pairs on the MCU chip? With bypass caps? What power source are you using? Programmers typically will not power a target, but they need to be connected to the target's power supply to set their output drivers accordingly, and people sometimes mistake that signal for a power output. \$\endgroup\$ – Chris Stratton Oct 31 '19 at 15:15
  • \$\begingroup\$ Yes, yes, and we're not trying to power from the programmer, we have a dedicated power supply on the board. \$\endgroup\$ – Peter Kapteyn Oct 31 '19 at 17:01
  • \$\begingroup\$ Did you try lowering the SWD frequency? \$\endgroup\$ – Jan Dorniak Oct 31 '19 at 17:50
  • \$\begingroup\$ Yeah I tried several different lower frequencies \$\endgroup\$ – Peter Kapteyn Oct 31 '19 at 18:20
  • \$\begingroup\$ Is it completely obvious to everyone else which is the blue curve and which is the yellow curve on the oscilloscope? They both look white to me. \$\endgroup\$ – DKNguyen Oct 31 '19 at 18:23
2
\$\begingroup\$

Turns out it was a missing cap that was the culprit after all. We put a cap between VDDCORE and ground then all our troubles disappeared.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.