Segger’s Awkward USB-C Issue With The J-Link Compact Debugger

Theoretically USB-C is a pretty nifty connector, but the reality is that it mostly provides many exciting new ways to make your device not work as expected. With the gory details covered by [Alvaro], the latest to join the party is Segger, with its J-Link BASE Compact MCU debugger displaying the same behavior which we saw back when the Raspberry Pi 4 was released in 2019. Back then so-called e-marked USB-C cables failed to power the SBC, much like how this particular J-Link unit refuses to power up when connected using one of those special USB-C cables.

We covered the issue in great detail back then, discussing how the CC1 and CC1 connections need to be wired up correctly with appropriate resistors in order for the USB-C supply – like a host PC – to provide power to the device. As [Alvaro] discovered through some investigation, this unit made basically the same mistake as the RPi 4B SBC before the corrected design. This involves wiring CC1 and CC2 together and as a result seeing the same <1 kOhm resistance on the active CC line, meaning that to the host device you just hooked up a USB-C audio dongle, which obviously shouldn’t be supplied with power.

Although it’s not easy to tell when this particular J-Link device was produced, the PCB notes its revision as v12.1, so presumably it’s not the first rodeo for this general design, and the product page already shows a different label than for the device that [Alvaro] has. It’s possible that it originally was sloppily converted from a previous micro-USB-powered design where CC lines do not exist and things Just Work™, but it’s still a pretty major oversight from what should be a reputable brand selling a device that costs €400 + VAT, rather than a reputable brand selling a <$100 SBC.

For any in the audience who have one of these USB-C-powered debuggers, does yours work with e-marked cables, and what is the revision and/or purchase date?

34 thoughts on “Segger’s Awkward USB-C Issue With The J-Link Compact Debugger

    1. Type C fits in well with smartphones: jack of all trades, master of none.

      In that scenario it makes sense to have a miniature “do everything” connector, but on a laptop or especially a desktop host I’d rather have specific connectors for different interfaces, that are less of a compromise for a given task and a whole lot simpler to implement. Less stuff for manufacturers and hobbyists alike to screw up.

      Shouldn’t the focus of your project be about getting the widget itself doing its thing instead of debugging Type C handshake and ID problems?

    2. The USB-C committee could come to my house and take turns slapping me in the face, and I’d still thank them for freeing me from the need to carry a separate wall wart / power brick for every electronic device I travel with.

      1. You never needed that – a set of tips to suit your devices and adjustable supply would let you avoid it no matter what your devices if you cared that much. And I used to carry a 12v and 5v in a single brick as that covered everything I needed for a while. Really not a big deal for a HAD reader at least.

        So as before USB-C and USB-PD you plug a device into your master device with a cable and the only thing that stops it from just working is this cable managed to be one of the cheap out ones that only has power lines – easy problem to solve as its always the darn cable.

        Where now everything is USB-C but the port, cable and device all must support the optional function, and any one of them doesn’t it fails to work often entirely silently so you don’t know where to look! Did you plug it into the wrong port, does this cable/port/device combo actually care if you plug it in upside down (it happens and I think would actually still be fully spec compliant in the same way those motherboards that put two usb3 ports worth of data on the single usb-C port)? Is this cable e-marked, capable of carrying the display port signals, etc? Can the powersupply provide whichever spec of PD output the device asks for? Which as its a moving standard that has changed too many darn times is reasonably likely not to be the case!

        And all that is when everything USB-C is actually designed to spec, as most of it is optional. So not even counting all the stuff like this that gets it wrong because the spec is too darn convoluted, ever evolving, and trying to do too darn much. So yeah I’d love it if USB-C went away to be replaced by something less infuriating – go back the old roots where if the conenctor fits it at least works well enough for your device to tell you ‘this would perform better in a USB3’ and the like rather than just silently failing so you have no idea if its the relatively fragile cable, or one of the things it connecting just doesn’t do that feature on that port…

        1. Lucky you with only 12V and 5V, before usb C I had a phone with 5V, a camera with 7.5V powerbank with 12V, Laptop with 19V, wireless headphone 4.5V and some other weird voltages. With USB C these are all possible, but with one charger and one cable…

        2. You never needed that – a set of tips to suit your devices and adjustable supply would let you avoid it no matter what your devices if you cared that much. And I used to carry a 12v and 5v in a single brick as that covered everything I needed for a while. Really not a big deal for a HAD reader at least.

          I’ve always been afraid of those things, and their obvious relation to Murphy’s law.

          1. Indeed, but if it goes wrong it is your fault. And if you are a HAD reader you can do ‘crazy’ things like replace all the barrel connectors to be the same ones for your 5V devices etc. The point is for folks like us if we really find carrying extra power bricks around so onerous its a trivial solve.

          2. lmao I literally designed and sold the first widely used USB PD trigger board

            There you go a fairly trivial solve, now it exists so you can solve it that way. And had you got annoyed enough before USB-PD standards you’d have figured out something else.

          3. Understanding enough of a 600 page specification document to create an implementation from scratch is hardly what I’d call “trivial,” but you’re obviously a troll who’s going to disagree with me no matter what.

          4. but you’re obviously a troll who’s going to disagree with me no matter what.

            Not really, I did say ‘fairly trivial’ which even with the hellscape USB is becoming it is still really, big difference between an unqualified trivial and fairly trivial. And should you have been annoyed enough to do something before you could piggyback on the USB-PD spec whatever you did instead could easily have ended up being far more work.

        3. Hell no, I’ve had far too many users bring devices that were cooked or malfunctioning while using those garbage interchangeable tip PSUs, the number of damaged charge sockets from someone forcing in the wrong connector is non zero as well.

          The first thing I do if a device comes in with one of those is cut the cable off and throw the PSU in the bin then issue the correct PSU

          I might not like the ways USB-C can screw you over but it’s far better than those things.

          1. I did say for the HAD audience – jamming the wrong connector in sounds like something most of us wouldn’t do, or would do very very deliberately knowing the likely result is we have to fix it properly later.

            I’ve used multi-tip for a very very long time, actually made up a set of cables for the multi barrel jack head to go on my bench – with the bench top power supply you have full control, can actually see the current draw etc. Just works so well when working on varied devices that happen to be barrel jack, so it doesn’t get that much use any more as so few devices turn up with barrel jacks.

          2. Unfortunately – USB-C is pretty fragile socket, especially used as charger for laptop, for example.
            Add here the mess of chineesium electronics that may supply, for example 12V-only usb-c power supplies with them (what in the world stopped them from using proper negotiation/trigger board or different connector?). And the mess of ‘you never know unless you read small print, which voltages it supports’ mess of support questions with power supplies…

            (type-c turns that into ‘but I plugged and it didn’t work. isn’t it a universal connector?!’. Ideally they do not fry whatever was sloppily designed and it just doesn’t work….
            Had enough problems of confiscating shitty phone chargers and cables. now there is one more issue).

        4. Every HaD reader has blown up at least one device with a barrel plug adapter that fits but is the wrong voltage or polarity. Worst case with USB-C is that the device doesn’t work until you replace the garbage cable or garbage power supply.

          1. I have never blown anything up, that way at least. And USB-C really isn’t that safe, though I do concede it is more idiot proof and safer, at least when done close to properly…

      2. Fun fact: before USB-C got put on all phones, we had micro-USB doing the exact same thing. Having different chargers for phone brands hasn’t been a thing for so long that there are generations growing up who never had to deal with that issue.

        Most USB-C ports on these devices also could have been micro-USB still, as they’re just USB 2.0 (or less), so the USB-C port just requires more internal volume and additional BOM parts. USB-C is literally a net-negative if you don’t need >USB 2.0 speeds.

      1. “You are in a twisty maze of passageways, all alike”. (You missed an s in the word standards). the whole idea of combining a myriad functions in one connector is brilliant, from the perspective of the LUS.
        Yes there is an xkcd for that and although it was written before the introduction of usb-c, it ironically still stands: https://xkcd.com/1892
        And the naming scheme, ohh.
        Before usb-c, i had a hate for the scart plug, but this is a very good second. (scart is inpossible to plug in blindly and actually tries to disengage when inserted)

        just my 2 cents.

        but yes, mechanically its a fine plug. i have to give you that.

  1. Why do people use SEGGER? Is the J-* tool ecosystem really that good? Is the RTT/ETM trace output really better than reading a fixed RAM section every couple of cycles to get the log? I mean that IS what RTT is, isn’t it?
    Don’t get me wrong, I use their tools as well but I don’t think they’re unique in their functionality. CMSIS-DAP does everything too

    1. The big appeal is this. I can literally go to ANY computer use their tools/software and everything just works. This includes about every Linux or bsd distro, Mac, Windows computer you can think of… I don’t have to worry about anything. Their tools support command line and even scripting interfacing as well as a good-ol gui of that’s your speed.

      Again they just work…

    2. You’ve already answered the question yourself. Yes, yes, and yes. There are even better ones, like the Lauterbach debugger, but you certainly don’t want to pay for that. You don’t seem to know much about it. RTT does indeed read a fixed RAM section. ETM is part of CMSIS-DAP. There are also people who use things for more than just their hobby. Time is money and having reliable, consistent and convenient products is key.

    3. I’m a 30+ year Linux vet and have used every FOSS debugging tool made and I still own a JLink Pro. As others above have pointed out, it just works… I often run the GDB server on Windows due proximity to the target and connect with GDB ext remote from Linux. Solid tool and good support from Segger.

    4. For me Ozone is the biggest selling point. You can debug without using the -debug compile option so I can track down the actually problem especially when dealing with time sensitive stuff like DMA moving memory around.

      Also it just works. I haven’t used the USB-C version but I haven’t seen any issues with the micro USB version.

    5. You don’t strictly need Segger’s tools to use RTT, but e.g. OpenOCD’s implementation is pretty janky.

      The appeal of Segger is that their tools and dongles generally Just Work (the USB-C connector issue notwithstanding), and are robust enough for production use. They also scale up with trace-capable tools, and the battery-powered programmers can be a godsend for field techs. The hardware upgrade/exchange program is also nice, though I do think the base units are way too expensive.

    6. It is. Adding an unsupported device is three C functions(One to erase flash, one to write a chunk, and one to read a chunk), a handful of configuration lines for the memory map and flash sizes, and then it pretty much Just Works. Very little debugging of the debugger.

  2. I feel bad for the engineer who screwed this up, but it’s a seriously embarrassing mistake to make at this price and with so many good resources for designs already published.

  3. Screwing up the USB-C design isn’t the worst part.

    The worst part is that Segger haven’t addressed it, fixed it, and apologised to users. Why the secrecy @Segger? Classic 21st century run & hide political tactic.

  4. i don’t understand what “e-marked cable” means but a quick googling makes them sound like premium cables you have to go out of your way to obtain?

    what i like about usb-c is that it all ‘just works’ for me. i never needed to go hunting for a specialty usb-c cable, so i never have. i have a couple long usb-c cables i bought for extension purposes, but mostly i use leftover cables that came included in the box with phones and doodads.

    i think the question about what kind of experience you should expect from a $400 device is, do they do what’s necessary to make it work? does it come with a cable that works with most computers? if you email their tech support, will they tell you to try the stock cable, and will that solve your problem?

    i don’t believe in idealism. the abstract compatibility question doesn’t matter, the real question is whether it ‘just works’.

    1. If all you want is USB2 or even dumb 5V only power USB-C is just mini-USB in a fancy coat, and should work reliably enough, as mini/micro USB is so very basic and uncomplicated you practically can’t screw it up or find optional elements of the standard are not implemented!

      But now everything is trying to use the one connector for everything you will find absolutely non of those cables you have work for something you need on that fancy device (probably). With a good case in point being higher powered device, which is what the e-marked cables are for – it is a chip in the cable that tells the devices ‘I’m capable of x’, in theory a way to allow higher power USB devices without melting cables.

      1. That’s flat out wrong for USB-C to USB-C cables and supplies.

        USB-A to USB-C is what you described, and it just gives you 5v. In the case of C to C, both CC pins are wired end to end, and the power supply won’t give any voltage unless there is an active negotiation (e.g. PD PPS) or the dummy resistors if you just want 5V. The issue with these devices is people assume USB-C is mini/micro in a fancy coat, and we get wrongly designed products.

        as for the cables, the e-marked cables are good in the sense that most people won’t need 200W on all of their cables. Things do get murky w.r.t. display out and Thinderbolt etc. Apple did it well, they just had Lightning and they have USB-C, and there are no other official options like a cheaper USB-C 2.0 cable or whatever, but obviously you can still get those horrible power-only cables on your usual shitty Aliexpress device

  5. That’s flat out wrong for USB-C to USB-C cables and supplies.

    Very true, I didn’t get into that detail and should have.

    However I really can’t call e-marked cables good myself, seems like a security nightmare waiting to happen, among other things – as the devices come with fewer and fewer ports, and faster and faster charging/higher power draw which does seem to be the way the game is going for serious gaming/business laptops and phones. So everyone will need a cable that has a chip in, and how the heck are you supposed to actually prove its not a rubber duckie when it must have a chip in it!?!?! Where if infosec is really important a dumb cable or whole batch can be tossed in the xray to inspect and notice.

    And the whole reason they are required I really don’t like – the idea of huge power and huge data speeds on tiny pinned connectors so darn close to each other – another recipe for dead devices really, though the connector and PD protocol is well enough designed you should get away with it often we are still talking about a huge pile of pads on the PCB and in the connector that are really darn close – tiny bit of tin whisker… Along the risk the power supply won’t react to a change quickly enough every time.

  6. How do the supposedly qualified idiots paid to design these products (Segger, Raspberry Pi, Adafruit) get it wrong, and yet me without EE qualifications can somehow do it correctly?

Leave a Reply to Greg ACancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.