How to make a Joycon Rail UART to capture boot log

I’ve been meaning to document this for a while now. Finally taking a break from all the other stuff to get this in writing.

First off, what is UART and why the heck do you want one?

Short answer is that it’s an easy way to get a console on a device and see what’s going on inside a device (such as a Switch) while it boots. So even if you can’t get to boot up, you can get some hints as to why. This is especially helpful when troubleshooting things such as Linux4Tegra and Android on Switch such as what you will find on #Switchroot

You can read more about Universal Asynchronous Receiver Transmitter here on Wikipedia.

There is great UART documentation on Switchbrew as well.

There’s documentation for UART logging in the Atmosphere config files too

# Key: log_port, default: 0.
# Desc: Controls what uart port exosphere will set up for logging.
# NOTE: 0 = UART-A, 1 = UART-B, 2 = UART-C, 3 = UART-D

The testpads for the 4 internal UART ports are very well documented here
(in cluster C you will find UART-A which is a completely unused albeit hard to reach internal point of entry that would otherwise be perfect for our use case.)

Here is a guy who tapped into the internal UART-A testpads and built a UART port permanently inside his switch.

There’s a treasure trove of Joycon reverse engineering with pinout information here


So what’s the point?

Well, I wanted the ability to temporarily hook up a UART whenever I needed to troubleshoot and the guys on #Switchroot were always talking about their joycon rail based UART logs during troubleshooting.

It couldn’t be that hard, right?
Well, it’s not hard once you’ve done one but finding all the information in one place and the final CROSS wiring (TX to RX) isn’t clear until you’ve done it wrong!

At the end of the day all you need is a USB to UART device from Amazon.

1675735979049.png

This is the one I used.

UPDATE: at the end of this thread I discovered this adapter which is a little more expensive because you have to buy 2 but it‘s MUCH smaller so it can be mounted inside the Switch to UART-A

1678041427872.png

https://jim.sh/1v8/

TX, RX and GND are still the only connections you need.


Important: This UART has the ability to move a jumper to make it do 1.8V. You MUST switch the device to 1.8V or you will damage your UART port.


We need to make a simple cable to connect the USB-to-UART to an unused Joycon rail assembly.



Here are the pinouts (1-10 from Left to Right)

1675736264703.jpeg

Documentation of each pin pictured above:

85ABF55A-4E71-4A6B-B4D3-3A28057DFB64.jpeg

We need pins 1, 5, and 8. Notice the 1.8V requirement.

We’ll start with the “finished product”

image.jpg

Here’s where you need to solder the 3 wires inside:

4D33A456-0B0B-4F04-A34D-88419CE37E84.jpeg

Another warning to set the jumper on the USB-to-UART circled in RED to 1.8V! If your UART can’t do 1.8V you should return it and get the correct one. If you connect a higher voltage UART you will fry your port.

1 - Black (GND)
5 - Green TX (Serial data console to Joycon)
8 - Blue RX (Serial data Joycon to console)
9 - 10 (connected with a glob of solder because this joycon doubles as an RCM Jig.)

You want to cross the TX (transmit) and RX (receive) wires with a cable to the connector in the red box at the end of the USB-to-UART adapter.

2 - Black (GND)
3 - Blue (TXD)
4 - Green (RXD)

On your PC you simply plug in your USB-to-UART device and then look in Device Manager and you should see it under Ports (COM&LPT)

1675740996980.png

Download putty.exe for your platform from the source site here: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

Open putty.exe and go to Connection -> Serial and set the serial line to match the com port in Device Manager above.

In my case that was COM3.

Speed should be 115200 and then what's commonly known as 8-n-1 or eight none and one.

1675741350266.png

Go back to Session

On connection type tap the radio button Serial.

Be sure your Serial line says COM3 and your Speed says 115200

Once everything looks like this:

1675741572368.png

You can type in a name for Saved Session and then click Save.



Now for some money shots!

As mentioned above there are 4 UART ports available on the Switch. The right Joycon rail is UART-B which in the Atmosphere docs is Port 1.

Edit your sd:/exosphere.ini file and set the log_port=1 and log_baud_rate=115200.

(Leave log_inverted=0 unless you don’t get anylogs at which point you can try setting it to log_inverted=1 and if it works that means you need to set it back to 0 and swap your TX and RX wires and try again.)

F9A7206A-2A7A-4FEE-AC7A-D76DF1C69BBD.jpeg

We should be all set…let’s Open our putty session, boot Atmosphere and watch the logs…

1675746439708.png

It's a bit anticlimactic because there's nothing going wrong but if there were errors they would show up here.

Let's do something a little more exciting and boot L4T from #Switchroot

Close your putty.exe window and open a new one.

This time let's configure L4T to do it’s looking on UART-B and see what happens...

The README_CONFIG.txt file for L4T says the UART port numbers are done slightly differently than Atmosphere:

18EE918D-F9CD-42BE-B7BC-95160E4AD7EE.jpeg

0 is disabled, 1 is UART-A (the hidden unused one inside the Switch) and UART-B (the joycon rail one we are using) is port 2.

We make that change in /bootloader/ini/L4T-bionic.ini

99423E62-8CBD-4DBB-B909-6E5C4B90278F.jpeg

Once again we ready a putty session, and…

It's a UNIX system! I know this!

1675749170234.png

Let me know if you run into anything w/ this tut.

Happy to make adjustments...
 
Last edited by binkinator,

rcpd

Well-Known Member
Member
Joined
Jan 31, 2023
Messages
617
Trophies
0
Age
55
XP
1,385
Country
United States
Great write up!! Hopefully I can add some info that’ll be helpful.

If you happen to have a Raspberry Pi 4 and some wires, you can also use that to debug UART. Hook up your UART wires to GPIO pins 0 and 01, also known as pins 27 and 28. Tx to pin 27, Rx to pin 28. Any ground will suffice.

Next enable UART2 by editing your boot.config file and adding “dtoverlay=uart2” to the end of the file. Reboot.

Install minicom using your package manager.

Finally fire up minicom and point it to the proper debugger. An example would be “minicom --device /dev/ttyUSB0 --baudrate 115200”

Hope this saves someone from buying hardware they don’t need. I may do this later today just to verify I can get output and get some photos of the process while I’m at it.
 

Slluxx

GBATemp Mayor
Developer
Joined
Jul 17, 2019
Messages
607
Trophies
0
XP
2,147
Country
Germany
Really cool guide and definitely useful!
You could probably earn a few bucks if you sell a pre soldered package.

Usually i debug my sysmodules via TCP client/server but if i had one of these, i would use this instead
 
  • Like
Reactions: binkinator

binkinator

Garfield’s Fitness Coach
OP
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,155
Country
United States
Great write up!! Hopefully I can add some info that’ll be helpful.

If you happen to have a Raspberry Pi 4 and some wires, you can also use that to debug UART. Hook up your UART wires to GPIO pins 0 and 01, also known as pins 27 and 28. Tx to pin 27, Rx to pin 28. Any ground will suffice.

Next enable UART2 by editing your boot.config file and adding “dtoverlay=uart2” to the end of the file. Reboot.

Install minicom using your package manager.

Finally fire up minicom and point it to the proper debugger. An example would be “minicom --device /dev/ttyUSB0 --baudrate 115200”

Hope this saves someone from buying hardware they don’t need. I may do this later today just to verify I can get output and get some photos of the process while I’m at it.
Be careful of the voltages. I believe gpio pins work at 3.3V which is almost double what the UART pins in a Switch operate on. Would probably work w’ a level shifter.

This in itself is funny because rPi typically needs a level shifter to safely work w/ 5V.
 
  • Like
Reactions: rcpd

rcpd

Well-Known Member
Member
Joined
Jan 31, 2023
Messages
617
Trophies
0
Age
55
XP
1,385
Country
United States
Be careful of the voltages. I believe gpio pins work at 3.3V which is almost double what the UART pins in a Switch operate on. Would probably work w’ a level shifter.

This in itself is funny because rPi typically needs a level shifter to safely work w/ 5V.
Good point! I’m used to debugging things that don’t give a crud about voltages like RockChip boards. Thanks for the reminder!
 
  • Like
Reactions: binkinator

binkinator

Garfield’s Fitness Coach
OP
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,155
Country
United States
Great work binki 👌
Her is the UART pinout for switch light. Credits goes to Ctcaer.
Much appreciated. This pic was a welcome surprise!

Thanks to both you and CTCaer for the pinouts.

Those two points in the middle have solder mask on them so I had to use a grinder to gently remove a thin layer.

I’ve got my https://jim.sh/ micro1v8 all soldered up!

image.jpg

Time to put the theory to test!
 
  • Like
Reactions: evil_santa

evil_santa

Well-Known Member
Member
Joined
Jan 15, 2020
Messages
380
Trophies
1
Age
39
XP
1,841
Country
Germany
very good binki
I'm sure the switchroot guys could use your help debugging android 11 on the lite. since only ctcear and now you have a uart port on the lite.
 
  • Like
Reactions: binkinator

binkinator

Garfield’s Fitness Coach
OP
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,155
Country
United States
Here’s my final pics of the inside of the Switch Lite. I forgot to hook up a GND wire in the previous pic.

image.jpg

Here’s a cleaned up diagram based on CTCaer’s pic.

4F9DBDF2-DCF7-4CFA-9DA5-AD528FD81D52.jpeg

Here it is in action!

17DB0422-5691-4F0E-AE03-B94C225DBB11.png

very good binki
I'm sure the switchroot guys could use your help debugging android 11 on the lite. since only ctcear and now you have a uart port on the lite.
Oh…wild. I figured there would be more UART-A/Lite people. I’ll ping them once I get everything mounted inside and closed back up.
Post automatically merged:

“It is finished” -Jesus

image.jpg

Full Frontal

image.jpg
Overhead Drone Shot

Oh, you naughty little monkey, you!

Here you go!
image.jpg


Magnets!

image.jpg


With LED!

image.jpg
 
Last edited by binkinator,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=A0FyqCEfD0E