-
Notifications
You must be signed in to change notification settings - Fork 1
/
01-setup_SD_card.txt
131 lines (92 loc) · 4.02 KB
/
01-setup_SD_card.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
SD card setup for the MicroZedBoard - Adrian Remonda 2014
Prompt:
~$ means your pc
microZed$ the MicroZed
Setup sd card:
--------------
Debian image I have prepare that boots fast (this is convenient when you are doing some kernel hacking).
Download it and flash it in the SD card with the “dd ” command.
Download:
6c6297b22fc71387da560a27ed55c0ba debian-small.img
https://www.dropbox.com/s/76dzekcpdub7pot/debian-small.img?dl=0
# compressed file
https://www.dropbox.com/s/fhpkdzlel790qbc/debian-small.img.tar.gz?dl=0
83366926e00c5f9e78ee620d52a43359 debian-small.img.tar.gz
#uncompress
tar -zxvf debian-small.img.tar.gz
Check that you have the next checksum with the md5sum command.
Should get : 6c6297b22fc71387da560a27ed55c0ba debian-small.img
With the command lsblk you can check to witch driver is the SD card (/dev/sdX)
$host: lsblk
$host: export DISK=/dev/sdXXX -> be carefull!!
$host: sudo dd if=/dev/zero of=${DISK} bs=1M count=20 -> be carefull!!
time sudo dd if=debian-minimal.img of=${DISK} -> be carefull!!
Boot the Debian image
-----------------------
Set the jumpers to boot from the SD card:
JMP1 = "1"
JMP2 = "0"
JMP3 = "0"
Connect the MicroZed with the SD card and s
Insert SD Card into MicroZed. Connect MicroZed to the host with USB
Serial port cable and RJ45 cable. Reboot MicroZed board (press RST).
3) check to witch driver is your serial port connected in the host
host$ ls /dev/tty*
should get something like ttyUSB0
4) host$ sudo minicom -s
configure with 115200 no hardware and using the previous device
5) You should get a promt with a log.
Restart the board and you should see the kernel logs
Setup ethernet connection
------------------------
Setup an static ip address in your pc
--------------------------------------
we have to set up an static ip address. If you want to setup permanently you must
set it in /etc/network/interfaces (write me if you have troubles)
(we can also setup a dhcp server but it is a bit slower).
The debian image has an static ip address (192.168.1.103) as a first step you can just
do as next in your desktop in order to connect.
host$: ifconfig eth0 192.168.1.103
host$: ifconfig eth0 up
host$: ifconfig
# the with ping
host$: ping 192.168.1.103
# connect with ssh
pw: root
Toolchain
-----------
We will be using the armhf (hardware floating point support)
1) The first step is to have a linux running in your MicroZed
2) The second is to crosscompile an user space program and run it in your board
- Download/Extract:
$ cd
$ mkdir toolchains
$ cd toolchains
$ wget -c https://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
$ tar xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
$ export CC=~/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-
or if you have added in the path in .bashrc
$ export CC=arm-linux-gnueabihf-
- In debian or Ubuntu install the next packages:
$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386
- Test:
$ ${CC}gcc --version
arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- To export it permanently
echo "export PATH=~/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin:$PATH" >> ~/.bashrc
- compile a hello world
$ ${CC}gcc main.c -o hello.elf
copy the hello world in your board:
---------------------------------
copy the elf file in your board:
host$ scp hello.elf [email protected]:/root
host$ ssh [email protected]
# now we are in the Zed
target$ cd /root
target$ ./hello.elf