EEVblog Electronics Community Forum

EEVblog => EEVblog Specific => Topic started by: EEVblog on February 11, 2021, 01:06:36 pm

Title: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: EEVblog on February 11, 2021, 01:06:36 pm
How easy is it to take the open source Trezor Model T crypto hardware wallet files and manufacture your own? Or to modify or improve the design?
The Trezor is open source hardware, so Dave checks out the Github and looks at the hardware files available and imports into Eagle and KiCAD. Where to from here?
OSHW Logo generator: https://maciek134.github.io/oshw-logo-gen/ (https://maciek134.github.io/oshw-logo-gen/)

https://www.youtube.com/watch?v=ggeCYry3gTw (https://www.youtube.com/watch?v=ggeCYry3gTw)
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: HKJ on February 11, 2021, 05:44:05 pm
Why not ask Chris Gammell about importing Eagle into KiCad, he has just done a video about it.
https://www.youtube.com/watch?v=Jbr2IEuyVQs (https://www.youtube.com/watch?v=Jbr2IEuyVQs)
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: x1ddos on February 11, 2021, 08:28:14 pm
Nice. Shameless plug: I work on BitBox2, a successor BitBox01, now with a screen and touch/scroller sensors.
Schematics and BOM are here but they are in just PDF files: https://github.com/digitalbitbox/bitbox02-firmware/tree/master/doc. I'm currently converting our Altium sources into KiCad with a plan to then publish everything including gerbers.

Curious what you think.
Alex.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: thinkfat on February 11, 2021, 08:49:08 pm
Why not ask Chris Gammell about importing Eagle into KiCad, he has just done a video about it.

Well I just tried it with a fairly recent compile of KiCAD 5.99. It's still far from usable. Issues are mainly the silk screen (locations and size of labels) and the footprint conversion. In converted footprints, sometimes the silk layer is imported into the soldermask layer. So you have exposed copper where the silk screen should have been and no openings for pads. Effectively unusable unless you spend the time fixing those issues manually.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Unixon on February 11, 2021, 09:03:59 pm
Dave, you can have multilayer board in free version of Eagle and even generate your Gerbers!
Eagle's CAM Processor complains about layer configuration but produces correct output files.
The policy about 3rd party files is something along the lines of that a loaded file is not a subjest for editing restrictions.

Fun fact: one can add additional layers to a standard 2-layer board and use them with little effort for power planes even in restricted freeware mode.
1) Open XML board file in text editor and declare new layers by copying and editing layer definition lines;
2) Open edited board file in Eagle, add a top/bottom polygon and then change layer that this polygon belongs to (you can do this multiple times back and forth);
Editing these layers is still prohibited, so it is not possible to put regular traces there, but one can have complex polygons correctly connected to vias and TH pads :)
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Unixon on February 11, 2021, 09:15:48 pm
p.s. These dotted polygons are unrouted polygons, you can run Ratsnest on them to fix this.
CAM Processor presets for 4 and 8 layer board are attached.

Example: 4-layer board (piece of .brd file header)
Code: [Select]
<layer number="1" name="Top" color="4" fill="1" visible="yes" active="yes"/>
<layer number="2" name="Layer2" color="5" fill="1" visible="no" active="yes"/>
<layer number="3" name="Layer3" color="3" fill="1" visible="no" active="yes"/>
<layer number="16" name="Bottom" color="1" fill="1" visible="yes" active="yes"/>

Example: 8-layer board (piece of .brd file header)
Code: [Select]
<layer number="1" name="Top" color="4" fill="1" visible="yes" active="yes"/>
<layer number="2" name="Layer2" color="5" fill="1" visible="yes" active="yes"/>
<layer number="3" name="Layer3" color="3" fill="1" visible="yes" active="yes"/>
<layer number="4" name="Layer4" color="6" fill="1" visible="yes" active="yes"/>
<layer number="5" name="Layer5" color="7" fill="1" visible="yes" active="yes"/>
<layer number="6" name="Layer6" color="15" fill="1" visible="yes" active="yes"/>
<layer number="7" name="Layer7" color="9" fill="1" visible="yes" active="yes"/>
<layer number="16" name="Bottom" color="1" fill="1" visible="yes" active="yes"/>

Well, you get the idea... XML is your friend.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Unixon on February 11, 2021, 09:49:52 pm
Watch out for drill files! This board uses both TH vias (.0116 file extension) and blind vias (.0102 file extension).
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: thinkfat on February 11, 2021, 09:55:57 pm
This is how the PCB looks like after spending about 1 hour worth of fixing the footprints and adding some 3D goodness.

PS: after another hour or so, you're down to 20 DRC violations that you need to look into and about 1000 warnings about silkscreen overlaps that you can ignore for a while. The original PCB doesn't seem to have any reference designators on the silkscreen, so you'd do the same and disable them. Also, KiCAD by default warns about silkscreen overlapping pads, which Eagle (or the PCB designer who did the Trezor) seems to be OK with.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: EEVblog on February 12, 2021, 03:13:06 am
Watch out for drill files! This board uses both TH vias (.0116 file extension) and blind vias (.0102 file extension).

WTF, why would blind vias be needed on this?
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: unkown_h on February 12, 2021, 06:19:35 am
I managed to load the files in too eagle cad (seem to now be part of fusion 360) and I keep looking at silk screen and wondering why it goes off the board?  Also the reference designation seem to show up but they are all the wrong size some overlapping and some straight going over pads. I was able to generate some sort of parts lists but it still makes almost no sense with C_0603$REFLOW and some of the other thing dave mentioned,I have attached it bellow. I have also had a go at generating the Gerber files but I have almost no I idea what I am doing (2nd year electronics student), however I would more than happy to upload them if people want them.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Unixon on February 12, 2021, 06:50:59 am
Watch out for drill files! This board uses both TH vias (.0116 file extension) and blind vias (.0102 file extension).
WTF, why would blind vias be needed on this?
I don't know, but you can see ' extent="1-2" ' parameter in .brd file for some vias which determines a blind via while all other have ' extent="1-16" ' which determines through hole via.
This board is weird, it has 16 layers declared, but 3 of them used, 2nd internal layer is empty, there's not even a power polygon in there.
Top and bottom layers are signal+power, 2nd layer is signal, 3rd is empty.  :-//
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: riyadh144 on February 12, 2021, 07:08:26 am
Blind vias on this, why god why?
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: riyadh144 on February 12, 2021, 07:21:17 am
I tried importing it into kicad 5.99, the edge cuts are fine, after refilling nothing is not connected, the problem is those micro vias, which I honestly dones't understand the need for. I think it might be easier to relay out at least the traces.
I will be doing that now.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Unixon on February 12, 2021, 07:29:22 am
OK, I fixed blind vias, had to replace extent for all blind vias and move 3 of them slightly to fix overlapping with bottom signal traces.
Now it's semi-standard 3of4-layer board and it looks like it passes DRC.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Unixon on February 12, 2021, 07:33:45 am
Attached fixed Eagle files.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: riyadh144 on February 12, 2021, 07:34:31 am
You have done a great job,
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: riyadh144 on February 12, 2021, 07:41:12 am
Importing into kicad gives me a huge amount of errors, the vias aren't connected on other layers it is complaining.

I really want to start this project all over. It might be worth it to reroute it. Also I hate their layout it sucks
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: thinkfat on February 12, 2021, 07:46:17 am
Indeed, the designer allowed himself a pretty expensive luxury for convenience sake. Blind vias with 0.2mm drills, that puts you outside of cheap manufacturing. Pretty sure the whole board could have been done with 0.3/0.6 vias, it's not that densely populated. They could have reduced the track width in exchange for board area, they're doing 8/8, going down to 6/6 would have saved some space and still be what e.g. JLCPCB can manufacture. There's just two areas where routing will get a little fiddly, one is the USB-C receptacle where things are quite tight, the other place is the display connector on the bottom right of the top side.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: thinkfat on February 12, 2021, 07:56:46 am
Importing into kicad gives me a huge amount of errors, the vias aren't connected on other layers it is complaining.

I really want to start this project all over. It might be worth it to reroute it. Also I hate their layout it sucks

I'll put my KiCAD project on my github in a while. I'm down to about 4 DRC violations and a ton of silkscreen warnings that I excluded. Didn't fix the blind via thing yet. You're welcome to start from that.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: riyadh144 on February 12, 2021, 08:00:52 am
Oh wow that display connector is killing me, that isn't within JLCPCBs capabilities. And yes the USB C, there is a trace that I am 100% confident cannot fit with JLC's capabilities, I would certainly change a few components to make them more easily manufacturable, the board isn't that small and there isn't that many components.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Unixon on February 12, 2021, 12:18:45 pm
Considering the display connector ... it's almost OK, but pads must be little bit thinner to allow 0.2mm clearance.
USB C is OK, nothing special, 0.3mm pads with 0.2mm clearance.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Rdx on February 12, 2021, 04:31:14 pm
Being a mechanical engineer I feel like mentioning that the data 3D for the case also seems to be only given as STEP format - not the actual CAD data.
It is more like having only a PDF file vs the actual native data that you can edit.

Another one to take off of their OSHW logo
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: thinkfat on February 12, 2021, 04:58:06 pm
https://github.com/thinkfat/trezor-model-t-kicadv6
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: riyadh144 on February 12, 2021, 05:27:20 pm
I don't know these dimensions aren't manufactured easily with something like JLCPCB. We could go with cheaper and better suited components, especially that we only need USB 2.0
That is my favorite connector for that. https://lcsc.com/product-detail/USB-Connectors_XKB-Enterprise-U262-161N-4BVC11_C319148.html

Also the clearances on that display connector is very small and not manufacturable with the usual scumbags.

The components are places way too close together and their orientations suck in my opinion, they could have spaced them out and made their locations more appropriate, they have the space why not use it.

Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Unixon on February 12, 2021, 07:34:33 pm
Also the clearances on that display connector is very small and not manufacturable with the usual scumbags.
Here's your good clearance connector :)

p.s. It's easy to extract components from an Eagle project into a library. Just create an empty library and copy over (in text editor) corresponding library sections from .sch and .brd files. I believe once there was even a script to do this in one click.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: ignilux on February 13, 2021, 04:06:30 am
I tried to post this in a comment on the follow-up video, but apparently Google has decided that links to Github should be banned. Thanks, asshats...

The hardware docs for the Trezor Model T are in a separate repo, found here (https://github.com/trezor/trezor-core/tree/master/docs). Hardware.md had some interesting stuff including an image of the schematic and a text-only BOM.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: thinkfat on February 13, 2021, 10:55:58 am
https://github.com/thinkfat/trezor-model-t-kicadv6

Update: got rid of all blind and micro-vias. PCB may need another pass to make sure the display data lines have all unbroken reference planes. The PCB now fits into JLCPCPs 4-layer process constraints, with one exception: The USB-C receptacle will be problematic due to their hole-hole and hole-copper constraints. It will be necessary to select a different part.

EDIT: they actually don't have a real ground reference for any signals. The display signals are routed both on the ground and the VCC-2 power plane. That could be resolved by moving some jumper traces to the bottom layer and all the remaining display and touchscreen traces to the 3rd layer. That gets you a nice ground plane at the cost of breaking the VCC-2 plane, which then needs to be patched up on the bottom layer. That might not be a big problem if there's enough decoupling.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: EEVblog on February 13, 2021, 11:19:35 pm
EDIT: they actually don't have a real ground reference for any signals. The display signals are routed both on the ground and the VCC-2 power plane. That could be resolved by moving some jumper traces to the bottom layer and all the remaining display and touchscreen traces to the 3rd layer. That gets you a nice ground plane at the cost of breaking the VCC-2 plane, which then needs to be patched up on the bottom layer. That might not be a big problem if there's enough decoupling.

For a product like this that won't be a problem.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: unkown_h on February 14, 2021, 06:35:43 am
Has any one been able to figure out what screen they are using? I have looked at all the available documents, googled all the available serial codes and product codes. I also had a look at the site that supplied the screens used with dev board but have found nothing close to the tenzor supplied tear down images.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: thinkfat on February 14, 2021, 12:25:47 pm
I'm pretty sure the screen and touchscreen assembles were custom made for the Trezor. You won't find the screen on the free market, but you'll likely find something in the same dimensions and with the same controller.

I see no point in having the pcbs duplicated either, for exactly that reason. The Eagle or KiCad projects are much more valuable.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: thinkfat on February 14, 2021, 01:03:35 pm
That's what I came up with. Might not be necessary, but EMI-wise it's likely better than the original. Got rid of some vias, too.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: aabbcc on February 24, 2021, 04:00:16 pm
That's what I came up with. Might not be necessary, but EMI-wise it's likely better than the original. Got rid of some vias, too.

Awesome, great work! I was looking at buying a hardware wallet but id much rather build my own if anyone manages to find a compatible screen with the same dimensions.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Arek_R on March 15, 2021, 11:33:11 pm
Has any one been able to figure out what screen they are using? I have looked at all the available documents, googled all the available serial codes and product codes. I also had a look at the site that supplied the screens used with dev board but have found nothing close to the tenzor supplied tear down images.

In one of the github repos there are those pictures, might be a bit of a hint on where to get the screen: <see attachments>
Though ideally we want to find some off the shelf assembly anyone can buy from ebay or ali that has a capacitive touch screen.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: Arek_R on March 15, 2021, 11:38:49 pm
Another thing I would suggest to swap this USB-C socket into easier to solder type with 2.0 interface and so no hidden pins, only 12 pins, I'm sure trezor doesn't use 3.0 interface because there is not much data to transfer.
I use this one in my projects: Mfr no: 918-418K2023S40001 LCSC no: C167321 it's also cheap and has through hole mechanical pins that should make it strong.
If you want EAGLE footprint there should be one made by adafruit for their USB-C breakout board.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: unkown_h on April 12, 2021, 05:54:40 am
Hi, I have had a look at your repo, but I am bit stuck. Is it ready for manufacturer? Is all I need to do, generate the Gerber files and send them off to a manufacture?
 
Thanks for you time.
Title: Re: EEVblog #1374 - DIY Trezor Crypto Hardware Wallet - Part 1
Post by: thinkfat on April 12, 2021, 01:56:51 pm
What are you talking about?