3

CLion を IDE として使用しています。ビルド後の出力は実行可能ファイルですexample。私が達成したいのは.hex、それからファイルを作成し、それを経由してAVRにアップロードすることavrdudeです。ここでいくつかの可能な解決策を読んで試しました

xxd -p example | tr -d '\n' > example.hex

avrdude -u -c usbasp-clone -p atmega8 -P /dev/bus/usb/001/006 -U flash:w:example.hex

しかし、avrdude出力

avrdude: input file example.hex auto detected as invalid format
avrdude: invalid input file format: -1
avrdude: read from file 'example.hex' failed

ここに何かアイデアはありますか?

4

1 に答える 1

3

実行可能ファイルからセクションを抽出し、別の形式に変換するツールはobjcopy.

avr-objcopy -j .text -j .data -O ihex example example.hex

または、avrdude が ELF サポート付きでビルドされている場合は、実行可能ファイルを直接使用できます。

avrdude -c usbasp-clone -p atmega8 -U flash:w:example
于 2015-12-02T09:29:58.310 に答える