SOP 002-Environnement informatique » Historique » Version 48
  Patrice Nadeau, 2016-02-06 17:29 
  
| 1 | 1 | Patrice Nadeau | h1. SOP 002-Environnement informatique | 
|---|---|---|---|
| 2 | |||
| 3 | Ce SOP explique comment configurer un poste pour | ||
| 4 | * la programmation (C) | ||
| 5 | 3 | Patrice Nadeau | * le désign de circuits électroniques | 
| 6 | 1 | Patrice Nadeau | > Pour l’instant, seulement un environnement GNU\Linux (openSUSE) est documenté. | 
| 7 | |||
| 8 | {{lastupdated_at}} {{lastupdated_by}} | ||
| 9 | |||
| 10 | --- | ||
| 11 | |||
| 12 | {{toc}} | ||
| 13 | |||
| 14 | h2. Matériel | ||
| 15 | |||
| 16 | h3. Ordinateur | ||
| 17 | |||
| 18 | * Processeur | ||
| 19 | 36 | Patrice Nadeau | ** 64 bits | 
| 20 | 1 | Patrice Nadeau | * Mémoire | 
| 21 | ** 2 Mo | ||
| 22 | * Disque | ||
| 23 | * Port série ou convertisseur USB/série (communication série et programmeur AVR) | ||
| 24 | * Port USB 2.0 ou plus (sonde Logic et programmeur AVR) | ||
| 25 | |||
| 26 | |||
| 27 | h3. Écran | ||
| 28 | |||
| 29 | * Résolution minimal de 1690x900 (VIM 2 x 80 colonnes + taglist) | ||
| 30 | ** 1 minimum, 2 fortement recommandés | ||
| 31 | |||
| 32 | h3. Programmeur | ||
| 33 | |||
| 34 | Pour le transfert des programmes vers les uC AVR. | ||
| 35 | |||
| 36 | Les programmeur suivants ont été testés : | ||
| 37 | * Atmel STK500 | ||
| 38 | * Atmel STK600 | ||
| 39 | * Atmel AVRISP mkII | ||
| 40 | |||
| 41 | h2. Logiciels | ||
| 42 | |||
| 43 | h3. Système d'exploitation | ||
| 44 | |||
| 45 | 42 | Patrice Nadeau | openSUSE Leap 42.1 interface graphique | 
| 46 | 1 | Patrice Nadeau | |
| 47 | h3. Navigateur Web | ||
| 48 | |||
| 49 | Pour l’accès à Redmine | ||
| 50 | |||
| 51 | h4. Firefox | ||
| 52 | |||
| 53 | Dictionnaire français | ||
| 54 | |||
| 55 | h3. Suite bureautique | ||
| 56 | |||
| 57 | LibreOffice | ||
| 58 | |||
| 59 | h3. Autres | ||
| 60 | |||
| 61 | Document viewer (Evince) | ||
| 62 | |||
| 63 | h3. Éditeur | ||
| 64 | |||
| 65 | L’éditeur "VIM":http://www.vim.org est utilisé. | ||
| 66 | Plusieurs compléments sont installés et une personnalisation est appliquée. | ||
| 67 | |||
| 68 | <pre><code class="bash"> | ||
| 69 | 14 | Patrice Nadeau | sudo zypper install gvim vim-data vim-plugin-a | 
| 70 | 1 | Patrice Nadeau | </code></pre> | 
| 71 | |||
| 72 | Plugin de http://www.vim.org/ | ||
| 73 | * puppet_syntax | ||
| 74 | * taglist | ||
| 75 | * NERDTree | ||
| 76 | |||
| 77 | Ctags | ||
| 78 | <pre><code class="bash"> | ||
| 79 | 14 | Patrice Nadeau | sudo zypper install ctags | 
| 80 | 1 | Patrice Nadeau | </code></pre> | 
| 81 | |||
| 82 | h4. Personnalisation | ||
| 83 | |||
| 84 | Copier les gabarits | ||
| 85 | > TODO : gabarits Vim | ||
| 86 | |||
| 87 | <pre><code class="bash"> | ||
| 88 | mkdir ~/Documents/projects | ||
| 89 | ... | ||
| 90 | </code></pre> | ||
| 91 | |||
| 92 | Créer des liens symboliques pour : | ||
| 93 | <pre><code class="bash"> | ||
| 94 | ln -s ~/Documents/projects/vim/vimrc ~/.vimrc | ||
| 95 | ln -s~/Documents/projects/vim/vim ~/.vim | ||
| 96 | ln -s~/Documents/projects/vim/ctags ~/.ctags | ||
| 97 | </code></pre> | ||
| 98 | |||
| 99 | Créer un raccourci pour l’application | ||
| 100 | <pre><code class="bash"> | ||
| 101 | gvim –cmd:cd /home/repertoire_projets | ||
| 102 | </code></pre> | ||
| 103 | |||
| 104 | h3. Unison | ||
| 105 | |||
| 106 | Synchronisation de données | ||
| 107 | <pre><code class="bash"> | ||
| 108 | 15 | Patrice Nadeau | sudo zypper install unison | 
| 109 | 1 | Patrice Nadeau | </code></pre> | 
| 110 | |||
| 111 | h3. Minicom | ||
| 112 | |||
| 113 | Logiciel de terminal sous GNU/Linux | ||
| 114 | |||
| 115 | Installation | ||
| 116 | <pre><code class="bash"> | ||
| 117 | 16 | Patrice Nadeau | sudo zypper install minicom | 
| 118 | 1 | Patrice Nadeau | </code></pre> | 
| 119 | |||
| 120 | Personnalisation | ||
| 121 | Ajouter l’utilisateur dans le groupe *dialout*. | ||
| 122 | <pre><code class="bash"> | ||
| 123 | 16 | Patrice Nadeau | sudo usermod --groups dialout username | 
| 124 | 1 | Patrice Nadeau | </code></pre> | 
| 125 | L’usager doit se reloguer. | ||
| 126 | |||
| 127 | h3. XƎTEX | ||
| 128 | |||
| 129 | Installation | ||
| 130 | <pre><code class="bash"> | ||
| 131 | 41 | Patrice Nadeau | sudo zypper install texlive-latex texlive-listing texlive-fancyhdr texlive-graphics texlive-todo texlive-siunitx texlive-beamer texlive-context-fullpage texlive-lastpage texlive-polyglosisa texlive-lstaddons | 
| 132 | 1 | Patrice Nadeau | </code></pre> | 
| 133 | |||
| 134 | h2. Programmation | ||
| 135 | |||
| 136 | Le langage _C_ est celui utilisé pour les systèmes embarqués. | ||
| 137 | |||
| 138 | h3. Éditeur | ||
| 139 | |||
| 140 | Ajouts supplémentaire à VIM | ||
| 141 | |||
| 142 | h3. Compilateur C | ||
| 143 | |||
| 144 | h4. gcc | ||
| 145 | |||
| 146 | <pre><code class="bash"> | ||
| 147 | 17 | Patrice Nadeau | sudo zypper install gcc make | 
| 148 | 1 | Patrice Nadeau | </code></pre> | 
| 149 | |||
| 150 | h4. splint | ||
| 151 | |||
| 152 | Vérificateur de syntaxe C | ||
| 153 | <pre><code class="bash"> | ||
| 154 | 17 | Patrice Nadeau | sudo zypper install splint | 
| 155 | 1 | Patrice Nadeau | </code></pre> | 
| 156 | |||
| 157 | h3. Doxygen | ||
| 158 | |||
| 159 | Outil de documentation (C/C++, java) | ||
| 160 | |||
| 161 | Installation | ||
| 162 | <pre><code class="bash"> | ||
| 163 | 18 | Patrice Nadeau | sudo zypper install doxygen texlive-latex | 
| 164 | 1 | Patrice Nadeau | </code></pre> | 
| 165 | |||
| 166 | h3. Git | ||
| 167 | |||
| 168 | Système de contrôle de version | ||
| 169 | |||
| 170 | Installation | ||
| 171 | <pre><code class="bash"> | ||
| 172 | 19 | Patrice Nadeau | sudo zypper install git | 
| 173 | 1 | Patrice Nadeau | </code></pre> | 
| 174 | |||
| 175 | h3. Atmel AVR | ||
| 176 | |||
| 177 | Pour la programmation des micro-controleur AVR 8 bits d’Atmel. | ||
| 178 | |||
| 179 | h4. Atmel AVR 8-bit toolchain | ||
| 180 | |||
| 181 | 35 | Patrice Nadeau | > Version 3.5.0 | 
| 182 | |||
| 183 | 43 | Patrice Nadeau | (!) Contient la version avr-gcc 4.9.2 avec le bogue "64452":https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64452 | 
| 184 | |||
| 185 | 23 | Patrice Nadeau | Télécharger du site de Atmel (un compte n’est pas obligatoire) : http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORLINUX.aspx | 
| 186 | 1 | Patrice Nadeau | |
| 187 | Décompresser le fichier. | ||
| 188 | 21 | Patrice Nadeau | <pre><code class="bash"> | 
| 189 | tar xf Downloads/avr8-gnu-toolchain-3.5.0.1662-linux.any.x86_64.tar.gz | ||
| 190 | </code></pre> | ||
| 191 | |||
| 192 | Copier les fichiers : | ||
| 193 | 1 | Patrice Nadeau | <pre><code class="bash"> | 
| 194 | # Créer le dossier (si n’existe pas déjà) | ||
| 195 | 20 | Patrice Nadeau | sudo mkdir --parents /opt/cross/avr | 
| 196 | 1 | Patrice Nadeau | # Copier les fichiers | 
| 197 | 22 | Patrice Nadeau | sudo cp --recursive avr8-gnu-toolchain-linux_x86_64/* /opt/cross/avr | 
| 198 | 1 | Patrice Nadeau | # Créer les liens | 
| 199 | 22 | Patrice Nadeau | sudo ln --symbolic /opt/cross/avr/ /usr/local/avr | 
| 200 | 20 | Patrice Nadeau | </code></pre> | 
| 201 | 1 | Patrice Nadeau | |
| 202 | 23 | Patrice Nadeau | Créer le fichier d'environnement : | 
| 203 | 1 | Patrice Nadeau | <pre><code class="bash"> | 
| 204 | 22 | Patrice Nadeau | sudo vi /etc/profile.d/avr.sh | 
| 205 | </code></pre> | ||
| 206 | 23 | Patrice Nadeau | Contenu du fichier : | 
| 207 | 1 | Patrice Nadeau | <pre><code class="bash"> | 
| 208 | #!/bin/bash | ||
| 209 | # Export path for AVR toolchain | ||
| 210 | export PATH=/usr/local/avr/bin:${PATH} | ||
| 211 | export MANPATH=/usr/local/avr/man:/usr/local/avr/share/man:${MANPATH} | ||
| 212 | </code></pre> | ||
| 213 | |||
| 214 | Se loguer en tant que l’utilisateur et exécuter | ||
| 215 | <pre><code class="bash"> | ||
| 216 | source /etc/profile.d/avr.sh | ||
| 217 | </code></pre> | ||
| 218 | |||
| 219 | 48 | Patrice Nadeau | h4. Logiciel tiers pour toolchain | 
| 220 | 47 | Patrice Nadeau | |
| 221 | > Version 4.8.4 de avr-gcc | ||
| 222 | 44 | Patrice Nadeau | |
| 223 | <pre><code class="bash"> | ||
| 224 | 45 | Patrice Nadeau | wget http://download.opensuse.org/repositories/home:/derselbst/openSUSE_Leap_42.1/x86_64/cross-avr-gcc-4.8.4-5.5.x86_64.rpm | 
| 225 | 44 | Patrice Nadeau | wget http://download.opensuse.org/repositories/openSUSE:/Leap:/42.1/standard/x86_64/cross-avr-binutils-2.25.0-5.1.x86_64.rpm | 
| 226 | wget http://download.opensuse.org/repositories/home:/derselbst/openSUSE_Leap_42.1/noarch/avr-libc-1.8.1-3.1.noarch.rpm | ||
| 227 | 46 | Patrice Nadeau | sudo zypper install cross-avr-gcc-4.8.4-5.5.x86_64.rpm cross-avr-binutils-2.25.0-5.1.x86_64.rpm avr-libc-1.8.1-3.1.noarch.rpm | 
| 228 | 44 | Patrice Nadeau | </code></pre> | 
| 229 | |||
| 230 | 1 | Patrice Nadeau | h4. Avrdude | 
| 231 | 34 | Patrice Nadeau | > Version 6.1 | 
| 232 | 1 | Patrice Nadeau | |
| 233 | Logiciel de transfert pour AVR. | ||
| 234 | |||
| 235 | Installation Les modules suivant sont nécessaire : | ||
| 236 | <pre><code class="bash"> | ||
| 237 | 24 | Patrice Nadeau | sudo zypper install avrdude libusb-compat-devel | 
| 238 | 1 | Patrice Nadeau | </code></pre> | 
| 239 | |||
| 240 | 25 | Patrice Nadeau | Permissions USB | 
| 241 | 24 | Patrice Nadeau | Créer le fichier de règle : | 
| 242 | <pre><code class="bash"> | ||
| 243 | 26 | Patrice Nadeau | sudo vi /etc/udev/rules.d/60-avrisp.rules | 
| 244 | 24 | Patrice Nadeau | </code></pre> | 
| 245 | 39 | Patrice Nadeau | Contenu du fichier : | 
| 246 | 1 | Patrice Nadeau | <pre><code class="bash"> | 
| 247 | SUBSYSTEM!="usb_device", ACTION!="add", GOTO="avrisp_end" | ||
| 248 | # Atmel Corp. JTAG ICE mkII | ||
| 249 | ATTR{idVendor}=="03eb", ATTR{idProduct}=="2103", MODE="660", GROUP="avr" | ||
| 250 | # Atmel Corp. AVRISP mkII | ||
| 251 | ATTR{idVendor}=="03eb", ATTR{idProduct}=="2104", MODE="660", GROUP="avr" | ||
| 252 | # Atmel Corp. Dragon | ||
| 253 | ATTR{idVendor}=="03eb", ATTR{idProduct}=="2107", MODE="660", GROUP="avr" | ||
| 254 | LABEL="avrisp_end" | ||
| 255 | </code></pre> | ||
| 256 | |||
| 257 | Rebrancher le programmeur USB pour relire le fichier */etc/udev/rules.d* | ||
| 258 | |||
| 259 | Créer un groupe *avr* et y ajouter les usagers nécessaires. | ||
| 260 | <pre><code class="bash"> | ||
| 261 | 27 | Patrice Nadeau | sudo groupadd avr | 
| 262 | sudo usermod --groups avr username | ||
| 263 | 1 | Patrice Nadeau | </code></pre> | 
| 264 | |||
| 265 | L’usager doit se reloguer. | ||
| 266 | |||
| 267 | h3. BeagleBone | ||
| 268 | |||
| 269 | h2. CAD | ||
| 270 | |||
| 271 | h3. KiCAD | ||
| 272 | 40 | Patrice Nadeau | > Version 4.0.1 | 
| 273 | 1 | Patrice Nadeau | |
| 274 | h4. Installation | ||
| 275 | |||
| 276 | <pre><code class="bash"> | ||
| 277 | 40 | Patrice Nadeau | # Enelever le repo existant | 
| 278 | sudo zypper removerepo electronics | ||
| 279 | 30 | Patrice Nadeau | # Ajouter le repo | 
| 280 | sudo zypper addrepo http://download.opensuse.org/repositories/electronics/openSUSE_Leap_42.1/electronics.repo | ||
| 281 | # installation | ||
| 282 | sudo zypper install kicad | ||
| 283 | 1 | Patrice Nadeau | </code></pre> | 
| 284 | |||
| 285 | h4. Personnalisation | ||
| 286 | |||
| 287 | 13 | Patrice Nadeau | Les fichiers gabarit d'un +nouveau+ projet sont : | 
| 288 | 4 | Patrice Nadeau | * Global (system wide) : */usr/share/kicad/template/kicad.pro*. | 
| 289 | * Utilisateur courant : *~/noname.pro* | ||
| 290 | 5 | Patrice Nadeau | |
| 291 | 10 | Patrice Nadeau | >Comme les libraires fournis proviennent de source divers et que je ne contrôle pas, je ne travaille qu’avec mes propres libraires. | 
| 292 | >J’enlève donc les librairies de KiCad et j'ajoute les miennes. | ||
| 293 | >Fichier _~/noname.pro_ (2 lignes à modifier) : | ||
| 294 | >* _LibDir_ : */home/pnadeau/Documents/projects/cad/libraries/kicad/* | ||
| 295 | 1 | Patrice Nadeau | |
| 296 | h2. Autres | ||
| 297 | |||
| 298 | h3. Logic | ||
| 299 | 32 | Patrice Nadeau | > Version 1.2.5 | 
| 300 | 1 | Patrice Nadeau | |
| 301 | Analyseur logique | ||
| 302 | |||
| 303 | Téléchargement à partir de http://www.saleae.com/downloads | ||
| 304 | |||
| 305 | Décompresser le fichier et placer les fichiers dans *~/Logic* | ||
| 306 | |||
| 307 | Installer le pilote | ||
| 308 | <pre><code class="bash"> | ||
| 309 | 31 | Patrice Nadeau | ~/Logic/Drivers/install_driver.sh | 
| 310 | 1 | Patrice Nadeau | </code></pre> | 
| 311 | |||
| 312 | 31 | Patrice Nadeau | Débrancher et rebrancher l'analyseur. | 
