Environnement de travail à distance » Historique » Version 11
Patrice Nadeau, 2015-03-23 18:40
| 1 | 3 | Patrice Nadeau | h1. Environnement de travail à distance |
|---|---|---|---|
| 2 | 1 | Patrice Nadeau | |
| 3 | 2 | Patrice Nadeau | {{TOC}} |
| 4 | |||
| 5 | ---- |
||
| 6 | |||
| 7 | 3 | Patrice Nadeau | h2. Matériel requis |
| 8 | 1 | Patrice Nadeau | |
| 9 | * BeagleBone Black (Digikey #"BB-BBLK-000-REVC-ND":http://www.digikey.ca/product-detail/en/BB-BBLK-000/BB-BBLK-000-REVC-ND/4842211) |
||
| 10 | |||
| 11 | 3 | Patrice Nadeau | h3. Mode « slave » |
| 12 | 1 | Patrice Nadeau | |
| 13 | * Câble USB A - Mini-B (fournis avec le BBB) |
||
| 14 | |||
| 15 | 4 | Patrice Nadeau | h3. Mode « stand-alone » |
| 16 | 1 | Patrice Nadeau | |
| 17 | Dans ce mode le BBB se comporte comme un ordinateur complet. |
||
| 18 | |||
| 19 | * Bloc d’alimentation 5V, 1A, 2.1mm, centre positif (DigiKey #"T139-P5P-ND":http://www.digikey.ca/product-search/en?vendor=0&keywords=T1139-P5P-ND) |
||
| 20 | * Câble Ethernet |
||
| 21 | > Facultatif |
||
| 22 | > * Concentrateur USB |
||
| 23 | > * Clavier/souris |
||
| 24 | > * Adaptateur vidéo |
||
| 25 | |||
| 26 | 3 | Patrice Nadeau | h2. Branchement |
| 27 | 1 | Patrice Nadeau | |
| 28 | Peux importe la méthode, le BBB seras disponible à l'adresse *192.168.7.2* avec l'utilisateur *root*. |
||
| 29 | |||
| 30 | 3 | Patrice Nadeau | h3. Mode « slave » |
| 31 | 1 | Patrice Nadeau | |
| 32 | Brancher le BBB à l'ordinateur en utilisant le port Micro-B. |
||
| 33 | Un nouveau média apparaitra ainsi qu'une nouvelle carte réseau. |
||
| 34 | |||
| 35 | > Optionnellement |
||
| 36 | > A partir du nouveau media, copier localement le fichier *boot/Drivers/Linux/FTDI/mkudevrule.sh*. |
||
| 37 | > A partir d'une session terminal, exécuter le script |
||
| 38 | ><pre><code class="bash"> |
||
| 39 | chmod +x mkudevrule.sh |
||
| 40 | sudo ./mkudevrule.sh |
||
| 41 | </code></pre> |
||
| 42 | |||
| 43 | 6 | Patrice Nadeau | h3. Mode « stand-alone » |
| 44 | 1 | Patrice Nadeau | |
| 45 | 7 | Patrice Nadeau | Au minimum, brancher les câbles d'alimentation et Ethernet. |
| 46 | 1 | Patrice Nadeau | Un clavier, souris et écran peuvent aussi être branchés. |
| 47 | |||
| 48 | 3 | Patrice Nadeau | h2. Logiciel requis |
| 49 | 1 | Patrice Nadeau | |
| 50 | 3 | Patrice Nadeau | h3. Développement local |
| 51 | 1 | Patrice Nadeau | |
| 52 | Comme la compilation seras longue sur un processeur de cette vitesse et les outils dépendant de la version installé sur le BBB, je ne documenterai pas cette section. |
||
| 53 | |||
| 54 | 3 | Patrice Nadeau | h3. Développement à partir d'un autre poste |
| 55 | 1 | Patrice Nadeau | |
| 56 | Comme pour les AVR d'ATMEL, l’écriture du code source et sa compilation peut être faite à partir d'un autre poste. |
||
| 57 | |||
| 58 | 8 | Patrice Nadeau | h4. Poste GNU/Linux |
| 59 | 9 | Patrice Nadeau | |
| 60 | 8 | Patrice Nadeau | J'utilise ici une station de travail sous openSUSE 13.2. |
| 61 | |||
| 62 | 1 | Patrice Nadeau | Télécharger les fichier suivants |
| 63 | * Compilateur (gcc) |
||
| 64 | ** http://software.opensuse.org/package/cross-arm-linux-gnueabi-binutils |
||
| 65 | ** http://software.opensuse.org/package/cross-arm-linux-gnueabi-gcc |
||
| 66 | * Librairies |
||
| 67 | ** http://software.opensuse.org/package/cross-arm-linux-gnueabi-kernel-headers |
||
| 68 | ** http://software.opensuse.org/package/cross-arm-linux-gnueabi-glibc |
||
| 69 | ** http://software.opensuse.org/package/cross-arm-linux-gnueabi-libffi |
||
| 70 | |||
| 71 | https://github.com/VegetableAvenger/BBBIOlib |
||
| 72 | |||
| 73 | En tant que *root* : |
||
| 74 | <pre><code class="bash"> |
||
| 75 | # Installer les packages |
||
| 76 | rpm -Uhv cross-arm-linux-gnueabi*.rpm |
||
| 77 | # Créer le lien vers les exécutable |
||
| 78 | ln -s /opt/cross/bin /usr/local/arm |
||
| 79 | </code></pre> |
||
| 80 | |||
| 81 | Créer le fichier */etc/profile.d/arm.sh* |
||
| 82 | <pre><code class="bash"> |
||
| 83 | #!/bin/bash |
||
| 84 | # Export path for ARM tollchain |
||
| 85 | export PATH=/usr/local/arm:${PATH} |
||
| 86 | export MANPATH=/opt/cross/share/man:${MANPATH} |
||
| 87 | </code></pre> |
||
| 88 | |||
| 89 | 3 | Patrice Nadeau | h3. Utilisation |
| 90 | 1 | Patrice Nadeau | |
| 91 | 10 | Patrice Nadeau | h4. GNU/Linux |
| 92 | |||
| 93 | En tant qu'utilisateur, se relogguer OU dans la session _courante_, exécuter |
||
| 94 | 1 | Patrice Nadeau | <pre><code class="bash"> |
| 95 | source /etc/profile.d/arm.sh |
||
| 96 | </code></pre> |
||
| 97 | |||
| 98 | 3 | Patrice Nadeau | h2. Création du code |
| 99 | 1 | Patrice Nadeau | |
| 100 | Créer un fichier *test.c* |
||
| 101 | <pre><code class="c"> |
||
| 102 | #include <stdio.h> |
||
| 103 | void (main)(void) |
||
| 104 | { |
||
| 105 | printf("Allo la terre !\n"); |
||
| 106 | int x; |
||
| 107 | } |
||
| 108 | </code></pre> |
||
| 109 | |||
| 110 | 3 | Patrice Nadeau | h3. Compilation |
| 111 | 1 | Patrice Nadeau | |
| 112 | Compiler avec |
||
| 113 | <pre><code class="bash"> |
||
| 114 | arm-linux-gnueabi-gcc test.c -o test |
||
| 115 | </code></pre> |
||
| 116 | |||
| 117 | 3 | Patrice Nadeau | h3. Téléchargement |
| 118 | 1 | Patrice Nadeau | |
| 119 | Copier l’exécutable dans le BBB |
||
| 120 | |||
| 121 | <pre><code class="bash"> |
||
| 122 | scp test root@192.168.7.2: |
||
| 123 | </code></pre> |
||
| 124 | |||
| 125 | 11 | Patrice Nadeau | Ouvrir une session et exécuter le programme directement dans sur le BBB |
| 126 | 1 | Patrice Nadeau | |
| 127 | <pre><code class="bash"> |
||
| 128 | ssh root@192.168.7.2 |
||
| 129 | ./test |
||
| 130 | </code></pre> |