Wiki » Historique » Version 16
  Patrice Nadeau, 2014-07-24 20:37 
  
| 1 | 2 | Patrice Nadeau | %{font-size:18pt}Utilisation d'un BeagleBone Black% | 
|---|---|---|---|
| 2 | |||
| 3 | 1 | Patrice Nadeau | ---  | 
| 4 | |||
| 5 | {{toc}} | 
||
| 6 | |||
| 7 | h1. Matériel requis  | 
||
| 8 | |||
| 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 | h1. Accessoires requis  | 
||
| 12 | |||
| 13 | * 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)  | 
||
| 14 | * Concentrateur USB  | 
||
| 15 | 3 | Patrice Nadeau | |
| 16 | h1. Logiciel requis  | 
||
| 17 | |||
| 18 | 1 | Patrice Nadeau | h1. Branchement physique  | 
| 19 | |||
| 20 | 15 | Patrice Nadeau | Brancher le BeagleBone Black au port USB de l'ordinateur.  | 
| 21 | Un nouveau média apparaitra ainsi qu'une nouvelle carte réseau.  | 
||
| 22 | 12 | Patrice Nadeau | |
| 23 | 15 | Patrice Nadeau | > Optionnellement  | 
| 24 | > Copier localement le fichier */boot/Drivers/Linux/FTDI/mkudevrule.sh*.  | 
||
| 25 | > A partir d'une session terminal  | 
||
| 26 | ><pre><code class="bash">  | 
||
| 27 | 12 | Patrice Nadeau | chmod +x mkudevrule.sh  | 
| 28 | 13 | Patrice Nadeau | sudo ./mkudevrule.sh  | 
| 29 | 12 | Patrice Nadeau | </code></pre>  | 
| 30 | |||
| 31 | 3 | Patrice Nadeau | h2. Développement à partir d'un autre poste  | 
| 32 | |||
| 33 | Comme pour les AVR d'ATMEL, l’écriture du code source et sa compilation peut être faite sur un autre poste.  | 
||
| 34 | |||
| 35 | Compilateur (gcc)  | 
||
| 36 | * http://software.opensuse.org/package/cross-arm-linux-gnueabi-binutils  | 
||
| 37 | * http://software.opensuse.org/package/cross-arm-linux-gnueabi-gcc  | 
||
| 38 | |||
| 39 | Librairies  | 
||
| 40 | 9 | Patrice Nadeau | * http://software.opensuse.org/package/cross-arm-linux-gnueabi-kernel-headers  | 
| 41 | 3 | Patrice Nadeau | * http://software.opensuse.org/package/cross-arm-linux-gnueabi-glibc  | 
| 42 | * http://software.opensuse.org/package/cross-arm-linux-gnueabi-libffi  | 
||
| 43 | |||
| 44 | 4 | Patrice Nadeau | Le compilateur est installé dans */opt/cross/bin/*  | 
| 45 | * arm-linix-gnueabi-gcc  | 
||
| 46 | * ...  | 
||
| 47 | 5 | Patrice Nadeau | |
| 48 | 6 | Patrice Nadeau | Créer le lien vers l’exécutable :  | 
| 49 | 5 | Patrice Nadeau | <pre><code class="bash">  | 
| 50 | ln -s /opt/cross/bin /usr/local/arm  | 
||
| 51 | </code></pre>  | 
||
| 52 | |||
| 53 | 10 | Patrice Nadeau | Crer le fichier */etc/profile.d/arm.sh*  | 
| 54 | 1 | Patrice Nadeau | <pre><code class="bash">  | 
| 55 | 7 | Patrice Nadeau | #!/bin/bash  | 
| 56 | # Export path for ARM tollchain  | 
||
| 57 | 5 | Patrice Nadeau | export PATH=/usr/local/arm:${PATH} | 
| 58 | 1 | Patrice Nadeau | export MANPATH=/opt/cross/share/man:${MANPATH} | 
| 59 | 7 | Patrice Nadeau | </code></pre>  | 
| 60 | |||
| 61 | 11 | Patrice Nadeau | h1. Utilisation  | 
| 62 | |||
| 63 | En tant qu'utilisateur, se relogguer OU dans la session _courante_  | 
||
| 64 | 7 | Patrice Nadeau | <pre><code class="bash">  | 
| 65 | 1 | Patrice Nadeau | source /etc/profile.d/arm.sh  | 
| 66 | </code></pre>  | 
||
| 67 | |||
| 68 | 11 | Patrice Nadeau | h2. Creation du code  | 
| 69 | |||
| 70 | 10 | Patrice Nadeau | Créer un fichier *test.c*  | 
| 71 | <pre><code class="c">  | 
||
| 72 | #include <stdio.h>  | 
||
| 73 | void (main)(void)  | 
||
| 74 | { | 
||
| 75 |     printf("Allo la terre !\n"); | 
||
| 76 | int x;  | 
||
| 77 | }  | 
||
| 78 | 1 | Patrice Nadeau | </code></pre>  | 
| 79 | |||
| 80 | 11 | Patrice Nadeau | h2. Compilation  | 
| 81 | |||
| 82 | 10 | Patrice Nadeau | Compiler avec  | 
| 83 | <pre><code class="bash">  | 
||
| 84 | 1 | Patrice Nadeau | arm-linux-gnueabi-gcc test.c -o test  | 
| 85 | </code></pre>  | 
||
| 86 | 11 | Patrice Nadeau | |
| 87 | h2. Téléchargement dans le BeagleBone  | 
||
| 88 | 16 | Patrice Nadeau | |
| 89 | Copier l’exécutable dans le BeagleBone Black  | 
||
| 90 | |||
| 91 | <pre><code class="bash">  | 
||
| 92 | scp test root@192.168.7.2:  | 
||
| 93 | </code></pre>  | 
||
| 94 | |||
| 95 | Ouvrir une session dans et exécuter le programme directement dans le BeagleBone  | 
||
| 96 | |||
| 97 | <pre><code class="bash">  | 
||
| 98 | ssh root@192.168.7.2  | 
||
| 99 | ./test  | 
||
| 100 | </code></pre>  |