Closed k0d closed 4 years ago
Yeah, Vref may be a bit of a misnomer, but I'll explain how we got there and see what you think:
I started from the JTAG/SWD interface directly from Keil's ULINKplus In that, they call it VCC. The CMSIS-DAP (DAPLink) adapter I was currently using (as in, sitting on my desk at the moment) also uses VCC as one of it's 5 pins (VCC,GND,SWDIO,SWCLK,nRESET).
I think it was when @tannewt I were looking at seeing that it could support lots of different protocols that we swapped it to Vref, because it didn't necessarily need to supply power in some of those cases. I really can't tell if it's something we should be naming "VCC/Vref", naming something else, or how to deal with it exactly.
If you want a real confusing rabbit hole to dig down, check out all the different names/'functions' ST uses for essentially the same pin: VDD, Target VCC, MCU VCC, MCU VDD, VAPP.
Maybe we need a whole new name that is all of those, plus the potential of Vref?
On the STLink v3 board, it's connected to a voltage divider that the STLink MCU uses to detect the target voltage.
If we called it VCC, then I'd expect it to supply voltage...which a STDC14 to Debug-Edge adapter board would not. On JTAG there is a pin (19 I think) which is 5v supply, that's VCC in my view.
What's the CMSIS-DAP connector you have?
This one https://github.com/ARMmbed/mbed-HDK-Eagle-Projects/blob/master/DAPLink/Probes/SWDAP/v1.0.0/SWDAP-v1.0.0-SCH.pdf is kind of an official one, and VCC isn't connected. It's meant to be T_VCC...but they don't label it as that it seems.
OpenOCD uses the target voltage detection sometimes to do then flash programming. It can fail sometimes if you don't use it.
My suggestion is we keep VRef and use it as T_VCC (don't connect to H_VCC), but maybe it's good to get other people into this discussion. Maybe @ladyada @arturo182 ?
Hmm, off course, if you supply 3v3 on the VRef to the target, then the target's VCC will be 3v3, which is what it'd detect. So I guess it depends on if the H_VCC line can supply enough mAh to the target.
I think it's ok to use it as both....but...we should clearly mark that VRef might not supply current in the debug-edge docs. That's the biggest issue with other connector specs, it's not clearly communicated.
Oh....should we add a marking on the VRef pin to indicate if it supplies power? then the board developer can choose to show it or not.
^ That was along the lines of what I was thinking, but I couldn't come up with a clean (read: tiny) way to say "this might supply power, depending on your adapter/protocol/etc." Any ideas?
My board I'm making right now will not supply power, so it doesn't matter for me today.
That's good at least! Yeah that's why I had the little solder bridge there that can be cut on the Vref line on the host board side, because I'm not quite sure what the right answer is yet, too!
On Mon, Aug 31, 2020 at 9:39 AM Mark Olsson notifications@github.com wrote:
My board I'm making right now will not supply power, so it doesn't matter for me today.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/debug-edge/DebugEdge/issues/4#issuecomment-683784873, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAETEQZIPCWCWQB3Q32VYW3SDOR2HANCNFSM4QQNX6WQ .
I wasn't thinking it'd supply power. There should definitely be a way to power it separately.
VRef is used on the JTAG connector to detect the target's voltage. It shouldn't be used to supply power to the target.
So, if we want to provide power with debug-edge, then we need to change it to VCC. Or if we use it as VRef, then the connector is still BYOP.
I prefer to have VRef, so it's then more compatible with the ARM/JTAG 10 pin connectors.
Maybe confusing and not 100% checked yet...but here is the pinouts of various connectors.