This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rg35xx by /u/novirium on 2024-08-26 13:28:59+00:00.


TLDR:

  • Can some chargers damage my device? Yes. Not all, but definitely some. The damage is caused by the RG35XX Plus mistakenly detecting that some USB C chargers are an external device (like a USB gamepad) that needs power, and trying to apply 5V to the charger itself. This can result in either or both the RG35XX Plus and the charger to heat up - sometimes just a bit, sometimes enough to damage components or the nearby battery. Read below for an explanation about how this happens.
  • If I want to be safe, what chargers are definitely going to be okay to use? Anything that uses a cable with USB A on one end, and USB C on the other. The voltage and current rating of the charger itself makes no difference. This doesn’t mean that no other setups will work (for instance, most tethered USB C chargers, or non e-marked C<->C cables will), but using an A<->C cable is the only straightforward way for most people to be sure.
  • Is there a mod to enable charging on all USB C chargers? Yes, but you lose the ability to power other devices from the USB C port on the RG35XX Plus, and it involves soldering tiny SMD components.
  • Is this relevant to other RG35XX family devices? Probably, but I don’t know - I’ve only had a look at the RG35XX Plus. Specifically, mine is marked as a “RG35XX Plus V6.0, 2024-01-09” inside on the PCB.

The full story:

I’ve had an RG35XX Plus for a week or two now, and generally been really happy with it. The one main thing that annoyed me was that it wouldn’t charge on most of the USB C chargers I have around the house. Reading around on Reddit, it became apparent this is a whole thing with the Anbernic devices - with varying reports all over the place about various chargers not working and some seeming to actually do damage to the devices. Having dealt with USB C and its power negotiation circuitry before, I decided to open the thing up, do some reverse engineering, and sort out what was going on. Fair warning - this is going to get a bit technical.

This is the circuit used in the RG35XX Plus to control and monitor the CC pins on the USB C port. I’ve labelled the relevant components in the photos of the PCB, and they’re in roughly the same position in the schematic. The other pins on the USB C port are connected on the PCB, but not shown here:

USB CC pin control and monitoring circuit

USB section on the front of the PCB

USB section on the back of the PCB

The reason I’m looking at the circuit for the two CC pins is this is how USB C tells a device on the other end of a USB C cable if it can consume or supply power. Of note - all USB chargers (either with C ports, A ports, or a tethered cable) will only ever supply 5V unless there’s digital communication from the device to explicitly say it can handle a higher voltage. This is done as a safety measure, and I’ve never heard of a (non-faulty) USB charger that damaged a device by supplying too high a voltage. The RG35XX Plus doesn’t implement this type of communication at all (USB PD or QC), and so no charger is ever going to give it more than 5V - even if the charger is capable of more than that. This is why the voltage rating on the charger doesn’t matter for our purposes, as they’ll never negotiate to use a voltage higher than 5V. The current rating also doesn’t really matter - the RG35XX Plus will draw up to 1.5A, but won’t go higher than that, even if the charger can support 3A (this is as expected, but I’ve also measured it and confirmed). This is limited by the power management chip in the RG35XX Plus.

Looking at the circuit now, before anything else: I honestly have no idea why the SBU pins on the USB C port are connected at all. Chargers don’t use them, and they definitely shouldn’t be shorted to the CC pins via R2 and R4 like they are. They won’t mess with the charging process, but they could hurt some other obscure devices if you tried to plug them into the RG35XX Plus.

The red crosses in my circuit are Do Not Populate (DNP) parts - there’s a spot for them on the PCB, but there’s no actual component on the PCB. This is common on PCBs to let the manufacturer change the circuit by removing and adding components later on, without having to reprint the PCB itself. In this case, we can see that the the engineers at Anbernic have given themselves three options to control the CC pins:

  1. Only populate R5 and R6, and just have resistors connecting the CC pins to ground.
  2. Only populate R12 and R13, and give control of the CC pins to the AXP717 power management chip.
  3. (the option currently used) Only populate R10 and R11, and connect the CC pins together to a small custom circuit around Q1.

I’m honestly not really sure why the custom circuit is used when the AXP717 chip supports proper control of the USB port pins - my guess is that this requires the firmware to communicate with the AXP717 to do it, and that software development might not have been done by the time the PCBs were manufactured. It does mean that given firmware support, a small component change could fix the problems I’m about to describe though.

Without going too deep into what the CC pins actually need to do, the circuit being used on the left is there so the RG35XX Plus can detect when a device that isn’t a charger is plugged in, so it can try and supply 5V power to it. The setup here with an NPN transistor is very non-standard, but it does nearly work. It results in roughly the correct voltage on the CC pins for a charger to detect that the RG35XX requires power, and also allows the RG35XX Plus to see when an external device needing power has been plugged in and it needs to turn the USB C port power on. This circuit has two main problems:

  1. The two CC pins on the USB C connector are shorted together. This is a common misunderstanding in implementing a USB C device, and was famously a problem on the first version of the Raspberry Pi 4. The USB C standard is quite clear about needing to keep the two CC pins separate, with their own switching and monitoring each. The main problem it causes is with e-marked USB C<->C cables, as these use one of the two CC pins to power the tiny chip inside them. The end result is that a proper USB C charger just thinks that an active cable or something like an audio adapter is connected, but not a device that needs proper power, and so it doesn’t turn on the main 5V supply. Almost all USB cables with a C type plug on both ends these days have this e-marking chip inside them, only extremely cheap ones don’t. While this is annoying - it means your device won’t charge - it’s not actually dangerous, as it won’t damage anything.
  2. The CC sense circuit can’t tell the difference between an e-marked USB C cable and a device that needs power (like a gamepad). Usually a USB C port can tell when a device that needs power is connected, because the device pulls one of the CC pins low with a 5.1K resistor. An e-marked cable actually does something very similar, but it does it with a 1K resistor, resulting in a lower voltage. Usually, you can distinguish between the two by measuring the voltage on the CC pins directly. Both of these situations will turn off transistor Q1, leaving the CC_sense line high. The circuit isn’t actually measuring the voltage, so it can’t tell the difference.

It’s this second issue that’s the potentially dangerous one: if you plug an e-marked USB C<->C cable into the RG35XX Plus, it detects this as an external device being plugged in, and happily supplies 5V to the USB C port. Critically, it does this even if there is a charger on the other end of that cable - something a USB device absolutely should not do. What happens next can vary a fair bit depending on how accurately the RG35XX Plus and the charger actually define 5V, and how the circuitry is designed. In some cases, nothing happens - the charger wonders why on earth it’s being fed 5V, and either just sits there, or turns off. In other cases the two 5V supplies “fight”, and high current can wind up flowing through components that were never intended to handle it. Usually this means they heat up, sometimes to the point of failure. There have been reports of some chargers completely destroying some Anbernic devices - I’d now say odds are pretty good that this process is what happened to them.

So - how to we avoid this happening to our devices? Well - don’t use e-marked USB C<->C cables. I don’t think this problem should ever be present in chargers that have a USB C cable tethered to them (permanently attached), but don’t know enough about their implementation to be sure. Instead, my advice would be to avoid the chance of the RG35XX Plus thinking your charger is device to be powered entirely, and always use a USB A<->C cable. USB A ports physically don’t have the CC pins, and so a USB A<->C cable usually has a built in pullup resistor to tell the USB C end that it can supply power. They definitely don’t have a pulldown resistor like the e-marked C<->…


Content cut off. Read original on https://old.reddit.com/r/RG35XX/comments/1f1o80v/an_explanation_of_the_usb_c_charging_issues_on/