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