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