{"id":99,"date":"2017-10-05T18:55:10","date_gmt":"2017-10-05T18:55:10","guid":{"rendered":"http:\/\/marcjuneau.ca\/?p=99"},"modified":"2017-10-05T19:15:06","modified_gmt":"2017-10-05T19:15:06","slug":"utiliser-avrdude-dans-avr-studio","status":"publish","type":"post","link":"https:\/\/marcjuneau.ca\/?p=99","title":{"rendered":"Utiliser AVRDUDE dans AVR Studio"},"content":{"rendered":"<p>Dans cet article, vous verrez comment t\u00e9l\u00e9charger votre programme dans votre Arduino sans utiliser de programmeur externe.<\/p>\n<p>Une version vid\u00e9o de cette article est disponible sur mon canal Youtube \u00e0\u00a0<a href=\"https:\/\/youtu.be\/HB7oB3Bfg4k\">https:\/\/youtu.be\/HB7oB3Bfg4k<\/a>.<\/p>\n<p>Les cartes Arduino sont livr\u00e9es avec ce qu&rsquo;on appel un bootloader. Il s&rsquo;agit d&rsquo;un petit programme qui demeure dans votre microcontr\u00f4leur et qui permet de charger le fichier hex via un port de communication. Dans le car du Arduino, il utilise le port s\u00e9rie qui est reli\u00e9 au port USB de la carte.<\/p>\n<p>La premi\u00e8re \u00e9tape consiste \u00e0 ouvrir Arduino IDE et de charger un exemple simple, puis de le t\u00e9l\u00e9charger sur la carte. Apr\u00e8s le chargement, trouvez dans la liste des commandes celles qui r\u00e9f\u00e8re \u00e0 Avrdude.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-100\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape1.png\" alt=\"etape1\" width=\"907\" height=\"600\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape1.png 907w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape1-300x198.png 300w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape1-768x508.png 768w\" sizes=\"auto, (max-width: 907px) 100vw, 907px\" \/><\/p>\n<p>Copiez ensuite la ligne compl\u00e8te dans un \u00e9diteur de texte.<\/p>\n<p>S\u00e9parez la commande en deux partie.<\/p>\n<p><strong>Partie 1 (Commande)<\/strong><\/p>\n<p><span style=\"color: #ff0000;\">C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\/bin\/avrdude<\/span><\/p>\n<p>Vous devez ajouter .exe \u00e0 la fin de cette commande, ce qui vous donnera ceci :<\/p>\n<p><span style=\"color: #339966;\">C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\/bin\/avrdude.exe<\/span><\/p>\n<p><strong>Partie 2\u00a0(Arguments)<\/strong><\/p>\n<p>-CC:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\/etc\/avrdude.conf -v -patmega328p -carduino -PCOM47 -b115200 -D -Uflash:w:C:\\Users\\MARC~1.JUN\\AppData\\Local\\Temp\\arduino_build_327788\/Blink.ino.hex:i<\/p>\n<p>La premi\u00e8re partie des arguments donne le chemin vers le fichier de configuration d&rsquo;Avrdude. Vous devez ajouter des \u00ab\u00a0\u00a0\u00bb \u00e0 cette partie.<\/p>\n<p>Ensuite, il faut modifier l&rsquo;argument du port comme suit :<br \/>\n-PCOM47 deviendra -P\\\\.\\COM47<\/p>\n<p>Finalement, il faudra remplacer le chemin du fichier hex pour celui de votre projet. Sous AVR Studio, il y a des constantes de path qui simplifient cette t\u00e2che. L&rsquo;argument\u00a0\u00ab\u00a0$(ProjectDir)Debug\\$(TargetName).hex\u00a0\u00bb pointera sur le hex de votre projet \u00e0 moins que vous aillez changer ce chemin manuellement.<\/p>\n<p>La ligne d&rsquo;arguments\u00a0devrait donc ressembler \u00e0 ceci :<\/p>\n<p>-C\u00a0\u00bbC:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\/etc\/avrdude.conf\u00a0\u00bb -v -patmega328p -carduino -P\\\\.\\COM47 -b115200 -D -Uflash:w:\u00a0\u00bb$(ProjectDir)Debug\\$(TargetName).hex\u00a0\u00bb:i<\/p>\n<p>Maintenant, ouvrez un nouveau projet dans AVR Studio pour le Atmega328p.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-103\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape2.png\" alt=\"etape2\" width=\"955\" height=\"660\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape2.png 955w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape2-300x207.png 300w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape2-768x531.png 768w\" sizes=\"auto, (max-width: 955px) 100vw, 955px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-102\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape3.png\" alt=\"etape3\" width=\"766\" height=\"531\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape3.png 766w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape3-300x208.png 300w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><\/p>\n<p>Faites un petit programme qui fait clignoter le LED du Arduino. Dans le cas du UNO Rev3 c&rsquo;est PB5 qui contr\u00f4le la LED.<br \/>\n(Voici le sch\u00e9ma\u00a0:\u00a0<a href=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/Arduino_Uno_Rev3-schematic.pdf\">Arduino_Uno_Rev3-schematic<\/a>)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-101\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape4.png\" alt=\"etape4\" width=\"984\" height=\"795\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape4.png 984w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape4-300x242.png 300w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape4-768x620.png 768w\" sizes=\"auto, (max-width: 984px) 100vw, 984px\" \/><\/p>\n<p>Compilez et v\u00e9rifiez qu&rsquo;il n&rsquo;y a pas d&rsquo;erreur.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-105\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape7.png\" alt=\"etape7\" width=\"975\" height=\"200\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape7.png 975w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape7-300x62.png 300w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape7-768x158.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/p>\n<p>Ajoutez AVRDude comme outil externe.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-107\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape5.png\" alt=\"etape5\" width=\"422\" height=\"385\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape5.png 422w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape5-300x274.png 300w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/p>\n<p>Copiez la ligne de commande et la ligne d&rsquo;argument puis cliquez sur Apply.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-106\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/epate6.png\" alt=\"epate6\" width=\"469\" height=\"462\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/epate6.png 469w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/epate6-300x296.png 300w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/p>\n<p>Retournez dans le menu <strong><em>Tools<\/em> <\/strong>et s\u00e9lectionnez <em><strong>AVRDUDE<\/strong><\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-104\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape8.png\" alt=\"etape8\" width=\"327\" height=\"356\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape8.png 327w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/10\/etape8-276x300.png 276w\" sizes=\"auto, (max-width: 327px) 100vw, 327px\" \/><\/p>\n<p>Notez que vous pourriez avoir \u00e0 changer l&rsquo;argument du port si jamais ce dernier venait \u00e0 changer lors d&rsquo;une prochaine connexion du c\u00e2ble USB.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dans cet article, vous verrez comment t\u00e9l\u00e9charger votre programme dans votre Arduino sans utiliser de programmeur externe. Une version vid\u00e9o de cette article est disponible sur mon canal Youtube \u00e0\u00a0https:\/\/youtu.be\/HB7oB3Bfg4k. Les cartes Arduino sont livr\u00e9es avec ce qu&rsquo;on appel un bootloader. Il s&rsquo;agit d&rsquo;un petit programme qui demeure dans votre<span class=\"more-link\"><a href=\"https:\/\/marcjuneau.ca\/?p=99\">Continue Reading<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,11,2],"tags":[],"class_list":["entry","author-mjuneau","post-99","post","type-post","status-publish","format-standard","category-arduino","category-avrstudio","category-cc"],"_links":{"self":[{"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=99"}],"version-history":[{"count":3,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":444,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions\/444"}],"wp:attachment":[{"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}