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