Using OSHW and OSS for building your custom hardware platform Yet - - PowerPoint PPT Presentation

using oshw and oss for building your custom hardware
SMART_READER_LITE
LIVE PREVIEW

Using OSHW and OSS for building your custom hardware platform Yet - - PowerPoint PPT Presentation

Using OSHW and OSS for building your custom hardware platform Yet another talk about Olimex Lime2 hardware Priit Laes @plaes AboutPAF.com / K-Space.ee February 2, 2020 Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for


slide-1
SLIDE 1

Using OSHW and OSS for building your custom hardware platform

Yet another talk about Olimex Lime2 hardware Priit Laes @plaes

AboutPAF.com / K-Space.ee

February 2, 2020

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 1 / 31

slide-2
SLIDE 2

AboutPAF.com

˚ Alands Penningautomatf¨

  • rening
slide-3
SLIDE 3

AboutPAF.com

˚ Alands Penningautomatf¨

  • rening aka PAF

Offices: Mariehamn (˚ Aland) Helsinki (FI) Stockholm (SE) Norrk¨

  • ping (SE)

Tallinn (EE) Oslo (NO) Riga (LV) Madrid (SE)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 1 / 31

slide-4
SLIDE 4

AboutPAF.com

Money gambling operator, established in 1966.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 2 / 31

slide-5
SLIDE 5

AboutPAF.com

Money gambling operator, established in 1966. 1973 - sole rights to operate onboard ˚ Aland registered car ferries

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 2 / 31

slide-6
SLIDE 6

AboutPAF.com

Money gambling operator, established in 1966. 1973 - sole rights to operate onboard ˚ Aland registered car ferries 1999 - online pioneers - one of the first online casinos - PAF.com

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 2 / 31

slide-7
SLIDE 7

AboutPAF.com

Money gambling operator, established in 1966. 1973 - sole rights to operate onboard ˚ Aland registered car ferries 1999 - online pioneers - one of the first online casinos - PAF.com Guinness World records 2012 - The largest jackpot payout in a non-pooled online slot machine game – 8,636,042 euros. 2013 - The largest jackpot payout in an online slot machine game – 17,861,813 euros.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 2 / 31

slide-8
SLIDE 8

AboutPAF.com

Money gambling operator, established in 1966. 1973 - sole rights to operate onboard ˚ Aland registered car ferries 1999 - online pioneers - one of the first online casinos - PAF.com Guinness World records 2012 - The largest jackpot payout in a non-pooled online slot machine game – 8,636,042 euros. 2013 - The largest jackpot payout in an online slot machine game – 17,861,813 euros. Global leader in responsible gaming

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 2 / 31

slide-9
SLIDE 9

Why build your own hardware?

1973 - sole rights to operate onboard ˚ Aland registered car ferries

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 3 / 31

slide-10
SLIDE 10

Why build your own hardware?

1973 - sole rights to operate onboard ˚ Aland registered car ferries 2005 - casinos on ferries in different jurisdictions on Baltic and Northern Seas

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 3 / 31

slide-11
SLIDE 11

Why build your own hardware?

1973 - sole rights to operate onboard ˚ Aland registered car ferries 2005 - casinos on ferries in different jurisdictions on Baltic and Northern Seas So far it has been quite a straightforward operation - buy slot machines, make sure the software has certificates required for target market and then just operate them...

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 3 / 31

slide-12
SLIDE 12

Why build your own hardware?

1973 - sole rights to operate onboard ˚ Aland registered car ferries 2005 - casinos on ferries in different jurisdictions on Baltic and Northern Seas So far it has been quite a straightforward operation - buy slot machines, make sure the software has certificates required for target market and then just operate them... 2008 - Estonia enacts new gambling law

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 3 / 31

slide-13
SLIDE 13

Why build your own hardware?

1973 - sole rights to operate onboard ˚ Aland registered car ferries 2005 - casinos on ferries in different jurisdictions on Baltic and Northern Seas So far it has been quite a straightforward operation - buy slot machines, make sure the software has certificates required for target market and then just operate them... 2008 - Estonia enacts new gambling law player protection (identify player and check against online database)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 3 / 31

slide-14
SLIDE 14

Why build your own hardware?

1973 - sole rights to operate onboard ˚ Aland registered car ferries 2005 - casinos on ferries in different jurisdictions on Baltic and Northern Seas So far it has been quite a straightforward operation - buy slot machines, make sure the software has certificates required for target market and then just operate them... 2008 - Estonia enacts new gambling law player protection (identify player and check against online database) daily automated electronic reporting for each slot machine and table

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 3 / 31

slide-15
SLIDE 15

Why build your own hardware?

1973 - sole rights to operate onboard ˚ Aland registered car ferries 2005 - casinos on ferries in different jurisdictions on Baltic and Northern Seas So far it has been quite a straightforward operation - buy slot machines, make sure the software has certificates required for target market and then just operate them... 2008 - Estonia enacts new gambling law player protection (identify player and check against online database) daily automated electronic reporting for each slot machine and table There’s nothing like that in the market...

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 3 / 31

slide-16
SLIDE 16

Why build your own hardware?

1973 - sole rights to operate onboard ˚ Aland registered car ferries 2005 - casinos on ferries in different jurisdictions on Baltic and Northern Seas So far it has been quite a straightforward operation - buy slot machines, make sure the software has certificates required for target market and then just operate them... 2008 - Estonia enacts new gambling law player protection (identify player and check against online database) daily automated electronic reporting for each slot machine and table There’s nothing like that in the market... ...also operating on ships - limited network connectivity

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 3 / 31

slide-17
SLIDE 17

Buy the solution

A solution was designed by third party based on Intel Atom based industrial PCs

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 4 / 31

slide-18
SLIDE 18

Buy the solution

A solution was designed by third party based on Intel Atom based industrial PCs

Figure: Gen. 1 of TCD Hardware (2009?)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 4 / 31

slide-19
SLIDE 19

Buy the solution

A solution was designed by third party based on Intel Atom based industrial PCs

Figure: Gen. 1 of TCD Hardware (2009?) Figure: Gen. 2 of TCD Hardware (2015?)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 4 / 31

slide-20
SLIDE 20

Auditing the existing solution

Hired by PAF in 2018 to take a look of existing hardware-software solution (also including the whole automated meter reporting backend) and improve it.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 5 / 31

slide-21
SLIDE 21

Auditing the existing solution

Hired by PAF in 2018 to take a look of existing hardware-software solution (also including the whole automated meter reporting backend) and improve it. Embedded software actually written in Java, storing data in local MySQL server and communicating remotely using HTTP

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 5 / 31

slide-22
SLIDE 22

Auditing the existing solution

Hired by PAF in 2018 to take a look of existing hardware-software solution (also including the whole automated meter reporting backend) and improve it. Embedded software actually written in Java, storing data in local MySQL server and communicating remotely using HTTP Also has graphical interface acting on events and showing animations (1024x800 gifs)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 5 / 31

slide-23
SLIDE 23

Auditing the existing solution

Hired by PAF in 2018 to take a look of existing hardware-software solution (also including the whole automated meter reporting backend) and improve it. Embedded software actually written in Java, storing data in local MySQL server and communicating remotely using HTTP Also has graphical interface acting on events and showing animations (1024x800 gifs) Boxes still running Ubuntu 12.04

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 5 / 31

slide-24
SLIDE 24

Auditing the existing solution

Hired by PAF in 2018 to take a look of existing hardware-software solution (also including the whole automated meter reporting backend) and improve it. Embedded software actually written in Java, storing data in local MySQL server and communicating remotely using HTTP Also has graphical interface acting on events and showing animations (1024x800 gifs) Boxes still running Ubuntu 12.04 Intel Atom D2500 CPU

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 5 / 31

slide-25
SLIDE 25

Auditing the existing solution

Hired by PAF in 2018 to take a look of existing hardware-software solution (also including the whole automated meter reporting backend) and improve it. Embedded software actually written in Java, storing data in local MySQL server and communicating remotely using HTTP Also has graphical interface acting on events and showing animations (1024x800 gifs) Boxes still running Ubuntu 12.04 Intel Atom D2500 CPU Initial plan: reuse existing hardware. Started with a clean install of latest Ubuntu LTS.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 5 / 31

slide-26
SLIDE 26

Auditing the existing solution

Hired by PAF in 2018 to take a look of existing hardware-software solution (also including the whole automated meter reporting backend) and improve it. Embedded software actually written in Java, storing data in local MySQL server and communicating remotely using HTTP Also has graphical interface acting on events and showing animations (1024x800 gifs) Boxes still running Ubuntu 12.04 Intel Atom D2500 CPU Initial plan: reuse existing hardware. Started with a clean install of latest Ubuntu LTS. Result: Ubuntu installed, but no graphics driver for Intel GMA 3600.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 5 / 31

slide-27
SLIDE 27

Auditing the existing solution

Hired by PAF in 2018 to take a look of existing hardware-software solution (also including the whole automated meter reporting backend) and improve it. Embedded software actually written in Java, storing data in local MySQL server and communicating remotely using HTTP Also has graphical interface acting on events and showing animations (1024x800 gifs) Boxes still running Ubuntu 12.04 Intel Atom D2500 CPU Initial plan: reuse existing hardware. Started with a clean install of latest Ubuntu LTS. Result: Ubuntu installed, but no graphics driver for Intel GMA 3600. Imagination Technologies PowerVR SGX 545

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 5 / 31

slide-28
SLIDE 28

Auditing the existing solution

Hired by PAF in 2018 to take a look of existing hardware-software solution (also including the whole automated meter reporting backend) and improve it. Embedded software actually written in Java, storing data in local MySQL server and communicating remotely using HTTP Also has graphical interface acting on events and showing animations (1024x800 gifs) Boxes still running Ubuntu 12.04 Intel Atom D2500 CPU Initial plan: reuse existing hardware. Started with a clean install of latest Ubuntu LTS. Result: Ubuntu installed, but no graphics driver for Intel GMA 3600. Imagination Technologies PowerVR SGX 545 Nope - Not gonna happen.. :(

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 5 / 31

slide-29
SLIDE 29

Let’s go shopping

Our requirements for ”slot” computer: Small form factor HDMI output USB Bunch of GPIOs Ethernet Proper storage (eMMC) Mainline u-boot / Linux Long term availability Cheap

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 6 / 31

slide-30
SLIDE 30

Let’s go shopping

Our requirements for ”slot” computer: Small form factor HDMI output USB Bunch of GPIOs Ethernet Proper storage (eMMC) Mainline u-boot / Linux Long term availability Cheap

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 6 / 31

slide-31
SLIDE 31

Designing a shield for Lime2

Install KiCAD

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-32
SLIDE 32

Designing a shield for Lime2

Install KiCAD Draw schematic and select components

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-33
SLIDE 33

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-34
SLIDE 34

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board Use A20 OLinuXino Lime2 SHIELD TEMPLATE from github:Olimex/OLINUXINO

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-35
SLIDE 35

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board Use A20 OLinuXino Lime2 SHIELD TEMPLATE from github:Olimex/OLINUXINO ... No mounting holes?

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-36
SLIDE 36

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board Use A20 OLinuXino Lime2 SHIELD TEMPLATE from github:Olimex/OLINUXINO ... No mounting holes? No problem, let’s open up the board file instead

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-37
SLIDE 37

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board Use A20 OLinuXino Lime2 SHIELD TEMPLATE from github:Olimex/OLINUXINO ... No mounting holes? No problem, let’s open up the board file instead... Wait.. It’s Eagle?

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-38
SLIDE 38

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board Use A20 OLinuXino Lime2 SHIELD TEMPLATE from github:Olimex/OLINUXINO ... No mounting holes? No problem, let’s open up the board file instead... Wait.. It’s Eagle? No problem, let’s just use KiCAD’s Eagle import

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-39
SLIDE 39

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board Use A20 OLinuXino Lime2 SHIELD TEMPLATE from github:Olimex/OLINUXINO ... No mounting holes? No problem, let’s open up the board file instead... Wait.. It’s Eagle? No problem, let’s just use KiCAD’s Eagle import... Wait.. It’s old binary Eagle format?

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-40
SLIDE 40

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board Use A20 OLinuXino Lime2 SHIELD TEMPLATE from github:Olimex/OLINUXINO ... No mounting holes? No problem, let’s open up the board file instead... Wait.. It’s Eagle? No problem, let’s just use KiCAD’s Eagle import... Wait.. It’s old binary Eagle format? Install Eagle and figure out which layers to export...

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-41
SLIDE 41

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board Use A20 OLinuXino Lime2 SHIELD TEMPLATE from github:Olimex/OLINUXINO ... No mounting holes? No problem, let’s open up the board file instead... Wait.. It’s Eagle? No problem, let’s just use KiCAD’s Eagle import... Wait.. It’s old binary Eagle format? Install Eagle and figure out which layers to export... In case anyone else needs that, the layers are: Dimension, tKeepout, Drills, tDocu

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-42
SLIDE 42

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board Use A20 OLinuXino Lime2 SHIELD TEMPLATE from github:Olimex/OLINUXINO ... No mounting holes? No problem, let’s open up the board file instead... Wait.. It’s Eagle? No problem, let’s just use KiCAD’s Eagle import... Wait.. It’s old binary Eagle format? Install Eagle and figure out which layers to export... In case anyone else needs that, the layers are: Dimension, tKeepout, Drills, tDocu Import the .dxf into the template layout and position it

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-43
SLIDE 43

Designing a shield for Lime2

Install KiCAD Draw schematic and select components Design board Use A20 OLinuXino Lime2 SHIELD TEMPLATE from github:Olimex/OLINUXINO ... No mounting holes? No problem, let’s open up the board file instead... Wait.. It’s Eagle? No problem, let’s just use KiCAD’s Eagle import... Wait.. It’s old binary Eagle format? Install Eagle and figure out which layers to export... In case anyone else needs that, the layers are: Dimension, tKeepout, Drills, tDocu Import the .dxf into the template layout and position it Finish layout

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 7 / 31

slide-44
SLIDE 44

Almost ready?

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 8 / 31

slide-45
SLIDE 45

Almost ready?

Are we there yet?

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 8 / 31

slide-46
SLIDE 46

Almost ready?

Are we there yet? Build (or order) the board Order components Solder it together Test it

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 8 / 31

slide-47
SLIDE 47

K-Space.ee

Hackerspace in Tallinn, Estonia

Community driven co-working and meeting space.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 9 / 31

slide-48
SLIDE 48

K-Space.ee

Hackerspace in Tallinn, Estonia

Community driven co-working and meeting space. Basic fabrication capabilities

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 9 / 31

slide-49
SLIDE 49

K-Space.ee

Hackerspace in Tallinn, Estonia

Community driven co-working and meeting space. Basic fabrication capabilities 3D printer CNC machine Laser cutter SMD reflow oven

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 9 / 31

slide-50
SLIDE 50

K-Space.ee

Hackerspace in Tallinn, Estonia

Community driven co-working and meeting space. Basic fabrication capabilities 3D printer CNC machine Laser cutter SMD reflow oven Our own server room with bunch of full-size racks.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 9 / 31

slide-51
SLIDE 51

K-Space.ee

Hackerspace in Tallinn, Estonia

Community driven co-working and meeting space. Basic fabrication capabilities 3D printer CNC machine Laser cutter SMD reflow oven Our own server room with bunch of full-size racks.

Also home to Armbian.com :)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 9 / 31

slide-52
SLIDE 52

Milling your own PCB?

Howto steps for the K-Space CNC in our wiki: Export front, back, drill and outline Gerbers from your favourite PCB design software Convert Gerbers to G-code using pcb2gcode command below (on next slide) Dump the files to the K-Space Nextcloud share Approach the CNC setup, in web browser open bookmarked link for the same share, download files Under supervision by Lauri, Kaarel or Silver: mill front, drill holes, flip, mill back, cut

  • utline

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 10 / 31

slide-53
SLIDE 53

Generating G-code using pcb2gcode (1)

KiCAD already generated our gerbers, so let’s turn it something that CNC can eat..

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 11 / 31

slide-54
SLIDE 54

Generating G-code using pcb2gcode (1)

KiCAD already generated our gerbers, so let’s turn it something that CNC can eat.. git clone https://github.com/pcb2gcode/pcb2gcode/ cd pcb2gcode # Pull usable version git checkout eeee27db62b6b447f84d020cd80a65a81daa54b1 apt install libboost-all-dev libgtkmm-2.4-dev gerbv shtool autogen autoreconf -fv ./configure --prefix=$HOME/opt make -j4 && make install

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 11 / 31

slide-55
SLIDE 55

Generating G-code using pcb2gcode (2)

pcb2gcode --vectorial \

  • -software linuxcnc --zero-start --tile-x 3 --tile-y 2 \
  • -front *-F.Cu.g* --front-output front.ngc \
  • -back *-B.Cu.g* --back-output back.ngc \
  • -drill *.drl --drill-output drill.ngc --drill-side back \
  • -outline *-Edge.Cuts.g* --outline-output cutout.ngc \
  • -metric --metricoutput --noconfigfile \
  • -zsafe 1 --zchange 100 \
  • -cut-feed 150 --cut-speed 6000 --cut-infeed 0.6 --zcut -1.5 \
  • -zbridges -1 --bridges 3 --bridgesnum 4 --cutter-diameter 2 \
  • -mill-feed 500 --mill-speed 6000 --zwork -0.2 --offset 0.2 \
  • -drill-feed 500 --drill-speed 6000 --zdrill -3 \
  • -spindown-time 2 --spinup-time 2

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 12 / 31

slide-56
SLIDE 56

Figure: First fit!

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 13 / 31

slide-57
SLIDE 57

Figure: First fit! Figure: Why does it not work?!

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 13 / 31

slide-58
SLIDE 58

Figure: First fit! Figure: Why does it not work?!

Conclusion: CNC is too much work.. Let’s try the fabs.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 13 / 31

slide-59
SLIDE 59

Figure: First fit! Figure: Why does it not work?!

Conclusion: CNC is too much work.. Let’s try the fabs.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 13 / 31

slide-60
SLIDE 60

PCBs from a fab house?

Buying locally vs from China?

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 14 / 31

slide-61
SLIDE 61

PCBs from a fab house?

Buying locally vs from China? 3 weeks vs 1.5 weeks (with shipping from China).

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 14 / 31

slide-62
SLIDE 62

PCBs from a fab house?

Buying locally vs from China? 3 weeks vs 1.5 weeks (with shipping from China). Not going to mention the cost (even when using ”insert brandnames here” for shipping.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 14 / 31

slide-63
SLIDE 63

PCBs from a fab house?

Buying locally vs from China? 3 weeks vs 1.5 weeks (with shipping from China). Not going to mention the cost (even when using ”insert brandnames here” for shipping.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 14 / 31

slide-64
SLIDE 64

Software platform (1)

Olimex Lime2-eMMC running Debian stable (aka Ticket Check Device)

◮ Somewhat custom kernel and bootloader setup ◮ We build our own .deb from mainline kernel (with some extra configuration options) ◮ Our own software on devices is also packaged as .deb packages Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 15 / 31

slide-65
SLIDE 65

Software platform (1)

Olimex Lime2-eMMC running Debian stable (aka Ticket Check Device)

◮ Somewhat custom kernel and bootloader setup ◮ We build our own .deb from mainline kernel (with some extra configuration options) ◮ Our own software on devices is also packaged as .deb packages ◮ Applications written in Python: Gtk+ and Gstreamer Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 15 / 31

slide-66
SLIDE 66

Software platform (1)

Olimex Lime2-eMMC running Debian stable (aka Ticket Check Device)

◮ Somewhat custom kernel and bootloader setup ◮ We build our own .deb from mainline kernel (with some extra configuration options) ◮ Our own software on devices is also packaged as .deb packages ◮ Applications written in Python: Gtk+ and Gstreamer ◮ Light media player on ships not under Estonian flag - no interaction with slot machine Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 15 / 31

slide-67
SLIDE 67

Software platform (1)

Olimex Lime2-eMMC running Debian stable (aka Ticket Check Device)

◮ Somewhat custom kernel and bootloader setup ◮ We build our own .deb from mainline kernel (with some extra configuration options) ◮ Our own software on devices is also packaged as .deb packages ◮ Applications written in Python: Gtk+ and Gstreamer ◮ Light media player on ships not under Estonian flag - no interaction with slot machine ◮ Ticket check application - interacting with slot machine (clicking a single relay)

...requires some udev GPIO magic

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 15 / 31

slide-68
SLIDE 68

Software platform (1)

Olimex Lime2-eMMC running Debian stable (aka Ticket Check Device)

◮ Somewhat custom kernel and bootloader setup ◮ We build our own .deb from mainline kernel (with some extra configuration options) ◮ Our own software on devices is also packaged as .deb packages ◮ Applications written in Python: Gtk+ and Gstreamer ◮ Light media player on ships not under Estonian flag - no interaction with slot machine ◮ Ticket check application - interacting with slot machine (clicking a single relay)

...requires some udev GPIO magic

◮ Ticket check device for tables - Lime2 with I2C display for croupiers

...using devicetree overlays

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 15 / 31

slide-69
SLIDE 69

Software platform (2)

Central server on each ship (either VM or physical host)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 16 / 31

slide-70
SLIDE 70

Software platform (2)

Central server on each ship (either VM or physical host)

◮ Acts as a ”gateway” with API translation layers - same gateway API for all the ships Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 16 / 31

slide-71
SLIDE 71

Software platform (2)

Central server on each ship (either VM or physical host)

◮ Acts as a ”gateway” with API translation layers - same gateway API for all the ships ◮ Translates queries towards ship passenger database and compares results against block list Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 16 / 31

slide-72
SLIDE 72

Software platform (2)

Central server on each ship (either VM or physical host)

◮ Acts as a ”gateway” with API translation layers - same gateway API for all the ships ◮ Translates queries towards ship passenger database and compares results against block list ◮ Hosts a ”hashed” version of gambling block list - no sensitive data on Lime2 devices Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 16 / 31

slide-73
SLIDE 73

Software platform (2)

Central server on each ship (either VM or physical host)

◮ Acts as a ”gateway” with API translation layers - same gateway API for all the ships ◮ Translates queries towards ship passenger database and compares results against block list ◮ Hosts a ”hashed” version of gambling block list - no sensitive data on Lime2 devices ◮ Central host to look up Lime2 devices on board (using Avahi for lookup) Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 16 / 31

slide-74
SLIDE 74

Software platform (2)

Central server on each ship (either VM or physical host)

◮ Acts as a ”gateway” with API translation layers - same gateway API for all the ships ◮ Translates queries towards ship passenger database and compares results against block list ◮ Hosts a ”hashed” version of gambling block list - no sensitive data on Lime2 devices ◮ Central host to look up Lime2 devices on board (using Avahi for lookup) ◮ WIP: Hosts our own APT repository (Aptly) ◮ WIP: Log collection and aggregation (rsyslog) ◮ TODO: Proper monitoring... (MQTT maybe?) Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 16 / 31

slide-75
SLIDE 75

Software platform (3)

Provisioning Lime2 devices in two minutes

Prerequisites (sunxi-fel and fastboot):

◮ u-boot image ◮ Basic Debian image 325MB with ssh keys and avahi service ◮ Image for ESP partition containing boot scripts for u-boot Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 17 / 31

slide-76
SLIDE 76

Software platform (3)

Provisioning Lime2 devices in two minutes

Prerequisites (sunxi-fel and fastboot):

◮ u-boot image ◮ Basic Debian image 325MB with ssh keys and avahi service ◮ Image for ESP partition containing boot scripts for u-boot

Preparation tasks (collect MAC address and format eMMC):

◮ sunxi-fel uboot $DATA/u-boot-sunxi-with-spl.bin write 0x43100000

$DATA/env.txt

◮ echo $(fastboot getvar uboot:ethaddr 2>&1|head -n 1 |cut -f 3- -d ’:’

)

◮ fastboot oem format && fastboot reboot Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 17 / 31

slide-77
SLIDE 77

Software platform (3)

Provisioning Lime2 devices in two minutes

Prerequisites (sunxi-fel and fastboot):

◮ u-boot image ◮ Basic Debian image 325MB with ssh keys and avahi service ◮ Image for ESP partition containing boot scripts for u-boot

Preparation tasks (collect MAC address and format eMMC):

◮ sunxi-fel uboot $DATA/u-boot-sunxi-with-spl.bin write 0x43100000

$DATA/env.txt

◮ echo $(fastboot getvar uboot:ethaddr 2>&1|head -n 1 |cut -f 3- -d ’:’

)

◮ fastboot oem format && fastboot reboot

And now the flashing process:

◮ sunxi-fel spiflash-write 0 $DATA/u-boot-sunxi-with-spl.bin ◮ sunxi-fel uboot $DATA/u-boot-sunxi-with-spl.bin

write 0x43100000 $DATA/env.txt

◮ fastboot flash esp $DATA/esp.img ◮ fastboot flash system $DATA/tcd-base-debian-buster.img Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 17 / 31

slide-78
SLIDE 78

Software platform (3)

Provisioning Lime2 devices in two minutes

Prerequisites (sunxi-fel and fastboot):

◮ u-boot image ◮ Basic Debian image 325MB with ssh keys and avahi service ◮ Image for ESP partition containing boot scripts for u-boot

Preparation tasks (collect MAC address and format eMMC):

◮ sunxi-fel uboot $DATA/u-boot-sunxi-with-spl.bin write 0x43100000

$DATA/env.txt

◮ echo $(fastboot getvar uboot:ethaddr 2>&1|head -n 1 |cut -f 3- -d ’:’

)

◮ fastboot oem format && fastboot reboot

And now the flashing process:

◮ sunxi-fel spiflash-write 0 $DATA/u-boot-sunxi-with-spl.bin ◮ sunxi-fel uboot $DATA/u-boot-sunxi-with-spl.bin

write 0x43100000 $DATA/env.txt

◮ fastboot flash esp $DATA/esp.img ◮ fastboot flash system $DATA/tcd-base-debian-buster.img

And now we can continue with ansible-playbook

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 17 / 31

slide-79
SLIDE 79

Software platform (4)

Ansible playbooks for post-flash (we can run these in parallel):

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 18 / 31

slide-80
SLIDE 80

Software platform (4)

Ansible playbooks for post-flash (we can run these in parallel): bootstrap

◮ resize root file system ◮ regenerate ssh host keys ◮ ”fix” the hostname Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 18 / 31

slide-81
SLIDE 81

Software platform (4)

Ansible playbooks for post-flash (we can run these in parallel): bootstrap

◮ resize root file system ◮ regenerate ssh host keys ◮ ”fix” the hostname

Run ship-specific setup:

◮ Set up Xorg ◮ Set up service user ◮ Install required packages (our own TCD application) Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 18 / 31

slide-82
SLIDE 82

Software platform (4)

Ansible playbooks for post-flash (we can run these in parallel): bootstrap

◮ resize root file system ◮ regenerate ssh host keys ◮ ”fix” the hostname

Run ship-specific setup:

◮ Set up Xorg ◮ Set up service user ◮ Install required packages (our own TCD application)

Update the static DNS record in /etc/hosts with correct IP for ship gateway

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 18 / 31

slide-83
SLIDE 83

Software platform (4)

Ansible playbooks for post-flash (we can run these in parallel): bootstrap

◮ resize root file system ◮ regenerate ssh host keys ◮ ”fix” the hostname

Run ship-specific setup:

◮ Set up Xorg ◮ Set up service user ◮ Install required packages (our own TCD application)

Update the static DNS record in /etc/hosts with correct IP for ship gateway Update the avahi service txt-record with the correct slot location

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 18 / 31

slide-84
SLIDE 84

Software platform (5)

How do we know the location of the devices?

Each device advertises its location using avahi service record: $ cat /etc/avahi/services/paf-ssh.service <?xml version="1.0" standalone=’no’?><!--*-nxml-*--> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">PAF ssh %h</name> <service> <type>_ssh._tcp</type> <port>22</port> <txt-record>slot=unknown</txt-record> </service> </service-group>

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 19 / 31

slide-85
SLIDE 85

Software platform (5)

How do we know the location of the devices?

Each device advertises its location using avahi service record: $ cat /etc/avahi/services/paf-ssh.service <?xml version="1.0" standalone=’no’?><!--*-nxml-*--> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">PAF ssh %h</name> <service> <type>_ssh._tcp</type> <port>22</port> <txt-record>slot=unknown</txt-record> </service> </service-group> $ avahi-browse -d local

  • ssh. tcp --resolve -t -p |grep slot

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 19 / 31

slide-86
SLIDE 86

Bonus: Hardware picture

Figure: Gen. 1 of TCD Hardware (2009?) Figure: Gen. 2 of TCD Hardware (2015?)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 20 / 31

slide-87
SLIDE 87

Bonus: Hardware picture

Figure: Gen. 1 of TCD Hardware (2009?) Figure: Gen. 2 of TCD Hardware (2015?)

PAF In-House TCD Hardware

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 20 / 31

slide-88
SLIDE 88

Overview of problems encountered and solved

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 21 / 31

slide-89
SLIDE 89

GPIO pins not working?

Symptom: GPIO pin not being able to push out 3.3V to trigger relay.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 22 / 31

slide-90
SLIDE 90

GPIO pins not working?

Symptom: GPIO pin not being able to push out 3.3V to trigger relay. Cause: Missing regulators for GPIO banks:

+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts &pio { + vcc-pa-supply = <&reg_vcc3v3>; + vcc-pc-supply = <&reg_vcc3v3>; + vcc-pe-supply = <&reg_ldo3>; + vcc-pf-supply = <&reg_vcc3v3>; + vcc-pg-supply = <&reg_ldo4>; + led_pins_olinuxinolime: led-pins { pins = "PH2"; function = "gpio_out";

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 22 / 31

slide-91
SLIDE 91

Failure to boot from eMMC

Symptom: Occasional boot failures from eMMC

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 23 / 31

slide-92
SLIDE 92

Failure to boot from eMMC

Symptom: Occasional boot failures from eMMC Path to solution: Initial testing and setups were done on Olimex Lime2 rev.G2 boards.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 23 / 31

slide-93
SLIDE 93

Failure to boot from eMMC

Symptom: Occasional boot failures from eMMC Path to solution: Initial testing and setups were done on Olimex Lime2 rev.G2 boards. Second batch for deployment (around 35 devices for prodution) were rev.K

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 23 / 31

slide-94
SLIDE 94

Failure to boot from eMMC

Symptom: Occasional boot failures from eMMC Path to solution: Initial testing and setups were done on Olimex Lime2 rev.G2 boards. Second batch for deployment (around 35 devices for prodution) were rev.K We cut some corners and ship devices running Armbian from sdcard

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 23 / 31

slide-95
SLIDE 95

Failure to boot from eMMC

Symptom: Occasional boot failures from eMMC Path to solution: Initial testing and setups were done on Olimex Lime2 rev.G2 boards. Second batch for deployment (around 35 devices for prodution) were rev.K We cut some corners and ship devices running Armbian from sdcard Cause: eMMC chip was changed - Olimex agrees to fix boards

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 23 / 31

slide-96
SLIDE 96

Failure to boot from eMMC

Symptom: Occasional boot failures from eMMC Path to solution: Initial testing and setups were done on Olimex Lime2 rev.G2 boards. Second batch for deployment (around 35 devices for prodution) were rev.K We cut some corners and ship devices running Armbian from sdcard Cause: eMMC chip was changed - Olimex agrees to fix boards Problem: devices have been already deployed

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 23 / 31

slide-97
SLIDE 97

Failure to boot from eMMC

Symptom: Occasional boot failures from eMMC Path to solution: Initial testing and setups were done on Olimex Lime2 rev.G2 boards. Second batch for deployment (around 35 devices for prodution) were rev.K We cut some corners and ship devices running Armbian from sdcard Cause: eMMC chip was changed - Olimex agrees to fix boards Problem: devices have been already deployed Order second batch of devices - test and find more boot issues (1 out of 8 boots fails)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 23 / 31

slide-98
SLIDE 98

Failure to boot from eMMC

Symptom: Occasional boot failures from eMMC Path to solution: Initial testing and setups were done on Olimex Lime2 rev.G2 boards. Second batch for deployment (around 35 devices for prodution) were rev.K We cut some corners and ship devices running Armbian from sdcard Cause: eMMC chip was changed - Olimex agrees to fix boards Problem: devices have been already deployed Order second batch of devices - test and find more boot issues (1 out of 8 boots fails) Olimex aknowledges the second issue, adds SPI eeprom and we send our boards back

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 23 / 31

slide-99
SLIDE 99

Failure to boot from eMMC

Symptom: Occasional boot failures from eMMC Path to solution: Initial testing and setups were done on Olimex Lime2 rev.G2 boards. Second batch for deployment (around 35 devices for prodution) were rev.K We cut some corners and ship devices running Armbian from sdcard Cause: eMMC chip was changed - Olimex agrees to fix boards Problem: devices have been already deployed Order second batch of devices - test and find more boot issues (1 out of 8 boots fails) Olimex aknowledges the second issue, adds SPI eeprom and we send our boards back Lots of device shuffling from our side

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 23 / 31

slide-100
SLIDE 100

Device hangs after reboot in bootloader

Symptom: Device hangs in bootloader after reboot

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 24 / 31

slide-101
SLIDE 101

Device hangs after reboot in bootloader

Symptom: Device hangs in bootloader after reboot Cause: Wrongly sized capacitors in the power supply section.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 24 / 31

slide-102
SLIDE 102

Device hangs after reboot in bootloader

Symptom: Device hangs in bootloader after reboot Cause: Wrongly sized capacitors in the power supply section. Solution: Patchset from Olliver Schinagl (Ultimaker) that had not been upstreamed yet. [PATCH v3 0/9] Stop AXP from crashing when enabling LDO3 ... The root cause is that some boards have too high capacitance on the LDO3

  • utput port causing inrush currents exceeding the maximum of the AXP209.

...

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 24 / 31

slide-103
SLIDE 103

Device hangs after reboot in bootloader

Symptom: Device hangs in bootloader after reboot Cause: Wrongly sized capacitors in the power supply section. Solution: Patchset from Olliver Schinagl (Ultimaker) that had not been upstreamed yet. [PATCH v3 0/9] Stop AXP from crashing when enabling LDO3 ... The root cause is that some boards have too high capacitance on the LDO3

  • utput port causing inrush currents exceeding the maximum of the AXP209.

... Please submit your stuff upstream!

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 24 / 31

slide-104
SLIDE 104

Display issues (1)

Symptom: HDMI display not working in u-boot

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 25 / 31

slide-105
SLIDE 105

Display issues (1)

Symptom: HDMI display not working in u-boot Cause: Display’s HDMI hotplug detect pin not connected properly.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 25 / 31

slide-106
SLIDE 106

Display issues (1)

Symptom: HDMI display not working in u-boot Cause: Display’s HDMI hotplug detect pin not connected properly. Workaround: Force display always on from kernel commandline and hardcode EDID data.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 25 / 31

slide-107
SLIDE 107

Display issues (1)

Symptom: HDMI display not working in u-boot Cause: Display’s HDMI hotplug detect pin not connected properly. Workaround: Force display always on from kernel commandline and hardcode EDID data. Solution: Always poll DDC bus for EDID data.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 25 / 31

slide-108
SLIDE 108

Display issues (1)

Symptom: HDMI display not working in u-boot Cause: Display’s HDMI hotplug detect pin not connected properly. Workaround: Force display always on from kernel commandline and hardcode EDID data. Solution: Always poll DDC bus for EDID data. u-boot: Patch accepted in together with some EDID relaxation checks.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 25 / 31

slide-109
SLIDE 109

Display issues (1)

Symptom: HDMI display not working in u-boot Cause: Display’s HDMI hotplug detect pin not connected properly. Workaround: Force display always on from kernel commandline and hardcode EDID data. Solution: Always poll DDC bus for EDID data. u-boot: Patch accepted in together with some EDID relaxation checks. Linux kernel: Patch rejected with: Fix your hardware!

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 25 / 31

slide-110
SLIDE 110

Display issues (1)

Symptom: HDMI display not working in u-boot Cause: Display’s HDMI hotplug detect pin not connected properly. Workaround: Force display always on from kernel commandline and hardcode EDID data. Solution: Always poll DDC bus for EDID data. u-boot: Patch accepted in together with some EDID relaxation checks. Linux kernel: Patch rejected with: Fix your hardware!

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 25 / 31

slide-111
SLIDE 111

Display issues (2)

Symptom: Display does not turn on when kernel takes over from bootloader (1 in 8 boots)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 26 / 31

slide-112
SLIDE 112

Display issues (2)

Symptom: Display does not turn on when kernel takes over from bootloader (1 in 8 boots) Workaround: Force display always on from kernel commandline.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 26 / 31

slide-113
SLIDE 113

Display issues (2)

Symptom: Display does not turn on when kernel takes over from bootloader (1 in 8 boots) Workaround: Force display always on from kernel commandline. Cause: HDMI TMDS clock turned on/off with each DDC probe.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 26 / 31

slide-114
SLIDE 114

Display issues (2)

Symptom: Display does not turn on when kernel takes over from bootloader (1 in 8 boots) Workaround: Force display always on from kernel commandline. Cause: HDMI TMDS clock turned on/off with each DDC probe. Fix: Enable proper refcounting in the clock tree. (5e1bc251ce)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 26 / 31

slide-115
SLIDE 115

Display issues (2)

Symptom: Display does not turn on when kernel takes over from bootloader (1 in 8 boots) Workaround: Force display always on from kernel commandline. Cause: HDMI TMDS clock turned on/off with each DDC probe. Fix: Enable proper refcounting in the clock tree. (5e1bc251ce)

+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -92,6 +92,8 @@ static void sun4i_hdmi_disable(struct drm_encoder *encoder) + clk_disable_unprepare(hdmi->tmds_clk); } @@ -102,6 +104,8 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder) + clk_prepare_enable(hdmi->tmds_clk);

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 26 / 31

slide-116
SLIDE 116

Display issues (3)

Quirky display (640x480) with actually top 240 pixels are visible. Problem: Need to identify quirky displays from the TCD application, so we can supply the correct sized media.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 27 / 31

slide-117
SLIDE 117

Display issues (3)

Quirky display (640x480) with actually top 240 pixels are visible. Problem: Need to identify quirky displays from the TCD application, so we can supply the correct sized media. Solution?: Use manufacturer information from Gtk+? from gi.repository import Gdk disp = Gdk.Display.get_default() num = Gdk.Display.get_n_monitors(disp) for m in range(0, num): monitor = Gdk.Display.get_monitor(disp, m) print (monitor.get_model()) print (monitor.get_manufacturer())

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 27 / 31

slide-118
SLIDE 118

Display issues (3)

Quirky display (640x480) with actually top 240 pixels are visible. Problem: Need to identify quirky displays from the TCD application, so we can supply the correct sized media. Solution?: Use manufacturer information from Gtk+? from gi.repository import Gdk disp = Gdk.Display.get_default() num = Gdk.Display.get_n_monitors(disp) for m in range(0, num): monitor = Gdk.Display.get_monitor(disp, m) print (monitor.get_model()) print (monitor.get_manufacturer()) Bug?: Manufacturer fields always empty, and model contains output name (for example HDMI-1, DP-1-2, eDP-1, ...)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 27 / 31

slide-119
SLIDE 119

Display issues (3)

Quirky display (640x480) with actually top 240 pixels are visible. Problem: Need to identify quirky displays from the TCD application, so we can supply the correct sized media. Solution?: Use manufacturer information from Gtk+? from gi.repository import Gdk disp = Gdk.Display.get_default() num = Gdk.Display.get_n_monitors(disp) for m in range(0, num): monitor = Gdk.Display.get_monitor(disp, m) print (monitor.get_model()) print (monitor.get_manufacturer()) Bug?: Manufacturer fields always empty, and model contains output name (for example HDMI-1, DP-1-2, eDP-1, ...) Fix: https://gitlab.gnome.org/GNOME/gtk/merge_requests/848

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 27 / 31

slide-120
SLIDE 120

Fun with /dev/random

Symptom: Reaaaallllyyy long boot time after switch to Debian 10.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 28 / 31

slide-121
SLIDE 121

Fun with /dev/random

Symptom: Reaaaallllyyy long boot time after switch to Debian 10. Cause: Systemd which using /dev/random (?) is blocked due to lack of entropy. IIRC it was actually caused by kernel itself changing the randomness behaviour.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 28 / 31

slide-122
SLIDE 122

Fun with /dev/random

Symptom: Reaaaallllyyy long boot time after switch to Debian 10. Cause: Systemd which using /dev/random (?) is blocked due to lack of entropy. IIRC it was actually caused by kernel itself changing the randomness behaviour. Solution: apt install haveged

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 28 / 31

slide-123
SLIDE 123

Networking troubles (1)

Symptom: Link does not come up when connected to certain switches

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 29 / 31

slide-124
SLIDE 124

Networking troubles (1)

Symptom: Link does not come up when connected to certain switches Cause: Buggy silicon in PHY chip

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 29 / 31

slide-125
SLIDE 125

Networking troubles (1)

Symptom: Link does not come up when connected to certain switches Cause: Buggy silicon in PHY chip Solution: Enable correct PHY in defconfig (9567832aba7) +++ b/arch/arm/configs/sunxi_defconfig CONFIG_STMMAC_ETH=y # CONFIG_NET_VENDOR_VIA is not set # CONFIG_NET_VENDOR_WIZNET is not set +CONFIG_MICREL_PHY=y # CONFIG_WLAN is not set CONFIG_INPUT_EVDEV=y CONFIG_KEYBOARD_SUN4I_LRADC=y

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 29 / 31

slide-126
SLIDE 126

Networking troubles (2)

Symptom: Unable to find devices from network using avahi-browse after the flashing step.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 30 / 31

slide-127
SLIDE 127

Networking troubles (2)

Symptom: Unable to find devices from network using avahi-browse after the flashing step. Cause: DHCP pool full, new devices not getting IP anymore.

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 30 / 31

slide-128
SLIDE 128

Networking troubles (2)

Symptom: Unable to find devices from network using avahi-browse after the flashing step. Cause: DHCP pool full, new devices not getting IP anymore. Easy, right :)

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 30 / 31

slide-129
SLIDE 129

So long, and Thanks for All the Bugs! Questions?

Priit Laes @plaes (AboutPAF.com / K-Space.ee) Using OSHW and OSS for building your custom hardware platform February 2, 2020 31 / 31