Différences entre versions de « Pololu-Romi-32U4-Ressusciter-Arduino-IDE »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 26 : Ligne 26 :
  
 
== La méthode bootloader-before-uploading ==
 
== La méthode bootloader-before-uploading ==
The goal of the bootloader-before-uploading method is to select the bootloader’s virtual serial port in the Arduino IDE and then make sure the board is in bootloader mode at the time when the Arduino IDE enters the uploading phase.
+
Le but de la méthode "bootloader-before-uploading" (bootloader avant téléversement) consiste à sélectionner le port virtuel du bootloader dans Arduino IDE et de s'assurer que la carte est en mode bootloader au moment où Arduino IDE débute sa phase de téléversement.
 +
 
 +
{{traduction}}
  
 
# Connect the device to your computer via USB.
 
# Connect the device to your computer via USB.

Version du 21 mars 2020 à 22:40

Introduction

Cette section propose deux méthodes spéciales pour programmer l'A-Star (et autre cartes 32U4 de Pololu) en utilisant Arduino IDE dans le cas où votre méthode habituelle de programmation ne fonctionne pas. Ces instructions sont développées autour de Arduino IDE 1.0.5-r2 et 1.6.0 (et pourrait avoir besoin d'être mise-à-jour pour les futures versions).

Bouton Reset

Si vous disposez d'un A-Star 32U4 Micro, vous devriez connecter un bouton poussoir momentané entre les broches GND et RST (il servira de bouton RESET). D'autres cartes de la famille 32U4 disposent déjà d'un bouton Reset. Alternativement, il est toujours possible d'utiliser un bout de fil pour connecter momentanément GND et RST ensemble à la place d'utiliser un bouton Reset.

Réinitialisez la carte deux fois endéans 750 ms active le mode bootloader de la carte. Le bootloader termine automatiquement son exécution au bout de 8 secondes et essaye de démarrer le programme utilisateur (si aucun croquis est téléversé). Pour réactiver la carte, il faut téléverser un croquis endéans les 8 secondes. Le croquis "Blink without delay" est un excellent candidat.

Dans le modue bootloader, la LED jaune pulse (celle portant le libellé LED 13). En surveillant la LED il est facile d'identifier le mode de fonctionnement du microcontroleur. De même, Pololu recommande d'activer l'affichage des messages détaillés durant le téléversement du croquis (voir l'option "Fichiers > Préférences"). En surveillant la LED et les informations détaillées durant la procédure vous aidera à comprendre ce qui se passe.

La méthode uploading-before-bootloader

Le but de la méthode uploading-before-bootloader (téléverser avec le bootloader) consiste en la sectionner un port série non-existant dans Arduino IDE et ensuite de s'assurer que Arduino IDE entre en phase de téléversement AVANT que le bootloader soit activé sur le microcontroleur. Cette méthode a été testée sur Arduino 1.0.5-r2 et 1.6.0. Cette méthode ne fonctionne pas avec Arduino 1.5.6-r2 car cette version de l'IDE provoque un message d'erreur fatale si le port série n'est pas sélectionné au début de la phase de téléversement (ex: "Carte sur COM7 n'est pas disponible").

  1. Connectez le périphérique sur votre ordinateur via USB.
  2. Dans le menu "Outils", ouvrir le sous-menu "Carte" et sélectionnez "Pololu A-Star 32U4".
  3. Dans le menu "Outils", ouvrir le sous-menu "Port" et vérifier qu'il n'y a pas de port sélectionné. Si le menu "Port" est grisé ou qu'aucun port est sélectionné alors tout est en bonne ordre et vous pouvez passer à l'étape 6.
  4. Réinitialisez la carte deux fois pour activer le mode bootloader. Pendant que la carte est en mode bootloader, sélectionnez rapidement le nouveau port série qui correspond à la carte en mode bootloader (par l'intermédiaire du menu "Port").
  5. Après 8 secondes, le bootloader cesse de fonctionner et essaye d'exécuter le programme utilisateur une nouvelle fois. Attendre que le bootloader termine son exécution et vérifier que le monu port soit grisé ou qu'aucun port n'y soit soit sélectionné.
  6. Cliquer sur le bouton téléverser. Arduino IDE commencera à compiler le croquis puis démarre le téléversement.
  7. Dès que la barre de statut d'Arduino IDE affiche "Téléversement..." (ou Uploading en anglais), pressez deux fois le bouton RESET pour activer le mode bootloader.

Arduino IDE restera en mode téléversement pendant 10 secondes, attendant qu'un nouveau port série apparaisse. Une fois le port série du bootloader apparu, Arduino IDE s'y connectera et enverra les commandes de programmation.

La méthode bootloader-before-uploading

Le but de la méthode "bootloader-before-uploading" (bootloader avant téléversement) consiste à sélectionner le port virtuel du bootloader dans Arduino IDE et de s'assurer que la carte est en mode bootloader au moment où Arduino IDE débute sa phase de téléversement.

  1. Connect the device to your computer via USB.
  2. In the “Tools” menu, open the “Board” sub-menu and check to see if the “Pololu A-Star 32U4 (bootloader port)” entry is visible. If this entry is visible, you can skip to step 6.
  3. If you are using a 1.0.x version of the Arduino IDE, open the file [sketchbook location]/hardware/pololu/boards.txt using a text editor. If you are using a 1.5.x version of the Arduino IDE, open the file [sketchbook location]/hardware/pololu/avr/boards.txt using a text editor. You can see the sketchbook location in the Arduino IDE preferences dialog. The file you are looking for is part of the A-Star add-on.
  4. In the boards.txt file that you opened, find the lines at the bottom of the file that start with #a-star32U4bp. Uncomment each of those lines by deleting the “#” character, and then save the file.
  5. Close the Arduino IDE and restart it.
  6. In the “Tools” menu, open the “Board” sub-menu and select “Pololu A-Star 32U4 (bootloader port)”. This entry is configured so that the Arduino IDE will send programming commands directly to selected serial port, instead of trying to send a special USB command to the port to get it into bootloader mode and then waiting for the new port to appear. By selecting this entry, the timing of the programming process below becomes easier, especially on Windows.
  7. Prepare the computer to show you a list of its virtual serial ports. If you are using Windows, this means you should open the Device Manager. If you are on Linux or Mac OS X, this means you should open a Terminal and type the command ls /dev/tty* but do not press enter until the board is in bootloader mode in the next step.
  8. Reset the board twice to get the board into bootloader mode. While it is in bootloader mode, quickly look at the list of serial ports provided by your operating system in order to determine what port the bootloader is assigned to.
  9. Reset the board twice to get the board into bootloader mode again. While the board is in bootloader mode, quickly select the serial port of the bootloader in the Arduino IDE. The port can be selected in the “Port” sub-menu under “Tools”.
  10. In the Arduino IDE, click the “Verify” button to compile your sketch. This could make the timing easier during the next step.
  11. Press the reset button twice to get the board into bootloader mode again. As soon as you see the yellow LED fading in and out, press the Upload button.

The Arduino IDE will compile your sketch and then upload it to the selected serial port.

If the compilation of the sketch takes longer than 8 seconds, then this procedure will fail because the bootloader will time out and start trying to run the malfunctioning sketch again. If that happens, try the procedure again using a simpler sketch such as the Blink example that can be found under File > Examples > 01.Basics > Blink .

After reviving your device, be sure to change the Board setting back to “Pololu A-Star 32U4” and select the right Port.


Basé sur "Guide utilisateur de la carte de contrôle Romi 32U4" de Pololu (https://www.pololu.com/docs/0J69) - Traduit en Français par shop.mchobby.be CC-BY-SA pour la traduction
Toute copie doit contenir ce crédit, lien vers cette page et la section "crédit de traduction". Traduit avec l'autorisation expresse de Pololu (www.pololu.com)

Based on "Pololu Romi 32U4 Control Board User’s Guide" from Pololu (https://www.pololu.com/docs/0J69) - Translated to French by shop.mchobby.be CC-BY-SA for the translation
Copies must includes this credit, link to this page and the section "crédit de traduction" (translation credit). Translated with the Pololu's authorization (www.pololu.com)