Profile cover photo
Profile photo
Jen Tong (Mimming)
Helping people cause trouble with code
Helping people cause trouble with code


Post has attachment
I got one of my favorite dino drawings ever from Aerial Essentials

I also need to fix EXIF rotation data stuff in my mobile hexo posting flow's image cruncher. :)
Aerial Essentials
Aerial Essentials

Post has attachment
I’m about to jump on stream to work on a PANOPTES electronics board. You can watch me live on Twitch

I’m doing the conference thing this week at RSA so my coding livestream will be delayed until the evening. Tonight I’ll continue on my PANOPTES demo unit build.

Post has attachment
Ordering the parts for my PANOPTES unit has an added bonus: 2 new dinosaur drawings for Dinopacks
Dino Drawings
Dino Drawings

Post has attachment
Today on my coding stream: tinkering around with Sysdig’s open source stuff for Kubernetes and GKE. I’ll start at 1100 PDT on Twitch

Post has attachment

Last year I did a blog series on social media spring cleaning. Is there any interest in a revisit for this year?

I’m considering doing it as a checklist on GitHub for easier contributions.

Post has attachment
This week on my coding stream I’ll be doing some PANOPTES observation integration stuff, followed by continuous integration for a Hexo static html site. 11am PDT to about 3pm on

Post has shared content
This post is a detailed writeup of the protocol errors noticed on the +Nintendo Switch.

Good news: the +Innergie / +InnergieEurope / +Delta Electronics 45w charger is robust and works to power both the Switch and Switch Dock!
Bad news: the Nintendo Switch and Dock are chock full of USB-C protocol errors and flaws. See the attached.

Although long in tooth, the Innergie is one of the few chargers that will actually properly power the Nintendo Switch and Dock. It is a USB-PD "v1.0" supply -- meaning it was designed around the 5v/12v/20v levels. (12v was split to 9v/15v in "v2.0".)

However, because it was USB-C compliant (followed the darn spec) and robustly engineered, it will work with the Switch even though it came out nearly two years before the Switch was released. (Hooray!) Innergie had the foresight to add 15v as an "optional and extra" voltage level and now it reaps the rewards. (It also has $3k $1mil in connected device insurance, so I can recommend it.)

I've attached traffic logs highlighting the multiple errors in the Switch. I first tested the PSU side of the dock, then INSIDE the dock (Switch side of the dock), then on the Switch alone.

Issues noted:

[PSU side of dock:]

* This is more of a quirk, but the Switch (and Dock) always request 0.5a before upgrading to the full amperage. However, this behavior is buggy and causes problems. (See below.)
* The dock doesn't listen to the charger. The charger says "I can't do Dual-Role Data", but the dock ignores that and tries a DR_SWAP anyway. ("50 DKP minus.")
* The dock does not properly discharge Vbus to vSafe0v within the set time. Although this isn't strictly necessary since the dock's external port isn't Dual-Role Power, it means there is excessive capacitance in the Vbus line. This is strictly regulated in the Type-C spec.
* The dock does not respond properly to DISC_ID requests from its port partner.

[Switch side of the dock:]
This is a bit of a mess. :( So I've numerically coded the errors where possible.

* (1a) The dock tells the Switch it is Dual-Role Power capable on the internal port. Meaning it is claiming the Switch tablet can theoretically power the dock itself, backwards! I don't know if this is a future planned addon for the Switch or not, but ....
* (1b) ... in the Alternate Mode Adapter product descriptor (more on this later) it claims it does not need Vbus to operate. These two points (1a) and (1b) are contradictory. (Perhaps it switches the flag as necessary?)

* (2) The dock "neuters" the USB-PD advertisements from the AC adapter. It only passes through the 5v and 15v levels. This just seems like poor future planning, especially since the Switch itself can accept multiple input voltages. Also, this means the dock passthrough is not Power Rules compliant.

* (3a) The dock remembers to "subtract" some amperage from the 5v level (3a to 0.5a) to account for its own power use, like most other hubs. (Or, it only leaves a stub since 5v/0.1a is mandatory for "error message" signaling with USB-PD.) However, it forgets to deduct the same wattage from the 15v level! (15v/3a from the Innergie 45w should be reduced to around 15v/2.4a. The Switch 39w PSUs 15v/2.6a should be reduced to around 15v/2.0a.)
* (3b) The Switch tablet is a power hog! Its maximum draw should be 2.6a, yet it hogs the whole 3.0a from the adapter. (This is similar to the bad behavior the +Made by Google Pixel phone had -- it only needs 9v/2a=18w max, but it hogged 9v/3a=27w.)

* (4a) The Switch and Dock use a proprietary "Nintendo AltMode". This is fine. However, what's not fine is jumping the gun and entering the AltMode before even querying the Dock via a DISCover_SVID probe to see if it supports it!
* (4b) The DISC_SVID probe exposing DisplayPort and "Nintendo" AltModes appears after the entry at (4a). This is bad because it means the Switch is assuming the presence of the AltMode merely because of the USB VID and PID in the DISC_ID above! This strongly hints the motivation was DRM, vendor-lockout, and shows poor consideration of forwards-compatibility. (Remember, Nintendo may release a different dock in the future... with different USB VID and PID! Hardcoding it is a bad idea, and instead it should rely on USB-PD commands to do it.)

* (5) The Switch tablet itself also has the excess capacitance on Vbus and vSafe0v time problem the dock has. This is a much greater concern since it is a "Dual-Role Power" device. (It can accept power or give power.) This vSafe0v delay problem causes significant Power-Role Swap issues with safe, compliant hardware that correctly checks for 0v before swapping power. It can take up to 2 minutes for the Switch to naturally discharge Vbus.

* (6) When the Switch finally does issue a DISC_SVID, and the dock replies, the dock messes up the reply. When you respond to a DISC_SVID request, you are supposed to "terminate" and pad the VDO message with "0000" (or "0000 0000"). Nintendo completely forgot to do that here, and tells me their chipset is bad. This noncompliant behavior means even third-party docks will have to emulate this wrong behavior to work.... which is bad for everyone, especially the ecosystem. (Race to the bottom for "compatibility".)

[Switch itself:]

* The Switch tablet always requests 0.5a before moving on to the full amperage. I don't know why it does this. Especially since this behavior causes major errors with the Switch if the charger does a SRC_CAP re-advertisement, as mentioned in my previous post.
* The Switch doesn't listen to the charger. (Yes, this is the same as the dock.) The charger says "I can't do Dual-Role Data", but the Switch ignores that and tries a DR_SWAP anyway. ("100 DKP minus.")
* The Switch does not respond properly to DISC_ID requests from its port partner.

[Interesting notes from decoding the Dock DISC_ID command:]

* The dock claims to be a dongle! No joke. "Alternate Mode Adapter". All this means it is a USB-PD device that supports AlternateModes, and there is no "cable" in-between it and the device. (No SOP'.) It also suggests there are few obstacles to using a plain-jane USB-C-over-DisplayPort-to-HDMI adapter as a mobile dock. (There were no heatsinks or fans in the dock itself, to my observation. So I don't see why not.) I hope it may be possible to hook up a Switch directly to a USB-C monitor that has >39w USB-PD and DisplayPort. (I need to test this.)

[More notes:]

* Certain chargers crash the Switch and Dock outright. (87w Apple.)
* Only 2 adapters I tested work. (The Innergie is one, I hesitate to name the other due to other flaws.)
* If your Switch bugs out, it will refuse to charge with anything until it is hard-rebooted.
* Most (80%) of chargers cause the dock to hard-crash. Instead of (properly) negotiating a 5v/0.1a "error message" to the Switch, the charge controller in the dock locks up and does not negotiate with the Switch at all.
* The Switch and dock do not properly use the CAP_MISMATCH flag. Rather, they don't use it at all. This seems like the greatest oversight, since that's specifically why it's there. USB-PD has a requirement for flashing an error LED, or displaying an error, if there is a power problem. That's what the CAP_MISMATCH bit in a REQUEST is for.

This has been a bit of a long-winded post, but it helps explain A LOT of the problems I've heard about. Hopefully Nintendo takes this post seriously and addresses these issues before ramping up production, per their recent notice. Some of these issues are chipset- and hardware- level, meaning they can only be fixed via a hardware revision ASAP.

It's really, really hard to fix a problem after you've shipped a product. Given their recent notice, it seems it may muddy the waters of the USB-C ecosystem quite severely if left unchecked. And once again, I'm just a freelance volunteer engineer doing this testing -- dedicated teams should be the ones to look at this and implement it correctly.

Comments or corrections are welcome, as always.

#USB #TypeC #USBC #NintendoSwitch
6 Photos - View album

Post has attachment
I'm coding on stream from 1100 to about 1500 PDT today (in about 30 min) This week I'm finishing up the software for my nixie tube RPG dice, and wrapping up my migration to Hexo. Live on Twitch Archives posted to YouTube
Wait while more posts are being loaded