Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fca6724

Browse files
committedAug 24, 2015
Further scripts improvements:
* Reorganised/cleaned up README.md * Moved some manual steps back into get-env.sh * Create 'flash-hdmi2usb.sh' script to easily get a board running
1 parent cb1502e commit fca6724

File tree

8 files changed

+97
-105
lines changed

8 files changed

+97
-105
lines changed
 

‎README

+1-7
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,8 @@ This firmware is supported on the following to boards;
2424

2525
[> Getting started
2626
------------------
27-
1. Follow MiSoC Quick start guide
28-
https://github.com/m-labs/misoc
2927

30-
2. Clone https://github.com/timvideos/HDMI2USB-misoc-firmware into same directory as misoc
31-
32-
3. Follow instructions to build the gateware and software:
33-
# In the HDMI2USB-misoc-firmware directory
34-
make help
28+
1. See scripts/README.md for firmware build instructions
3529

3630
[> Status:
3731
atlys_base:

‎scripts/.README.md.swp

16 KB
Binary file not shown.

‎scripts/52-hdmi2usb.rules

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Grant permission to makestuff usb devices.
2+
ATTR{idVendor}=="1d50", MODE:="666"
3+
4+
# Grant permissions to hdmi2usb usb devices.
Has a conversation. Original line has a conversation.
5+
ATTR{idVendor}=="fb9a", MODE:="666"
6+
7+
# Grant permissions to unconfigured cypress chips.
8+
ATTR{idVendor}=="04b4", MODE:="666"
9+
10+
# Grant permissions to Digilent Development board JTAG
11+
ATTR{idVendor}=="1443", MODE:="666"

‎scripts/README.md

+35-87
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,42 @@
11
# Building HDMI2USB-misoc-firmware
2-
#### (assumes a new Ubuntu Desktop 14.04 LTS install)
32

4-
TODO: Complete this, clean this up, move some of it back into the script
3+
These scripts are designed to bootstrap a firmware build environment on Ubuntu 14.04 LTS.
54

6-
These scripts are designed to bootstrap an environment on Ubuntu 14.04 LTS.
5+
Instructions:
76

8-
To get started (will install packages, etc):
7+
1. Install Xilinx ISE WebPACK 14.7 + activate a licence:
98

10-
* Run the bootstrap script to get everything required for flashing firmware:
11-
```
12-
curl -fsS https://raw.githubusercontent.com/timvideos/HDMI2USB-misoc-firmware/master/scripts/bootstrap.sh | bash
13-
```
14-
15-
* Download (URL?)
16-
* & install Xilinx ISE WebPACK 14.7 into the default location in /opt/
9+
* Download from [http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/design-tools.html]
10+
* Install into the default location in /opt (requires X11 GUI):
1711
```
1812
tar xvf Xilinx_ISE_DS_Lin_14.7_1015_1.tar
1913
cd Xilinx_ISE_DS_Lin_14.7_1015_1
20-
sudo ./xsetup (gui, needs X forwarding if over ssh)
14+
sudo ./xsetup
2115
```
22-
step ?, "Select products to install: (*) ISE WebPACK" 17403 MB
16+
Ensure you select "ISE WebPACK" 17403 MB
2317

2418

25-
* Ensure you have a free WebPACK license for ISE installed, see http://license.xilinx.com/getLicense
26-
27-
goes in ~/.Xilinx/Xilinx.lic
19+
* Ensure you have a free WebPACK license for ISE installed, see [http://license.xilinx.com/getLicense], ensure installed into ```~/.Xilinx/Xilinx.lic```
2820

2921
* Ensure licence is activated by checking ISE:
3022
```
3123
source /opt/Xilinx/14.7/ISE_DS/settings64.sh
3224
ise
3325
```
3426
Go to About > Licence, ensure under "information" you can see your ISC WebPACK licence.
Has a conversation. Original line has a conversation.
35-
or maybe Help, Manage Licence?
36-
37-
* Change into the HDMI2USB-misoc-firmware directory:
27+
28+
2. Run the bootstrap script to build an environment required for flashing firmware:
3829
```
39-
cd ~/HDMI2USB-misoc-firmware
30+
curl -fsS https://raw.githubusercontent.com/timvideos/HDMI2USB-misoc-firmware/master/scripts/bootstrap.sh | bash
4031
```
4132

42-
* Initialise the environment:
33+
3. Initalise the environment (required for any of the build/load steps below[2]):
4334
```
35+
cd ~/HDMI2USB-misoc-firmware
4436
source scripts/setup-env.sh
4537
```
4638

47-
* Build the gateware:
39+
4. Build the gateware:
4840
```
4941
make gateware
5042
```
@@ -58,7 +50,7 @@ goes in ~/.Xilinx/Xilinx.lic
5850

5951
The built gateware will be in build/misoc/build/.
6052

61-
* Ensure board has the right pins set:
53+
5. You've now built the HDMI2USB firmware/gateware. Ensure board has the right pins set before flashing anything, and plug it in:
6254

6355
As the HDMI2USB firmware manipulates the EDID information the following jumpers must be removed;
6456

@@ -67,91 +59,47 @@ goes in ~/.Xilinx/Xilinx.lic
6759
JP6 and JP7 (which connects the EDID lines from J3/HDMI IN to J2/HDMI OUT).
6860
```
6961

70-
* Plug board in using PROG port & switch on. If using a VM, ensure the device is passed through.
71-
72-
* Load in custom udev rules:
73-
(make a script, which is called as part of get-env)
74-
75-
```
76-
cat > /etc/udev/rules.d/52-hdmi2usb.rules <<EOF
77-
# Grant permission to makestuff usb devices.
78-
ATTR{idVendor}=="1d50", MODE:="666"
79-
80-
# Grant permissions to hdmi2usb usb devices.
81-
ATTR{idVendor}=="fb9a", MODE:="666"
82-
83-
# Grant permissions to unconfigured cypress chips.
84-
ATTR{idVendor}=="04b4", MODE:="666"
85-
86-
# Grant permissions to Digilent Development board JTAG
87-
ATTR{idVendor}=="1443", MODE:="666"
88-
EOF
89-
90-
udevadm control --reload-rules
91-
```
92-
* Flash the gateware and firmware - see [1] if using a VM:
62+
* Plug board in using USB PROG port & switch on. If using a VM, ensure the device is passed through.
63+
* Other USB port is for the HDMI2USB capture. Recommend plugging this in too so you can use/test the device.
64+
65+
6. Flash the gateware and firmware - see [1] if using a VM:
9366

9467
```
9568
PROG=fpgalink make load-gateware
9669
```
70+
(may need to run several times)
9771

98-
* Connect to lm32 softcore:
72+
7. Load fx2 firmware to enable USB capture:
9973
```
100-
make connect-lm32
74+
make load-fx2-firmware
10175
```
10276

103-
* Set a mode/capture - press 'h' and read instructions. TODO: Explain this more
104-
105-
* Run fx2 firmware to enable USB capture:
77+
8. Connect to lm32 softcore to send direct commands to the HDMI2USB such as changing resolution:
10678
```
107-
make load-fx2-firmware
79+
make connect-lm32
10880
```
81+
Set a mode/capture - press 'h' and read instructions.
82+
TODO: Expand on this
10983

110-
---
111-
112-
CHANGES TO GET ENV SCRIPT:
113-
114-
```
115-
cd HDMI2USB-misoc-firmware/build
116-
git clone https://github.com/mithro/exar-uart-driver
117-
cd exar-uart-driver
118-
sudo apt-get install linux-headers-generic debhelper module-assistant
119-
dpkg-buildpackage -rfakeroot
120-
sudo dpkg --install ../vizzini-source_*_all.deb
121-
(copy package build command from README.Debian) (what?)
122-
```
123-
124-
---
125-
126-
To get a device working after above is all built (booted up, etc):
127-
```
128-
cd ~/HDMI2USB-misoc-firmware
129-
source scripts/setup-env.sh
130-
PROG=fpgalink make load-gateware
131-
make load-lm32-firmware
132-
```
84+
9. Once everything has been built, get HDMI2USB running again after a power cycle by running this script (does non-build steps above):
85+
```
86+
~/HDMI2USB-misoc-firmware/scripts/flash-hdmi2usb.sh
87+
```
13388

13489
#### Footnotes
13590

13691
[1] If you are in a VM, during flashing the device will change USB UUID's up to 3 times. You can just run the command above again until you see "Programming successful!" (you may need to choose the new USB vendor/device ID in your hypervisor to pass through).
13792

138-
---
139-
140-
* https://github.com/timvideos/HDMI2USB-firmware-prebuilt
141-
142-
programmer i want to use when running make is
143-
fpgalink (probably)
144-
urjtag
145-
x3progs
146-
147-
last two require firmware on device first, first will do firmware loading for me
148-
so probably use first
93+
[2] Note firmware is only temporarily flashed to the device and is lost if HDMI2USB is power cycled, so has to be reflashed. You can use the 'go-hdmi2usb.sh' script metioned in step 9.
Has a conversation. Original line has a conversation.
14994

15095
---
15196

152-
Files:
97+
#### Files
15398

15499
* bootstrap.sh: script to run on a fresh Ubuntu 14.04 LTS install
155100
* get-env.sh: called from bootstrap (gets and installs software)
156101
* setup-env.sh: script to run after installation to setup environemnt
157102

103+
* 52-hdmi2usb.rules: udev rules loaded by get-env.sh
104+
* view-hdmi2usb.sh: test script to view HDMI2USB output
105+
* flash-hdmi2usb.sh: script to run after gateware/firmware built

‎scripts/bootstrap.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ set -x
44
set -e
55

66
GIT_REPO=https://github.com/timvideos/HDMI2USB-misoc-firmware.git
7-
GIT_BRANCH=scripts
7+
GIT_BRANCH=master
88

99
sudo apt-get install -y git realpath
1010

1111
if [ -e HDMI2USB-misoc-firmware ]; then
1212
cd HDMI2USB-misoc-firmware
13-
#git pull
13+
git pull
1414
else
1515
git clone $GIT_REPO
1616
cd HDMI2USB-misoc-firmware

‎scripts/flash-hdmi2usb.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
set -x
4+
set -e
5+
6+
if [ ! -e ~/HDMI2USB-misoc-firmware/build ]; then
7+
echo "You need to build the firmware first. Please see README.md"
8+
exit 1
9+
fi
10+
11+
cd ~/HDMI2USB-misoc-firmware
12+
13+
source ~/HDMI2USB-misoc-firmware/scripts/setup-env.sh
14+
15+
echo "Attempting to load gateware; will attempt 3 times, errors are normal"
16+
17+
for loop in 1 2 3
18+
do
19+
PROG=fpgalink make load-gateware; sleep 2
20+
done
21+
22+
make load-fx2-firmware; sleep 1
23+
make connect-lm32
24+

‎scripts/get-env.sh

+24-9
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,17 @@ sudo adduser $USER dialout
6565
# Get migen
6666
(
6767
cd $BUILD_DIR
68-
if [ -e migen ]; then
69-
cd migen
70-
git pull
71-
else
72-
git clone https://github.com/m-labs/migen.git
73-
cd migen
74-
fi
75-
cd vpi
68+
rm -fr migen
Has a conversation. Original line has a conversation.
69+
git clone https://github.com/m-labs/migen.git
70+
cd migen/vpi
7671
make all
7772
sudo make install
7873
)
7974

8075
# Get misoc
8176
(
8277
cd $BUILD_DIR
78+
rm -fr misoc
8379
git clone https://github.com/m-labs/misoc.git
8480
cd misoc
8581
git submodule init
@@ -93,13 +89,32 @@ sudo adduser $USER dialout
9389
(
9490
cd $BUILD_DIR
9591
sudo apt-get install -y libreadline-dev libusb-1.0-0-dev python-yaml sdcc fxload
92+
rm -fr makestuff
9693
wget -qO- http://tiny.cc/msbil | tar zxf -
97-
9894
cd makestuff/libs
9995
../scripts/msget.sh makestuff/libfpgalink
10096
cd libfpgalink
10197
make deps
10298
)
99+
# Load custom udev rules
100+
(
101+
cd $SETUP_DIR
102+
sudo cp -uf 52-hdmi2usb.rules /etc/udev/rules.d/
103+
104+
)
105+
106+
# build exar-uart-driver
Has a conversation. Original line has a conversation.
107+
(
108+
cd $BUILD_DIR
109+
rm -fr exar-uart-driver
110+
git clone https://github.com/mithro/exar-uart-driver
111+
cd exar-uart-driver
112+
sudo apt-get install linux-headers-generic debhelper module-assistant
113+
dpkg-buildpackage -rfakeroot
114+
sudo dpkg --install ../vizzini-source_*_all.deb
115+
)
116+
117+
103118

104119
sudo apt-get install -y gtkwave
105120

File renamed without changes.

0 commit comments

Comments
 (0)
Please sign in to comment.