Code Monkey home page Code Monkey logo

avrdude's Introduction

AVRDUDE

Build Status

AVRDUDE - AVR Downloader Uploader - is a program for downloading and uploading the on-chip memories of Microchip’s AVR microcontrollers. It can program the Flash and EEPROM, and where supported by the programming protocol, it can program fuse and lock bits. AVRDUDE also supplies a direct instruction mode allowing one to issue any programming instruction to the AVR chip regardless of whether AVRDUDE implements that specific feature of a particular chip.

AVRDUDE was originally written in 2003 by Brian S. Dean. Since 2006, AVRDUDE has been maintained by Jörg Wunsch, with the help of various contributors.

The latest version of AVRDUDE is always available here:
https://github.com/avrdudes/avrdude

Documentation

Documentation for current and previous releases is on Github Pages. Git main is documented only with the most recent avrdude.pdf.

Getting AVRDUDE for Windows

To get AVRDUDE for Windows, install the latest version from the Releases page.

Alternatively, you may build AVRDUDE yourself from source.

Getting AVRDUDE for Linux

To install AVRDUDE for Linux, install the package avrdude using the software package manager. For example, under Debian/Ubuntu, you can use the following commands:

sudo apt-get install avrdude

Alternatively, you may build AVRDUDE yourself from source.

Getting AVRDUDE for macOS

On macOS, AVRDUDE can be installed through MacPorts or Homebrew.

Alternatively, you may build AVRDUDE yourself from source.

Using AVRDUDE

AVRDUDE is a command-line application. Run the command avrdude without any arguments for a list of options.

A typical command to program your HEX file into your AVR microcontroller looks like this:

avrdude -c <programmer> -p <part> -U flash:w:<file>:i

For instance, to program an Arduino Uno connected to the serial port COM1 with a HEX file called blink.hex, you would run the following command:

avrdude -c arduino -P COM1 -b 115200 -p atmega328p -D -U flash:w:objs/blink.hex:i

There are many different programmers and options that may be required for the programming to succeed.

For more information, refer to the AVRDUDE documentation.

Using the AVRDUDE GUI demonstrator

Starting with version 8, a GUI implementation has been added, to demonstrate the functionality of libavrdude is suitable to implement a native GUI (as opposed to CLI wrapper).

The GUI is based on the Qt toolkit and its Python bindings, called PySide. Either Qt5 with PySide2, or Qt6 with PySide6 are supported.

A script named avrdude-gui is installed into the same location as the AVRDUDE CLI program. It can be used to start the GUI. There is a builtin help describing the usage.

avrdude's People

Contributors

askn37 avatar colinoflynn avatar dbuchwald avatar dfries avatar dhoerl avatar dl8dtl avatar embedme avatar funkeleinhorn avatar hallard avatar ho-ro avatar jkent avatar kantbe avatar mariusgreuel avatar mcudude avatar mcuee avatar mhei avatar mikeraffa avatar mludvig avatar ndim avatar papazoga avatar prchal avatar rliebscher avatar s-wakaba avatar sbngross avatar sebkuzminsky avatar steelman avatar stefanrueger avatar therealdreg avatar troth avatar yegorich avatar

avrdude's Issues

全般的なTODO(日本語)

このページは気がつくと更新されます。

It's written frankly, so even if it's automatically translated into English, it might not come across correctly.

進行中

  • 古い設定ファイルを食わせると互換性がなくて segmentation fault
  • serialupdi が起動またはスリープ中のCPUで操作できない
  • 新事実:AVR_EB の SIB が未知のP番号を持っていました!なんてこった!NEW

提案、報告済

  • ~/.avrduderc のバージョン間互換性保証がないことへの対策(プロパイダー目線)

解決済

些細な、あるいはまだ報告していない提案と問題

(core)

  • あまりにも不親切で時代錯誤の、programmer_display、avr_display を、そろそろ考え直す時代。
    • 個々のpgmdouleで適切な表示は異なるはずだから、それぞれが自分の自由なdisplayを持てるべきでは?
    • 個々のAVR世代でメモリマップが違うから、これもmoduleカスタマーが責任を担うべきでは?
  • 常にexit(0)で終了してない?
    • コマンドライン不正以外は常に0で終わるかも。「サンキュー」が出る時は、$?は変化しないようだ。現状はrcだけがエラーを返せる?
  • DTR/RTSサポートをprogrammerセクションで記述できない(提案)
    • programmer に "preopen_macro=" なんかを追加して直接文字列で"rts_high;100ms;rts_low;100ms"などと書かせる?
  • コンパイル時のオプションやライブラリリンク情報を表示するコマンドラインスイッチが欲しい。例えば"perl -V"のように(提案)
    • バグレポートを書く時、これは明白に便利。
  • boot、application、appdataの最後にCRCを書き込む機能追加(誰得か分からんがmodernAVRにある機能で唯一誰も実現していない)
  • shebang に対応できると思う?
    • 無理だろう。現在のターミナルモードはそういう実装に全く向いていない。全く別のプロジェクトだろう。

(moderAVR 構成)

  • AVR_EBのPDICFG取扱ポリシー。HVを持ってしても解除できないUPDI絶対禁止ロックなので、安易に書き換えできないようにすべき。(注意喚起)
    • 個人的には"fuses size=9"に固定して、PDICFGは明示的に"fusea"を指定しなければ書けなくしている。これなら"-U fuses:w:file"で全体を書いても触れずに済む。デフォルト値バックアップファイルから書き戻す作業が多いため。

(serialupdi)

  • serialupdi の USERROW 書込が、施錠モードしか対応していない(普通のEEPROM/Flashとして扱えない)
    • usersig書換は実装依存で共通合意はないと思われる。PICkit4でも片方だけ? 両方できるUPDI4AVRのほうが珍しい。
  • serialupdi がフラッシュ領域のブロック消去に対応していない
    • チップ消去済のブロックにしか正しく書けないので、部分書き換えができない(まあ普通はできないか^^)
      • ブートローダはチップ消去できないので、逆に部分ブロック書き込みしかできない。両方できるUPDI4AVRのほうが珍しい。
  • Arduino IDE+シリアルモニターと組み合わせると、いつも書き込み後に真っ赤な画面になる。
    • ポートクローズの記述が不正か、そもそもUSB-CDCを正しく扱えていない?
    • 場当たり的対応は、post_close_delay を加える。

(jtagmkII)

  • jtagmkII で、いつからか"sernum"が認識されなくなった(おそらく memory "io" 設定の影響)
    • 不正ビルドの可能性があるので再試験保留中。

(これはずっと後回しで良い)

  • UPDI4AVRサポート追加の依頼
    • 施錠モードのUSERROW書換に、SRAM先頭アドレスを渡すために memory "data" の記述が必要。
      • 構成ファイル変更は他の実装で"data"をどう使っているか分からないので、クロス検証が必要。(じゃあserialupdiはどういう魔術なんだ?)
    • dump sib対応。ST500v2拡張コマンドかメモリコマンドで実装できるが、avrdude側がサポート未対応。
      • programmer に "updi_sib_support= 1" を追加可能にする。そして "jtagmkII.c" で対応する。
    • HV-activationを強制するコマンドラインオプションが実装できないか?
      • 現在はCPU状態から推測して、チップ消去時のみ許可するか、ジャンパーで強制している。
      • 自動判別がAVR_DA/DB/DDを区別できない
        • AVR_DDだけがHV対象。
        • 拡張された256bit SIBで判別できる?(これはUPDI4AVRの課題) 識別不能を確認。AVR_Dx=KV0で統一。tinyAVR=59B、AVR_EA=59Fで、主クロック仕様がわかるだけ
      • CMND_SET_XMEGA_PARAMSにそういう項目はない。
        • やるならCMND_ENTER_PROGかCMND_RESETを拡張するのがベター。
        • hvupdi_variant も渡す(印加するピン区別と電圧指定のため必須)

ちょっと別な話(ゆるい結合性)

  • macports に libserialport のビルドをプルする
  • STK500v1/2プロトコルエミュレーターのブラッシュアップ
  • m328p+ソフトウェアUPDIベースの、スタンドアロン・ブートライターFWブラッシュアップ

AVRデータシート日本語翻訳 https://avr.jp/ (添削)

[課題] UPDI4AVR モジュールの追加

案件:updi4avr.c をプロジェクトに追加する

jtagmkII.c が v7.3 マイルストーンで予定される改修で、従来との互換性を失う可能性が示唆された。恐らく10年以上変化していなかった挙動が変更される。
このソースの UPDI サポートは、事実上 JTAG2UPDI のために追加されたコードになっている。
端的には、JTAGICEmkII プロトコル(AVR067)では UPDI サポートについて言及していない。
そして JTAG2UPDI は FW version 6 を基盤に設計されている。これについては公的にサポート対象の範疇にあるが、
FW version 7 については AVRISPmkII と AVR-Dragon 以外に存在しないため、互換性保護対象にない。(それらは全てUSB実装である)
つまり UPDI4AVR が現在使用している FW7 + UPDI + SerialPort 実装は、ソースファイル自体を分けるのが必須作業となった。

対象機器

UPDI4AVR Firmware : https://github.com/askn37/multix-zinnia-updi4avr-firmware-builder

  • Model-B : FWV7実装。本件の対象。

UPDI4AVR Software : https://github.com/askn37/UPDI4AVR-Software

  • Model-A : FWV6実装。こちらは影響を受けない。引き続きJTAG2UPDI互換維持。

要件定義

  • updi4avr.c は現在の jtagmkII.c のサブセットになる。UPDI チップに関係しないコードは整理される。
  • 新規登録ラベルは updi4avr_updi と updi4avr_hvupdi の2種。
  • USB対応については原則残すが、適用可能ハードウェアがないため、検証は当面されない。予定: updi4avr_asp
  • UPDI OCD については公的文書がないため、検討はされない。
  • FWV6(JTAG2UPDI)に必要な互換性は残す。独自拡張も当面しない。
  • FWV7 には幾らかの拡張を加える。主に高電圧命令群。そして自動ボーレート対応。
  • 構成ファイルの変更。
  • CMake プロジェクトの変更。(最初に必要なステップ)
  • Windows でのビルド環境の確立。winget だけで可能か?ARM64で可能か?

重要な検討

(JTAGICEmkII)

AVR067ではXMEGA拡張が文書化されていない。従ってこれは他の既存実装から再定義する。
JTAGICEmkII の最終実装動作を再確認-> https://onlinedocs.microchip.com/pr/GUID-73C92233-8EC5-497C-92C3-D52ED257761E-en-US-1/index.html?GUID-60701625-2CF9-43AA-943E-D0F78B165880

  • MTYPE_FLASH : 極めて曖昧な使われ方をしているので用途を明確にする。
  • XMEGA_ERASE_USERSIG : ターミナルで"erase userrow"を可能にする。(非施錠通常時)

技術

  • pgm_type.c : ここにモジュール初期化コールバックを登録する。CMakeはそのまま結合してくれる。
  • term_keep_alive : urlclockに実装例。ターミナルでPGMの犬を撫でるために使う。これ arduino.c にも追加できなくない?と思ったがarduino実装はコールバックに対応していない。これは別のブランチ。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.