Compare commits
No commits in common. "windows" and "v6.3.1.1-windows" have entirely different histories.
windows
...
v6.3.1.1-w
|
@ -0,0 +1,33 @@
|
|||
*.diff
|
||||
*.patch
|
||||
y.output
|
||||
y.tab.h
|
||||
lexer.c
|
||||
config_gram.c
|
||||
config_gram.h
|
||||
.cvsignore
|
||||
.depend
|
||||
.deps
|
||||
INSTALL
|
||||
Makefile.in
|
||||
Makefile
|
||||
ac_cfg.h.in
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
compile
|
||||
missing
|
||||
mkinstalldirs
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
ac_cfg.h
|
||||
avrdude.conf
|
||||
avrdude.conf.tmp
|
||||
avrdude.spec
|
||||
config.guess
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
avrdude
|
|
@ -1,39 +1,9 @@
|
|||
# EditorConfig: https://editorconfig.org
|
||||
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
|
||||
|
||||
root = true
|
||||
|
||||
[{CMakeLists.txt,*.cmake}]
|
||||
charset = utf-8
|
||||
tab_width = 4
|
||||
indent_size = 4
|
||||
[*]
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{bootstrap,configure.ac,avrdude.spec.in,Makefile.am}]
|
||||
charset = utf-8
|
||||
tab_width = 4
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
|
||||
[avrdude.conf.in]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
|
||||
[*.{c,h,cpp,y}]
|
||||
tab_width = 4
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
charset = utf-8
|
||||
tab_width = 2
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
tab_width = 8
|
||||
|
||||
[*.yml]
|
||||
charset = utf-8
|
||||
tab_width = 2
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
|
|
@ -1,293 +0,0 @@
|
|||
#
|
||||
# build.yml - GitHub build action for AVRDUDE
|
||||
# Copyright (C) 2021 Marius Greuel
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'onlinedocs'
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- 'onlinedocs'
|
||||
workflow_call:
|
||||
|
||||
env:
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
|
||||
jobs:
|
||||
linux-x86_64:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install prerequisites
|
||||
run: >-
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt-get install -y
|
||||
build-essential
|
||||
cmake
|
||||
flex
|
||||
bison
|
||||
libelf-dev
|
||||
libusb-dev
|
||||
libusb-1.0-0-dev
|
||||
libhidapi-dev
|
||||
libftdi1-dev
|
||||
libreadline-dev
|
||||
texinfo
|
||||
texlive
|
||||
texi2html
|
||||
- name: Configure
|
||||
run: >-
|
||||
cmake
|
||||
-D BUILD_DOC=1
|
||||
-D DEBUG_CMAKE=1
|
||||
-D HAVE_LINUXGPIO=1
|
||||
-D HAVE_LINUXSPI=1
|
||||
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
-B build
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Archive build artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-linux-x86_64
|
||||
path: |
|
||||
build/
|
||||
!**/*.d
|
||||
!**/*.o
|
||||
- name: Archive executables
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: avrdude-linux-x86_64
|
||||
path: |
|
||||
build/src/avrdude
|
||||
build/src/avrdude.conf
|
||||
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
container: debian:11
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- { arch: i386, processor: i686, prefix: i686-linux-gnu, inc-lib: i386-linux-gnu }
|
||||
- { arch: armhf, processor: armhf, prefix: arm-linux-gnueabihf, inc-lib: arm-linux-gnueabihf }
|
||||
- { arch: arm64, processor: aarch64, prefix: aarch64-linux-gnu, inc-lib: aarch64-linux-gnu }
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Add architecture
|
||||
run: |
|
||||
dpkg --add-architecture ${{matrix.arch}}
|
||||
apt-get update
|
||||
- name: Install prerequisites
|
||||
run: >-
|
||||
apt-get update
|
||||
|
||||
apt-get install -y
|
||||
git
|
||||
cmake
|
||||
flex
|
||||
bison
|
||||
crossbuild-essential-${{matrix.arch}}
|
||||
libelf-dev:${{matrix.arch}}
|
||||
libusb-dev:${{matrix.arch}}
|
||||
libusb-1.0-0-dev:${{matrix.arch}}
|
||||
libhidapi-dev:${{matrix.arch}}
|
||||
libftdi1-dev:${{matrix.arch}}
|
||||
libreadline-dev:${{matrix.arch}}
|
||||
- name: Configure
|
||||
run: >-
|
||||
cmake
|
||||
-D DEBUG_CMAKE=1
|
||||
-D HAVE_LINUXGPIO=1
|
||||
-D HAVE_LINUXSPI=1
|
||||
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
-D CMAKE_SYSTEM_NAME=Linux
|
||||
-D CMAKE_SYSTEM_PROCESSOR=${{matrix.processor}}
|
||||
-D CMAKE_C_COMPILER=${{matrix.prefix}}-gcc
|
||||
-D CMAKE_FIND_ROOT_PATH=/usr/${{matrix.prefix}}
|
||||
-D CMAKE_INCLUDE_PATH=/usr/include/${{matrix.inc-lib}}
|
||||
-D CMAKE_LIBRARY_PATH=/usr/lib/${{matrix.inc-lib}}
|
||||
-B build
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Archive build artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-linux-${{matrix.processor}}
|
||||
path: |
|
||||
build/
|
||||
!**/*.d
|
||||
!**/*.o
|
||||
- name: Archive executables
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: avrdude-linux-${{matrix.processor}}
|
||||
path: |
|
||||
build/src/avrdude
|
||||
build/src/avrdude.conf
|
||||
|
||||
macos-x86_64:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install prerequisites
|
||||
run: >-
|
||||
# brew update
|
||||
|
||||
brew install
|
||||
cmake
|
||||
flex
|
||||
bison
|
||||
libelf
|
||||
libusb
|
||||
hidapi
|
||||
libftdi
|
||||
readline
|
||||
- name: Configure
|
||||
run: >-
|
||||
cmake
|
||||
-D CMAKE_C_FLAGS=-I/usr/local/include
|
||||
-D CMAKE_EXE_LINKER_FLAGS=-L/usr/local/Cellar
|
||||
-D DEBUG_CMAKE=1
|
||||
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
-B build
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Archive build artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-macos-x86_64
|
||||
path: |
|
||||
build/
|
||||
!**/*.d
|
||||
!**/*.o
|
||||
- name: Archive executables
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: avrdude-macos-x86_64
|
||||
path: |
|
||||
build/src/avrdude
|
||||
build/src/avrdude.conf
|
||||
|
||||
msvc:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- { arch: x86, platform: Win32 }
|
||||
- { arch: x64, platform: x64 }
|
||||
- { arch: arm64, platform: ARM64 }
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install prerequisites
|
||||
# As Chocolatey is notoriously unreliable, install winflexbison3 directly from GitHub.
|
||||
# run: choco install winflexbison3
|
||||
run: |
|
||||
curl https://github.com/lexxmark/winflexbison/releases/download/v2.5.24/win_flex_bison-2.5.24.zip --location --output winflexbison.zip
|
||||
unzip winflexbison.zip -d ${{github.workspace}}\winflexbison
|
||||
echo "${{github.workspace}}\winflexbison" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- name: Configure
|
||||
run: >-
|
||||
cmake
|
||||
-A ${{matrix.platform}}
|
||||
-D DEBUG_CMAKE=1
|
||||
-D CMAKE_SYSTEM_VERSION=11
|
||||
-D CMAKE_C_FLAGS_RELWITHDEBINFO="/MT /GL /Zi /O2 /Ob1 /DNDEBUG"
|
||||
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /GL /Zi /O2 /Ob1 /DNDEBUG"
|
||||
-D CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO="/DEBUG /INCREMENTAL:NO /LTCG /OPT:REF /OPT:ICF"
|
||||
-D HAVE_LIBREADLINE=HAVE_LIBREADLINE-NOTFOUND
|
||||
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
-D USE_EXTERNAL_LIBS=1
|
||||
-B build
|
||||
- name: Build
|
||||
run: cmake --build build --config ${{env.BUILD_TYPE}}
|
||||
- name: Archive build artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-msvc-${{matrix.arch}}
|
||||
path: |
|
||||
build/
|
||||
!**/_deps/
|
||||
!**/*.obj
|
||||
- name: Move executables
|
||||
run: |
|
||||
mv build/src/RelWithDebInfo/avrdude.exe build/src
|
||||
mv build/src/RelWithDebInfo/avrdude.pdb build/src
|
||||
- name: Archive executables
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: avrdude-msvc-${{matrix.arch}}
|
||||
path: |
|
||||
build/src/avrdude.exe
|
||||
build/src/avrdude.pdb
|
||||
build/src/avrdude.conf
|
||||
|
||||
mingw:
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- { sys: mingw32, env: i686 }
|
||||
- { sys: mingw64, env: x86_64 }
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{matrix.sys}}
|
||||
update: true
|
||||
install: >-
|
||||
base-devel
|
||||
mingw-w64-${{matrix.env}}-gcc
|
||||
mingw-w64-${{matrix.env}}-cmake
|
||||
mingw-w64-${{matrix.env}}-libelf
|
||||
mingw-w64-${{matrix.env}}-libusb
|
||||
mingw-w64-${{matrix.env}}-libusb-compat-git
|
||||
mingw-w64-${{matrix.env}}-hidapi
|
||||
mingw-w64-${{matrix.env}}-libftdi
|
||||
- name: Configure
|
||||
run: >-
|
||||
cmake
|
||||
-G"MSYS Makefiles"
|
||||
-D DEBUG_CMAKE=1
|
||||
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
-B build
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Archive build artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-mingw-${{matrix.env}}
|
||||
path: |
|
||||
build/
|
||||
- name: Archive executables
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: avrdude-mingw-${{matrix.env}}
|
||||
path: |
|
||||
build/src/avrdude.exe
|
||||
build/src/avrdude.conf
|
|
@ -1,78 +0,0 @@
|
|||
#
|
||||
# deploy.yml - GitHub deploy action for AVRDUDE
|
||||
# Copyright (C) 2021 Marius Greuel
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*-windows'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: mariusgreuel/avrdude/.github/workflows/build.yml@windows
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
steps:
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
with:
|
||||
tag_name: ${{github.ref}}
|
||||
release_name: AVRDUDE ${{github.ref}}
|
||||
body: "See **[Release Notes](https://github.com/avrdudes/avrdude/blob/main/NEWS)** for changes"
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
asset-msvc:
|
||||
needs: release
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- { arch: x86 }
|
||||
- { arch: x64 }
|
||||
- { arch: arm64 }
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: avrdude-msvc-${{matrix.arch}}
|
||||
|
||||
- name: Create release asset
|
||||
run: >-
|
||||
zip -j asset.zip
|
||||
avrdude.exe
|
||||
avrdude.pdb
|
||||
avrdude.conf
|
||||
|
||||
- name: Upload release asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
with:
|
||||
upload_url: ${{needs.release.outputs.upload_url}}
|
||||
asset_path: ./asset.zip
|
||||
asset_name: avrdude-${{github.ref_name}}-windows-${{matrix.arch}}.zip
|
||||
asset_content_type: application/zip
|
|
@ -1,67 +1,68 @@
|
|||
.DS_Store
|
||||
.deps/
|
||||
.libs/
|
||||
m4/
|
||||
*.diff
|
||||
*.patch
|
||||
y.output
|
||||
y.tab.h
|
||||
lexer.c
|
||||
config_gram.c
|
||||
config_gram.h
|
||||
.depend
|
||||
INSTALL
|
||||
Makefile.in
|
||||
Makefile
|
||||
ac_cfg.h.in
|
||||
ac_cfg.h.in~
|
||||
aclocal.m4
|
||||
.deps
|
||||
.libs
|
||||
autom4te.cache
|
||||
configure
|
||||
configure~
|
||||
depcomp
|
||||
install-sh
|
||||
compile
|
||||
missing
|
||||
mkinstalldirs
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
m4
|
||||
|
||||
ac_cfg.h
|
||||
ac_cfg.h.in
|
||||
aclocal.m4
|
||||
avrdude
|
||||
avrdude.conf
|
||||
avrdude.conf.tmp
|
||||
avrdude.spec
|
||||
compile
|
||||
config.guess
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
avrdude
|
||||
config_gram.c
|
||||
config_gram.h
|
||||
configure
|
||||
depcomp
|
||||
INSTALL
|
||||
install-sh
|
||||
lexer.c
|
||||
libtool
|
||||
ltmain.sh
|
||||
Makefile
|
||||
Makefile.in
|
||||
mdate-sh
|
||||
mkinstalldirs
|
||||
missing
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
texinfo.tex
|
||||
y.output
|
||||
y.tab.h
|
||||
ylwrap
|
||||
tags
|
||||
cscope.out
|
||||
|
||||
*.o
|
||||
*.lo
|
||||
*.a
|
||||
*.la
|
||||
*.diff
|
||||
*.patch
|
||||
|
||||
# CMake
|
||||
out/
|
||||
build/
|
||||
build_*/
|
||||
## Ignore Visual Studio build results
|
||||
|
||||
# Visual Studio
|
||||
.vs/
|
||||
[Dd]ebug/
|
||||
[Rr]elease/
|
||||
x64/
|
||||
x86/
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Rr]elease/
|
||||
x64/
|
||||
x86/
|
||||
*.log
|
||||
|
||||
# Visual Studio code
|
||||
.vscode/
|
||||
# Visual Studio cache/options directory
|
||||
.vs/
|
||||
|
||||
# Include pre-built files
|
||||
!ac_cfg.h
|
||||
!config_gram.c
|
||||
!config_gram.h
|
||||
!lexer.c
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
language: c++
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- name: "Linux (GCC)"
|
||||
os: linux
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
before_install:
|
||||
- sudo apt-get -y install make gcc automake libtool flex bison
|
||||
- sudo apt-get -y install libelf-dev libusb-dev libftdi1-dev libhidapi-dev
|
||||
script:
|
||||
- ./bootstrap
|
||||
- ./configure
|
||||
- make
|
||||
- name: "macOS (clang)"
|
||||
os: osx
|
||||
osx_image: xcode12u
|
||||
compiler: clang
|
||||
before_install:
|
||||
- brew install flex bison
|
||||
script:
|
||||
- ./bootstrap
|
||||
- ./configure
|
||||
- make
|
||||
- name: "Windows (MSVC)"
|
||||
if: branch = windows OR branch = dev
|
||||
os: windows
|
||||
before_install:
|
||||
- choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.18362"
|
||||
- export PATH=$PATH:"/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin"
|
||||
script:
|
||||
- MSBuild.exe -fileLogger -target:avrdude -property:Configuration=Release -property:Platform=x64 avrdude.sln
|
24
AUTHORS
24
AUTHORS
|
@ -2,14 +2,6 @@ AVRDUDE was written by:
|
|||
|
||||
Brian S. Dean <bsd@bdmicro.com>
|
||||
|
||||
AVRDUDE is currently maintained by:
|
||||
|
||||
Hans Eirik Bull
|
||||
Stefan Rueger
|
||||
Xiaofan Chen
|
||||
Marius Greuel
|
||||
Joerg Wunsch
|
||||
|
||||
Contributors:
|
||||
|
||||
Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
@ -32,19 +24,7 @@ Contributors:
|
|||
Rene Liebscher <r.liebscher@gmx.de>
|
||||
Jim Paris <jim@jtan.com>
|
||||
Jan Egil Ruud <janegil.ruud@microchip.com>
|
||||
David Mosberger <davidm@egauge.net>
|
||||
David Sainty
|
||||
Marius Greuel <greuelm@mgtek.com>
|
||||
Dawid Buchwald <dawid.buchwald@hotmail.com>
|
||||
Hans Eirik Bull
|
||||
Stefan Rueger
|
||||
Xiaofan Chen
|
||||
David Mosberger-Tang
|
||||
|
||||
Contributors to code no longer present:
|
||||
|
||||
Dale Roberts for the giveio driver
|
||||
Paula Tomlinson for the loaddrv sources
|
||||
Chris Liechti for loaddrv modifications
|
||||
|
||||
For minor contributions, please see the ChangeLog files / Git log.
|
||||
For minor contributions, please see the ChangeLog files.
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
$Id$
|
||||
|
||||
How to build avrdude from SVN:
|
||||
|
||||
1. svn co svn://svn.savannah.nongnu.org/avrdude/trunk
|
||||
|
||||
2. cd trunk/avrdude
|
||||
|
||||
3. ./bootstrap
|
||||
|
||||
4. ./configure
|
||||
|
||||
5. make
|
396
CMakeLists.txt
396
CMakeLists.txt
|
@ -1,396 +0,0 @@
|
|||
#
|
||||
# CMakeLists.txt - CMake project for AVRDUDE
|
||||
# Copyright (C) 2021 Marius Greuel
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Typical usage:
|
||||
# cmake -B build
|
||||
# cmake --build build
|
||||
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
project(avrdude VERSION 7.1 LANGUAGES C)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED True)
|
||||
|
||||
option(BUILD_DOC "Enable building documents" OFF)
|
||||
option(HAVE_LINUXGPIO "Enable Linux sysfs GPIO support" OFF)
|
||||
option(HAVE_LINUXSPI "Enable Linux SPI support" OFF)
|
||||
option(HAVE_PARPORT "Enable parallel port support" OFF)
|
||||
option(USE_EXTERNAL_LIBS "Use external libraries from AVRDUDE GitHub repositories" OFF)
|
||||
option(USE_LIBUSBWIN32 "Prefer libusb-win32 over libusb" OFF)
|
||||
option(DEBUG_CMAKE "Enable debugging output for this CMake project" OFF)
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
|
||||
if(WIN32)
|
||||
# Prefer static libraries over DLLs on Windows
|
||||
option(USE_STATIC_LIBS "Use static libraries" ON)
|
||||
else()
|
||||
option(USE_STATIC_LIBS "Use static libraries" OFF)
|
||||
endif()
|
||||
|
||||
include(CheckIncludeFile)
|
||||
include(CheckSymbolExists)
|
||||
include(FetchContent)
|
||||
include(FindPackageMessage)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}")
|
||||
set(AVRDUDE_FULL_VERSION ${CMAKE_PROJECT_VERSION})
|
||||
|
||||
# =====================================
|
||||
# Get Git commit info
|
||||
# =====================================
|
||||
|
||||
# GIT_COMMIT_HASH -> hash of latest commit, e.g. b8b859f5
|
||||
# GIT_COMMIT_DATE -> date of latest commit, e.g. 20201231
|
||||
# GIT_COMMIT_YEAR -> year of latest commit, e.g. 2020
|
||||
|
||||
find_package(Git)
|
||||
if(Git_FOUND)
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%h
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%ad --date=format:%Y%m%d
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE GIT_COMMIT_DATE
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%ad --date=format:%Y
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE GIT_COMMIT_YEAR
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" log -1 --tags --format=%h
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE GIT_TAG_HASH
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# If the commit is not tagged, include the date and commit hash in the full version string.
|
||||
if(NOT GIT_COMMIT_HASH STREQUAL GIT_TAG_HASH)
|
||||
set(AVRDUDE_FULL_VERSION "${CMAKE_PROJECT_VERSION}-${GIT_COMMIT_DATE} (${GIT_COMMIT_HASH})")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(FLEX)
|
||||
if(NOT FLEX_FOUND)
|
||||
message(SEND_ERROR "This CMake project requires 'flex', which is not installed on your system." )
|
||||
endif()
|
||||
|
||||
find_package(BISON QUIET)
|
||||
if(BISON_FOUND)
|
||||
find_package_message(BISON "Found BISON: ${BISON_EXECUTABLE} (found version \"${BISON_VERSION}\")" "[${BISON_EXECUTABLE}][${BISON_VERSION}]")
|
||||
else()
|
||||
find_program(YACC_EXECUTABLE NAMES yacc byacc DOC "path to the yacc executable")
|
||||
mark_as_advanced(YACC_EXECUTABLE)
|
||||
if(YACC_EXECUTABLE)
|
||||
find_package_message(YACC "Found YACC: ${YACC_EXECUTABLE}" "[${YACC_EXECUTABLE}]")
|
||||
else()
|
||||
message(SEND_ERROR "This CMake project requires 'bison', 'yacc', or 'byacc', which is not installed on your system." )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# =====================================
|
||||
# Detect installed libraries
|
||||
# =====================================
|
||||
|
||||
if(USE_STATIC_LIBS)
|
||||
set(PREFERRED_LIBELF libelf.a elf)
|
||||
set(PREFERRED_LIBUSB libusb.a usb)
|
||||
set(PREFERRED_LIBUSB_1_0 libusb-1.0.a usb-1.0)
|
||||
set(PREFERRED_LIBHIDAPI libhidapi.a libhidapi-libusb.a libhidapi-hidraw.a hidapi hidapi-libusb hidapi-hidraw)
|
||||
set(PREFERRED_LIBFTDI libftdi.a ftdi)
|
||||
set(PREFERRED_LIBFTDI1 libftdi1.a ftdi1)
|
||||
set(PREFERRED_LIBREADLINE libreadline.a)
|
||||
else()
|
||||
set(PREFERRED_LIBELF elf)
|
||||
set(PREFERRED_LIBUSB usb)
|
||||
set(PREFERRED_LIBUSB_1_0 usb-1.0)
|
||||
set(PREFERRED_LIBHIDAPI hidapi hidapi-libusb hidapi-hidraw)
|
||||
set(PREFERRED_LIBFTDI ftdi)
|
||||
set(PREFERRED_LIBFTDI1 ftdi1)
|
||||
set(PREFERRED_LIBREADLINE readline)
|
||||
endif()
|
||||
|
||||
# -------------------------------------
|
||||
# Find libelf
|
||||
|
||||
find_library(HAVE_LIBELF NAMES ${PREFERRED_LIBELF})
|
||||
if(HAVE_LIBELF)
|
||||
set(LIB_LIBELF ${HAVE_LIBELF})
|
||||
check_include_file(libelf.h HAVE_LIBELF_H)
|
||||
check_include_file(libelf/libelf.h HAVE_LIBELF_LIBELF_H)
|
||||
endif()
|
||||
|
||||
# -------------------------------------
|
||||
# Find libusb
|
||||
|
||||
find_library(HAVE_LIBUSB NAMES ${PREFERRED_LIBUSB})
|
||||
if(HAVE_LIBUSB)
|
||||
set(LIB_LIBUSB ${HAVE_LIBUSB})
|
||||
endif()
|
||||
|
||||
find_library(HAVE_LIBUSB_1_0 NAMES ${PREFERRED_LIBUSB_1_0})
|
||||
if(HAVE_LIBUSB_1_0)
|
||||
set(LIB_LIBUSB_1_0 ${HAVE_LIBUSB_1_0})
|
||||
endif()
|
||||
|
||||
# FreeBSD's library 'libusb' supports both the libusb-0.1 and libusb-1.0 API.
|
||||
if (HAVE_LIBUSB AND CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
set(HAVE_LIBUSB_1_0 ${HAVE_LIBUSB})
|
||||
endif()
|
||||
|
||||
find_library(HAVE_LIBUSB_WIN32 NAMES libusb0.a usb0)
|
||||
|
||||
if(HAVE_LIBUSB OR HAVE_LIBUSB_1_0 OR HAVE_LIBUSB_WIN32)
|
||||
check_include_file(usb.h HAVE_USB_H)
|
||||
check_include_file(lusb0_usb.h HAVE_LUSB0_USB_H)
|
||||
check_include_file(libusb.h HAVE_LIBUSB_H)
|
||||
check_include_file(libusb-1.0/libusb.h HAVE_LIBUSB_1_0_LIBUSB_H)
|
||||
|
||||
if((USE_LIBUSBWIN32 OR NOT HAVE_LIBUSB) AND HAVE_LIBUSB_WIN32)
|
||||
set(HAVE_LIBUSB ${HAVE_LIBUSB_WIN32})
|
||||
set(LIB_LIBUSB ${HAVE_LIBUSB_WIN32})
|
||||
unset(HAVE_USB_H CACHE)
|
||||
elseif(NOT HAVE_USB_H)
|
||||
find_path(LIBUSB_COMPAT_DIR libusb-compat/usb.h)
|
||||
if(LIBUSB_COMPAT_DIR)
|
||||
set(LIBUSB_COMPAT_DIR ${LIBUSB_COMPAT_DIR}/libusb-compat)
|
||||
set(HAVE_USB_H 1)
|
||||
else()
|
||||
unset(LIBUSB_COMPAT_DIR CACHE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# -------------------------------------
|
||||
# Find libhidapi
|
||||
|
||||
find_library(HAVE_LIBHID NAMES hid)
|
||||
if(HAVE_LIBHID)
|
||||
set(LIB_LIBHID ${HAVE_LIBHID})
|
||||
endif()
|
||||
|
||||
find_library(HAVE_LIBHIDAPI NAMES ${PREFERRED_LIBHIDAPI})
|
||||
if(HAVE_LIBHIDAPI)
|
||||
set(LIB_LIBHIDAPI ${HAVE_LIBHIDAPI})
|
||||
check_include_file(hidapi/hidapi.h HAVE_HIDAPI_HIDAPI_H)
|
||||
endif()
|
||||
|
||||
# -------------------------------------
|
||||
# Find libftdi
|
||||
|
||||
find_library(HAVE_LIBFTDI NAMES ${PREFERRED_LIBFTDI})
|
||||
if(HAVE_LIBFTDI)
|
||||
set(LIB_LIBFTDI ${HAVE_LIBFTDI})
|
||||
set(HAVE_LIBFTDI_TYPE_232H 1)
|
||||
endif()
|
||||
|
||||
find_library(HAVE_LIBFTDI1 NAMES ${PREFERRED_LIBFTDI1})
|
||||
if(HAVE_LIBFTDI1)
|
||||
set(LIB_LIBFTDI1 ${HAVE_LIBFTDI1})
|
||||
set(HAVE_LIBFTDI_TYPE_232H 1)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${LIB_LIBFTDI1} ${LIB_LIBUSB} ${LIB_LIBUSB_1_0})
|
||||
check_symbol_exists(ftdi_tcioflush "libftdi1/ftdi.h" HAVE_FTDI_TCIOFLUSH)
|
||||
endif()
|
||||
|
||||
# -------------------------------------
|
||||
# Find libreadline
|
||||
|
||||
find_library(HAVE_LIBREADLINE NAMES ${PREFERRED_LIBREADLINE})
|
||||
if(HAVE_LIBREADLINE)
|
||||
set(LIB_LIBREADLINE ${HAVE_LIBREADLINE})
|
||||
elseif(MSVC)
|
||||
set(HAVE_LIBREADLINE 1)
|
||||
endif()
|
||||
|
||||
# =====================================
|
||||
# Use external libraries if requested
|
||||
# =====================================
|
||||
|
||||
if(USE_EXTERNAL_LIBS)
|
||||
FetchContent_Declare(libelf
|
||||
GIT_REPOSITORY https://github.com/avrdudes/libelf.git
|
||||
GIT_TAG e5a39bf19bd6598c42e09172be5a78ceec2a065c
|
||||
)
|
||||
|
||||
FetchContent_Declare(libusb
|
||||
GIT_REPOSITORY https://github.com/avrdudes/libusb.git
|
||||
GIT_TAG 632bc25d04eff563cc00de29435b9a7ed6f4654c
|
||||
)
|
||||
|
||||
FetchContent_Declare(libhidapi
|
||||
GIT_REPOSITORY https://github.com/avrdudes/libhidapi.git
|
||||
GIT_TAG d1307487973c857bc158e27ecc99644b2f5e68ea
|
||||
)
|
||||
|
||||
FetchContent_Declare(libftdi
|
||||
GIT_REPOSITORY https://github.com/avrdudes/libftdi.git
|
||||
GIT_TAG f9fe6e96b97c3a08efd081632c1859cb83aa14e3
|
||||
)
|
||||
|
||||
message(STATUS "Fetching external libraries, please wait...")
|
||||
FetchContent_MakeAvailable(
|
||||
libelf
|
||||
libusb
|
||||
libhidapi
|
||||
libftdi
|
||||
)
|
||||
|
||||
message(STATUS "Using external library 'libelf'")
|
||||
set(LIB_LIBELF libelf)
|
||||
set(HAVE_LIBELF 1)
|
||||
set(HAVE_LIBELF_H 1)
|
||||
|
||||
message(STATUS "Using external library 'libusb'")
|
||||
set(LIB_LIBUSB libusb)
|
||||
set(HAVE_LIBUSB 1)
|
||||
set(HAVE_LUSB0_USB_H 1)
|
||||
|
||||
message(STATUS "Using external library 'libhidapi'")
|
||||
set(LIB_LIBHIDAPI libhidapi)
|
||||
set(HAVE_LIBHIDAPI 1)
|
||||
set(HAVE_HIDAPI_HIDAPI_H 1)
|
||||
|
||||
message(STATUS "Using external library 'libftdi'")
|
||||
set(LIB_LIBFTDI libftdi)
|
||||
set(HAVE_LIBFTDI 1)
|
||||
set(HAVE_LIBFTDI_TYPE_232H 1)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
if(BUILD_DOC)
|
||||
add_subdirectory(src/doc)
|
||||
endif()
|
||||
|
||||
# =====================================
|
||||
# Configuration
|
||||
# =====================================
|
||||
|
||||
message(STATUS "Configuration summary:")
|
||||
message(STATUS "----------------------")
|
||||
|
||||
if (DEBUG_CMAKE)
|
||||
message(STATUS "CMAKE_HOST_SYSTEM: ${CMAKE_HOST_SYSTEM}")
|
||||
message(STATUS "CMAKE_SYSTEM: ${CMAKE_SYSTEM}")
|
||||
message(STATUS "CMAKE_FIND_ROOT_PATH: ${CMAKE_FIND_ROOT_PATH}")
|
||||
message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
|
||||
message(STATUS "CONFIG_DIR: ${CONFIG_DIR}")
|
||||
message(STATUS "AVRDUDE_FULL_VERSION: ${AVRDUDE_FULL_VERSION}")
|
||||
message(STATUS "USE_EXTERNAL_LIBS: ${USE_EXTERNAL_LIBS}")
|
||||
message(STATUS "USE_LIBUSBWIN32: ${USE_LIBUSBWIN32}")
|
||||
message(STATUS "HAVE_LIBELF: ${HAVE_LIBELF}")
|
||||
message(STATUS "HAVE_LIBUSB: ${HAVE_LIBUSB}")
|
||||
message(STATUS "HAVE_LIBUSB_1_0: ${HAVE_LIBUSB_1_0}")
|
||||
message(STATUS "HAVE_LIBUSB_WIN32: ${HAVE_LIBUSB_WIN32}")
|
||||
message(STATUS "HAVE_LIBHID: ${HAVE_LIBHID}")
|
||||
message(STATUS "HAVE_LIBHIDAPI: ${HAVE_LIBHIDAPI}")
|
||||
message(STATUS "HAVE_LIBFTDI: ${HAVE_LIBFTDI}")
|
||||
message(STATUS "HAVE_LIBFTDI1: ${HAVE_LIBFTDI1}")
|
||||
message(STATUS "HAVE_LIBREADLINE: ${HAVE_LIBREADLINE}")
|
||||
message(STATUS "HAVE_LIBELF_H: ${HAVE_LIBELF_H}")
|
||||
message(STATUS "HAVE_LIBELF_LIBELF_H: ${HAVE_LIBELF_LIBELF_H}")
|
||||
message(STATUS "HAVE_USB_H: ${HAVE_USB_H}")
|
||||
message(STATUS "HAVE_LUSB0_USB_H: ${HAVE_LUSB0_USB_H}")
|
||||
message(STATUS "HAVE_LIBUSB_H: ${HAVE_LIBUSB_H}")
|
||||
message(STATUS "HAVE_LIBUSB_1_0_LIBUSB_H: ${HAVE_LIBUSB_1_0_LIBUSB_H}")
|
||||
message(STATUS "HAVE_HIDAPI_HIDAPI_H: ${HAVE_HIDAPI_HIDAPI_H}")
|
||||
message(STATUS "LIBUSB_COMPAT_DIR: ${LIBUSB_COMPAT_DIR}")
|
||||
message(STATUS "----------------------")
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBELF)
|
||||
message(STATUS "DO HAVE libelf")
|
||||
else()
|
||||
message(STATUS "DON'T HAVE libelf")
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBUSB)
|
||||
message(STATUS "DO HAVE libusb")
|
||||
else()
|
||||
message(STATUS "DON'T HAVE libusb")
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBUSB_1_0)
|
||||
message(STATUS "DO HAVE libusb_1_0")
|
||||
else()
|
||||
message(STATUS "DON'T HAVE libusb_1_0")
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBHIDAPI)
|
||||
message(STATUS "DO HAVE libhidapi")
|
||||
else()
|
||||
message(STATUS "DON'T HAVE libhidapi")
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBFTDI)
|
||||
if(HAVE_LIBFTDI1)
|
||||
message(STATUS "DO HAVE libftdi (but prefer to use libftdi1)")
|
||||
else()
|
||||
message(STATUS "DO HAVE libftdi")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "DON'T HAVE libftdi")
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBFTDI1)
|
||||
message(STATUS "DO HAVE libftdi1")
|
||||
else()
|
||||
message(STATUS "DON'T HAVE libftdi1")
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBREADLINE)
|
||||
message(STATUS "DO HAVE libreadline")
|
||||
else()
|
||||
message(STATUS "DON'T HAVE libreadline")
|
||||
endif()
|
||||
|
||||
if(BUILD_DOC)
|
||||
message(STATUS "ENABLED doc")
|
||||
else()
|
||||
message(STATUS "DISABLED doc")
|
||||
endif()
|
||||
|
||||
if(HAVE_PARPORT)
|
||||
message(STATUS "ENABLED parport")
|
||||
else()
|
||||
message(STATUS "DISABLED parport")
|
||||
endif()
|
||||
|
||||
if(HAVE_LINUXGPIO)
|
||||
message(STATUS "ENABLED linuxgpio")
|
||||
else()
|
||||
message(STATUS "DISABLED linuxgpio")
|
||||
endif()
|
||||
|
||||
if(HAVE_LINUXSPI)
|
||||
message(STATUS "ENABLED linuxspi")
|
||||
else()
|
||||
message(STATUS "DISABLED linuxspi")
|
||||
endif()
|
||||
|
||||
message(STATUS "----------------------")
|
|
@ -1,76 +0,0 @@
|
|||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "USE_EXTERNAL_LIBS",
|
||||
"value": "true",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "USE_EXTERNAL_LIBS",
|
||||
"value": "true",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x86-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x86" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "USE_EXTERNAL_LIBS",
|
||||
"value": "true",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x86-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x86" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "USE_EXTERNAL_LIBS",
|
||||
"value": "true",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,148 @@
|
|||
2018-01-21 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #8444: Proposal for modifications in -B and -U command options managment
|
||||
* update.c (parse_op): Default -U filename to RBIN for output
|
||||
files
|
||||
|
||||
2018-01-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Simone:
|
||||
patch #8128: Added new option to configure.ac script
|
||||
* configure.ac (disable-libusb_1_0): New option
|
||||
|
||||
2018-01-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Jan Egil Ruud:
|
||||
patch #9542: Correct "usersig" on avr8x devices
|
||||
* avrdude.conf.in (.avr8x_tiny, .avr8x_mega): rename "userrow" to
|
||||
"usersig", and fix its page size for .avr8x_mega
|
||||
* jtag3.c: Remove all "userrow" handling
|
||||
|
||||
2018-01-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Reinhard Max
|
||||
patch #8311: Add IPv6 support to the -Pnet:host:port option
|
||||
* ser_posix.c (net_open): Rewrite to use getaddrinfo()
|
||||
rather than gethostbyname()
|
||||
* avrdude.1: Document IPv6 feature
|
||||
* doc/avrdude.texi: (Dito)
|
||||
|
||||
2018-01-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Maciej:
|
||||
patch #9185: Add extended_param to usbasp.c - erasing
|
||||
configuration section in ATtiny 4...40 (TPI)
|
||||
* usbasp.c: Implement extended parameter parsing, and modify
|
||||
usbasp_tpi_chip_erase() appropriately
|
||||
* avrdude.1: Document USBasp extended parameters
|
||||
* doc/avrdude.texi: (Dito)
|
||||
|
||||
2018-01-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Tom Carney:
|
||||
patch #8219: Fix boot_start for xmega devices on jtagmkII
|
||||
* jtagmkII.c (jtagmkII_initialize): Determine boarder between
|
||||
application and boot area correctly.
|
||||
|
||||
2018-01-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
|
||||
patch #9507: Fix UPDI chip erase
|
||||
* libavrdude.h (PROGRAMMER): add unlock method
|
||||
* avr.c (avr_unlock): Generic unlock function
|
||||
* jtag3.c: Implement unlock feature; avoid calling
|
||||
jtag3_edbg_prepare() and jtag3_edbg_signoff() on XplainedMini
|
||||
boards to work around a bug in early firmware versions;
|
||||
implement "userrow" memory region
|
||||
* main.c: Call avr_unlock() rather than avr_chip_erase() when
|
||||
encountering a locked UPDI chip
|
||||
|
||||
2018-01-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Nicolas BRULEZ
|
||||
patch #8910: ATxmega32c4 and ATxmega16c4 have wrong signatures
|
||||
bug #41388: ATxmega32c4 and ATxmega16c4 have wrong signatures
|
||||
* avrdude.conf.in (ATxmega16C4, ATxmega32C4): Fix signatures
|
||||
|
||||
2018-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Dennis Reimers:
|
||||
patch #8580: FT245r support to select device by serial number
|
||||
* ft245r.c (ft245r_open): Add serial number parsing.
|
||||
|
||||
2018-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Axel Simon:
|
||||
patch #9033: avrdoper backend uses libhidapi instead of libusb
|
||||
* ser_avrdoper: Add libhidapi implementation
|
||||
* stk500v2.c: Adapt #ifdefs for LIBHIDAPI
|
||||
* avrdude.1: Document change
|
||||
* doc/avrdude.texi: (Dito)
|
||||
|
||||
2018-01-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by David Mosberger-Tang
|
||||
patch #8924: Enable TPI for usbtiny
|
||||
* usbtiny.c: Extend to handle TPI targets
|
||||
* configure.ac: Probe for <netinet/in.h>
|
||||
|
||||
2018-01-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Yegor Yefremov:
|
||||
patch #9222: Enable silent build
|
||||
* configure.ac: Add AM_SILENT_RULES
|
||||
* Makefile.am: Document how to run "make" to get verbose
|
||||
build messages
|
||||
|
||||
2018-01-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by: Kjetil Kjeka:
|
||||
patch #9317: Support atmega64m1 as part
|
||||
* avrdue.conf.in (ATmega64M1): New entry.
|
||||
|
||||
2018-01-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Submitted David Griffith:
|
||||
patch #9530: Update URL to Ladyada's USBtinyISP page.
|
||||
* avrdude.conf.in (usbtiny): Update URL
|
||||
|
||||
2018-01-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Milan Kupcevic:
|
||||
patch #9423: Support ATtiny841 and ATtiny441
|
||||
bug #47376: ATtiny841 description missing in configuration file
|
||||
bug #49455: support for tiny441
|
||||
* avrdude.conf.in (ATtiny841, ATtiny441): New entries
|
||||
|
||||
2018-01-10 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Morten Engelhardt Olsen
|
||||
patch #9506: Script to create device configuration stub from Atmel ATDF files
|
||||
* tools/atdf-to-avrdude.xslt: New script
|
||||
|
||||
2018-01-10 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
|
||||
patch #9507: Fix UPDI chip erase
|
||||
* lexer.l (family_id): New keyword.
|
||||
* config_gram.y: (Ditto)
|
||||
* doc/avrdude.texi: Document new keyword
|
||||
* avrdude.conf.in: Add family_id for avr8x devices
|
||||
* avr.c: Pass error code up.
|
||||
* jtag3.c: Pass error code from memory read up; implement
|
||||
jtag3_read_sib()
|
||||
* libavrdude.h: Add new items.
|
||||
* main.c: Implement different chip erase handling required
|
||||
for UPDI devices.
|
||||
|
||||
2018-01-10 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
|
||||
patch #9506: Script to create device configuration stub from Atmel ATDF files
|
||||
* avrdude.conf.in (ATtiny202, ATtiny204, ATtiny402, ATtiny404)
|
||||
(ATtiny406, ATtiny804, ATtiny806, ATtiny807, ATtiny1604)
|
||||
(ATtiny1606, ATtiny1607, ATtiny212, ATtiny214, ATtiny412)
|
||||
(ATTiny414, ATtiny416, ATtiny417, ATtiny814, ATtiny816)
|
||||
(ATtiny1614, ATtiny1616, ATtiny3214, ATtiny3216, ATtiny3217)
|
||||
(ATmega3208, ATmega3209, ATmega4808, ATmega4809): New devices
|
||||
|
|
@ -0,0 +1,598 @@
|
|||
2001-12-30 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* main.c: Update version.
|
||||
|
||||
* avrdude.conf.sample: Clarify a comment.
|
||||
|
||||
* avrdude.conf.sample: fix address bits
|
||||
|
||||
* avrdude.1: Bring up to date.
|
||||
|
||||
2001-12-29 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrdude.conf.sample: Add the AVR3 progammer.
|
||||
|
||||
* avr.c, avrdude.conf.sample, config_gram.y, main.c, pindefs.h:
|
||||
Fix VCC assertion.
|
||||
|
||||
Make the BUFF pin a mask like VCC to allow multiple pins to be
|
||||
asserted at the same time (STK200 has two buffer enable lines).
|
||||
|
||||
Add the STK200 programmer.
|
||||
|
||||
Fix EEPROM address line selection for several parts.
|
||||
|
||||
2001-12-15 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrdude.conf.sample: fix spelling error
|
||||
|
||||
2001-11-24 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile:
|
||||
Change "WARNING" to "NOTE" when overwriting the avrprog.conf file.
|
||||
|
||||
* avrdude.1: Add my e-mail address.
|
||||
|
||||
* avrdude.conf.sample:
|
||||
Add comments about instruction formats. Correct an instruction
|
||||
specification (cut&paste error).
|
||||
|
||||
2001-11-21 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avr.c, config_gram.y, lexer.l, term.c:
|
||||
In interactive mode, reset the address and length if we start dumping
|
||||
a memory type different than the previous one.
|
||||
|
||||
* avr.c, avrdude.conf.sample, config_gram.y:
|
||||
Allow instruction data to be specified more flexibly, which can be
|
||||
used to make the instruction input more readable in the config file.
|
||||
|
||||
* main.c: Bump version number.
|
||||
|
||||
* Makefile, avr.c, avr.h, avrdude.conf.sample, config.c, config.h:
|
||||
* config_gram.y, fileio.c, fileio.h, lexer.l, main.c, term.c:
|
||||
This is a major re-write of the programming algorithms. The Atmel
|
||||
serial programming instructions are not very orthoganal, i.e., the
|
||||
"read fuse bits" instruction on an ATMega103 is an entirely different
|
||||
opcode and data format from the _same_ instruction for an ATMega163!
|
||||
Thus, it becomes impossible to have a single instruction encoding
|
||||
(varying the data) across the chip lines.
|
||||
|
||||
This set of changes allows and requires instruction encodings to be
|
||||
defined on a per-part basis within the configuration file. Hopefully
|
||||
I've defined the encoding scheme in a general enough way so it is
|
||||
useful in describing the instruction formats for yet-to-be invented
|
||||
Atmel chips. I've tried hard to make it match very closely with the
|
||||
specification in Atmel's data sheets for their parts. It's a little
|
||||
more verbose than what I initially hoped for, but I've tried to keep
|
||||
it as concise as I could, while still remaining reasonably flexible.
|
||||
|
||||
2001-11-19 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avr.c, avr.h, avrdude.conf.sample, main.c, ppi.c, term.c:
|
||||
Add support for ATMega163.
|
||||
|
||||
Add support for reading/writing ATMega163 lock and fuse bits.
|
||||
Unfortunately, in looking at the specs for other ATMega parts, they
|
||||
use entirely different instruction formats for these commands. Thus,
|
||||
these routines won't work for the ATMega103, for example.
|
||||
|
||||
Add support for sending raw command bytes via the interactive terminal
|
||||
interface. This allows one to execute any programming instruction on
|
||||
the target device, whether or not avrprog supports it explicitly or
|
||||
not. Thus, one can use this feature to program fuse / lock bits, or
|
||||
access any other feature of a current or future device that avrprog
|
||||
does not know how to do.
|
||||
|
||||
Add in comments, an experimental instruction format in the
|
||||
configuration file. If this works out, it would allow supporting new
|
||||
parts and non-orthoganal instructions across existing parts without
|
||||
making avrprog code changes.
|
||||
|
||||
2001-11-17 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrdude.conf.sample: Add ATMEGA163 part.
|
||||
|
||||
2001-11-11 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* main.c: output formatting
|
||||
|
||||
2001-11-05 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* ppi.c: Get ppi.h from /usr/include, not /sys.
|
||||
|
||||
2001-10-31 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avr.c, avrdude.conf.sample, main.c: Correct version string.
|
||||
Update read/write status more frequently.
|
||||
Prefix ATMega parts with an 'm'.
|
||||
|
||||
2001-10-16 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avr.c: Change ording for memory display.
|
||||
|
||||
* config_gram.y: comment
|
||||
|
||||
* avr.c, avr.h, avrdude.conf.sample, config_gram.y, lexer.l, term.c:
|
||||
Fix (again, hopefully) page addressing for the ATMega parts.
|
||||
|
||||
Rename the poorly chosen name "bank" to "page" for page addressing.
|
||||
Atmel calls it "page" in their documentation.
|
||||
|
||||
* config_gram.y, main.c: Fix an (non)exit.
|
||||
Silence a couple of compiler warnings.
|
||||
|
||||
* avr.c, avr.h, avrdude.conf.sample, config_gram.y, main.c:
|
||||
Fix ATMega flash addressing. Add an ATMEGA16 part. Perform sanity
|
||||
checking on the memory parameters for parts that do bank addressing.
|
||||
|
||||
2001-10-15 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* config.c, config.h, lists.h: Add copyright.
|
||||
|
||||
* config_gram.y, lexer.l, lists.c: Add copyrights.
|
||||
|
||||
* Makefile: Attempt to install avrprog.conf.
|
||||
|
||||
* avrdude.conf.sample: Correct dt006 pinout.
|
||||
|
||||
* Makefile, lexer.l:
|
||||
Try and detect an old-style config file and print an appropriate error
|
||||
message and a suggestion for correcting it.
|
||||
|
||||
* Makefile, avr.c, avrdude.1, avrdude.conf.sample: Update the man page.
|
||||
|
||||
Miscellaneous minor cleanups.
|
||||
|
||||
2001-10-14 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile, Makefile.inc, avr.c, avr.h, avrdude.conf.sample:
|
||||
* config.c, config.h, config_gram.y, lexer.l, lists.c, lists.h:
|
||||
* main.c, pindefs.h, term.c:
|
||||
Use lex/yacc for parsing the config file. Re-work the config file
|
||||
format using a more human-readable format.
|
||||
|
||||
Read part descriptions from the config file now instead of hard-coding
|
||||
them.
|
||||
|
||||
Update usage().
|
||||
|
||||
Cleanup unused code.
|
||||
|
||||
* Makefile, avr.c, avr.h, fileio.c, term.c:
|
||||
First cut at supporting the ATmega 103 which uses bank addressing and
|
||||
has a 128K flash.
|
||||
|
||||
Due to the bank addressing required, interactive update of the flash
|
||||
is not supported, though the eeprom can be updated interactively.
|
||||
Both memories can be programmed via non-interactive mode.
|
||||
|
||||
Intel Hex Record type '04' is now generated as required for outputing
|
||||
memory contents that go beyond 64K.
|
||||
|
||||
2001-10-13 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avr.c, avr.h, fileio.c, fileio.h, main.c, ppi.c, ppi.h, term.c:
|
||||
* term.h:
|
||||
Style fixes.
|
||||
|
||||
* avr.c, avr.h, fileio.c, fileio.h, main.c, term.c:
|
||||
Commit changes in preparation for support the ATMega line.
|
||||
|
||||
2001-10-01 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile: Don't override CFLAGS.
|
||||
|
||||
* avrdude.1: Correct default pin assignment.
|
||||
|
||||
* avr.c, fileio.c, main.c, ppi.c, term.c:
|
||||
Remove debugging code - it served its purpose.
|
||||
|
||||
Update copyrights.
|
||||
|
||||
2001-09-21 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* main.c:
|
||||
Be sure to read the exit specs after the pin configuration has been
|
||||
assigned, otherwise, we may apply the exit specs to the wrong pins.
|
||||
|
||||
* main.c: debugging
|
||||
|
||||
2001-09-20 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrdude.1, avrdude.conf.sample, main.c:
|
||||
Prefix pin config entries in the config file with a "c:". Later, I
|
||||
might make part descriptions read in this way and we can use a
|
||||
different letter for those (p). This will make the parsing easier to
|
||||
distinguish between the entry types.
|
||||
|
||||
* main.c: Initialize pin configuration description.
|
||||
|
||||
2001-09-19 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* AVRprog.pdf, Makefile, avr.c, avrdude.1, avrdude.conf.sample:
|
||||
* avrdude.pdf, fileio.c, fileio.h, main.c, pindefs.h, term.c:
|
||||
Make the pin definitions configurable based on entries in a config
|
||||
file. This makes supporting other programmers much easier.
|
||||
|
||||
Rename AVRprog.pdf to avrprog.pdf.
|
||||
|
||||
2001-04-29 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrprog-programmer.jpg: Remove this image file from the repository.
|
||||
|
||||
2001-04-26 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrprog-schematic.jpg:
|
||||
Remove this image, use AVRprog.pdf as the preferred schematic for the
|
||||
programmer.
|
||||
|
||||
2001-04-25 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* AVRprog.pdf, Makefile, avrdude.1:
|
||||
Add a schematic provided by Joerg Wunch and also update the manual
|
||||
page (also updated by Joerg) to reference the schematic.
|
||||
|
||||
2001-02-25 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile, Makefile.inc: Automate dependency generation.
|
||||
|
||||
2001-02-08 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* main.c: Turn off ready led when finished programming.
|
||||
|
||||
* main.c: update version
|
||||
|
||||
* avr.c, main.c: Correct a few comments.
|
||||
|
||||
* Makefile, avr.c, term.c: Makefile : update dependencies
|
||||
|
||||
avr.c : correct status led updates
|
||||
|
||||
term.c : update status leds on write, make the address and length
|
||||
arguments for dump optional.
|
||||
|
||||
2001-01-26 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* main.c: Version 1.1
|
||||
|
||||
* main.c:
|
||||
Hmmm ... cvs co -D <timestamp> does not work. Change the revision
|
||||
timestamp to a full date/time value.
|
||||
|
||||
* avr.c, fileio.c, main.c, ppi.c, term.c:
|
||||
Add a -V option to display the version information about each
|
||||
component module. This is intended for support purposes, so that I
|
||||
can tell unambiguously what version a binary out in the field is.
|
||||
|
||||
Additionally, display a revision timestamp along with the version
|
||||
number. This also is intended for aiding in support and is the Unix
|
||||
time of the latest component module. Having this, should allow me to
|
||||
do a "cvs co -D timestamp avrprog" and get exactly the source of the
|
||||
version that is being reported.
|
||||
|
||||
* fileio.c:
|
||||
Return the maximum address (+1) written as opposed to the actual
|
||||
number of bytes written. The presence of an Intel Hex address
|
||||
record can cause these two number to be different; but the callers
|
||||
of this routine need the former.
|
||||
|
||||
* main.c:
|
||||
Fix a place where we were exiting without applying the exit-specs.
|
||||
|
||||
Wrap a long line.
|
||||
|
||||
* avr.c, fileio.c: avr.c: Update a comment.
|
||||
|
||||
fileio.c: Properly handle all the Intel Hex record types that I can
|
||||
find information about.
|
||||
|
||||
2001-01-25 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Usage, avr.h: Get rid of the Usage file.
|
||||
|
||||
2001-01-24 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile, avr.c, avr.h, main.c, pindefs.h, ppi.c:
|
||||
Move pin definitions to their own file.
|
||||
|
||||
First pass at providing feedback via the optionally connected leds. I
|
||||
don't actually have any of these attached to my programmer, so I can
|
||||
only guess as whether this is toggling them on and off correctly.
|
||||
|
||||
Also, enable and disable the optional 74367 buffer.
|
||||
|
||||
* avr.h, main.c, ppi.c, ppi.h, avr.c:
|
||||
Rearrange the pinout for the programmer to be a little more logical.
|
||||
Provide hooks to support a buffered programmer, pin 6 is now used to
|
||||
enable a buffer that can be used to isolate the target system from the
|
||||
parallel port pins. This is important when programming the target
|
||||
in-system.
|
||||
|
||||
Totally change the way the pin definitions are defined. Actually
|
||||
set/clear pins based on the way more intuitive pin number, instead of
|
||||
PPI data register, bit number combination. A table of pin data is
|
||||
used so that any hardware inversion done by the parallel port is
|
||||
accounted for, what you set is actually what appears at the pin.
|
||||
Retain the old method for handling Vcc, however, because the hold
|
||||
method is much easier to use when setting / retrieving multiple pins
|
||||
simultaneously.
|
||||
|
||||
2001-01-22 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile: Don't gzip the man page.
|
||||
|
||||
* avrdude.1: .Nm macro fix. Submitted by Joerg.
|
||||
|
||||
* main.c: Cosmetic, don't output a preceding linefeed for usage().
|
||||
|
||||
* Makefile, avr.c, avr.h, fileio.c, term.c:
|
||||
Makefile : use gzip -f for man page installation so that we don't get
|
||||
prompted.
|
||||
|
||||
avr.c avr.h fileio.c term.c :
|
||||
|
||||
Change the avrpart data structure so that the typedef AVRMEM is
|
||||
used as an index into an array for the sizes of the memory types
|
||||
and also for pointers to buffers that represent the chip data for
|
||||
that memory type. This removes a lot of conditional code of the
|
||||
form:
|
||||
|
||||
switch (memtype) {
|
||||
case AVR_FLASH :
|
||||
...
|
||||
}
|
||||
|
||||
Also, re-code avr_read_byte() and avr_write_byte() to properly
|
||||
handle the flash memory type without having to tell them whether
|
||||
they should program the high byte or the low byte - figure that
|
||||
out from the address itself. For flash memory type, these
|
||||
routines now take the actual byte address instead of the word
|
||||
address. This _greatly_ simplifies many otherwise simple
|
||||
operations, such a reading or writing a range of memory, by not
|
||||
having to worry about whether the address starts on an odd byte
|
||||
or an even byte.
|
||||
|
||||
2001-01-20 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avr.c, avr.h, fileio.c, fileio.h, main.c:
|
||||
Return error codes instead of exiting, thus making sure that we exit
|
||||
only via main() so that the exitspecs are properly applied.
|
||||
|
||||
When reading input data from a file, remember how many bytes were read
|
||||
and write and verify only that many bytes.
|
||||
|
||||
Don't complain when an input file size is smaller than the memory size
|
||||
we are programming. This is normal.
|
||||
|
||||
* fileio.c:
|
||||
Correct checksum calculation; failure to account for the value of the
|
||||
record type was causing non-zero record types to be calculated
|
||||
incorrectly.
|
||||
|
||||
* Makefile, main.c: Makefile : install the man page
|
||||
|
||||
main.c : drop the giant usage text now that we have a man page.
|
||||
|
||||
* avrdude.1:
|
||||
Add initial man page graciously contributed by Joerg Wunsch. Thanks
|
||||
Joerg!
|
||||
|
||||
2001-01-19 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* term.c:
|
||||
Accept abbreviations for eeprom and flash for the dump and write
|
||||
commands.
|
||||
|
||||
Fix small bug keeping 1 character command lines from being added to
|
||||
the history.
|
||||
|
||||
* term.c:
|
||||
Implement enough state in cmd_dump so that if it is called with no
|
||||
arguments, it successively dumps the next chunk of data of the same
|
||||
previously specified length.
|
||||
|
||||
* term.c, term.h, fileio.c, fileio.h, main.c, ppi.c, ppi.h:
|
||||
* Makefile, avr.c, avr.h, avrprog.c:
|
||||
The program was getting too large for a single file. Split it up into
|
||||
more modular pieces.
|
||||
|
||||
Also, accept command abbreviations as long as they are not ambiguous.
|
||||
|
||||
* avrprog.c:
|
||||
Add ability to specify the state of the power and reset pins on
|
||||
program exit. Default to leaving the pins in the state they were when
|
||||
we found them.
|
||||
|
||||
Contributed by: Joerg Wunsch
|
||||
|
||||
2001-01-18 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile, avrprog.c:
|
||||
Switch to using readline() for getting terminal input. I can't seem
|
||||
to get the history capabilities working yet, but even so, it does
|
||||
better handling of the prompt and strips newlines for us, so it's
|
||||
still a win.
|
||||
|
||||
Add a few new commands for terminal mode: help, sig, part, erase.
|
||||
Display rudimentory help using the help command.
|
||||
|
||||
Add some function prototypes.
|
||||
|
||||
* Usage, avrprog.c:
|
||||
Change -c (interactive command mode) to the more intuitive -t
|
||||
(terminal mode).
|
||||
|
||||
Make binary format the default for output.
|
||||
|
||||
Update the parts table with corrections for old values and add some
|
||||
new values.
|
||||
|
||||
2001-01-15 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrprog.c:
|
||||
Automatically verify on-chip data with what we just programmed.
|
||||
|
||||
* avrprog.c, Makefile:
|
||||
Prepare the Makefile for integration into the FreeBSD ports tree.
|
||||
|
||||
Fix a few "may be used uninitialized" bugs found by -Wall.
|
||||
|
||||
2001-01-14 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrprog.c: Free a buffer.
|
||||
|
||||
* avrprog.c:
|
||||
Use a smarter programming algorithm - read the existing data byte
|
||||
first and only write the new one if it is different.
|
||||
|
||||
Add -n option which is a test mode in which the chip is not actually
|
||||
updated. This option does not affect writes in interactive mode.
|
||||
|
||||
* avrprog.c: Add the "dump" and "write" interactive commands.
|
||||
|
||||
* avrprog.c:
|
||||
Correctly produce and handle "end of record" for intel hex files.
|
||||
|
||||
2001-01-13 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrprog.c:
|
||||
Re-enable writing to the chip. I should probably should make this a
|
||||
command-line selectable option so that I don't keep forgetting and
|
||||
committing it with it disabled.
|
||||
|
||||
* avrprog.c:
|
||||
Add a newline before exiting due to command line errors. Perform a
|
||||
bit more option compatibility testing between -c, -i, and -o.
|
||||
|
||||
* avrprog.c: Add input file format auto-detection support.
|
||||
|
||||
* Usage, avrprog.c: Say what the defaults are.
|
||||
|
||||
* avrprog-programmer.jpg, Usage, avrprog-schematic.jpg: New files.
|
||||
|
||||
* avrprog.c: Correct usage text.
|
||||
|
||||
* avrprog.c:
|
||||
Parameterize a few additional items per chip. Print out all per-chip
|
||||
parameters on startup. Use the per-chip parameters in the code
|
||||
instead of hard-coded values for the 2313.
|
||||
|
||||
* avrprog.c: Fix filename assignment error.
|
||||
|
||||
Clean up debugging code a little, utilize fileio() instead of making
|
||||
direct calls to b2ihex().
|
||||
|
||||
* avrprog.c: A lot of general code cleanup.
|
||||
|
||||
Re-work command line options to be more intuitive.
|
||||
|
||||
Support Intel Hex input and output file formats. Provide hooks to
|
||||
support Motorola S-Record as well.
|
||||
|
||||
Add a few more part-specific parameters to the avrpart structure.
|
||||
|
||||
Only write the flash or eeprom if the data to be written is not 0xff.
|
||||
|
||||
2000-12-31 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrprog.c: Update a comment.
|
||||
|
||||
* avrprog.c:
|
||||
Provide the ability to tie additionally tie pins 6-9 of the parallel
|
||||
port to Vcc in order to supply more current.
|
||||
|
||||
Fix a typo on the size of the S1200's Flash.
|
||||
|
||||
Bring RESET low when programming is completed.
|
||||
|
||||
* avrprog.c:
|
||||
Correct pin connection comments. Elaborate a bit on Vcc connection.
|
||||
|
||||
* avrprog.c:
|
||||
Update after receiving some good feedback from Joerg Wunsch. We
|
||||
should now be able to program AT90S1200's.
|
||||
|
||||
2000-12-30 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrprog.c: Don't limit eeprom addresses.
|
||||
|
||||
2000-12-20 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile, avrprog.c:
|
||||
Add support for the 8515. Make the addition for other devices easier.
|
||||
|
||||
2000-08-27 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrprog.c:
|
||||
Clear all bits except AVR_RESET when finished reading or programming
|
||||
the Atmel device.
|
||||
|
||||
2000-08-07 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrprog.c: update announcement message
|
||||
|
||||
* avrprog.c: Update announcement message.
|
||||
|
||||
* avrprog.c: Return the correct return code from 'main()'.
|
||||
|
||||
* avrprog.c:
|
||||
Add ppi_pulse() function and fix ppi_toggle() to actully toggle
|
||||
instead of pulse.
|
||||
|
||||
Make all abnormal returns after the parallel port has been opened go
|
||||
through a single exit point at the bottom of 'main()'.
|
||||
|
||||
2000-08-06 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile, avrprog.c: Makefile: add --pedantic compiler option
|
||||
|
||||
avrprog.c:
|
||||
|
||||
Add lots of comments, move getop() variable declarations to
|
||||
the top of the program.
|
||||
|
||||
Add a typedef name to the AVR memory type and use it for
|
||||
function declarations.
|
||||
|
||||
Add a usleep() delay in the sense loop to avoid becoming a cpu
|
||||
hog.
|
||||
|
||||
Print out a version string so that folks know what version of
|
||||
the software they are running.
|
||||
|
||||
Be sure and close the parallel device and the i/o file when
|
||||
terminating abnormally.
|
||||
|
||||
* avrprog.c: Print out version information when invoked.
|
||||
|
||||
* Makefile, avrprog.c: Makefile: Add an install target.
|
||||
|
||||
avrprog.c:
|
||||
|
||||
Add license.
|
||||
|
||||
Document the header a bit better.
|
||||
|
||||
Add capability to read out and display the device signature bytes.
|
||||
|
||||
Add capability to power the device from the parallel port.
|
||||
|
||||
Eliminate debug print facility.
|
||||
|
||||
Provide 'avr_cmd()' function.
|
||||
|
||||
When memory locations don't program, generate a newline so that the
|
||||
information is not overwritten and lost.
|
||||
|
||||
Don't print out the message about needing to specify a file if the
|
||||
user is not requesting an operation that requires the file.
|
||||
|
||||
2000-08-05 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrprog.c: Pring usage when no arguments are supplied.
|
||||
|
||||
* Makefile, avrprog.c: Initial check-in
|
||||
|
||||
* Makefile, avrprog.c: New file.
|
||||
|
|
@ -0,0 +1,237 @@
|
|||
2002-12-12 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* main.c: minor cleanup
|
||||
|
||||
2002-12-07 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrdude.1, main.c:
|
||||
If the stk500 is being used, default to using the first serial port.
|
||||
|
||||
2002-12-03 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrdude.1: Mention STK500 support.
|
||||
|
||||
2002-12-01 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* stk500.c: Remove unused code.
|
||||
|
||||
* CHANGELOG, stk500.c:
|
||||
Document changes since the previous version in the CHANGELOG.
|
||||
|
||||
Cleanup stk500.c a bit.
|
||||
|
||||
* stk500.c: Fix cut and paste braino.
|
||||
|
||||
* avr.c, avrdude.conf.sample, main.c, pgm.h, stk500.c:
|
||||
The STK500 can perform paged read/write operations even on standard
|
||||
"non-paged" parts. Take advantage of that and use the faster internal
|
||||
routines of the STK500 for those parts as well.
|
||||
|
||||
* avr.c, avr.h, avrpart.h, main.c, pgm.c, pgm.h, stk500.c:
|
||||
Optimize reading and writing for the STK500 programmer if the part
|
||||
supports paged reads and writes. This greatly decreases the
|
||||
program/verify time from about 4.5 minutes down to about 10 seconds in
|
||||
a 12K program size test case.
|
||||
|
||||
Print out the hardware and firmware version for the STK500 if verbose
|
||||
is enabled.
|
||||
|
||||
* avrdude.conf.sample, avrpart.h, config_gram.y, lexer.l, pgm.h:
|
||||
* ppi.c, ppi.h, stk500.c, stk500.h, stk500_private.h:
|
||||
Add basic support for STK500.
|
||||
|
||||
2002-11-30 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrdude.conf.sample, config.c, config.h, config_gram.y, lexer.l:
|
||||
* main.c, pgm.c, pgm.h, ppi.c, ppi.h, term.c, term.h, Makefile:
|
||||
* avr.c, avr.h:
|
||||
Seperate programmer operations out into a driver-like interface so
|
||||
that programmers other than the direct parallel port connection can be
|
||||
supported.
|
||||
|
||||
2002-11-23 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* CHANGELOG, main.c, term.c:
|
||||
term.c - when in interactive terminal mode and dumping memory using
|
||||
the 'dump <memtype>' command without any address information,
|
||||
and the end of memory is reached, wrap back around to zero on
|
||||
the next invocation.
|
||||
|
||||
CHANGELOG - describe changes
|
||||
|
||||
main.c - update version number
|
||||
|
||||
* main.c:
|
||||
When getting ready to initiate communications with the AVR device,
|
||||
first pull /RESET low for a short period of time before enabling the
|
||||
buffer chip. This sequence allows the AVR to be reset before the
|
||||
buffer is enabled to avoid a short period of time where the AVR may be
|
||||
driving the programming lines at the same time the programmer tries
|
||||
to. Of course, if a buffer is being used, then the /RESET line from
|
||||
the programmer needs to be directly connected to the AVR /RESET line
|
||||
and not via the buffer chip.
|
||||
|
||||
2002-11-06 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* CHANGELOG: Update changelog.
|
||||
|
||||
* avr.c, avr.h, main.c: Fix -Y option. Reported by Joerg Wunsch.
|
||||
|
||||
2002-11-01 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* CHANGELOG, main.c: Version update and CHANGELOG entry.
|
||||
|
||||
* avr.c:
|
||||
Be backward compatible with the 2-byte rewrite cycle counter which
|
||||
appeared in version 2.1.0, but was changed to a 4 byte counter in
|
||||
version 2.1.1. Reminded by Joerg Wunsch.
|
||||
|
||||
2002-10-29 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* CHANGELOG, avrdude.1, main.c:
|
||||
Add '-V' (no verify) flag requested by Joerg Wunsch. Update the man
|
||||
page.
|
||||
|
||||
2002-10-13 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* CHANGELOG, avrdude.1: Update man page and changelog.
|
||||
|
||||
* main.c: Update version number.
|
||||
|
||||
2002-10-12 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile: Remove --pedantic and -g from the compiler options.
|
||||
|
||||
2002-10-11 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avr.c, term.c:
|
||||
Use a four byte value instead of a two byte value for the programming
|
||||
cycle count stored at the end of EEPROM. It seems as though Atmel was
|
||||
greatly conservative in claiming a 1000 count reliability for the
|
||||
FLASH. I current have a part that has been reprogrammed 173330 times,
|
||||
and counting.
|
||||
|
||||
Fix a compiler warning.
|
||||
|
||||
* avrdude.conf.sample:
|
||||
Fix ATMega128 instruction encoding for reading the low and high fuse
|
||||
bits. Thanks to Joerg Wunsch for tripping over this.
|
||||
|
||||
2002-08-01 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avr.c, avrdude.1, main.c:
|
||||
Move erase-rewrite cycle increment to within the chip erase routine so
|
||||
that it is tracked no matter where the erase was initiated: command
|
||||
line mode or interactive mode, without code duplicaiton.
|
||||
|
||||
* CHANGELOG: Recent updates.
|
||||
|
||||
* avr.c: Eliminate unused variables.
|
||||
|
||||
* avr.c, avr.h, avrdude.1, fileio.c, main.c:
|
||||
Implement a way of tracking how many erase-rewrite cycles a part has
|
||||
undergone. This utilizes the last two bytes of EEPROM to maintain a
|
||||
counter that is incremented each time the part is erased.
|
||||
|
||||
2002-07-27 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avr.c, main.c:
|
||||
Fix a typo in a comment. Display the size of memory being written.
|
||||
Display the correct memory name in an error message (previously
|
||||
hardcoded).
|
||||
|
||||
2002-06-22 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* CHANGELOG, avrdude.conf.sample:
|
||||
Add support for ATtiny15 - contributed by Asher Hoskins
|
||||
<asher@crumbly.freeserve.co.uk>
|
||||
|
||||
2002-04-23 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* CHANGELOG: Say what changed.
|
||||
|
||||
2002-04-07 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* Makefile, avrdude.conf.sample:
|
||||
Backup the config file to a timestamped name to keep from possibly
|
||||
overwriting user-modified configs.
|
||||
|
||||
Add read/write instructions for all memory types for ATMEGA103,
|
||||
ATMEGA128, ATMEGA16, and ATMEGA8.
|
||||
|
||||
2002-04-05 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrdude.conf.sample:
|
||||
Add support for ATMEGA128; untested; requested by Jeff Gardner
|
||||
<gardner@journey.com>.
|
||||
|
||||
2002-02-15 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrdude.conf.sample: Minor ordering.
|
||||
|
||||
* CHANGELOG, main.c: Update version numbers.
|
||||
|
||||
2002-02-14 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* CHANGELOG: Summarize latest updates.
|
||||
|
||||
* avrdude.conf.sample, config_gram.y:
|
||||
Make pwroff_after_write a yes/no field instead of a numeric.
|
||||
|
||||
* avrdude.conf.sample: Document the pwroff_after_write flag.
|
||||
|
||||
* avr.c: Enable the extra part verbosity when verbosity >= 3.
|
||||
|
||||
* avr.c, avr.h, avrdude.conf.sample, config_gram.y, lexer.l:
|
||||
* main.c, term.c:
|
||||
Fix error reporting by avr_write_byte().
|
||||
|
||||
Fix setting of status LEDs under various write-fail conditions.
|
||||
|
||||
Add a flag to indicate that a memory type requires the device to
|
||||
possibly be powered off and back on after a write to it. This is due
|
||||
to a hardware problem on some Atmel devices, see:
|
||||
|
||||
http://www.atmel.com/atmel/acrobat/doc1280.pdf
|
||||
|
||||
Add greater verbosity to the part-display code when verbose>1 to
|
||||
display avrprog's encoding of the defined programming instructions.
|
||||
This is primarily for debugging purposes.
|
||||
|
||||
|
||||
Part updates:
|
||||
|
||||
* add the AT90S4414 part
|
||||
|
||||
* add fuse and lock bit access instructions for the AT90S1200,
|
||||
AT90S4434, and AT90S8515.
|
||||
|
||||
* add the pwroff_after_write flag to the fuse bits for the AT90S2333
|
||||
and AT90S4433 parts
|
||||
|
||||
2002-02-09 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* avrdude.conf.sample:
|
||||
Updates to the 2333 and 4433 parts, contributed by Joerg Wunsh.
|
||||
|
||||
2002-01-18 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* CHANGELOG: Add changelog.
|
||||
|
||||
2002-01-12 Brian S. Dean <bsd@bsdhome.com>
|
||||
|
||||
* main.c: Add (c) to copyright.
|
||||
|
||||
* fileio.c, fileio.h, lexer.l, lists.c, lists.h, main.c:
|
||||
* pindefs.h, ppi.c, ppi.h, term.c, term.h, avr.c, avr.h:
|
||||
* config.c, config.h, config_gram.y:
|
||||
Update version number. Update copyright.
|
||||
|
||||
* avrdude.1: Update copyright and add description of "default".
|
||||
|
||||
Submitted by: Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* avr.c, term.c:
|
||||
Fix programming of write-only memories (such as lock bits on the
|
||||
2313).
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,364 @@
|
|||
2007-11-08 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Partially revert the line buffered output change,
|
||||
and turn stderr into unbuffered output while producing the
|
||||
progress report.
|
||||
|
||||
2007-11-07 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Add setup and teardown hooks to the programmer
|
||||
definition. If present, call the setup hook immediately after
|
||||
finding the respective programmer object, and schedule the
|
||||
teardown hook to be called upon exit. This allows the
|
||||
programmer implementation to dynamically allocate private
|
||||
programmer data.
|
||||
* pgm.c: (Ditto.)
|
||||
* pgm.h: (Ditto.)
|
||||
* avr910.c: Convert static programmer data into dynamically
|
||||
allocated data.
|
||||
* butterfly.c: (Ditto.)
|
||||
* jtagmkI.c: (Ditto.)
|
||||
* jtagmkII.c: (Ditto.)
|
||||
* stk500v2.c: (Ditto.)
|
||||
* usbasp.c: (Ditto.)
|
||||
* usbtiny.c: (Ditto.)
|
||||
|
||||
2007-11-06 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* butterfly.c: Remove the no_show_func_info() calls, as Brian
|
||||
promised some 4 years ago.
|
||||
|
||||
2007-11-06 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Add the -x option to pass extended parameters to
|
||||
the programmer backend.
|
||||
* pgm.c: (Ditto.)
|
||||
* pgm.h: (Ditto.)
|
||||
* jtagmkII.c: Implement the extended parameter jtagchain=
|
||||
to support JTAG daisy-chains.
|
||||
* avrdude.1: Document all of the above.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2007-10-30 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version for post-release.
|
||||
|
||||
2007-10-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version, releasing avrdude-5.5.
|
||||
|
||||
2007-10-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
Submitted by <bikenomad@gmail.com>:
|
||||
patch #5007: Patch for line-buffering of stdout and stderr
|
||||
* main.c: call setvbuf() for stdout and stderr.
|
||||
|
||||
2007-10-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
Submitted by <graceindustries@gmail.com>:
|
||||
patch #5953: Add AT90CAN64 and AT90CAN32 to avrdude.conf
|
||||
* avrdude.conf.in: Add entry for AT90CAN64 and AT90CAN32.
|
||||
|
||||
2007-10-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Wolfgang Moser:
|
||||
patch #6121: ISP support for the C2N232I device (serial port
|
||||
bitbanging)
|
||||
* avrdude.conf.in: Add entry for c2n232i.
|
||||
|
||||
2007-10-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
Submitted by <karl.yerkes@gmail.com>:
|
||||
patch #6141: accept binary format immediate values
|
||||
* fileio.c: Detect a 0b prefix, and call strtoul() differently
|
||||
in that case.
|
||||
|
||||
2007-10-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
bug #21076: -vvvv serial receive prints are empty in Win32 build
|
||||
* ser_win32.c (ser_recv): Drop the essentially unused variable
|
||||
"len", and use the variable "read" in order to track how many
|
||||
bytes have just been read in.
|
||||
|
||||
2007-10-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
bug #21145: atmega329p not recognized
|
||||
* avrdude.conf.in: Add definitions for the ATmega329P/3290P.
|
||||
Same as ATmega329/3290 except of the different signature.
|
||||
|
||||
2007-10-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
bug #21152: Unable to program atmega324p with avrdude 5.4 and AVRISP
|
||||
using default configuration file.
|
||||
* avrdude.conf.in: Uncomment the (bogus) stk500_devcode lines for
|
||||
the ATmega164P, ATmega324P, ATmega644, and ATmega644P definitions.
|
||||
This only affects users of STK500v1 firmware.
|
||||
|
||||
2007-10-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
Submitted by <ladyada@gmail.com>:
|
||||
Patch #6233: Add support for USBtinyISP programmer
|
||||
* usbtiny.c: New file.
|
||||
* usbtiny.h: (Ditto.)
|
||||
* Makefile.am: Include usbtiny into the build.
|
||||
* avrdude.conf.in: (Ditto.)
|
||||
* config_gram.y: (Ditto.)
|
||||
* lexer.l: (Ditto.)
|
||||
* avrdude.1: Document the usbtiny support.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2007-10-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* doc/avrdude.texi: Sort list of supported programmers into
|
||||
alphabetical order, add all missing programmers.
|
||||
|
||||
2007-07-24 Thomas Fischl <tfischl@gmx.de>
|
||||
|
||||
* usbasp.c: Added long addresses to support devices with more
|
||||
than 64kB flash. Closes bug #20558: Long address problem with
|
||||
USBasp.
|
||||
|
||||
2007-06-27 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add ChangeLog-2004-2006.
|
||||
|
||||
2007-05-16 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version for post-release.
|
||||
|
||||
2007-05-16 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version, releasing avrdude-5.4.
|
||||
|
||||
2007-05-16 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in: Fix AVR910 devcodes. It seems that the AVR109
|
||||
listing refers to "BOOT"-type code, while the standard codes are
|
||||
different (usually one below).
|
||||
|
||||
2007-05-16 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* avr.c (avr_read, avr_write): only use the paged_load and
|
||||
paged_write backend functions iff the memory area in question has
|
||||
a page_size != 0.
|
||||
This is supposed to fix bug #19234: avrdude-5.3.1 segfaults when
|
||||
stk500v1 tries to program an ATtiny15
|
||||
|
||||
2007-05-15 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* avr910.c: Fall back to avr_{read,write}_byte_default(). Fixes
|
||||
bug #18803: Fuse reading regression in avrdude 5.3.1 with avr910
|
||||
programmer
|
||||
|
||||
2007-05-15 Colin O'Flynn <coflynn@newae.com>
|
||||
|
||||
* avrdude.conf.in: Rename the ATmega164 and ATmega324 into
|
||||
ATmega164P and ATmega324P, resp. Add an entry for the ATmega644P.
|
||||
Fixes bug #19769: ATmega164p not recognized
|
||||
|
||||
2007-05-15 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* ser_posix.c (ser_send): Don't select() on the output fd before
|
||||
trying to write something to the serial line. That kind of
|
||||
polling isn't very useful anyway, and it seems it breaks for the
|
||||
Linux CP210x USB<->RS-232 bridge driver which is certainly a bug
|
||||
in the driver, but we can just avoid that bug alltogether.
|
||||
|
||||
2007-05-15 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in: Fix the STK500v2 ISP delay parameter for
|
||||
ATmega640/1280/1281/2560/2561. Atmel has changed the XML
|
||||
files after the initial release.
|
||||
|
||||
2007-05-01 Colin O'Flynn <coflynn@newae.com>
|
||||
|
||||
* safemode.c: -Oops - bug in verbose output. Fixed.
|
||||
-Fixed handling of cases where programmer cannot read fuses (AVR910)
|
||||
* main.c: -Also fixing handling of cases where programmer cannot
|
||||
read fuses
|
||||
This should close one or more bugs (18803, 19570)
|
||||
|
||||
2007-05-01 Colin O'Flynn <coflynn@newae.com>
|
||||
|
||||
* safemode.c: Added verbose output from safemode routines.
|
||||
|
||||
2007-03-25 Colin O'Flynn <coflynn@newae.com>
|
||||
|
||||
* stk500generic.c: Forgot to close the serial port before trying to
|
||||
open it again, caused problems on Windows machines.
|
||||
Closes bug #19411
|
||||
|
||||
2007-02-26 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in: Add the AT90PWM2/3B devices.
|
||||
|
||||
2007-02-02 Thomas Fischl <tfischl@gmx.de>
|
||||
|
||||
* usbasp.c: Changed return value of function usbasp_initialize to stop
|
||||
avrdude on communication errors between programmer and target.
|
||||
Closes bug #18581: safemode destroys fuse bits
|
||||
|
||||
2007-02-01 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* config_gram.y: Remove duplicate definition of token K_WRITEPAGE
|
||||
|
||||
2007-01-30 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* butterfly.c: Implement ATmega256x support for butterfly/avr109.
|
||||
|
||||
2007-01-30 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Fix subdir handling. Now finally, "make
|
||||
distcheck" will include the documentation into the tarball even if
|
||||
the configure had been run without the --enable-doc.
|
||||
|
||||
2007-01-30 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* safemode.c: Obtain progname from avrdude.h rather than trying to
|
||||
roll our own (duplicate) copy of it.
|
||||
* avr910.c: Constify char pointers.
|
||||
* avrpart.c: (Ditto.)
|
||||
* avrpart.h: (Ditto.)
|
||||
* butterfly.c: (Ditto.)
|
||||
* config.c: (Ditto.)
|
||||
* config.h: (Ditto.)
|
||||
* jtagmkI.c: (Ditto.)
|
||||
* jtagmkII.c: (Ditto.)
|
||||
* par.c: (Ditto.)
|
||||
* pgm.c: (Ditto.)
|
||||
* pgm.h: (Ditto.)
|
||||
* serbb_posix.c: (Ditto.)
|
||||
* serbb_win32.c: (Ditto.)
|
||||
* stk500.c: (Ditto.)
|
||||
* stk500v2.c: (Ditto.)
|
||||
* usbasp.c: (Ditto.)
|
||||
|
||||
2007-01-29 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* avrpart.c: More backend/library abstraction and generalization:
|
||||
turn the list_parts() and list_programmers() functions into
|
||||
general list iteration functions that call a caller-supplied
|
||||
callback for each element. Implement list_parts() and
|
||||
list_programmers() as private functions in main.c based on that
|
||||
approach.
|
||||
* avrpart.h: (Ditto.)
|
||||
* main.c: (Ditto.)
|
||||
* pgm.c: (Ditto.)
|
||||
* pgm.h: (Ditto.)
|
||||
|
||||
2007-01-25 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* Makefile.am: Rearrange everything so it is now built into a
|
||||
libavrdude.a library, and link main.c against that library.
|
||||
* configure.ac: Add AC_PROG_RANLIB as we are building a library
|
||||
now.
|
||||
|
||||
2007-01-24 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
Major code cleanup.
|
||||
- Make all internal functions "static".
|
||||
- Make sure each module's header and implementation file match.
|
||||
- Remove all library-like functionality from main.c, so only
|
||||
the actual frontend remains in main.c.
|
||||
- Add C++ brackets to all header files.
|
||||
* avr.c: (Ditto.)
|
||||
* avr.h: (Ditto.)
|
||||
* avr910.c: (Ditto.)
|
||||
* avr910.h: (Ditto.)
|
||||
* avrdude.h: (Ditto.)
|
||||
* avrpart.c: (Ditto.)
|
||||
* avrpart.h: (Ditto.)
|
||||
* bitbang.h: (Ditto.)
|
||||
* butterfly.h: (Ditto.)
|
||||
* config.c: (Ditto.)
|
||||
* config.h: (Ditto.)
|
||||
* confwin.h: (Ditto.)
|
||||
* crc16.c: (Ditto.)
|
||||
* crc16.h: (Ditto.)
|
||||
* fileio.c: (Ditto.)
|
||||
* fileio.h: (Ditto.)
|
||||
* jtagmkI.h: (Ditto.)
|
||||
* jtagmkII.h: (Ditto.)
|
||||
* lexer.l: (Ditto.)
|
||||
* lists.h: (Ditto.)
|
||||
* main.c: (Ditto.)
|
||||
* par.h: (Ditto.)
|
||||
* pgm.c: (Ditto.)
|
||||
* pgm.h: (Ditto.)
|
||||
* ppi.c: (Ditto.)
|
||||
* ppi.h: (Ditto.)
|
||||
* safemode.h: (Ditto.)
|
||||
* serbb.h: (Ditto.)
|
||||
* serial.h: (Ditto.)
|
||||
* stk500.h: (Ditto.)
|
||||
* stk500v2.c: (Ditto.)
|
||||
* stk500v2.h: (Ditto.)
|
||||
* term.c: (Ditto.)
|
||||
* term.h: (Ditto.)
|
||||
* usbasp.h: (Ditto.)
|
||||
* update.c: New file.
|
||||
* update.h: New file.
|
||||
* Makefile.am: Include update.c and update.h.
|
||||
|
||||
2007-01-24 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
Move all "extern" declarations into a centreal header file.
|
||||
* Makefile.am: Add new avrdude.h.
|
||||
* avrdude.h: New file.
|
||||
* avr.c: Replace private extern decl's by #include "avrdude.h".
|
||||
* avr910.c: (Ditto.)
|
||||
* avrpart.c: (Ditto.)
|
||||
* bitbang.c: (Ditto.)
|
||||
* butterfly.c: (Ditto.)
|
||||
* config.c: (Ditto.)
|
||||
* config_gram.y: (Ditto.)
|
||||
* fileio.c: (Ditto.)
|
||||
* jtagmkI.c: (Ditto.)
|
||||
* jtagmkII.c: (Ditto.)
|
||||
* lexer.l: (Ditto.)
|
||||
* main.c: (Ditto.)
|
||||
* par.c: (Ditto.)
|
||||
* pgm.c: (Ditto.)
|
||||
* ppi.c: (Ditto.)
|
||||
* ppiwin.c: (Ditto.)
|
||||
* ser_avrdoper.c: (Ditto.)
|
||||
* ser_posix.c: (Ditto.)
|
||||
* ser_win32.c: (Ditto.)
|
||||
* serbb_posix.c: (Ditto.)
|
||||
* serbb_win32.c: (Ditto.)
|
||||
* stk500.c: (Ditto.)
|
||||
* stk500generic.c: (Ditto.)
|
||||
* stk500v2.c: (Ditto.)
|
||||
* term.c: (Ditto.)
|
||||
* usb_libusb.c: (Ditto.)
|
||||
* usbasp.c: (Ditto.)
|
||||
|
||||
2007-01-13 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in (ATmega8): Bump the delay values for flash
|
||||
and EEPROM, based on the current Atmel XML file.
|
||||
|
||||
2007-01-12 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Improve the detection of the Win32 HID library,
|
||||
and the presence of the header ddk/hidsdi.h. It now works
|
||||
correctly under Cygwin and several flavours of MinGW.
|
||||
* Makefile.am: Add new LIBHID pattern.
|
||||
|
||||
2007-01-11 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* butterfly.c (butterfly_initialize): when sending the 'T'
|
||||
command (which is ignored by current AVR109 bootloaders),
|
||||
send the first reply from the list of supported device
|
||||
codes back rather than using avrdude.conf's idea about
|
||||
an AVR910 device code. Apparently, this solves disagreements
|
||||
between different versions of at least the ATmega8 AVR910
|
||||
device code.
|
||||
Closes bug #18727: Writing flash failed
|
||||
|
||||
2007-01-07 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
Reported by Till Harbaum:
|
||||
* avrdude.conf.in (ATtiny25/45/85): Change HVSP reset from
|
||||
500 microseconds to 1 ms, matching the most recent Atmel XML
|
||||
specs.
|
|
@ -0,0 +1,185 @@
|
|||
2008-11-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.h: Change the prototype for usleep() to be more Cygwin-
|
||||
friendly.
|
||||
* ppiwin.c: (Ditto.)
|
||||
|
||||
2008-11-06 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by limor <limor@ladyada.net>
|
||||
* usbtiny.c (usbtiny_cmd): Replace sizeof() by a fixed constant
|
||||
4 for the result array, because otherwise it would take the size
|
||||
of a pointer which miserably fails on 64-bit machines.
|
||||
|
||||
2008-11-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #6609: Using PCI parallel port cards on Windows
|
||||
* ppiwin.c (ppi_open): If the port parameter passed from the
|
||||
-p option is neither lpt1/2/3, try interpreting it directly as
|
||||
a base address.
|
||||
* avrdude.1: Document the change.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2008-11-04 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #22882: Erase Cycle Counter does not work for stk500v2
|
||||
* stk500v2.c (stk500v2_chip_erase,stk500hv_chip_erase): Return
|
||||
the expected 0 for success rather than a protocol-dependant
|
||||
number.
|
||||
|
||||
2008-11-04 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #22883: Chip Erase performed even with no-write flag (-n)
|
||||
* main.c: Do not erase the chip if both, -e and -n options have
|
||||
been specified.
|
||||
|
||||
2008-11-04 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #24589: AT90USB64* have wrong signature
|
||||
* avrdude.conf.in: Uncomment the correct, and delete the wrong
|
||||
signature for AT90USB646/647. Alas, the datasheet has never been
|
||||
corrected for years.
|
||||
|
||||
2008-10-31 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c: Fix a serious memory corruption that happened when
|
||||
using the JTAG ICE mkII (or AVR Dragon) in ISP mode. The wrong
|
||||
set of per-programmer private data had been allocated (stk500v2
|
||||
vs. jtagmkII) which was too small to hold the actual data.
|
||||
* jtagmkII.h: (Ditto.)
|
||||
* stk500v2.c: (Ditto.)
|
||||
|
||||
2008-07-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c: Implement Xmega JTAG support.
|
||||
* jtagmkII_private.h: Add EMULATOR_MODE_JTAG_XMEGA.
|
||||
|
||||
2008-07-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Remember whether the device initialization worked, and
|
||||
allow to continue with -F if it failed yet do not attempt to
|
||||
perform anything on the device itself. That way, -tF could be
|
||||
specified for programmers like the STK500/STK600 even without a
|
||||
device connected, just in order to allow changing parameters on
|
||||
the programmer itself.
|
||||
* avrdude.1: Document that possible use of the -F option.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2008-07-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c (stk600_xprog_paged_write): Fix a fatal miscalculation
|
||||
of the number of bytes to be written which caused a malloc chunk
|
||||
corruption.
|
||||
|
||||
2008-07-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
First implementation of ATxmega support. By now, only the
|
||||
PDI mode of the STK600 is supported. Single-byte EEPROM
|
||||
(and flash) updates do not work yet.
|
||||
* avr.c: "boot" memory is a candidate memory region for paged
|
||||
operations, besides "flash" and "eeprom".
|
||||
* avrdude.conf.in: add ATxmega128A1 and ATxmega128A1revD
|
||||
* avrpart.h: add the AVRPART_HAS_PDI flag (used to distinguish
|
||||
ATxmega parts from classic AVRs), the nvm_base part field, and
|
||||
the offset field for a memory region.
|
||||
* config_gram.y: add "has_pdi", "nvm_base", and "offset"
|
||||
* lexer.l: (Ditto.)
|
||||
* main.c: disable auto_erase for ATxmega parts
|
||||
* stk500v2.c: implement the XPROG functionality, and divert to
|
||||
this for ATxmega parts
|
||||
* avrdude.1: Document the changes.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2008-07-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Fix a bunch of warnings.
|
||||
* avr910.c (avr910_paged_load): possible unitialized use of
|
||||
rd_size
|
||||
* jtagmkI.c (jtagmkI_initialize): pointer signedness mixup
|
||||
* jtagmkII.c (jtagmkII_print_parms1): propagate const'ness
|
||||
of parameter
|
||||
* usbasp.c (usbasp_transmit): pointer signedness mixup
|
||||
* ser_avrdoper.c (usbGetReport): remove useless pointer deref
|
||||
|
||||
2008-07-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Contributed by Ville Voipio:
|
||||
patch #6501: New autotools support for avrdude
|
||||
* Makefile.am: add @WINDOWS_DIRS@ to SUBDIR
|
||||
* bootstrap: allow for autconf-2.61 and automake-1.10, too
|
||||
* configure.ac: fix @WINDOWS_DIRS@ recursion, replace
|
||||
AC_PROG_CC by AM_PROG_CC_C_O, for esoteric reasons
|
||||
|
||||
2008-06-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Contributed by Janos Sallai <janos.sallai@vanderbilt.edu>:
|
||||
patch #6074: added support for crossbow's MIB510 programmer
|
||||
* avrdude.conf.in: Add entry for mib510.
|
||||
* stk500.c: Add special hooks to handle the MIB510 programmer.
|
||||
It mostly talks STK500v1 protocol but has a special hello and
|
||||
goodbye sequence, and uses a fixed block size of 256 bytes.
|
||||
* doc/avrdude.texi: Document support for mib510.
|
||||
|
||||
2008-06-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Contributed by Klaus Leidinger <klaus@mikrocontroller-projekte.de>:
|
||||
* main.c: Realign verbose messages.
|
||||
* avrpart.c: (Ditto.)
|
||||
* avr910.c: Print the device code selected in verbose mode.
|
||||
* butterfly.c: (Ditto.)
|
||||
|
||||
2008-06-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Contributed by Klaus Leidinger <klaus@mikrocontroller-projekte.de>:
|
||||
Add check for buffermode feature, and use it if present. Can be
|
||||
turned off using -x no_blockmode.
|
||||
* avr910.c: Implement buffermode test and usage.
|
||||
* avrdude.1: Document -x no_blockmode.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2008-03-24 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usb_libusb.c: #undef interface for Win32
|
||||
|
||||
2008-03-24 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avr910.c: Add support for the -x devcode option.
|
||||
* avrdude.1: Document -x devcode for avr910.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2008-03-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Add initial support for the Atmel STK600, for
|
||||
"classic" AVRs (AT90, ATtiny, ATmega) in both,
|
||||
ISP and high-voltage programming modes.
|
||||
* Makefile.am: Add -lm.
|
||||
* avrdude.conf.in: Add stk600, stk600pp, and stk600hvsp.
|
||||
* config_gram.y: Add support for the stk600* keywords.
|
||||
* lexer.l: (Ditto.)
|
||||
* pgm.h: Add the "chan" parameter to set_varef().
|
||||
* stk500.c: (Ditto.)
|
||||
* serial.h: Add USB endpoint support to struct filedescriptor.
|
||||
* stk500v2.c: Implement the meat of the STK600 support.
|
||||
* stk500v2.h: Add new prototypes for stk600*() programmers.
|
||||
* stk500v2_private.h: Add new constants used in the STK600.
|
||||
* term.c: Add AREF channel support.
|
||||
* usb_libusb.c: Automatically determine the correct write
|
||||
endpoint ID, the STK600 uses 0x83 while all other tools use
|
||||
0x82. Propagate the EP to use through struct filedescriptor.
|
||||
* usbdevs.h: Add the STK600 USB product ID.
|
||||
* tools/get-stk600-cards.xsl: XSL transformation for
|
||||
targetboards.xml to obtain the list of socket and routing
|
||||
card IDs, to be used in stk500v2.c (for displaying the
|
||||
names).
|
||||
* tools/get-stk600-devices.xsl: XSL transformation for
|
||||
targetboards.xml to obtain the table of socket/routing cards
|
||||
and their respective AVR device support for doc/avrdude.texi.
|
||||
* avrdude.1: Document all the STK600 stuff.
|
||||
* doc/avrdude.texi: Ditto. Added a new chapter for
|
||||
Programmer Specific Information.
|
||||
|
||||
2008-01-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c (stk500v2_recv): Make length computation unsigned so
|
||||
it cannot accidentally become negative.
|
||||
|
|
@ -0,0 +1,411 @@
|
|||
2009-11-09 David Hoerl <dhoerl@mac.com>
|
||||
|
||||
* fileio.c: ihex2bin did not properly handle files > 64K bytes
|
||||
* usb_libusb.c: re-enabled usb_reset for Macs (no reset causes lots of failures)
|
||||
* avrdude.1: spacing issue for avr32 fixed.
|
||||
|
||||
2009-11-09 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* buspirate.c: Implemented reset= and speed= extended parameters.
|
||||
* avrdude.1: Document the change.
|
||||
|
||||
2009-11-04 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* configure.ac, Makefile.am: Test if GCC accepts -Wno-pointer-sign
|
||||
|
||||
2009-11-04 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* buspirate.c: Implemented 'BinMode' support for
|
||||
firmware 2.7 and higher.
|
||||
* avrdude.1: Added info about BusPirate.
|
||||
|
||||
2009-11-03 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* arduino.c: Add on to bug #26703 / patch #6866 - clear DTR/RTS
|
||||
when closing the port.
|
||||
* Makefile.am: Silent warnings about signedness - they're useless
|
||||
and annoying, especially for 'char' vars.
|
||||
|
||||
2009-10-22 David Hoerl <dhoerl@mac.com>
|
||||
|
||||
* usb_libusb.c: disabled usb_reset for Macs (same as FreeBSD)
|
||||
|
||||
2009-10-12 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* main.c: Re-added default to serial port for BusPirate.
|
||||
|
||||
2009-10-12 David Hoerl <dhoerl@mac.com>
|
||||
|
||||
* main.c: removed some avr32 code that was pushed into jtagmkII.c
|
||||
* jtagmkII.c: consolodated the avr32 reset code and avr32_chipreset
|
||||
* avrpart.h: modified AVRPART flags for avr32
|
||||
* lexer.l: added is_avr32 flag - only way to get yacc code to set flag
|
||||
* avrdude.conf.in: updated avr32 section to include "is_avr32" flag
|
||||
|
||||
2009-10-12 David Hoerl <dhoerl@mac.com>
|
||||
|
||||
* config_gram.y: Restored inadvertantly removed buspirate entry
|
||||
* lexer.l: Restored inadvertantly removed buspirate entry
|
||||
|
||||
2009-10-12 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* buspirate.c: Replace GNU-only %as with %s in sscanf call.
|
||||
* ser_win32.c(ser_set_dtr_rts): Fixed typo in parameter name.
|
||||
* NEWS: Announce BusPirate.
|
||||
|
||||
2009-10-11 David Hoerl <dhoerl@mac.com>
|
||||
|
||||
Support for AVR32
|
||||
|
||||
* AUTHORS: added myself
|
||||
* NEWS: announced AVR32 support
|
||||
* main.c: AVR32 flag tests to avoid several code blocks
|
||||
* fileio.c: mods to ihex read function to handle address offsets and
|
||||
size of avr32
|
||||
* jtagmkI.c: added cast to printf call to remove warning
|
||||
* arduino.c: added header file to bring in prototype for usleep()
|
||||
* config_gram.y: added defines for avr32, new jtag_mkii variant for avr32
|
||||
* jtagmkII_private.h: new jtag_mkii message types defined (used by
|
||||
avr32program)
|
||||
* jtagmkII.h: extern jtagmkII_avr32_initpgm() addition
|
||||
* jtagmkII.c: huge amount of code in support of avr32
|
||||
* avrpart.h: additional flags to AVRPART for avr32
|
||||
* usb_libusb.c: modified verbose test for USB read per-byte messages by
|
||||
by one, so with verbose=3 you get just full messages, 4 gives you bytes
|
||||
too
|
||||
* lexer.l: additions for avr32
|
||||
|
||||
2009-10-10 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
Support for Arduino auto-reset:
|
||||
* serial.h, ser_avrdoper.c, ser_posix.c, ser_win32.c: Added
|
||||
serial_device.set_dtr_rts implementations.
|
||||
* arduino.c, stk500.c, stk500.h: Call serial_set_dtr_rts()
|
||||
to reset Arduino board before program upload.
|
||||
Inspired by patch #6866, resolves bug #26703
|
||||
|
||||
2009-10-08 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* buspirate.c: Optimised buspirate_cmd() - reading 1kB EEPROM now
|
||||
takes only 14 sec instead of almost 2 mins with the original
|
||||
implementation.
|
||||
|
||||
2009-10-08 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* buspirate.c, buspirate.h: Support for the BusPirate programmer
|
||||
* config_gram.y, avrdude.conf.in, main.c, lexer.l, Makefile.am:
|
||||
Glue for BusPirate.
|
||||
|
||||
2009-08-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usb_libusb.c (usbdev_close): Repair the logic around the
|
||||
conditional compilation of usb_reset() introduced in r798.
|
||||
|
||||
2009-07-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: We are post-5.8 now.
|
||||
|
||||
2009-07-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Prepare for releasing version 5.8
|
||||
|
||||
2009-07-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Roger Wolff:
|
||||
bug #26527: bug in unicode conversion
|
||||
* ser_avrdoper.c (convertUniToAscii): when encountering a UTF-16
|
||||
character that cannot be converted to ASCII, increment the UTF-16
|
||||
pointer anyway when proceeding.
|
||||
|
||||
2009-07-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkI.c (jtagmkI_send): Replace %zd format by %u since not all
|
||||
implementations do understand the C99 formatting options (sigh).
|
||||
* jtagmkII.c (jtagmkII_send): (Ditto.)
|
||||
* stk500v2.c (stk500v2_recv): (Ditto.)
|
||||
|
||||
2009-07-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #26002: HVPP of EEPROM with AVR Dragon and ATmega8 Fails
|
||||
* avrdude.conf.in (ATmega8): add page size for EEPROM.
|
||||
|
||||
2009-07-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c: Fix a serious memory corruption problem resulting
|
||||
out of the chaining of both, the stk500v2 and the jtagmkII
|
||||
programmers for some programming hardware (JTAG ICE mkII and AVR
|
||||
Dragon running in ISP, HVSP or PP mode), where both programmers
|
||||
have to maintain their private programmer data.
|
||||
|
||||
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Post-release (is pre-release...)
|
||||
|
||||
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Prepare for releasing version 5.7
|
||||
|
||||
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Add my name to the copyright output when being verbose.
|
||||
|
||||
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Contributed by Shaun Jackman <sjackman@gmail.com>
|
||||
bug #21798: Fix both XSLT scripts
|
||||
* tools/get-dw-params.xsl (format-hex): Add the parameter count.
|
||||
* tools/get-hv-params.xsl (format_cstack): Ditto.
|
||||
|
||||
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #21922: ATmega163 still not working in version 5.5
|
||||
* avrdude.conf.in (atmega163): fill in stk500v2 parameters, correct
|
||||
some flash programming parameters as well.
|
||||
|
||||
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #22206: avrdude: ser_setspeed(): tcsetattr() failed
|
||||
* ser_posix.c (ser_setspeed): Don't pass TCSAFLUSH to tcsetattr() as
|
||||
it apparently fails to work on Solaris. After reading the
|
||||
documentation again, it seems TCSAFLUSH and TCSANOW are indeed
|
||||
mutually exclusive.
|
||||
|
||||
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #22234: WINDOWS version: HOWTO: Specify Serial Ports Larger than COM9
|
||||
* ser_win32.c (ser_open): prepend \\.\ to any COM port name, so it is
|
||||
safe to be used for COM ports above 9.
|
||||
|
||||
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #26408: Crash in stk500v2_open()
|
||||
* stk500generic.c: Implement setup and teardown hooks, calling in turn
|
||||
the respective hooks of the stk500v2 implementation.
|
||||
|
||||
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #26130: Avrdude doesn't display it's version.
|
||||
* main.c (usage): add a version number display to the default usage
|
||||
message.
|
||||
|
||||
2009-07-01 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #26412: avrdude segfaults when called with a programmer that does not
|
||||
support it
|
||||
* main.c: do not call pgm->perform_osccal() unless it is != 0.
|
||||
|
||||
2009-06-24 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Contributed by Zoltan Laday:
|
||||
patch #6825: xmega problems with JTAGICEmkII
|
||||
* jtagmkII.c: Many fixes for Xmega devices.
|
||||
* jtagmkII_private.h: Add various new constants required for
|
||||
Xmega devices.
|
||||
* avrdude.conf.in: New devices: ATXMEGA64A1, ATXMEGA192A1,
|
||||
ATXMEGA256A1, ATXMEGA64A3, ATXMEGA128A3, ATXMEGA192A3,
|
||||
ATXMEGA256A3, ATXMEGA256A3B, ATXMEGA16A4, ATXMEGA32A4,
|
||||
ATXMEGA64A4, ATXMEGA128A4
|
||||
* avr.c (avr_read, avr_write): Add more names for (Xmega)
|
||||
memory areas that require paged operation.
|
||||
|
||||
2009-06-24 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c (stk600_xprog_write_byte): Handle writing fuse bytes.
|
||||
|
||||
2009-04-28 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Carl Hamilton:
|
||||
* update.c (parse_op): correctly \0-terminate buf after filling
|
||||
it, before it is potentially used as the source of a call to
|
||||
strlen or strcpy.
|
||||
|
||||
2009-04-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* doc/avrdude.texi: Merge the -P 0xXXX option description from
|
||||
avrdude.1.
|
||||
|
||||
2009-04-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: declare AM_PROG_CC_C_O to avoid the warning
|
||||
"compiling `config_gram.c' with per-target flags
|
||||
requires `AM_PROG_CC_C_O' in `configure.ac'"
|
||||
|
||||
2009-03-22 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #25971: "error writing to <stdout>" with multiple -U params.
|
||||
* fileio.c: Do not close the input/output stream when working on an
|
||||
stdio stream.
|
||||
|
||||
2009-02-28 Thomas Fischl <tfischl@gmx.de>
|
||||
|
||||
Based on patch #6484 commited by Jurgis Brigmanis:
|
||||
* usbasp.c: added software control for ISP speed
|
||||
* usbasp.h: (Ditto.)
|
||||
|
||||
2009-02-28 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avr910.c (avr910_read_byte_flash): Eliminate a static variable that
|
||||
hasn't been in use for 5 years.
|
||||
|
||||
2009-02-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Post-release 5.6.
|
||||
|
||||
2009-02-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Prepare for releasing version 5.6.
|
||||
|
||||
2009-02-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Ed Okerson:
|
||||
* jtagmkII.c (jtagmkII_read_byte): Fix signature reading of
|
||||
Xmega.
|
||||
|
||||
2009-02-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Mikael Hermansson:
|
||||
* avrdude.conf.in (ATxmega256A3): new device.
|
||||
* stk500v2 (stk500v2_initialize): Enable the AVRISPmkII as a
|
||||
PDI-capable device for ATxmega parts.
|
||||
|
||||
2009-02-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Lars Immisch:
|
||||
patch #6750: Arduino support - new programmer-id
|
||||
* arduino.c: New file, inherits stk500.c.
|
||||
* arduino.h: New file.
|
||||
* Makefile.am: Add arduino.c and arduino.h.
|
||||
* config_gram.y: Add arduino keyword.
|
||||
* lexer.l: (Ditto.)
|
||||
* avrdude.conf.in: (Ditto.)
|
||||
* avrdude.1: Document the new programmer type.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2009-02-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c: Turn all non-const static data into instance data.
|
||||
|
||||
2009-02-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* Makefile.am: Move term.[ch] from the library into the CLI
|
||||
application section, as it is not useful for anything else but
|
||||
the CLI frontend.
|
||||
|
||||
2009-02-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in (ATmega1284P): new device.
|
||||
|
||||
2009-02-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
More fixes for Solaris, including fixes for the Sunpro compiler:
|
||||
* avr.h: Remove stray semicolon.
|
||||
* configure.ac: Add check for predefined types uint_t and ulong_t.
|
||||
* confwin.c: Include "avrdude.h" on top to avoid empty translation
|
||||
unit warning.
|
||||
* ppwin.c: (Ditto.)
|
||||
* ser_win32.c: (Ditto.)
|
||||
* serbb_win32.c: (Ditto.)
|
||||
* jtagmkII.c (jtagmkII_recv): remove unreachable "return".
|
||||
* stk500.c (stk500_initialize): (Ditto.)
|
||||
* par.c: Test for both, __sun__ and __sun to see whether we are
|
||||
being compiled on Solaris.
|
||||
* ppi.c: (Ditto.)
|
||||
* stk500v2.c: Implement the DEBUG and DEBUGRECV macros in a way
|
||||
that is compatible with the ISO C99 standard.
|
||||
* usbtiny.c: Only typedef uint_t and ulong_t if they have not
|
||||
been found already by the autoconf checks.
|
||||
|
||||
2009-02-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #22204: Solaris10/11 Undefiniertes Symbol gethostbyname socket
|
||||
connect
|
||||
* configure.ac: Add checks for gethostent() and socket().
|
||||
While being here, remove some old cruft left from ancient days.
|
||||
|
||||
2009-02-22 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* lexer.l: Bump the %p size so AT&T lex will continue to work.
|
||||
|
||||
2009-02-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
(Partially) submitted by John Voltz:
|
||||
bug #20004: AVRDUDE update (-U) operations do not close files
|
||||
* fileio.c (fmt_autodetect, fileio): fclose() files.
|
||||
|
||||
2009-02-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usbtiny.c: Replace all but one (very unlikely to trigger) exit(1)
|
||||
by return -1.
|
||||
|
||||
2009-02-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Dick Streefland:
|
||||
patch #6749: make reading from the USBtinyISP programmer more robust
|
||||
* usbtiny.c: Add code to retry failed communication attempts.
|
||||
|
||||
2009-02-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Nick Hibma:
|
||||
bug #22271: usb_reset in usb_libusb.c not necessary in FreeBSD 6.x
|
||||
* usb_libusb.c (usbdev_close): Do not call usb_reset() on FreeBSD.
|
||||
It is not necessary there.
|
||||
|
||||
2009-02-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Andrew O. Shadoura:
|
||||
bug #25156: add direct SPI transfer mode
|
||||
* bitbang.c: Implement direct SPI transfers.
|
||||
* bitbang.h: (Ditto.)
|
||||
* par.c: (Ditto.)
|
||||
* pgm.c: (Ditto.)
|
||||
* pgm.h: (Ditto.)
|
||||
* term.c: Add the "spi" and "pgm" commands.
|
||||
* avrdude.1: Document the changes.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2009-02-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Limor ("Lady Ada"):
|
||||
bug #24749: add support for '328p
|
||||
* avrdude.conf.in (ATmega328P): new device support.
|
||||
|
||||
2009-02-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by "Womo":
|
||||
bug #25241: AT90USB162, AT90USB82 device support patch for avrdude-5.5
|
||||
(also: bug #21745: AT90USBxx2 support)
|
||||
* avrdude.conf.in (AT90USB162, AT90USB82): new device support.
|
||||
|
||||
2009-02-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Evangelos Arkalis:
|
||||
patch #6069: Atmel AT89ISP Cable
|
||||
* avrdude.conf.in (89isp): new programmer support.
|
||||
|
||||
2009-02-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Bob Paddock:
|
||||
patch #6748: ATTiny88 Config
|
||||
* avrdude.conf.in (ATtiny88): new device support.
|
||||
|
||||
2009-02-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Mark Litwack:
|
||||
patch #6261: avrdude won't use dragon/debugwire to write a file
|
||||
to eeprom
|
||||
* jtagmkII.c (jtagmkII_paged_write): when in debugWire mode,
|
||||
implement a paged write to EEPROM as a series of byte writes.
|
||||
|
||||
2009-02-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Janos Sallai:
|
||||
patch #6542: paged_load fails on the MIB510 programming board
|
||||
* stk500.c: Add a workaround for the different signon sequence on
|
||||
MIB510 programmers.
|
||||
|
||||
2009-02-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in: Add the ATmega128RFA1.
|
||||
* avrdude.1: document the addition of ATmega128RFA1.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
|
@ -0,0 +1,354 @@
|
|||
2010-12-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in (ATmega128RFA1): Bump two timing values in order to
|
||||
improve ISP programming stability, in particular with the STK600.
|
||||
|
||||
2010-12-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c (stk500v2_command): Detect warning status codes.
|
||||
|
||||
2010-10-22 Nils Springob <nils@nicai-systems.de>
|
||||
|
||||
* serial.h: serial_open() calls will now return -1 on error (no call to exit())
|
||||
* buspirate.c: (Dito.)
|
||||
* jtagmkII.c: (Dito.)
|
||||
* butterfly.c: (Dito.)
|
||||
* jtagmkI.c: (Dito.)
|
||||
* arduino.c: (Dito.)
|
||||
* avr910.c: (Dito.)
|
||||
* stk500.c: (Dito.)
|
||||
* ser_avrdoper.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* ser_posix.c: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
|
||||
2010-07-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #30566: MinGW + Ubuntu 9.04
|
||||
* stk500v2.c (stk500v2_open): use same condition to refer to the AVR
|
||||
Doper support as used in the definition in ser_avrdoper.c.
|
||||
(Thanks to Christian Starkjohann for the analysis of the problem.)
|
||||
|
||||
2010-07-19 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* buspirate.c: Added compatibility with BusPirate "NewUI" firmware 5.x
|
||||
(contributed by Kari Knuuttila)
|
||||
|
||||
2010-07-12 Nils Springob <nils@nicai-systems.de>
|
||||
|
||||
* avrdude.conf.in (atmega88p): New device.
|
||||
|
||||
2010-06-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #29913: 246 Byte Bug - AVRdude crashes
|
||||
doc/avrdude.texi (Troubleshooting): Mention the libusb 0.1 API
|
||||
wrapper issue that is present in some Linux versions.
|
||||
|
||||
2010-03-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #29263: Can't build avrdude on windows using latest cygwin 1.7.1
|
||||
* doc/avrdude.texi: Remove the recommendation for building
|
||||
Win32 binaries under Cygwin; mention MinGW as an alternative
|
||||
environment.
|
||||
|
||||
2010-03-08 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* ser_posix.c(ser_set_dtr_rts): Fixed DTR on/off to make
|
||||
Arduino auto-reset work. (bug #29108, patch #7100)
|
||||
|
||||
2010-03-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* buspirate.c: Replace printf() by fprintf(stderr)
|
||||
* safemode.c: (Dito.)
|
||||
* usbtiny.c: (Dito.)
|
||||
|
||||
2010-01-22 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Cleanup Cygwin builds.
|
||||
* windows/Makefile.am (loaddrv_LDFLAGS): remove, the -mno-cygwin
|
||||
flag is supposed to be set in CFLAGS by ./configure
|
||||
* configure.ac: add a check for the presence of usleep(), add a
|
||||
check whether the linker accepts -static
|
||||
* avrdude.h: protect prototype for usleep by !defined(HAVE_USLEEP)
|
||||
* ppwin.c (usleep): protect by !defined(HAVE_USLEEP)
|
||||
* main.c: silence "array subscript of type char" compiler warnings
|
||||
by casting all arguments to tolower()/toupper() and isspace()/
|
||||
isdigit()/ispunct() to "int"
|
||||
* butterfly.c: (Dito.)
|
||||
* avr910.c: (Dito.)
|
||||
|
||||
2010-01-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Bump for post-5.10.
|
||||
|
||||
2010-01-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Released version 5.10.
|
||||
|
||||
2010-01-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #28677: Cygwin's GCC no longer supports -mno-cygwin option
|
||||
* configure.ac: For Win32 environments, add a check whether the
|
||||
compiler understands the -mno-cygwin option. If not, don't use
|
||||
it but suggest using a different compiler.
|
||||
|
||||
2010-01-18 David Hoerl <dhoerl@mac.com>
|
||||
|
||||
bug #28660: Problem with loading intel hex rom files that exceed
|
||||
0x10000 bytes
|
||||
* fileio.c: Fix two byte shifts.
|
||||
|
||||
2010-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Michael biebl:
|
||||
* configure.ac: Fix FreeBSD default serial port name.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2010-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c: If entering JTAG mode fails with a bad JTAG ID
|
||||
message, retry with external reset applied (in case the target
|
||||
is in sleep mode or has asserted the JTD bit).
|
||||
|
||||
2010-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Aurelien Jarno:
|
||||
* configure.ac: Fix build for GNU/kFreeBSD.
|
||||
* ppi.c: (Dito.)
|
||||
* par.c: (Dito.)
|
||||
|
||||
2010-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Bump version for post-5.8.
|
||||
|
||||
2010-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Bump version for release 5.8.
|
||||
|
||||
2010-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Soren Jorvang:
|
||||
bug #28611: -i delay not being applied to all serial port
|
||||
bit banging state transitions
|
||||
* serbb_win32.c: Apply ispdelay everywhere.
|
||||
* serbb_posix.c: (Dito.)
|
||||
|
||||
2010-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2_private.h: Implement TPI mode for AVRISPmkII/STK600
|
||||
* config_gram.y: (Dito.)
|
||||
* avrpart.h: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* main.c: (Dito.)
|
||||
* lexer.l: (Dito.)
|
||||
* avrdude.conf.in: Add ATtiny4/5/9/10
|
||||
* avrdude.1: Document TPI and new device support.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2010-01-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by clint fisher:
|
||||
patch #7038: Adding Atmega32U4 Device to avrdude.conf.in
|
||||
* avrdude.conf.in (atmega32u4): New device.
|
||||
* avrdude.1: Document the new device support.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2010-01-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Thomas Pircher:
|
||||
patch #6927: Documentation patches
|
||||
* doc/avrdude.texi: Fix various typos, and remove the last
|
||||
remnants of obsoleted options -i/-o/-m/-f.
|
||||
* avrdude.1: Merge typo fixes from avrdude.texi where
|
||||
applicable.
|
||||
|
||||
2010-01-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.1: Update documentation to match the reality (device
|
||||
support, memory areas).
|
||||
* doc/avrdude.texi: Update documentation to match the
|
||||
reality (device support, programmer support, memory areas).
|
||||
Merge buspirate-specific comments from avrdude.1.
|
||||
* jtagmkII.c: Add some firmware feature checks.
|
||||
|
||||
2010-01-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c: Implement PDI mode support for the JTAG ICE mkII
|
||||
and the AVR Dragon.
|
||||
* jtagmkII.h: (Dito.)
|
||||
* config_gram.y: (Dito.)
|
||||
* jtagmkII_private.h: (Dito.)
|
||||
* avrdude.conf.in: (Dito.)
|
||||
* lexer.l: (Dito.)
|
||||
|
||||
2010-01-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c: Update STK600 routing and socket card data from XML
|
||||
file.
|
||||
|
||||
2010-01-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c: Cleanup the open/close handling to avoid accessing
|
||||
unallocated memory (in the atexit handler) in case of bailing out.
|
||||
* main.c: (Ditto.)
|
||||
|
||||
2010-01-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c: Stylistic changes: move #defines out into
|
||||
jtagmkII_private.h, drop all #if 0 blocks, fold overly long lines,
|
||||
move the *_initpgm() functions to the end of the file; while being
|
||||
here, remove all trailing whitespace.
|
||||
* jtagmkII_private.h: move AVR32 #defines here.
|
||||
|
||||
2010-01-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* bootstrap: autoconf 2.62 works well.
|
||||
|
||||
2010-01-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Various fixes for Xmega devices.
|
||||
* avrdude.conf.in: Correctly declare EEPROM page sizes for
|
||||
all Xmega devices (0x20 instead of 0x100).
|
||||
* avr.c: If a memory region has a page size declared, try
|
||||
using the paged IO routines regardless of the target memory
|
||||
name. Xmega EEPROM requires to be written in paged mode.
|
||||
Correctly use a long (rather than unsigned long) variable to
|
||||
evaluate the success status of the paged mode write attempt.
|
||||
* stk500v2.c: Don't apply TIF space offsets twice (bug #27995:
|
||||
AVRDUDE 5.8svn fails to program and read XMEGA); use
|
||||
stk500v2_loadaddr() prior to paged mode (EEPROM and flash) writes,
|
||||
otherwise programming of flash areas will fail; while being there,
|
||||
check the return value of stk500v2_loadaddr() everywhere; use the
|
||||
correct write/erase mode bits (same as AVR Studio does).
|
||||
|
||||
2010-01-12 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* buspirate.c: Initialise firmware version to v0.0
|
||||
prior to parsing the buspirate banner.
|
||||
|
||||
2010-01-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Clean-up the Xmega erase functions.
|
||||
* jtagmkII_private.h: Add CMND_XMEGA_ERASE as well as
|
||||
the various XMEGA_ERASE_* definitions (from updated
|
||||
appnote AVR067)
|
||||
* jtagmkII.c (jtagmkII_chip_erase): Correctly implement Xmega chip
|
||||
erase based on CMND_XMEGA_ERASE. After erasing an Xmega part, do
|
||||
*not* reinitialize the world, as a subsequent programming
|
||||
operation will fail (for unknown reasons). Actually, this was
|
||||
really only required for ancient AVRs, but doesn't hurt on mega
|
||||
and tiny devices.
|
||||
* jtagmkII.c (jtagmkII_pre_write): Remove, this turned out
|
||||
to be just a chip erase.
|
||||
* jtagmkII.c (jtagmkII_program_disable): Don't try reading
|
||||
"hfuse" for Xmega parts; they don't have it.
|
||||
* main.c (main): Re-enable auto-erase. It's been done
|
||||
before (as "jtagmkII_pre_write") in jtagmkII_paged_write()
|
||||
anyway. Xmega boot and application flash areas should be
|
||||
handled separately in the future, so auto_erase can only
|
||||
affect the area just being programmed.
|
||||
|
||||
2010-01-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* main.c (main): disable safemode for Xmega parts.
|
||||
|
||||
2010-01-12 Michal Ludvig <mludvig@logix.net.nz>
|
||||
|
||||
* buspirate.c: If the BusPirate doesn't respond
|
||||
to a standard a reset command assume it was in binmode
|
||||
and attempt to exit to text mode first.
|
||||
|
||||
2010-01-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* bitbang.c: Fix Win32 build error: move freq up to the file
|
||||
level.
|
||||
* buspirate.c: Fix Win32 build warning: include <malloc.h> to
|
||||
to get a declaration for alloca().
|
||||
|
||||
2010-01-08 Thomas Fischl <tfischl@gmx.de>
|
||||
|
||||
bug #28520: Programming with USBasp with low clock speed fails
|
||||
* usbasp.c: Change blocksize depending on sck frequency to
|
||||
avoid usb transmition timeouts.
|
||||
|
||||
2010-01-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #27505: serbb_posix does not cope with inverted pins
|
||||
* serbb_posix (serbb_highpulsepin): apply PIN_MASK when
|
||||
checking pin numbers.
|
||||
* serbb_win32 (serbb_highpulsepin): (Dito.)
|
||||
|
||||
2010-01-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #28516: Linux/Dragon: Error message on exit
|
||||
* stk500v2.c: Fix the "bad response to GO command:
|
||||
RSP_ILLEGAL_EMULATOR_MODE" message. jtagmkII_close()
|
||||
has been called with the wrong pgm->cookie. Wrap it
|
||||
inside stk500v2_jtagmkII_close(), adjusting the cookie
|
||||
data appropriately.
|
||||
|
||||
2010-01-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Doug:
|
||||
patch #7010: Win32 enhanced bitbang_delay
|
||||
* bitbang.c (bitbang_calibrate_delay, bitbang_delay): On Win32,
|
||||
use the high-resolution performance counter rather than the
|
||||
uneducated delay loop guess if it is available on the target
|
||||
hardware.
|
||||
|
||||
2010-01-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Gerard:
|
||||
patch #6828: Using arbitrary BAUD rates
|
||||
* ser_posix.c (serial_baud_lookup): Allow non-standard baud
|
||||
rates.
|
||||
* ser_win32.c (serial_baud_lookup): (Dito.)
|
||||
|
||||
2010-01-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Eric Trein:
|
||||
bug #27596: AT90s2333 is not correctly supported in avrdude.conf
|
||||
* avrdude.conf.in (at90s2333): add various STK500v2 parameters.
|
||||
|
||||
2010-01-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Gyorgy Szekely:
|
||||
bug #28458: Buffer line is incorrectly released for PP programmers
|
||||
* par.c (par_close): use par_setmany() rather than par_setpin()
|
||||
for PPI_AVR_BUFF.
|
||||
|
||||
2010-01-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Lukasz Goralczyk:
|
||||
bug #27507: SIGSEGV when using avrdragon (avrdude 5.8)
|
||||
* stk500v2.c (stk500v2_dragon_isp_initpgm): Use
|
||||
stk500v2_jtagmkII_setup/stk500v2_jtagmkII_rather than their
|
||||
jtagII counterparts, to get the private data properly
|
||||
initialized.
|
||||
|
||||
2010-01-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* buspirate.c: Cosmetics: remove UTF-8 dashes, adjust for 8-column
|
||||
hard tabs.
|
||||
|
||||
2010-01-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* buspirate.c: add $ Id $ line.
|
||||
* buspirate.h: add $ Id $ line.
|
||||
|
||||
2010-01-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Fix a few warnings that came up recently (some of them only triggered
|
||||
by recent GCC versions).
|
||||
* config_gram.y (parse_cmdbits): "brkt possibly used uninitialized"
|
||||
(GCC errs here)
|
||||
* jtagmkII.c (jtagmkII_reset32): "status possibly used uninitialized"
|
||||
(I think GCC errs, too)
|
||||
* buspirate.c: "pointers differ in signedness" (mismatch between
|
||||
string processing and the use of "unsigned char" throughought the
|
||||
AVRDUDE API)
|
||||
|
||||
2010-01-01 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c (jtagmkII_smc_init32): replace sleep() by usleep() for
|
||||
win32 compatibility.
|
|
@ -0,0 +1,489 @@
|
|||
2011-12-30 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* avrdude.conf.in: Added is_at90s1200 option to part description
|
||||
* doc/avrdude.texi: Added missing options to part definition
|
||||
* config_gram.y: Fixed resetting of is_at90s1200 and is_avr32 flags
|
||||
|
||||
2011-12-30 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7693: Fix config file atmel URLs
|
||||
* avrdude.conf.in: Updated URLs
|
||||
* avrpart.h: Updated URLs
|
||||
* doc/avrdude.texi: Updated URLs
|
||||
|
||||
2011-12-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* ser_posix.c (baud_lookup_table): Conditionalize the inclusion of
|
||||
non-standard baud rates (only baud rates up to B38400 are
|
||||
standardized by the Single UNIX Specification).
|
||||
|
||||
2011-12-29 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #34302: Feature request : device configuration with parent classes
|
||||
* config_gram.y: Added part parent rule and allow overwriting existing
|
||||
data at several places
|
||||
* avrdude.conf.in: Added description comment and m328/m328p as example
|
||||
* avrpart.c: avr_dup_mem-functions now copy buf and tags memory block
|
||||
only they are already allocated.
|
||||
* lexer.l: Added parent as valid token
|
||||
|
||||
(not in original patch)
|
||||
* avrpart.c: New function avr_dup_opcode. avr_dup_mem/avr_dup_part-
|
||||
functions now duplicate the opcodes in their op-array to avoid memory leaks.
|
||||
* doc/avrdude.texi: Added description of part parent feature
|
||||
|
||||
2011-12-29 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7687: Autogenerating programmers and parts lists for docs
|
||||
(generating the parts lists, programmers lists follows later)
|
||||
* doc/Makefile.am: Add rule how to create avrdude before generating parts list
|
||||
|
||||
2011-12-29 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7687: Autogenerating programmers and parts lists for docs
|
||||
(generating the parts lists, programmers lists follows later)
|
||||
* doc/avrdude.texi: Add include of generated table of parts
|
||||
* doc/Makefile.am: Add generating of table of parts in parts.texi
|
||||
* doc/parts_comments.txt: Adding file containing part commenz references
|
||||
* avrdude.1: Remove table of parts and mention "-p ?" option
|
||||
* avrpart.c: Use AVR_DESCLEN for strncasecmp at list sorting
|
||||
|
||||
2011-12-22 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* configure.ac: Add writing of definition of confsubst to config.status,
|
||||
so it can run alone, not only called by configure.
|
||||
|
||||
2011-12-17 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7680: Fixing timeout problem in ser_recv in ser_win32.c
|
||||
* ser_win32.c: Return -1 at timeout in ser_recv().
|
||||
|
||||
2011-12-17 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* config_gram.y: Fixed another memory leak, when define an operation
|
||||
more than once
|
||||
* avrdude.conf.in: Fixed double definition at ATmega6490
|
||||
|
||||
2011-12-17 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* config_gram.y: Restructuring and compacting programmer definition
|
||||
part of grammar (in preparation of patch #7688)
|
||||
|
||||
2011-12-17 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* avrdude.conf.in: Update documentation of programmer definition
|
||||
* doc/avrdude.texi: Update documentation of programmer definition
|
||||
and add list of implemented programmer types
|
||||
|
||||
2011-12-17 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7667: Minor memory handling fixes
|
||||
* config_gram.y: Added several free_token() calls.
|
||||
|
||||
2011-12-16 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7671: Sorting programmers and parts lists for console output
|
||||
* avrdude.conf.in: change part desc of several parts to common pattern
|
||||
AT(mega|tiny|xmega)[0-9]+[A-Z]* (Upper case AT, lower case in middle)
|
||||
* list.[ch]: added sorting function lsort()
|
||||
* pgm.[ch]: added function sort_programmers()
|
||||
* avrpart.[ch]: added function sort_avrparts()
|
||||
* main.c: use sort functions in list_programmers() and list_parts()
|
||||
* main.c: list functions show config file info only at verbose mode
|
||||
|
||||
2011-10-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Replace "cvs" in version number by "svn".
|
||||
|
||||
2011-10-10 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #34518: loading intel hex files > 64k using record-type 4
|
||||
(Extended Linear Address Record)
|
||||
fileio.c: Replace the change from r928 (handling of 0x8000000
|
||||
offset in AVR32 files) by a completely different logic that no
|
||||
longer breaks hex files for other devices starting with an
|
||||
offset; also apply a similar change to S-record files, as well
|
||||
as when writing files.
|
||||
fileio.c: (Ditto.)
|
||||
|
||||
2011-09-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrftdi.c: Remove stray printf()s by fprintf(stderr)
|
||||
* usbtiny.c: (Ditto.)
|
||||
|
||||
2011-09-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Restrict the cyclecounter readout to those cases where
|
||||
it has been explicitly requested (by -y or -Y), rather than always
|
||||
attempting to read the last EEPROM bytes.
|
||||
|
||||
2011-09-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c (stk600_xprog_paged_load, stk600_xprog_paged_write):
|
||||
Fix regression in the AVRISPmkII/STK600 TPI handling introduced
|
||||
by the USBasp's TPI implementation which added a pagesize even for
|
||||
the minor memory regions of TPI devices. Also fix wrong offset
|
||||
introduced by the memory tagging patch.
|
||||
|
||||
2011-09-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avr.c (avr_read, avr_write): Don't bail out on TPI parts if
|
||||
their programmer doesn't provide a (low-level) cmd_tpi method;
|
||||
instead, fall back to the normal programmer methods which are
|
||||
supposed to handle the situation.
|
||||
This fixes a regression where the recent bitbang-TPI implementation
|
||||
broke TPI handling of STK600/AVRISPmkII.
|
||||
|
||||
2011-09-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Mega-commit to bring in memory tagging.
|
||||
Each memory image byte is now tagged as it's being read from a file.
|
||||
Only bytes read from a file will be written or verified (modulo page
|
||||
granularity requirements).
|
||||
* avrpart.h: Add memory tags.
|
||||
* avrpart.c: Allocate and initialize tag area.
|
||||
* update.h: Drop unused parameter "verify" from do_op().
|
||||
* pgm.h: Add parameter base_addr to the paged_load and paged_write
|
||||
methods, respectively.
|
||||
* avr.h: New parameter to avr_read: second AVRPART to verify against.
|
||||
* fileio.c: Track all memory regions that have been read from an
|
||||
input file by tagging them.
|
||||
* update.c: Call avr_read() with the new parameter list.
|
||||
* main.c: Call avr_initmem() to initialize the memory regions, rather
|
||||
than trying to duplicate an unitialized part, and then let the
|
||||
original part rot away.
|
||||
* avr.c: Implement the heart of the new featureset. For paged memory
|
||||
areas, when writing or verifying, call the paged_write and paged_load
|
||||
methods, respectively, once per page instead of on the entire memory.
|
||||
When writing, only write bytes or pages that have content read from a
|
||||
file. Whe verifying, only read memory bytes or pages where the
|
||||
verification data have been read from a file. Only verify those bytes
|
||||
that have been read from a file.
|
||||
* avrftdi.c: Implement the new API for paged_load and paged_write,
|
||||
respectively.
|
||||
* jtagmkII.c: (Ditto.)
|
||||
* butterfly.c: (Ditto.)
|
||||
* jtagmkI.c: (Ditto.)
|
||||
* avr910.c: (Ditto.)
|
||||
* stk500.c: (Ditto.)
|
||||
* usbasp.c: (Ditto.)
|
||||
* stk500v2.c: (Ditto.)
|
||||
* usbtiny.c: (Ditto.)
|
||||
|
||||
2011-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c (stk500v2_command): Treat warnings as errors rather than
|
||||
success.
|
||||
|
||||
2011-08-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #34027: avrdude AT90S1200 Problem (part 3 - documentation)
|
||||
* avrdude.1: Document the programmer type restrictions for AT90S1200
|
||||
devices.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2011-08-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #34027: avrdude AT90S1200 Problem (part 2 - stk500v2 and relatives)
|
||||
* stk500v2.c (stk500v2_initialize): For the AT90S1200, release
|
||||
/RESET for a moment before reinitializing, as this is required by
|
||||
its programming protocol.
|
||||
|
||||
2011-08-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: In AC_CHECK_LIB for libftdi, check for
|
||||
ftdi_usb_get_strings() rathern than ftdi_init(), as this is a more
|
||||
specific thing to search for in order to make sure getting a
|
||||
recent enough libftdi.
|
||||
|
||||
2011-08-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #34027: avrdude AT90S1200 Problem (part 1 - bitbang
|
||||
programmers)
|
||||
* config_gram.y: Introduce new keyword "is_at90s1200".
|
||||
* lexer.l: (Ditto.)
|
||||
* avrdude.conf.in: Applew new keyword to the AT90S1200 device.
|
||||
* avrpart.h: Introduce new flag AVRPART_IS_AT90S1200, reflecting
|
||||
the is_at90s1200 configuration keyword.
|
||||
* bitbang.c (bitbang_initialize): Replace existing test for
|
||||
AT90S1200 by AVRPART_IS_AT90S1200
|
||||
* avr.c (avr_write_byte_default): Avoid the pre-write reading for
|
||||
the AT90S1200, as this appears to sometimes corrupt the high byte
|
||||
by pre-programming the low byte just written into it.
|
||||
|
||||
2011-08-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Bump version for post-5.11.
|
||||
|
||||
2011-08-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Bump version for releasing AVRDUDE 5.11.
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.1: Update the list of supported AVR devices.
|
||||
* doc/avrdude.texi: (Ditto).
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: add -lusb as "other libraries" when checking
|
||||
for libftdi.
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Juergen Weigert:
|
||||
patch #7056: adding support for mikrokopter bootloader to butterfly
|
||||
* butterfly.c: Add some specific logic to handle the
|
||||
mikrokopter.de butterfly bootloader.
|
||||
* butterfly.h: Add one related function declaration.
|
||||
* config_gram.y: Add butterfly_mk keyword.
|
||||
* lexer.l: (Ditto.)
|
||||
* avrdude.conf.in: Add entry for butterfly_mk.
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Stefan Tomanek:
|
||||
patch #7542: add default_bitclock to configuration files
|
||||
* config.c: Add the new keyword and its handling.
|
||||
* config.h: (Ditto.)
|
||||
* config_gram.y: (Ditto.)
|
||||
* avrdude.conf.in: (Ditto.)
|
||||
* main.c: (Ditto.)
|
||||
* lexer.l: (Ditto.)
|
||||
* avrdude.1: Document the change.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Brett Hagman:
|
||||
patch #7603: wiring - programmer type for Wiring boards
|
||||
(based on STK500v2)
|
||||
* wiring.c: New file.
|
||||
* wiring.h: (Ditto.)
|
||||
* Makefile.am: Add new files.
|
||||
* stk500v2_private.h: Reorganize so some functions and struct
|
||||
pdata are globally known.
|
||||
* stk500v2.c: (Ditto.)
|
||||
* stk500v2.h: (Ditto.)
|
||||
* lexer.l: Add new programmer keywords.
|
||||
* config_gram.y: (Ditto.)
|
||||
* avrdude.conf.in: Add "wiring" programmer entry.
|
||||
* avrdude.1: Document the new programmer.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
* AUTHORS: Add Brett Hagman.
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by an anonymous contributor on the mailinglist:
|
||||
* avrdude.conf (jtagkey): Add a definition for the Amontec
|
||||
JTAGKey
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Juergen Weigert:
|
||||
bug #22720: avrdude-5.5 ignores buff settings in avrdude.conf
|
||||
(Note that the actual bug the subject is about has been fixed
|
||||
long ago.)
|
||||
* update.c (do_op): fix a diagnostic message
|
||||
* pgm.h: add exit_datahigh field
|
||||
* par.c: set and act upon the exit_datahigh field
|
||||
* avrdude.1: document the new -E options
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #33811: Parallel make fails
|
||||
* Makefile.am (BUILT_SOURCES): Add this macro.
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #33114: Segfault after setting the DWEN fuse with Dragon
|
||||
* jtagII.c (jtagmkII_getsync): Instead of exit()ing from
|
||||
deep within the tree when detecting the "need debugWIRE"
|
||||
situation, properly pass this up as a return code.
|
||||
* jtagII_private.h (JTAGII_GETSYNC_FAIL_GRACEFUL): New constant.
|
||||
* stk500v2.c (stk500v2_jtagmkII_open): Don't tell anything
|
||||
anymore when receiving a JTAGII_GETSYNC_FAIL_GRACEFUL from
|
||||
jtagmkII_getsync(); silently give up (all necessary has been
|
||||
said already).
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Reported by Jason Hecker:
|
||||
* usbasp.c (libusb_to_errno): Conditionalize some error codes
|
||||
that apparently are lacking on MinGW.
|
||||
|
||||
2011-08-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Fix warnings.
|
||||
* ser_avrdoper.c: add <stdlib.h> so exit() is declared.
|
||||
* usbtiny.c (usbtiny_open): provide an initializer to a
|
||||
"may be used uninitialized" variable (since GCC could not
|
||||
fully detect the logic behind).
|
||||
|
||||
2011-08-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Add a check for FreeBSD's libusb-1.0
|
||||
compatible library that is found in libusb.a/.so on
|
||||
FreeBSD 8+.
|
||||
|
||||
2011-08-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Doug Springer, based on work by
|
||||
Wolfgang Moser, Ville Voipio, Hannes Weisbach
|
||||
patch #7486: Patch to add FT2232C/D, FT2232H, FT4232H,
|
||||
usbvid, usbpid, usbdev for USB support - Based on #7062
|
||||
* avrftdi.c: New file.
|
||||
* avrftdi.h: (Ditto.)
|
||||
* configure.ac: Add check for libftdi.
|
||||
* config_gram.y: Add AVRFTDI and per-programmer USB string
|
||||
keywords.
|
||||
* lexer.l: (Ditto.)
|
||||
* avrdude.conf.in: Add avrftdi and 2232HIO programmers.
|
||||
* pgm.h: Add USB parameters.
|
||||
* Makefile.am: Add avrftdi.c and avrftdi.h.
|
||||
* AUTHORS: Mention the new authors.
|
||||
* avrdude.1: Document the changes.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2011-08-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #29585: Fix license
|
||||
* doc/avrdude.texi: Add FDL as an option to the licensing
|
||||
statement, as the savannah administration would like it
|
||||
that way.
|
||||
|
||||
2011-08-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Darell Tan:
|
||||
patch #7244: TPI bitbang implementation
|
||||
* bitbang.c: Add TPI bitbang stuff.
|
||||
* bitbang.h: (Ditto.)
|
||||
* avr.c: (Ditto.)
|
||||
* avr.h: (Ditto.)
|
||||
* pgm.c: (Ditto.)
|
||||
* pgm.h: (Ditto.)
|
||||
* serbb_posix.c: Wire bitbang_cmd_tpi into the struct pgm.
|
||||
* serbb_win32.c: (Ditto.)
|
||||
* par.c: (Ditto.)
|
||||
* doc/avrdude.texi: Document the TPI bitbang support.
|
||||
|
||||
2011-08-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Grygoriy Fuchedzhy:
|
||||
bug #31779: Add support for addressing usbtinyisp with -P option
|
||||
* usbtiny.c (usbtiny_open): Add logic to distinguish multiple USBtinyISP
|
||||
programmers by their bus:device tuple.
|
||||
* doc/avrdude.texi: Document the new functionality.
|
||||
* avrdude.1: (Ditto.)
|
||||
|
||||
2011-08-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Timon Van Overveldt:
|
||||
bug #30268: Debugwire broken in avrdude-5.10
|
||||
* jtagmkII.c (jtagmkII_initialize): only try setting up a JTAG chain when
|
||||
the programmer is using JTAG.
|
||||
|
||||
2011-08-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #29636: AVRDude issues invalid CMD_CHECK_TARGET_CONNECTION
|
||||
on the AVRISP-MKII
|
||||
* stk500v2.c (stk500v2_program_enable): Rewrite the logic to
|
||||
explain ISP activation failures.
|
||||
* stk500v2_private.h: Fix the various STATUS_* constants;
|
||||
AVR069 and AVR079 disagreed in their values, even though they
|
||||
are apparently implementing the same logic behind.
|
||||
|
||||
2011-08-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #29650: Programming timeouts in ATmega128RFA1 are too slow
|
||||
* avrdude.conf.in (ATmega128RFA1): Bump write delay values for flash and
|
||||
EEPROM to 50 ms.
|
||||
|
||||
2011-08-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in (ATmega8515, ATmega8535, ATmega48, ATmega88, ATmega88P,
|
||||
ATtiny88, ATmega168, ATmega168P, ATmega328P): Bump delay value for STK500v2
|
||||
EEPROM write operation to 5, according to the respective XML files.
|
||||
|
||||
2011-08-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Darcy Houlahan:
|
||||
bug #29694: error in avrdude.conf for attiny84 eeprom
|
||||
* avrdude.conf.in (ATtiny84, ATtiny85): fix A7 bit in EEPROM write
|
||||
command.
|
||||
|
||||
2011-08-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Durant Gilles:
|
||||
* avrdude.conf.in (ATtiny4313): Fix flash addressing bits for manual ISP
|
||||
algorithm.
|
||||
|
||||
2011-08-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Philip:
|
||||
bug #31386: A "BUILD.svn" or similar "how to get started" doc would be helpful
|
||||
* BUILD-FROM-SVN: New file.
|
||||
|
||||
2011-08-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Nic Jones:
|
||||
bug #32539: [Documentation][Patch] Man page is misleading
|
||||
re: Dragon & PDI
|
||||
* doc/avrdude.texi: Update information about PDI connections
|
||||
on AVR Dragon
|
||||
|
||||
2011-08-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usbasp.c: Add <stdint.h> so this actually compiles
|
||||
again.
|
||||
|
||||
2011-08-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Contributed by tixiv@gmx.net:
|
||||
bug #33345: File auto detection as binary doesn't open
|
||||
file in binary mode on Windows
|
||||
* fileio.c: Move the decision about opening files in
|
||||
binary mode until before the fopen() call.
|
||||
|
||||
2011-06-16 Thomas Fischl <tfischl@gmx.de>
|
||||
|
||||
* avrdude.conf.in: Fix part id of ATtiny9.
|
||||
|
||||
2011-05-28 Thomas Fischl <tfischl@gmx.de>
|
||||
|
||||
Based on patch #7440 commited by Slawomir Fraś:
|
||||
* usbasp.c: added TPI support for USBasp
|
||||
* usbasp.h: (Ditto.)
|
||||
|
||||
2011-05-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in: Add support for ATmega168P.
|
||||
|
||||
2011-05-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in: Fix abbreviated name for ATmega324PA.
|
||||
|
||||
2011-05-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Lech Perczak:
|
||||
bug #30946: Added support for ATmega8/16/32U2
|
||||
* avrdude.conf.in: Add ATmega8/16/32U2 entries.
|
||||
|
||||
2011-05-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by David A Lyons:
|
||||
patch #7393: Adding ATtiny4313 Device to avrdude.conf.in
|
||||
* avrdude.conf.in: Add ATtiny4313 data.
|
||||
|
||||
2011-05-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usb_libusb.c: Bump timeout values to allow for slow clock
|
||||
speeds.
|
||||
* jtagmkII.c: (Ditto.)
|
||||
|
||||
2011-03-04 Eric B. Weddington <eric.weddington@atmel.com>
|
||||
|
||||
Thanks to Vitaly Chernookiy for the patch.
|
||||
* avrdude.conf.in: Add support for atmega324pa.
|
||||
* ChangeLog-2010: New file, rotate ChangeLog for new year.
|
|
@ -0,0 +1,729 @@
|
|||
2012-12-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usbdefs.h (USBDEV_BULK_EP_WRITE_STK600)
|
||||
(USBDEV_BULK_EP_READ_STK600): new define values
|
||||
* stk500v2.c (stk600_open): use the STK600 EP values,
|
||||
as they are different from AVRISPmkII
|
||||
|
||||
2012-12-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #37942: Latest SVN can't program in dragon_jtag mode
|
||||
* jtagmkII.c (jtagmkII_initialize): For Xmega devices, and
|
||||
firmware >= 7.x, don't trigger a RESET, in order to work around a
|
||||
firmware bug that appears to be present in at least firmware 7.24
|
||||
for the Dragon.
|
||||
|
||||
2012-12-04 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* config_gram.y: Implement the "ocdrev" keyword
|
||||
* avrpart.c: (Dito)
|
||||
* avrpart.h: (Dito)
|
||||
* lexer.l: (Dito)
|
||||
* avrdude.conf.in: Add "ocdrev" key/value pairs, based
|
||||
on the AS6 XML file information.
|
||||
* jtag3.c: Use the ocdrev in the parameter block.
|
||||
|
||||
2012-12-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c: Make jtag3_command() public
|
||||
* jtag3.h: (Dito.)
|
||||
* jtag3_private.h: Add two new commands
|
||||
* stk500v2.c: Implement the "MonCon disable" hack that
|
||||
allows temporarily falling back to ISP when trying to
|
||||
talk to a part that has debugWIRE enabled
|
||||
|
||||
2012-12-03 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* pickit2.c: reordered #includes for non-usb configuration
|
||||
|
||||
2012-12-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c: Enable interactive adjustment of the various
|
||||
clock frequencies (JTAG Xmega, JTAG megaAVR, PDI Xmega)
|
||||
through the set_sck_period() callback.
|
||||
|
||||
2012-12-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c: Remove unused code that was left over from
|
||||
cloning the jtagmkII.c implementation
|
||||
|
||||
2012-12-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* pgm_type.c: Add "jtagice3_isp" programmer hook
|
||||
* avrdude.conf.in: Add "jtag3isp" programmer
|
||||
* jtag3.c: jtag3_setparm() is now public
|
||||
* jtag3.h: (Dito)
|
||||
* stk500v2_private.h: Command 0x1D is CMD_SPI_MULTI only
|
||||
for STK500v2, AVRISPmkII, and JTAGICEmkII; for JTAGICE3,
|
||||
it's CMD_SET_SCK now; also add CMD_GET_SCK
|
||||
* avrpart.c (avr_get_output_index): New function
|
||||
* avrpart.h: (Dito)
|
||||
* stk500v2.c: Implement the pasthrough programmer glue logic
|
||||
for JTAGICE3 in ISP mode
|
||||
* stk500v2.h: (Dito)
|
||||
* avrdude.1: Document the JTAGICE3 support.
|
||||
|
||||
2012-11-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c (jtag3_read_byte, jtag3_write_byte): Remove the
|
||||
m->offset from addr, JTAGICE3 doesn't need it anymore (similar
|
||||
to JTAGICEmkII with 7+ firmware)
|
||||
* jtag3.c (jtag3_read_byte): Allow for full-page reads of
|
||||
EEPROM also for Xmega and debugWIRE, allow for signature
|
||||
read in debugWIRE
|
||||
|
||||
2012-11-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3_private.h: Add two more error detail codes I stumbled
|
||||
across during development
|
||||
* jtag3.c: (Dito.)
|
||||
* usb_libusb.c: Reduce timeouts from 100 to 10 s, still long
|
||||
enough, but not getting cold feet when something goes wrong.
|
||||
|
||||
2012-11-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c: Handle events returned by the ICE
|
||||
* usbdevs.h: Add defines that mark an event in return
|
||||
from usb_recv_frame().
|
||||
* usb_libusb.c: (Dito.)
|
||||
|
||||
2012-11-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in: Remove "has_jtag" from Xmega A4 and D4
|
||||
devices, as they only have PDI.
|
||||
* jtag3.c (jtag3_page_erase): Actually implement this.
|
||||
|
||||
2012-11-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #37265: wrong page sizes for XMega64xx in avrdude.conf
|
||||
* avrdude.conf.in: Fix page sizes for all Xmega devices,
|
||||
by cross-checking against Atmel Studio's device XML files
|
||||
|
||||
2012-11-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c: Fill in the missing pieces for Xmega support (both,
|
||||
PDI and JTAG).
|
||||
* jtagmkII.c (jtagmkII_set_xmega_params): Use "fuse1" rather
|
||||
than "fuse0" memory space to fill in the NVM offset from, as
|
||||
there is no "fuse0" on some Xmega devices.
|
||||
|
||||
2012-11-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in (ATmega256RFR2, ATmega128RFR2, ATmega64RFR2):
|
||||
New devices
|
||||
|
||||
2012-11-28 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
First support for Atmel JTAGICE3. Guessed from USB sniffer
|
||||
traces made by Knut Schwichtenberg, and by similarity to
|
||||
JTAGICEmkII.
|
||||
Still quite incomplete, just megaAVR/JTAG is done by now.
|
||||
* jtag3.c: New file.
|
||||
* jtag3.h: (Dito.)
|
||||
* jtag3_private.h: (Dito.)
|
||||
* pgm_type.c: Add new programmers
|
||||
* avrdude.conf.in: (Dito.)
|
||||
* usbdevs.h: Add new parameters
|
||||
* Makefile.am: Add new files
|
||||
* usb_libusb.c: Handle separate event endpoint, and larger
|
||||
(USB 2.0) packet sizes
|
||||
|
||||
2012-11-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c: Change all the USB details (endpoint numbers,
|
||||
max transfer size etc.) to a per-programmer adjustable value.
|
||||
* serial.h: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* usbdevs.h: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
|
||||
2012-11-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* buspirate.c: Replace outdated FSF postal address by a reference to
|
||||
the GPL info on their website.
|
||||
* jtagmkII.c: (Dito.)
|
||||
* avrftdi.c: (Dito.)
|
||||
* wiring.c: (Dito.)
|
||||
* linux_ppdev.h: (Dito.)
|
||||
* serbb.h: (Dito.)
|
||||
* usbtiny.h: (Dito.)
|
||||
* confwin.c: (Dito.)
|
||||
* buspirate.h: (Dito.)
|
||||
* avrftdi.h: (Dito.)
|
||||
* wiring.h: (Dito.)
|
||||
* jtagmkII.h: (Dito.)
|
||||
* pickit2.c: (Dito.)
|
||||
* config.c: (Dito.)
|
||||
* term.c: (Dito.)
|
||||
* confwin.h: (Dito.)
|
||||
* avrdude.1: (Dito.)
|
||||
* windows/Makefile.am: (Dito.)
|
||||
* config.h: (Dito.)
|
||||
* pickit2.h: (Dito.)
|
||||
* term.h: (Dito.)
|
||||
* tools/get-hv-params.xsl: (Dito.)
|
||||
* tools/get-stk600-cards.xsl: (Dito.)
|
||||
* tools/get-stk600-devices.xsl: (Dito.)
|
||||
* tools/get-dw-params.xsl: (Dito.)
|
||||
* butterfly.c: (Dito.)
|
||||
* configure.ac: (Dito.)
|
||||
* doc/Makefile.am: (Dito.)
|
||||
* pgm_type.c: (Dito.)
|
||||
* butterfly.h: (Dito.)
|
||||
* jtagmkI.c: (Dito.)
|
||||
* ft245r.c: (Dito.)
|
||||
* COPYING: (Dito.)
|
||||
* pgm_type.h: (Dito.)
|
||||
* jtagmkI.h: (Dito.)
|
||||
* pindefs.h: (Dito.)
|
||||
* config_gram.y: (Dito.)
|
||||
* arduino.c: (Dito.)
|
||||
* arduino.h: (Dito.)
|
||||
* ser_win32.c: (Dito.)
|
||||
* serbb_win32.c: (Dito.)
|
||||
* avr910.c: (Dito.)
|
||||
* stk500.c: (Dito.)
|
||||
* freebsd_ppi.h: (Dito.)
|
||||
* avr910.h: (Dito.)
|
||||
* solaris_ecpp.h: (Dito.)
|
||||
* stk500.h: (Dito.)
|
||||
* jtagmkII_private.h: (Dito.)
|
||||
* avrdude.h: (Dito.)
|
||||
* bitbang.c: (Dito.)
|
||||
* bitbang.h: (Dito.)
|
||||
* avrpart.c: (Dito.)
|
||||
* safemode.c: (Dito.)
|
||||
* stk500generic.c: (Dito.)
|
||||
* serial.h: (Dito.)
|
||||
* avrpart.h: (Dito.)
|
||||
* jtagmkI_private.h: (Dito.)
|
||||
* ppi.c: (Dito.)
|
||||
* avr.c: (Dito.)
|
||||
* safemode.h: (Dito.)
|
||||
* stk500generic.h: (Dito.)
|
||||
* ser_avrdoper.c: (Dito.)
|
||||
* avr.h: (Dito.)
|
||||
* ppi.h: (Dito.)
|
||||
* usbasp.c: (Dito.)
|
||||
* lists.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* my_ddk_hidsdi.h: (Dito.)
|
||||
* tpi.h: (Dito.)
|
||||
* usbasp.h: (Dito.)
|
||||
* lists.h: (Dito.)
|
||||
* stk500v2.h: (Dito.)
|
||||
* ppiwin.c: (Dito.)
|
||||
* fileio.c: (Dito.)
|
||||
* ser_posix.c: (Dito.)
|
||||
* fileio.h: (Dito.)
|
||||
* serbb_posix.c: (Dito.)
|
||||
* usbdevs.h: (Dito.)
|
||||
* par.c: (Dito.)
|
||||
* update.c: (Dito.)
|
||||
* pgm.c: (Dito.)
|
||||
* main.c: (Dito.)
|
||||
* par.h: (Dito.)
|
||||
* update.h: (Dito.)
|
||||
* lexer.l: (Dito.)
|
||||
* Makefile.am: (Dito.)
|
||||
* pgm.h: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
* usbtiny.c: (Dito.)
|
||||
|
||||
2012-11-13 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #35186 inverting pins with "~" doesn't work for pin lists (i.e. vcc)
|
||||
bug #37727 Add support for LM3S811 dev board as a programmer
|
||||
* lexer.l,config_gram.y: accepting inverted pins at pin lists
|
||||
syntax: ~num or ~(num,num,...)
|
||||
* par.c: par_set_many_bits is now usable with inverted pins
|
||||
* avrftdi.c: fixed wrong index in ftdi_pin_name
|
||||
* avrdude.conf.in: added programmer lm3s811
|
||||
|
||||
2012-11-04 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* lexer.l,config_gram.y,config.[hc]: changed reading of numbers to integers
|
||||
except of default_bitclock which is the only real number.
|
||||
No signs are allowed as negative values do not make sense for current
|
||||
config values.
|
||||
* buspirate.c: include own header file buspirate.h
|
||||
* doc/.cvsignore: add programmers.texi to ignore list
|
||||
|
||||
2012-09-06 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* doc/Makefile.am: add EXTRA_DIST, replace $(srcdir) by
|
||||
$(builddir) for generated files, so "make distcheck"
|
||||
works again
|
||||
|
||||
2012-09-05 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* doc/Makefile.am: add $(srcdir) to name of generated files, so BSD make
|
||||
find the files ( GNU make sees no difference if the
|
||||
file is called version.texi or ./version.texi )
|
||||
|
||||
2012-08-15 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7184 Support for PICKit2 programmer
|
||||
* Makefile.am: add pickit2 files
|
||||
* pickit2.[ch]: new programmer implementation
|
||||
* pgm_type.c: add pickit to list
|
||||
* avrdude.1: documentation for pickit2
|
||||
* doc/avrdude.texi: documentation for pickit2
|
||||
* avrdude.conf.in: add pickit2 programmer entry
|
||||
|
||||
2012-08-15 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #30559 Ft232 bit-bang support, see comment #30
|
||||
* ft245r.c: added semaphore workaround for MacOS X,
|
||||
added pthread_testcancel in reader thread
|
||||
|
||||
* configure.ac: added check for TYPE_232H in libftdi (not in libftdi < 0.20)
|
||||
* avrftdi.c: do not use TYPE_232H if not declared
|
||||
|
||||
2012-08-13 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
* avrftdi.c: fixes pin_limit for different FTDI devices (there was a mixup
|
||||
between 2232C and 2232H)
|
||||
|
||||
2012-07-29 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
* avrftdi.c: bugfixes (synchronisation) and maintenance (paged programming,
|
||||
nicer output, separation of parameter checking and actual code)
|
||||
|
||||
2012-07-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c (jtagmkII_memtype): return MTYPE_FLASH rather than
|
||||
MTYPE_SPM for non-Xmega flash regions
|
||||
|
||||
2012-07-20 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
* avrpart.c, avrpart.h: adds avr_pin_name()
|
||||
|
||||
2012-07-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: check for libelf.h also in libelf/
|
||||
* fileio.c: include <libelf/libelf.h> if configure found this
|
||||
to be the case
|
||||
|
||||
2012-06-13 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* configure.ac: Check for presence of <pthread.h>
|
||||
* ft245r.c: Depend on HAVE_PTHREAD_H
|
||||
* Makefile.am: Add -lpthread if needed.
|
||||
|
||||
2012-06-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usbtiny.c (usbtiny_paged_load, usbtiny_paged_write):
|
||||
fix breakage introduced by the recent page handling reorg;
|
||||
it used to cause an infinite loop
|
||||
|
||||
2012-05-04 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Xmega page erase implementation for XPROG (AVRISPmkII, STK600)
|
||||
* stk500v2.c (stk600_xprog_page_erase): New function.
|
||||
|
||||
2012-05-04 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Xmega page erase implementation for JTAGICEmkII
|
||||
* jtagmkII.c: Handle flash pages sizes > 256 bytes, implement
|
||||
page_erase() method
|
||||
* avrdude.conf.in: Change flash pagesize for all Xmega devices
|
||||
to 512 bytes
|
||||
* avr.c: Implement auto_erase, using page_erase if available
|
||||
* avr.h: Remove unused parameters from avr_read(), replace
|
||||
unused parameter in avr_write)() by auto_erase
|
||||
* stk500v2.c: Handle flash page sizes > 256 bytes
|
||||
* update.c (do_op): Handle new updateflags parameter
|
||||
* main.c: Implement auto_erase as page_erase if possible
|
||||
* update.h (enum updateflags): New enum
|
||||
* pgm.h (struct programmer_t): Add page_erase method
|
||||
|
||||
2012-04-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c (jtagmkII_paged_load, jtagmkII_paged_write): fix bug
|
||||
in memory type calculation for Xmega "boot" memory region.
|
||||
|
||||
2012-04-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* update.c (parse_op): do not assume default memtype here
|
||||
* main.c: after locating the part information, determine default
|
||||
memtype for all update options that didn't have a memtype
|
||||
specified; this is "application" for Xmega parts, and "flash" for
|
||||
everything else.
|
||||
|
||||
2012-04-24 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* fileio.c: Rework the way ELF file sections are considered: while
|
||||
scanning the program header table, the offsets from a program
|
||||
header entry must never be used directly when checking the bounds
|
||||
of the current AVR memory region. Instead, they must always be
|
||||
checked based on the corresponding section's entry. That way,
|
||||
Xmega devices now properly take into account whether the segment
|
||||
fits into any of the application/apptable/boot memory region.
|
||||
|
||||
2012-04-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #30756: When setting SUT to 64ms on XMEGA, avrdude doesn't
|
||||
read device signature
|
||||
* main.c: When reading the signature yields 0x000000 or 0xffffff,
|
||||
retry (up to twice) after some progressive delay.
|
||||
|
||||
2012-04-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in (ATxmega16D4, ATxmega32D4, ATxmega64D4,
|
||||
ATxmega128D4): New devices. As Xmega D doesn't feature a fuse0
|
||||
memory cell, move that one out from the generic .xmega part into
|
||||
the individual Xmega A parts.
|
||||
|
||||
2012-04-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #29019: pagel/bs2 warning when uploading using stk500 to xmega
|
||||
* stk500.c (stk500_initialize): Insert dummy values for PAGEL and
|
||||
BS2 if they are not present in the config file, in order to be able
|
||||
to proceed with the stk500_set_extended_parms() anyway.
|
||||
|
||||
2012-04-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2_private.h (struct pdata): add boot_start
|
||||
* stk500v2.c: For the "flash" pseudo-memory of Xmega devices,
|
||||
distinguish addresses between "application" and "boot" area.
|
||||
|
||||
2012-04-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* fileio.c (elf2b): When checking the bounds of the current
|
||||
program header segment, subtract `low' from ph[n].p_paddr in order
|
||||
to correct the magic section offsets for the AVR's non-flash
|
||||
memory regions.
|
||||
|
||||
2012-04-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* fileio.c (elf_get_scn): Rather than trying to just match whether
|
||||
any given section maps straight to a program header segment, use a
|
||||
more sophisticated decision that matches any section as long as it
|
||||
fits into the segment. This is needed for situations where the
|
||||
program header segment spans a larger area than the section data
|
||||
provided. (This can e.g. happen in an ELF file that contains no
|
||||
data at address 0, like a bootloader only.)
|
||||
|
||||
2012-04-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #28744: Can't load bootloader to xmega128a1 (part 2, fix for
|
||||
firmware >= V7.x)
|
||||
* jtagmkII.c: Add firmware-version dependent handling of Xmega parameters.
|
||||
V7.x firmware expects the NVM offsets being specified through the Xmega
|
||||
parameters command, but left out as part of the memory address itself.
|
||||
* jtagmkII_private.h: Add CMND_SET_XMEGA_PARAMS, and struct xmega_device_desc.
|
||||
* config_gram.y: Add mcu_base keyword.
|
||||
* avrpart.h: (Dito.)
|
||||
* lexer.l: (Dito.)
|
||||
* avrdude.conf.in (.xmega): add mcu_base, and data memory segment.
|
||||
|
||||
2012-03-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #28744: Can't load bootloader to xmega128a1 (part 1, fix for
|
||||
firmware < V7.x)
|
||||
* jtagmkII.c: When going to write to the boot section of flash,
|
||||
use MTYPE_BOOT_FLASH rather than MTYPE_FLASH
|
||||
* jtagmkII_private.h: add MTYPE_BOOT_FLASH constant
|
||||
|
||||
2012-03-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII_private.h: Sort commands, response codes and events
|
||||
into numerical order.
|
||||
|
||||
2012-03-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #30451: Accessing some Xmega memory sections gives not
|
||||
supported error
|
||||
* stk500v2.c: Handle all Xmega memory sections (except
|
||||
"prodsig" which is not documented in AVR079)
|
||||
* fileio.c: Treat the "boot", "application", and "apptable"
|
||||
regions (which are actually subregions of "flash") all as
|
||||
being flash, i.e. suppress trailing 0xFF bytes when reading
|
||||
them
|
||||
* avr.c: (Dito.)
|
||||
|
||||
2012-03-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c (jtagmkII_close): The GO command before signing off
|
||||
turned out to be not required for normal megaAVR devices, and to
|
||||
cause the exact opposite (i.e. the target stopping) on Xmega
|
||||
devices being programmed to JTAG. However, programming Xmega
|
||||
devcies through PDI *does* need the GO command.
|
||||
|
||||
2012-03-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Print a configuration summary at the end of the
|
||||
configure run
|
||||
|
||||
2012-02-11 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7718: Merge global data of avrftdi in a private data structure
|
||||
* avrftdi.[ch]: moved global data into private data structure, moved
|
||||
private defines from header file into source file
|
||||
|
||||
2012-02-06 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7720 Bug in EEPROM write
|
||||
* avrftdi.c: fixed wrong buffer address initialization in paged_write
|
||||
* fileio.c: added #include <stdint.h>
|
||||
|
||||
2012-02-05 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #30559 Ft232 bit-bang support
|
||||
* ft245r.c: cancel reader thread before exiting program
|
||||
|
||||
2012-02-04 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7717 avrftdi_flash_write is broken
|
||||
* avrftdi.c: fixed wrong buffer address initialization in paged_write
|
||||
bug #35296 Extraneous newlines in output.
|
||||
* main.c: fixed output of newlines at 100% progress
|
||||
|
||||
2012-02-03 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7715 FT4232H support
|
||||
* avrdude.conf.in: added programmer 4232h
|
||||
|
||||
2012-02-03 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7687: Autogenerating programmers and parts lists for docs
|
||||
(generating the programmers lists)
|
||||
* doc/avrdude.texi: Add include of generated table of programmers
|
||||
* doc/Makefile.am: Add generating of table of programmers in programmers.texi
|
||||
|
||||
2012-02-03 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #34768 Proposition: Change the name of the AVR32 devices
|
||||
* avrdude.conf.in: renamed ucr2 to uc3a0512
|
||||
* avrpart.c: added cast to avoid compiler warning
|
||||
|
||||
2012-02-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* fileio.c (fileio_elf): Fix a copy'n-paste-o.
|
||||
|
||||
2012-02-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* par.c (par_desc): Move to end of file, outside the #if
|
||||
HAVE_PARPORT
|
||||
|
||||
2012-02-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Implement ELF file reading (finally). Requires libelf(3) to be
|
||||
present on the host system.
|
||||
* configure.ac (HAVE_LIBELF): Add logic to detect presence of
|
||||
libelf(3)
|
||||
* Makefile.am (avrdude_LDADD): Add @LIBELF@
|
||||
* fileio.h (FILEFMT): add FMT_ELF
|
||||
* fileio.c: Implement ELF file reader.
|
||||
* update.c (parse_op): add 'e' format specifier
|
||||
* avrdude.1: Document the ELF file reading capability
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2012-02-01 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #30559 Ft232 bit-bang support
|
||||
* ft245r.[ch]: new programmer type implementation
|
||||
* configure.ac: add pthread as link library
|
||||
* avrdude.conf.in: added some new programmers
|
||||
* Makefile.am: added new source files to compile
|
||||
* pindefs.h: change PIN_MASK, PIN_INVERSE to highest bit of unsigned int
|
||||
* pgm.[ch]: added generic function to print pin assignments (taken from par.c)
|
||||
* par.c: moved pin assigment print function to pgm.c
|
||||
|
||||
2012-02-01 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* lexer.l: Sort keyword tokens into alphabetic order.
|
||||
|
||||
2012-01-31 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* config_gram.y, lexer.l: removed unused ID/TKN_ID definitions
|
||||
* config.[hc]: removed unused function id(), use value.type to select
|
||||
values
|
||||
|
||||
2012-01-31 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7437 modifications to Bus Pirate module
|
||||
patch #7686 Updating buspirate ascii mode to current firmware, use AUX
|
||||
as clock generator, and setting of serial receive timeout
|
||||
* buspirate.c: added paged_write, changed binary mode setup/detection,
|
||||
added clock output on AUX pin
|
||||
* avrdude.1: updated documentation
|
||||
* doc/avrdude.texi: updated documentation
|
||||
|
||||
2012-01-31 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
Parser does not need to know all programmer types now, new programmers
|
||||
will update only the table in pgm_type.c.
|
||||
* config_gram.y, lexer.l: removed programmer type keywords,
|
||||
use now locate_programmer_type() function
|
||||
* pgm_type.[ch]: added new files for table of programmer types
|
||||
* main.c: allow list of programmer types by -c ?type
|
||||
* avrdude.conf.in: changed all type keywords to quoted strings
|
||||
* doc/avrdude.texi: changed description of type definition, list
|
||||
of valid types is now included from generated file
|
||||
* doc/Makefile.am: generate list of programmer types for doc
|
||||
* all programmers [hc]: add xxx_desc string for description of programmer
|
||||
|
||||
2012-01-30 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* configure.ac: fixed detection of yylex_destroy availability
|
||||
by checking the version number of flex; bump required autoconf
|
||||
version to 2.60 (for AC_PROG_SED)
|
||||
|
||||
2012-01-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* lexer.l: Replace the old, now-defunct #define YY_NO_UNPUT by
|
||||
the new %option nounput. This gets rid of a compiler warning.
|
||||
|
||||
2012-01-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Add a connection_type attribute to each programmer, rather than
|
||||
trying to hard-code the default port name in main.c.
|
||||
* pgm.h: Add conntype to struct pgm.
|
||||
* lexer.l: Extend grammar for connection_type.
|
||||
* config_gram.y: (Dito.)
|
||||
* config.h: Add DEFAULT_USB, for symmetry with default_parallel
|
||||
and default_serial.
|
||||
* main.c: Replace old default portname hack by avrdude.conf-based
|
||||
knowledge.
|
||||
* usbtiny.c: Drop an old hack that's no longer necessary.
|
||||
* avrdude.conf.in: Add connection_type to each programmer
|
||||
definition.
|
||||
|
||||
2012-01-27 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* avrdude.conf.in: used parent parts for some other parts, added
|
||||
abstract .xmega part as parent for xmegas
|
||||
* main.c: hide parts starting with '.' from parts list
|
||||
|
||||
2012-01-22 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7688: Implement parent programmers feature
|
||||
* avrdude.conf.in: updated documentation comment and some programmers
|
||||
have now parents
|
||||
* config_gram.y: initpgm will now called at first use of programmer
|
||||
in main. parser sets only the function pointer in the pgm structure.
|
||||
Pin and pin lists definitions can now be empty to remove the parents
|
||||
setting.
|
||||
* doc/avrdude.texi: updated documentation
|
||||
* main.c: added call to pgm->initpgm after locate_programmer
|
||||
* pgm.[hc]: added field initpgm in structure, added function pgm_dup
|
||||
|
||||
2012-01-21 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #21797: AT90PWM316: New part description
|
||||
* avrdude.conf.in: added pwm316 with parent pwm3b but 16KB flash
|
||||
|
||||
2012-01-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Check for presence of lusb_usb.h as an alternative
|
||||
to usb.h; libusb-win32 switched to this name in version 1.2.5.0.
|
||||
* avrftdi.c: Decide whether to include <usb.h>, or <lusb0_usb.h>.
|
||||
* ser_avrdoper.c: (Dito.)
|
||||
* usbasp.c: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
* usbtiny.c: (Dito.)
|
||||
|
||||
2012-01-19 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* avr.c: Unsigned variable was used for return code of paged_write/load
|
||||
functions. So a negative return code led never to a fallback to byte
|
||||
functions.
|
||||
|
||||
2012-01-17 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #34302: Feature request : device configuration with parent classes
|
||||
* config_gram.y: if memory section is overwritten old entry is removed
|
||||
|
||||
(not in original patch)
|
||||
* config_gram.y: if programmer or part is defined twice, a warning is
|
||||
output and the first instance is removed
|
||||
|
||||
General cleanup and free functions, so valgrind does not report any lost
|
||||
blocks at program end.
|
||||
* avrpart.[hc]: added avr_free_(opcode|mem|part) functions
|
||||
* pgm.[hc]: added pgm_free function
|
||||
* update.[hc]: added free_update functions
|
||||
* config.[hc]: added cleanup_config function, use yylex_destroy to reset
|
||||
the lexer after usage. (So it can be reused.)
|
||||
* main.c: add cleanup_main function which is called by atexit() (This
|
||||
frees all lists so that at program exit only really lost memory is
|
||||
reported by valgrind.)
|
||||
* usbasp.c: added libusb_free_device_list() and libusb_exit() calls to
|
||||
avoid lost memory
|
||||
* buspirate.c: moved memory allocation from initpgm to setup and added
|
||||
free in teardown
|
||||
* configure.ac: add definition of HAVE_YYLEX_DESTROY if $LEX is flex.
|
||||
* Makefile.am: added . in front of SUBDIRS to build avrdude before trying
|
||||
to use it for creating the part list for the docs.
|
||||
|
||||
2012-01-17 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* usbasp.c: USB vid/pid/vendor/product from config file are used, for
|
||||
id "usbasp" nibobee and old usbasp are tried as they were currently
|
||||
implemented within usbasp
|
||||
* avrdude.conf.in: added usb params to "usbasp", added new entry "nibobee"
|
||||
with params which were hardcoded in usbasp.c, and added an entry
|
||||
"usbasb-clone" which only checks vid/pid.
|
||||
|
||||
2012-01-10 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #35261 avrftdi uses wrong interface in avrftdi_paged_(write|load)
|
||||
* avrftdi.c: Fixed interface and implementation of avrftdi_paged_(write|load)
|
||||
patch #7672 adding support for O-Link (FTDI based JTAG) as programmer
|
||||
* avrdude.conf.in: added o-link entry
|
||||
|
||||
2012-01-10 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7699 Read additional config files
|
||||
* main.c: Added reading of additional config files
|
||||
* avrdude.1: updated man page
|
||||
* doc/avrdude.texi: updated documentation
|
||||
|
||||
2012-01-10 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Bob Frazier:
|
||||
bug #35208: avrdude 5.11 on freebsd 8.2-STABLE does not reset
|
||||
Arduino Uno properly
|
||||
* arduino.c (arduino_open): Bump the timeout between pulling
|
||||
the DTR and RTS lines low and high.
|
||||
|
||||
2012-01-08 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
Fixed following findings reported by cppcheck
|
||||
* avr910.c:625 (error) Possible null pointer dereference: cmd - otherwise it is redundant to check if cmd is null at line 624
|
||||
* avr910.c:626 (error) Possible null pointer dereference: cmd - otherwise it is redundant to check if cmd is null at line 624
|
||||
* avr910.c:168 (information) The scope of the variable 'devtype_1st' can be reduced
|
||||
* avr910.c:169 (information) The scope of the variable 'dev_supported' can be reduced
|
||||
* avrftdi.c:647 (error) Using sizeof for array given as function argument returns the size of pointer.
|
||||
* stk500v2.c:3347 (error) Memory leak: b
|
||||
* stk500v2.c:3452 (error) Memory leak: b
|
||||
* usbasp.c:554 (error) Using sizeof for array given as function argument returns the size of pointer.
|
||||
* usbasp.c:485 (information) The scope of the variable 'dly' can be reduced
|
||||
|
||||
2012-01-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Reported by Jason Kotzin:
|
||||
* usbasp.c (usbasp_spi_paged_load, usbasp_spi_paged_write):
|
||||
Fix buffer address calculation.
|
||||
|
||||
2012-01-03 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7629 add support for atmega48p
|
||||
* avrdude.conf.in: Added m48p with parent m48 + different signature
|
||||
|
||||
* avrdude.conf.in: made part parents (m88p = m88 + different signature,
|
||||
m168p = m168 + different signature)
|
||||
|
||||
2012-01-02 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #21663 AT90PWM efuse incorrect
|
||||
bug #30438 efuse bits written as 0 on at90pwmxx parts
|
||||
* avrdude.conf.in: (pwm2, pwm2b, pwm3, pwm3b) <efuse.write>: Write
|
||||
eight bits
|
||||
|
||||
* avrdude.conf.in: made part parents (pwm3 = pwm2, pwm3b = pwm2b,
|
||||
pwm2b = pwm2 + different signature)
|
||||
|
||||
* ChangeLog-2011: New file, rotate ChangeLog for new year.
|
|
@ -0,0 +1,618 @@
|
|||
2013-12-15 Nils Springob <nils@nicai-systems.de>
|
||||
|
||||
* pgm.c/pgm.h: fixed syntax error in const pointer to const
|
||||
|
||||
2013-12-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: bump version to 6.1-svn-20131205
|
||||
|
||||
2013-12-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #40817: Elf file support (possibly) not working on 6.0.1 windows build
|
||||
* fileio.c (fileio): open file in binary mode also for FMT_ELF
|
||||
|
||||
2013-12-04 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
Rework of bitbanging functions setpin, getpin, highpulsepin to make simplier use
|
||||
of new pindefs data in pgm structure
|
||||
* linuxgpio.c, bitbang.c, buspirate.c, par.c, pgm.h, term.c, serbb_*.c: changed
|
||||
interface of setpin, getpin, highpulsepin to take pin function as parameter
|
||||
(not the real number, which can be found by pgm->pinno[function])
|
||||
|
||||
2013-11-30 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #40748 linuxgpio doesn't work on Raspberry PI rev. 2.
|
||||
* linuxgpio.c: fixed check for unused pins to ignore the inverse flag
|
||||
* pindefs.c: fixed fill_old_pinlist to not create an empty mask with inverse flag set
|
||||
|
||||
2013-10-18 Nils Springob <nils@nicai-systems.de>
|
||||
|
||||
* avrdude.conf.in (atmega1284): ATmega1284 variant added (same as ATmega1284p but with different signature)
|
||||
|
||||
2013-09-25 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
First part of patch #7720:
|
||||
* avrdude.conf.in: Add UM232H and C232H programmers
|
||||
|
||||
2013-09-22 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Daniel Rozsnyo:
|
||||
bug #40085: Typo fix in fuses report (for 6.1-svn-20130917)
|
||||
* main.c: Fix a typo.
|
||||
|
||||
2013-09-19 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
task #12798: Please cleanup #ifdef notyet entries in avrftdi.c
|
||||
* avrftdi.c: ditto.
|
||||
avrftdi.c: Remove DRYRUN-option.
|
||||
|
||||
2013-09-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #40055: AVRDUDE segfaults when writing eeprom
|
||||
* main.c: Always clear the UF_AUTO_ERASE flag if either a
|
||||
non-Xmega device was found, or the programmer does not offer a
|
||||
page_erase method.
|
||||
|
||||
2013-09-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version to post-6.0.
|
||||
|
||||
2013-09-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version to 6.0.
|
||||
|
||||
2013-09-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c (jtag3_initialize): Fix a buffer overflow by limiting
|
||||
the flash page cache size to at most "readsize". For Xmegas with
|
||||
a page size of 512 bytes, the maximum USB packet size was
|
||||
overflowed, and subsequently, a memmove copied beyond the end of
|
||||
the allocated buffer.
|
||||
* jtag3.c (jtag3_read_byte): Add the correct offset also for the
|
||||
various flash regions, so reading the apptable or boot regions
|
||||
yields the correct data.
|
||||
|
||||
2013-09-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Joakim Lubeck:
|
||||
bug #40040: Support for ATtiny20 and ATtiny40
|
||||
* avrdude.conf.in: Restructure the reduced-core tiny devices
|
||||
to use a common entry .reduced_core_tiny; add ATtiny20 and
|
||||
ATtiny40
|
||||
|
||||
2013-09-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Joakim Lubeck:
|
||||
bug #40033: Support for the XMegaE5 family
|
||||
* avrdude.conf.in (ATxmega8E5, ATxmega16E5, ATxmega32E5): New
|
||||
entries.
|
||||
|
||||
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c (stk500v2_set_sck_period): Revamp this to match the
|
||||
description/pseudo-code in appnote AVR068.
|
||||
|
||||
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Stephen Roe:
|
||||
patch #7710: usb_libusb: Check VID/PID before opening device
|
||||
* usb_libusb.c (usbdev_open): Swap the sequence of verifying the
|
||||
VID:PID, and opening the device.
|
||||
|
||||
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #8176: butterfly.c (AVR109 protocol implementation) clean-up and bug-fixing
|
||||
* butterfly.c (butterfly_page_erase): Add dummy function to avoid
|
||||
segfault when writing to EEPROM.
|
||||
|
||||
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #35474 Feature request: print fuse values in safemode output
|
||||
* config_gram.y: New configuration token "default_safemode".
|
||||
* lexer.l: (Dito.)
|
||||
* avrdude.conf.in: (Dito.)
|
||||
* config.h: Add variable default_safemode.
|
||||
* config.c: (Dito.)
|
||||
* main.c: Handle default_safemode, including -u option.
|
||||
* avrdude.1: Document all this.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by HubertB:
|
||||
patch #7657 Add ATmega406 support for avrdude using DRAGON + JTAG
|
||||
* avrdude.conf.in (ATmega406): New entry.
|
||||
|
||||
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Marc de Hoop:
|
||||
patch #7606 ATtiny43u support
|
||||
* avrdude.conf.in (ATtiny43U): New entry.
|
||||
|
||||
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #5708 avrdude should make 10 synchronization attempts instead of just one
|
||||
* stk500.c (stk500_getsync): Loop 10 times trying to get in
|
||||
sync with the programmer.
|
||||
|
||||
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Contributed by Ricardo Martins:
|
||||
bug #36384 ATxmega32A4 usersig size
|
||||
* avrdude.conf.in: Revamp all the ATxmega* entries. Add new
|
||||
entries for ATxmega128A1U, ATxmega128A3U, ATxmega128A4U,
|
||||
ATxmega128B1, ATxmega128B3, ATxmega128C3, ATxmega128D3,
|
||||
ATxmega16A4U, ATxmega16C4, ATxmega192A3U, ATxmega192C3,
|
||||
ATxmega192D3, ATxmega256A3BU, ATxmega256A3U, ATxmega256C3,
|
||||
ATxmega256D3, ATxmega32A4U, ATxmega32C4, ATxmega384C3,
|
||||
ATxmega384D3, ATxmega64A1U, ATxmega64A3U, ATxmega64A4U,
|
||||
ATxmega64B1, ATxmega64B3, ATxmega64C3, ATxmega64D3
|
||||
|
||||
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #35456 The progress bar for STK500V2 programmer is "wrong".
|
||||
* avr.c (avr_read, avr_write): Change the progress reporting for
|
||||
paged read/write from per-address to per-considered-page. This
|
||||
ought to give a realistic estimation about the time still to be
|
||||
spent.
|
||||
|
||||
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #34277: avrdude reads wrong byte order if using avr911 (aka butterfly)
|
||||
* butterfly.c (butterfly_read_byte_flash): Swap bytes received.
|
||||
|
||||
2013-09-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #37768 Poll usbtiny 100 times at init time to handle low-clock devices
|
||||
* doc/avrdude.texi: Add a FAQ entry about how to connect to a
|
||||
target where the firmware has reduced the internal clock speed.
|
||||
|
||||
2013-09-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #28344 chip_erase_delay too short for ATmega324P, 644, 644P, and 1284P
|
||||
* avrdude.conf: Bump the chip_erase_delay for all ATmega*4 devices
|
||||
to 55 ms. While the datasheet still claims 9 ms, all the XML files
|
||||
tell either 45 or 55 ms, depending on STK600 or not.
|
||||
|
||||
2013-09-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* fileio.c (fileio): Don't exit(1) if something goes wrong; return
|
||||
-1 instead. Don't refer to obsolete option -f to specify the file
|
||||
format.
|
||||
|
||||
2013-09-10 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Matthias Trute:
|
||||
bug #36901 flashing Atmega32U4 EEPROM produces garbage on chip
|
||||
* avrdude.conf.in (ATmega32U4): Fix EEPROM pagesize to 4, the
|
||||
datasheet is wrong here.
|
||||
|
||||
2013-09-09 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: check for ar and ranlib in the target tool
|
||||
namespace, rather than on the host.
|
||||
|
||||
2013-09-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Fix byte-wise EEPROM and flash writes on Xmega
|
||||
* jtagmkII_private.h (MTYPE_EEPROM_XMEGA): New memory type.
|
||||
* jtagmkII.c (jtagmkII_write_byte): For Xmega EEPROM, use
|
||||
memory type MTYPE_EEPROM_XMEGA; for flash writes, always
|
||||
write 2 bytes starting on an even address.
|
||||
|
||||
2013-09-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* term.c: Implement the "verbose" terminal mode command.
|
||||
* avrdude.1: Document this.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2013-09-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c (jtag3_write_byte): Do not attempt to start the paged
|
||||
algorithm for EEPROM when being connected through debugWIRE.
|
||||
|
||||
2013-09-06 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Extend the single-byte algorithm to all devices, both flash and
|
||||
EEPROM. (Flash cells must have been erased before though.)
|
||||
* jtag3.c (jtag3_initialize): OCDEN no longer needs to be
|
||||
considered; a session with "programming" purpose is sufficient
|
||||
* jtag3.c (jtag3_write_byte): Use the paged algorithm for all
|
||||
flash and EEPROM areas, not just Xmega.
|
||||
|
||||
2013-09-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Fix single-byte EEPROM updates on Xmega:
|
||||
* jtag3_private.h (MTYPE_EEPROM_XMEGA): New define.
|
||||
* jtag3.c (jtag3_write_byte): When updating flash or
|
||||
EEPROM on Xmega devices, resort to jtag3_paged_write()
|
||||
after filling and modifying the page cache.
|
||||
* jtag3.c (jtag3_paged_write): use MTYPE_EEPROM_XMEGA
|
||||
where appropriate.
|
||||
* jtag3.c (jtag3_initialize): Open with debugging intent
|
||||
for Xmega devices, so single-byte EEPROM updates will
|
||||
work.
|
||||
|
||||
2013-09-04 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Matthias Neeracher:
|
||||
bug #38732: Support for ATtiny1634
|
||||
* avrdude.conf.in (ATtiny1634): New entry.
|
||||
|
||||
2013-09-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Brane Ždralo:
|
||||
patch #7769: Write flash fails for AVR910 programmers
|
||||
* avr910.c (avr910_paged_write): Fix flash addresses in
|
||||
'A' command.
|
||||
|
||||
2013-09-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Fred (magister):
|
||||
bug #38951: AVR109 use byte offset instead of word offset
|
||||
patch #8045: AVR109 butterfly failing
|
||||
* butterfly.c (butterfly_paged_load, butterfly_paged_write):
|
||||
fix calculation of 'A' address when operating on flash memory.
|
||||
It must be given in terms of 16-bit words rather than bytes.
|
||||
|
||||
2013-09-03 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* avrftdi.c, avrftdi_private.h: added tx buffer size, and use
|
||||
smaller block sizes as larger sometimes hang
|
||||
|
||||
2013-09-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.h: Remove the erase cycle counter (options -y / -Y).
|
||||
* avr.c: (Dito.)
|
||||
* main.c: (Dito.)
|
||||
* avrdude.1: Undocument -y / -Y.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2013-09-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #39691 Buffer overrun when reading EEPROM byte with JTAGICE3
|
||||
* jtag3.c (jtag3_initialize): initialize the eeprom_pagesize
|
||||
private attribute so the page cache will actually be usable
|
||||
|
||||
2013-09-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #38580 Current svn head, xmega and fuses, all fuses tied to fuse0
|
||||
* jtag3.c (jtag3_read_byte, jtag3_write_byte): Correctly apply the
|
||||
relevant part of mem->offset as the address to operate on.
|
||||
|
||||
2013-09-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* fileio.c: Fix "unused variable" warnings.
|
||||
* avr.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* stk500.c: (Dito.)
|
||||
* jtagmkII.c: (Dito.)
|
||||
* term.c: (Dito.)
|
||||
* ser_posix.c: (Dito.)
|
||||
|
||||
2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Travis Griggs:
|
||||
bug #38307: Can't write usersig of an xmega256a3
|
||||
* stk500v2.c (stk600_xprog_page_erase): allow erasing the usersig space.
|
||||
|
||||
2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Robert Niemi:
|
||||
bug #35800: Compilation error on certain systems if parport is disabled
|
||||
* linux_ppdev.h: Conditionalize inclusion of <linux/parport.h> and
|
||||
<linux/ppdev.h> on HAVE_PARPORT
|
||||
|
||||
2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #39794: warnings when building avrdude 6.0rc1 under CentOS 6.4
|
||||
* pickit.c (usb_open_device): Use %p rather than %X to print "handle"
|
||||
which is a pointer
|
||||
* jtag3.c (jtag3_initialize): Initialize "flashsize" to be sure it
|
||||
proceeds with a valid value.
|
||||
|
||||
2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #39794: warnings when building avrdude 6.0rc1 under CentOS 6.4
|
||||
* buspirate.c: Turn the "cmd" argument of the various methods into
|
||||
a "const unsigned char *"; while doing this, declare all arrays being
|
||||
passed as arguments to be pointers rather than arrays, as the latter
|
||||
obfuscates the way arrays are being passed to a callee in C.
|
||||
* avrftdi.c: (Dito.)
|
||||
* pickit2.c: (Dito.)
|
||||
* ft245r.c: (Dito.)
|
||||
* avr910.c: (Dito.)
|
||||
* stk500.c: (Dito.)
|
||||
* bitbang.c: (Dito.)
|
||||
* bitbang.h: (Dito.)
|
||||
* avrftdi_tpi.c: (Dito.)
|
||||
* avrftdi_tpi.h: (Dito.)
|
||||
* usbasp.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* pgm.h: (Dito.)
|
||||
* usbtiny.c: (Dito.)
|
||||
|
||||
2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #38023: avrdude doesn't return an error code when attempting
|
||||
to upload an invalid Intel HEX file
|
||||
* fileio.c (ihex2b): Turn the "No end of file record found" warning
|
||||
into an error if no valid record was found at all.
|
||||
|
||||
2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Claus-Justus Heine:
|
||||
bug #38713: Compilation of the documentation breaks with texinfo-5
|
||||
* doc/avrdude.texi: Turn @itemx into @item, add @headitem to STK600
|
||||
Routing/Socket card table
|
||||
|
||||
2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usbasp.c: Add trace output for -vvv to non-TPI functions, too.
|
||||
|
||||
2013-09-01 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usbasp.c (usbasp_tpi_paged_load): Calculate correct
|
||||
buffer address.
|
||||
* usbasp.c (usbasp_tpi_paged_write): Calculate correct
|
||||
buffer address; don't issue a SECTION_ERASE command for
|
||||
each page (a CHIP_ERASE has been done before anyway);
|
||||
remove the code that attempted to handle partial page
|
||||
writes, as all writes are now done with a full page.
|
||||
|
||||
2013-09-01 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usbasp.c: Add more trace output, by now only for the TPI
|
||||
functions.
|
||||
|
||||
2013-08-31 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usbasp.c (usbasp_transmit): Add -vvvv trace output.
|
||||
|
||||
2013-08-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #39893: Verification failure with AVRISPmkII and Xmega
|
||||
* stk500v2.c (stk600_xprog_page_erase): Fix argument that is
|
||||
passed to stk600_xprog_memtype()
|
||||
|
||||
2013-07-11 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* fileio.c (elf2b): replace elf_getshstrndx() by
|
||||
elf_getshdrstrndx() as the former one is deprecated
|
||||
|
||||
2013-06-19 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
use bitbanging on ftdi mpsse when wrong pins are used
|
||||
* avrftdi.c, avrftdi_private.h: added additional pin check
|
||||
and bitbanging fallback
|
||||
* pindefs.[ch]: added a flag to enable/disable output
|
||||
* ft245r.c: changes because of added flag above
|
||||
|
||||
2013-05-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by "Malte" and John McCorquodale:
|
||||
patch #7876 JTAGICE mkII fails to connect to attiny if debugwire
|
||||
is enabled AND target has a very slow clock
|
||||
* jtagmkII.c (jtagmkII_getsync): When leaving debugWIRE mode
|
||||
temporarily, immediately retry with ISP, rather than leaving.
|
||||
* stk500v2 (stk500v2_program_enable): Implemented similar logic
|
||||
for the JTAGICE3.
|
||||
|
||||
2013-05-16 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* configure.ac: reactivate check for TYPE_232H, which does not
|
||||
exist in libftdi < 0.20
|
||||
* avrftdi*.*: changed include check for libftdi/libusb, deactivate
|
||||
232H if not available
|
||||
* ft245r.c: changed include check for libftdi/libusb
|
||||
|
||||
2013-05-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* main.c (main): Add option -l logfile.
|
||||
* avrdude.1: Document -l option.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2013-05-15 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* configure.ac: if both found libftdi and libftdi1 use only libftdi1
|
||||
* avrdude.conf.in: fixed buff pins of avrftdi programmers (low
|
||||
active buffer need now inverted numbers)
|
||||
* avrftdi*.*: accept also old libftdi (0.20 still works with it),
|
||||
added powerup to initialize
|
||||
* ft245r.c: accept libftdi1, code cleanup and make it more similar
|
||||
to avrfdti (os they might be merged someday)
|
||||
|
||||
2013-05-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version to 6.0rc1.
|
||||
|
||||
2013-05-07 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
* avrftdi_private.h: Change size of pin_checklist to N_PINS (from N_PINS-1)
|
||||
* avrftdi.c: Adapt code to new size of pin_checklist. Remove pins_check()
|
||||
from set_pin().
|
||||
Add pgm->power[up|down] functions as well as fill pgm->enable|disable with
|
||||
proper content as suggested by Rene Liebscher.
|
||||
|
||||
2013-05-05 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* pindefs.h: use unsigned int if stdint.h is not available and UINT_MAX is 0xffffffff
|
||||
otherwise use unsinged long
|
||||
* ft245r.c: added support for more pin functions led, vcc, buff
|
||||
|
||||
2013-05-06 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
* avrftdi_tpi.c: instead of private set_pin() function pointer use the one
|
||||
declared in struct PROGRAMMER.
|
||||
* avrftdi_private.h: remove set_pin function pointer. Add pin_checklist_t
|
||||
member to check pgm->setpin calls during runtime.
|
||||
* avrftdi.c: remove set_pin function pointer init, add pgm->setpin init.
|
||||
Convert avrftdi to new 0-based pindefs infrastructure.
|
||||
* avrdude.conf.in: Change all avrftdi-based programmers' pin definitions to
|
||||
0-based.
|
||||
|
||||
2013-05-06 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* pindefs.h: Include "ac_cfg.h" before testing for HAVE_* macros.
|
||||
|
||||
2013-05-05 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* main.c: revert to rev 1159 (doing pgm_display after pgm_open)
|
||||
* avrpart.[ch]: moved avr_pin_name to pindefs.[ch]
|
||||
* pgm.c: moved pins_to_str to pindefs.[ch], added initialization of
|
||||
new pin definitions in pgm_new()
|
||||
* pindefs.[ch]: added moved functions from other files, added a lot of
|
||||
documentation, reformatted files using astyle to have consistent spacing,
|
||||
added a new generic check function for pins
|
||||
* ft245r.c: used new generic pin check function
|
||||
|
||||
2013-05-03 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
Create new pin definition data structures to support 0-based pin numbers,
|
||||
and mixed inverse/non-inverse pin lists.
|
||||
* avrftdi.c,buspirate.c,linuxgpio.c,par.c,serbb_*.c: added function call
|
||||
to fill old pinno entries from new pin definitions.
|
||||
* pindefs.[hc]: added data struct and helper functions for new pin definitions
|
||||
* avrdude.conf.in: pins in entries using ftdi_syncbb are now 0-based
|
||||
* config_gram.y: allow combinations of inverted and non-inverted pins in pin lists
|
||||
* ft245r.c: reworked to work directly with the new pin definitions,
|
||||
pins are now 0-based, inverse pins are supported, buff is supported
|
||||
* pgm.[ch]: added new pin definitions field to programmer structure,
|
||||
adapted pin display functions
|
||||
|
||||
2013-05-03 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
* avrftdi_private.h: Remove update forward declaration from avrftdi_print to
|
||||
avrftdi_log.
|
||||
* avrftdi_tpi.c: Do all I/O in terms of pgm->cmd_tpi()-calls instead of
|
||||
avrftdi_tpi_[read,write]_byte().
|
||||
Remove unnecessary set_pin call to set MOSI high, speeds up I/O.
|
||||
Removes SKEY array, moves it to tpi.h.
|
||||
Integrate new avr_tpi_[program_enable,chip_erase]() and functions into
|
||||
avrftdi_tpi.
|
||||
* avrftdi_tpi.h: Remove avrftdi_tpi_[program_enable,chip_erase] forward
|
||||
declarations.
|
||||
* avr.c: Adds avr_tpi_chip_erase() generic TPI chip erase function.
|
||||
Adds avr_tpi_program_enable() - generic TPI external programming enable
|
||||
function. Sets guard time, reads identification register, sends SKEY command
|
||||
and key, checks NVMEN bit. The required guard time has to be passed as
|
||||
parameter.
|
||||
* tpi.h: Adds SKEY array including CMD_SKEY in "correct" order.
|
||||
|
||||
2013-05-02 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
* avrftdi_private.h: Add libusb-1.0 include to fix include order in windows.
|
||||
* NEWS: Add notice avrftdi supporting TPI
|
||||
* avr.c: Fix avr_tpi_poll_nvmbsy() - poll read data instead of return code
|
||||
* avrftdi_private.h, avrftdi.c: move logging #defines to from avrftdi.c to
|
||||
avrftdi_private.h, so that they are available for avrftdi_tpi, too.
|
||||
|
||||
2013-04-30 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
* tpi.h: Add definition for TPI Identification Code
|
||||
* avrftdi_tpi.c: Add TPI-support for FTDI-based programmers
|
||||
* avrftdi_private.h: Add common include file for FTDI-based programmers
|
||||
|
||||
2013-04-28 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
* avrftdic: Rework of textual output. Messages are divided by severity and
|
||||
printed accordingly to the verbosity, as specified by the user. The provided
|
||||
severity level are (ERROR, WARN, INFO, DEBUG, TRACE). Where "ERROR" messages
|
||||
are always printed. Shortcut-macros including function, from which the
|
||||
output was generated, and line number were also added.
|
||||
Some log messages were updated and other code warnings removed.
|
||||
|
||||
2013-04-27 Hannes Weisbach <hannes_weisbach@gmx.net>
|
||||
|
||||
* configure.ac: Add libftdi1 library check, remove TYPE_232H DECL check
|
||||
* Makefile.am: Add @LIBFTDI1@ to avrdude_LDADD
|
||||
* avrftdi.c: Update from libftdi0 to libftdi1. Use libftdi1's function to
|
||||
find a device by vid/pid/serial instead of doing it ourself and add/update
|
||||
error messages. avrftdi_print is changed so that a message is printed when
|
||||
the verbosity level is greater or equal the message level, to have always-on
|
||||
messages.
|
||||
Fix a bug where the RX fifo of the FTDI chip is full, resulting in STALL/NAK
|
||||
of the ongoing OUT request and subsequently timeout, because an IN request
|
||||
cannot be issued due to the synchronous part of libftdi. This should fix
|
||||
#38831 and #38659.
|
||||
|
||||
2013-04-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac(AC_CONFIG_HEADERS): Replace the old AM_CONFIG_HEADER
|
||||
by this; automake 1.13+ barfs.
|
||||
|
||||
2013-03-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in (ATmega2564RFR2, ATmega1284RFR2, ATmega644RFR2):
|
||||
New devices
|
||||
|
||||
2013-01-30 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7724 Add TPI support for Bus Pirate using bitbang mode
|
||||
* buspirate.[ch]: added support for BusPirate Bitbanging
|
||||
* pgm_type.c: added entry for buspirate_bb
|
||||
* avrdude.conf.in: added entry for buspirate_bb
|
||||
|
||||
2013-01-30 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7936 Patch to support BusPirate AVR Extended Commands mode
|
||||
* buspirate.c: added support for BusPirate AVR Extended Commands mode
|
||||
* avrdude.1: added doc for nopagedread parameter
|
||||
* doc/avrdude.texi: added doc for nopagedread parameter
|
||||
|
||||
2013-01-30 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7723 Bus Pirate “raw-wire” mode which can run down to 5 kHz
|
||||
* buspirate.c: added raw wire mode
|
||||
* avrdude.1: added doc for rawfreq parameter
|
||||
* doc/avrdude.texi: added doc for rawfreq parameter
|
||||
|
||||
2013-01-30 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #37977 Support for Openmoko Debug Board
|
||||
* avrdude.conf.in: added openmoko entry
|
||||
|
||||
2013-01-29 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7932 Read USBtiny VID and PID from avrdude.conf if provided.
|
||||
* avrdude.conf.in: added usbpid, usbvid to usbtiny
|
||||
* usbtiny.[ch]: use usbpid, usbpid if provided in config file
|
||||
|
||||
2013-01-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #38172: avrftdi: Incorrect information in avrdude.conf
|
||||
* avrdude.conf.in (avrftdi): fix comments about ACBUS vs. ADBUS;
|
||||
add a comment that the MPSSE signals are fixed by the FTDI
|
||||
hardware and cannot be changed
|
||||
|
||||
2013-01-09 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7165 Add support for bitbanging GPIO lines using the Linux sysf GPIO interface
|
||||
* doc/avrdude.texi,avrdude.1: added doc for linuxgpio
|
||||
* avrdude.conf.in: added template for linuxgpio programmer
|
||||
* config_gram.y: pin numbers restricted to [PIN_MIN, PIN_MAX]
|
||||
* pindefs.h: added PIN_MIN, PIN_MAX, removed unused LED_ON/OFF
|
||||
* configure.ac: configure option enable-linuxgpio, print of enabled options
|
||||
* linuxgpio.[ch]: new source for linuxgpio programmer
|
||||
* Makefile.am: added linuxgpio to sources list
|
||||
* pgm_type.c: added linuxgpio to programmer types list
|
||||
|
||||
2013-01-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkI.c (jtagmkI_prmsg): replace a putchar() by putc(...stderr)
|
||||
* jtagmkII.c (jtagmkII_prmsg): (Dito.)
|
||||
* jtag3.c (jtag3_prevent, jtag3_prmsg): (Dito.)
|
||||
|
||||
2013-01-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usb_libusb.c (usbdev_open): Downgrade the max transfer size for
|
||||
the main data endpoints when being forced so by the USB; this can
|
||||
happen when attaching the JTAGICE3 to a USB 1.1 connection
|
||||
* jtag3.c (jtag3_initialize): When detecting a downgraded max
|
||||
transfer size on the JTAGICE3 (presumably, due to being connected
|
||||
to USB 1.1 only), bail out as its firmware cannot properly handle
|
||||
this (by now)
|
||||
|
||||
2013-01-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* ChangeLog: annual ChangeLog rotation time
|
|
@ -0,0 +1,697 @@
|
|||
2014-11-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* ser_win32.c (net_send): Properly declare argument 2 as being a
|
||||
pointer to const data.
|
||||
|
||||
2014-11-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #8380: adds 500k 1M 2M baud to ser_posix.c
|
||||
* ser_posix.c: Add a hack to allow for arbitrary baud rates on
|
||||
Linux
|
||||
|
||||
2014-11-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #8437: [PATCH] Serial-over-ethernet for Win32
|
||||
* configure.ac: Check for ws2_32 library
|
||||
* ser_win32.c: Add hooks for forwarding serial data over
|
||||
TCP connections
|
||||
* avrdude.1: Drop previous restriction of -P net:
|
||||
* doc/avrdude.conf: (Dito.)
|
||||
|
||||
2014-11-24 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #42908: no external reset at JTAGICE3
|
||||
* jtag3.c (jtag3_initialize): Retry with external reset applied if
|
||||
the first sign-on attempt fails.
|
||||
|
||||
2014-11-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Allow the -B option argument to be suffixed with Hz,
|
||||
kHz, or MHz, in order to specify a bitclock frequency rather than
|
||||
period.
|
||||
* avrdude.1: Document the -B option changes.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2014-11-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #40870: config nitpick: ATtiny25/45/85 have 1 calibration byte not 2
|
||||
* avrdude.conf.in (ATtiny25, ATtiny45, ATtiny85): Fix size of
|
||||
"calibration" memory area
|
||||
|
||||
2014-11-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #43137: Writing and reading incorrect pages when using jtagicemkI
|
||||
* jtagmkI.c (jtagmkI_paged_write, jtagmkI_paged_load): correctly
|
||||
calculate the size of a partial (non-pagesize) buffer
|
||||
|
||||
2014-11-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #43078: AVRDUDE crashes after sucessfully reading/writing eeprom
|
||||
* jtag3.c (jtag3_edbg_recv_frame): Return correct length as
|
||||
reported in the response packet, rather than full 512 byte which
|
||||
are always reported by the CMSIS-DAP layer. Miscalculations
|
||||
based on the wrongly reported length caused heap corruption
|
||||
elsewhere, so this is presumably also a fix for bug #43078.
|
||||
|
||||
2014-11-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #41561: AVRDUDE 6.0.1/USBasp doesn't write first bytes of
|
||||
flash page
|
||||
* usbasp.c (usbasp_spi_paged_write): Remove USBASP_BLOCKFLAG_LAST.
|
||||
It is no longer needed, as we always write full pages now in paged
|
||||
write mode.
|
||||
|
||||
2014-11-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #43626: Inconsistent timeouts in stk500v2
|
||||
* stk500v2.c (stk500v2_recv): Add a reference to the bug report
|
||||
but don't change anything, lest to break it somehow
|
||||
|
||||
2014-11-14 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #8529 2 more ftdi_syncbb devices
|
||||
* avrdude.conf.in: added 2 new programmers
|
||||
|
||||
2014-11-14 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #40142 Floating point exception on Ubuntu 10.04
|
||||
* avr.c: avoid division by zero in report_progress(), eg. when
|
||||
writing an empty eeprom file were total becomes 0
|
||||
|
||||
2014-11-13 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #8504 buspirate: Also support "cpufreq" extended parameter
|
||||
in binary mode
|
||||
* buspirate.c: applied patch + switch off at disable (even when
|
||||
a reset follows) + some general whitespace/tab cleanup
|
||||
|
||||
2014-10-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #37441: lockbits in ATxmega + avrdude = problem
|
||||
* fileio.c: replace strmcp(..., "lock") by strncmp(..., "lock", 4)
|
||||
where applicable
|
||||
* jtag3.c: (Dito.)
|
||||
* jtagmkII.c: (Dito.)
|
||||
|
||||
2014-10-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #42267: jtag3isp fails to read lock and fuse bytes directly
|
||||
after changing lock byte
|
||||
* stk500v2.c (stk500isp_write_byte): As a workaround for broken
|
||||
tool firmware, add 10 ms of delay before returning from any
|
||||
single-byte write operation.
|
||||
|
||||
2014-10-06 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c: Use stk500isp_read_byte/stk500isp_write_byte for
|
||||
every byte-wide access (rather than JTAGICE3 only). This finally
|
||||
obsoletes the use of the prehistoric SPI_MULTI command where
|
||||
AVRDUDE used to assemble all the low-level ISP stuff by itself.
|
||||
|
||||
2014-10-06 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #22248: Read efuse error
|
||||
* avrdude.conf.in (m168, m328, m48, m88, t1634, t26, t261, t461,
|
||||
t861, t88): In efuse (or hfuse for t26) read operation, turn all
|
||||
bits in byte 3 from "x" to "o" (output); this is a first step
|
||||
towards fixing the symptoms mentioned in the bug, by unifying the
|
||||
behaviour between different AVRs. Not touched are the historic
|
||||
devices where the fuses are not documented to form a full byte
|
||||
each (2333, 4433, 4434, 8535, m103, m161, m163).
|
||||
|
||||
2014-09-22 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #43268: usb_drain() call causes LUFA AVR-ISP MKII Code to Fail
|
||||
* usb_libusb.c (usbdev_drain): Make this a dummy function only.
|
||||
|
||||
2014-08-19 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #7694 Add support for the atmega32m1
|
||||
* avrdude.conf.in: added ATmega32M1
|
||||
|
||||
2014-08-18 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #8440 Print part id after signature
|
||||
When printing the part signature also print the part id.
|
||||
* avrpart.c (locate_part_by_signature): New function.
|
||||
* libavrdude.h (locate_part_by_signature): New function.
|
||||
* main.c (main): Use the new function to find the part and print its id.
|
||||
|
||||
2014-08-18 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #8511 Fix reset on FT245R
|
||||
* ft245r.c: applied patch
|
||||
|
||||
2014-08-18 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #43002 usbasp debug output typo
|
||||
* usbasp.c: fixed typos
|
||||
|
||||
2014-07-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #42662 clang warnings under FreeBSD 10.x
|
||||
* avrftdi.h: Fix header guard macro name.
|
||||
* pgm_type.c (programmers_types): Remove duplicate "const".
|
||||
|
||||
2014-07-16 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #42662 clang warnings under FreeBSD 10.x
|
||||
* avrftdi.c: remove warnings
|
||||
* buspirate.c: (Dito.)
|
||||
* dfu.c: (Dito.)
|
||||
* fileio.c: (Dito.)
|
||||
* libavrdude.h: (Dito.)
|
||||
* pickit2.c: (Dito.)
|
||||
* safemode.c: (Dito.)
|
||||
* ser_avrdoper.c: (Dito.)
|
||||
* ser_posix.c: (Dito.)
|
||||
* ser_win32.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
* usbasp.c: (Dito.)
|
||||
|
||||
* config_gram.y: fix problem when using parent part with usbpid lists
|
||||
(existing list was extended not overwritten)
|
||||
|
||||
2014-07-11 Axel Wachtler <axel@uracoli.de>
|
||||
|
||||
* avrftdi.c: rollback to vfprintf, fixed error from -r1305, (patch #8463)
|
||||
|
||||
2014-06-23 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* linux_ppdev.h: added missing msg level for avrdude_message
|
||||
in ppi_claim/ppi_release macros
|
||||
* avrftdi.c: added break at end of default
|
||||
|
||||
2014-06-21 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
patch #8419 fix ftdi_syncbb hang with libftdi 1
|
||||
* ft245r.c: set pthread cancel type to asynchronous, reorder ftdi_usb_close/deinit
|
||||
|
||||
2014-06-17 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
* avrftdi_private.h: added missing msg level for avrdude_message
|
||||
in E/E_VOID macros
|
||||
|
||||
2014-06-17 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
Removing exit calls from config parser
|
||||
* config.h: cleanup, left only internally needed definitions
|
||||
* config.c: removed exit calls, use yyerror and yywarning
|
||||
* config_gram.y: (Dito.)
|
||||
* lexer.l: (Dito.)
|
||||
* libavrdude.h: removed internal definitions of config parser
|
||||
* main.c: removed yyerror, it is now in config.c
|
||||
* jtagmkII.c: added missing free in error case
|
||||
* pgm.c: replaced exits by returns
|
||||
* pickit2.c: add missing return
|
||||
|
||||
2014-06-13 Axel Wachtler <axel@uracoli.de>
|
||||
|
||||
start removing global "verbose" variable, for avrdude library.
|
||||
* arduino.c: added verbose level in avrdude_message()
|
||||
* avr910.c: (Dito.)
|
||||
* avr.c: (Dito.)
|
||||
* avrdude.h: (Dito.)
|
||||
* avrftdi.c: (Dito.)
|
||||
* avrpart.c: (Dito.)
|
||||
* bitbang.c: (Dito.)
|
||||
* buspirate.c: (Dito.)
|
||||
* butterfly.c: (Dito.)
|
||||
* config.c: (Dito.)
|
||||
* config_gram.y: (Dito.)
|
||||
* dfu.c: (Dito.)
|
||||
* fileio.c: (Dito.)
|
||||
* flip1.c: (Dito.)
|
||||
* flip2.c: (Dito.)
|
||||
* ft245r.c: (Dito.)
|
||||
* jtag3.c: (Dito.)
|
||||
* jtagmkI.c: (Dito.)
|
||||
* jtagmkII.c: (Dito.)
|
||||
* lexer.l: (Dito.)
|
||||
* libavrdude.h: (Dito.)
|
||||
* linuxgpio.c: (Dito.)
|
||||
* main.c: (Dito.)
|
||||
* par.c: (Dito.)
|
||||
* pgm.c: (Dito.)
|
||||
* pickit2.c: (Dito.)
|
||||
* pindefs.c: (Dito.)
|
||||
* ppi.c: (Dito.)
|
||||
* ppiwin.c: (Dito.)
|
||||
* safemode.c: (Dito.)
|
||||
* ser_avrdoper.c: (Dito.)
|
||||
* serbb_posix.c: (Dito.)
|
||||
* serbb_win32.c: (Dito.)
|
||||
* ser_posix.c: (Dito.)
|
||||
* ser_win32.c: (Dito.)
|
||||
* stk500.c: (Dito.)
|
||||
* stk500generic.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* term.c: (Dito.)
|
||||
* update.c: (Dito.)
|
||||
* usbasp.c: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
* usbtiny.c: (Dito.)
|
||||
* wiring.c: (Dito.)
|
||||
|
||||
2014-06-11 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #42516 spelling-error-in-binary
|
||||
* stk500v2.c, avrftdi.c, usbasp.c: fixed spelling errors
|
||||
|
||||
2014-06-01 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #42337 avrdude.conf updates for UM232H/CM232H
|
||||
* avrdude.conf.in: fixed entries as proposed
|
||||
|
||||
2014-05-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #41854: avrdude 6.1 does not compile on systems without libUSB
|
||||
Submitted by Didrik Madheden:
|
||||
* flip1.c: Provide dummy functions for the #ifndef HAVE_LIBUSB case
|
||||
* flip2.c: (Dito.)
|
||||
|
||||
2014-05-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* libavrdude.h: Join the former "public" header files (avr.h avrpart.h pindefs.h
|
||||
serial.h fileio.h safemode.h update.h pgm_type.h config.h confwin.h lists.h) into
|
||||
a single header that can be included by anyone wanting to link against the
|
||||
library
|
||||
* avr.h: Remove file.
|
||||
* avrpart.h: (Dito.)
|
||||
* pindefs.h: (Dito.)
|
||||
* serial.h: (Dito.)
|
||||
* fileio.h: (Dito.)
|
||||
* safemode.h: (Dito.)
|
||||
* update.h: (Dito.)
|
||||
* pgm.h: (Dito.)
|
||||
* pgm_type.h: (Dito.)
|
||||
* config.h: (Dito.)
|
||||
* confwin.h: (Dito.)
|
||||
* lists.h: (Dito.)
|
||||
* Makefile.am: Adapt for new include file constellation; install shared lib
|
||||
* configure.ac: Bump version date
|
||||
* arduino.c: #include <libavrdude.h> rather than a bunch of different headers
|
||||
* avr910.c: (Dito.)
|
||||
* avr910.h: (Dito.)
|
||||
* avr.c: (Dito.)
|
||||
* avrftdi.c: (Dito.)
|
||||
* avrftdi_private.h: (Dito.)
|
||||
* avrftdi_tpi.c: (Dito.)
|
||||
* avrftdi_tpi.h: (Dito.)
|
||||
* avr.h: (Dito.)
|
||||
* avrpart.c: (Dito.)
|
||||
* avrpart.h: (Dito.)
|
||||
* bitbang.c: (Dito.)
|
||||
* buspirate.c: (Dito.)
|
||||
* butterfly.c: (Dito.)
|
||||
* config.c: (Dito.)
|
||||
* config_gram.y: (Dito.)
|
||||
* config.h: (Dito.)
|
||||
* confwin.c: (Dito.)
|
||||
* confwin.h: (Dito.)
|
||||
* dfu.c: (Dito.)
|
||||
* fileio.c: (Dito.)
|
||||
* fileio.h: (Dito.)
|
||||
* flip1.c: (Dito.)
|
||||
* flip1.h: (Dito.)
|
||||
* flip2.c: (Dito.)
|
||||
* flip2.h: (Dito.)
|
||||
* ft245r.c: (Dito.)
|
||||
* ft245r.h: (Dito.)
|
||||
* jtag3.c: (Dito.)
|
||||
* jtagmkI.c: (Dito.)
|
||||
* jtagmkII.c: (Dito.)
|
||||
* lexer.l: (Dito.)
|
||||
* libavrdude.h: (Dito.)
|
||||
* linuxgpio.c: (Dito.)
|
||||
* lists.c: (Dito.)
|
||||
* lists.h: (Dito.)
|
||||
* main.c: (Dito.)
|
||||
* par.c: (Dito.)
|
||||
* pgm.c: (Dito.)
|
||||
* pgm_type.c: (Dito.)
|
||||
* pgm_type.h: (Dito.)
|
||||
* pickit2.c: (Dito.)
|
||||
* pickit2.h: (Dito.)
|
||||
* pindefs.c: (Dito.)
|
||||
* pindefs.h: (Dito.)
|
||||
* ppi.c: (Dito.)
|
||||
* ppiwin.c: (Dito.)
|
||||
* safemode.c: (Dito.)
|
||||
* safemode.h: (Dito.)
|
||||
* ser_avrdoper.c: (Dito.)
|
||||
* serbb_posix.c: (Dito.)
|
||||
* serbb_win32.c: (Dito.)
|
||||
* serial.h: (Dito.)
|
||||
* ser_posix.c: (Dito.)
|
||||
* ser_win32.c: (Dito.)
|
||||
* stk500.c: (Dito.)
|
||||
* stk500generic.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* stk500v2_private.h: (Dito.)
|
||||
* term.c: (Dito.)
|
||||
* term.h: (Dito.)
|
||||
* update.c: (Dito.)
|
||||
* update.h: (Dito.)
|
||||
* usbasp.c: (Dito.)
|
||||
* usbasp.h: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
* usbtiny.c: (Dito.)
|
||||
* usbtiny.h: (Dito.)
|
||||
* wiring.c: (Dito.)
|
||||
|
||||
2014-05-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Cleanup unused include files.
|
||||
|
||||
2014-05-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* linux_ppdev.h: Caught two more instances of exit()
|
||||
* configure.ac: Add AC_CONFIG_MACRO_DIR as suggested by libtoolize
|
||||
* Makefile.am: add -I m4 to ACLOCAL_AMFLAGS as suggested by libtoolize
|
||||
|
||||
2014-05-16 Axel Wachtler <axel@uracoli.de>
|
||||
|
||||
* arduino.c: Replacing all occurences of fprintf(stderr,...) with avrdude_message(...)
|
||||
in potential library functions.
|
||||
* avr910.c: (Dito.)
|
||||
* avr.c: (Dito.)
|
||||
* avrdude.h: (Dito.)
|
||||
* avrftdi.c: (Dito.)
|
||||
* avrftdi_private.h: (Dito.)
|
||||
* avrpart.c: (Dito.)
|
||||
* bitbang.c: (Dito.)
|
||||
* buspirate.c: (Dito.)
|
||||
* butterfly.c: (Dito.)
|
||||
* config.c: (Dito.)
|
||||
* config_gram.y: (Dito.)
|
||||
* dfu.c: (Dito.)
|
||||
* fileio.c: (Dito.)
|
||||
* flip1.c: (Dito.)
|
||||
* flip2.c: (Dito.)
|
||||
* ft245r.c: (Dito.)
|
||||
* jtag3.c: (Dito.)
|
||||
* jtagmkI.c: (Dito.)
|
||||
* jtagmkII.c: (Dito.)
|
||||
* lexer.l: (Dito.)
|
||||
* linuxgpio.c: (Dito.)
|
||||
* linux_ppdev.h: (Dito.)
|
||||
* main.c: (Dito.)
|
||||
* par.c: (Dito.)
|
||||
* pgm.c: (Dito.)
|
||||
* pickit2.c: (Dito.)
|
||||
* pindefs.c: (Dito.)
|
||||
* ppi.c: (Dito.)
|
||||
* ppiwin.c: (Dito.)
|
||||
* safemode.c: (Dito.)
|
||||
* ser_avrdoper.c: (Dito.)
|
||||
* serbb_posix.c: (Dito.)
|
||||
* serbb_win32.c: (Dito.)
|
||||
* ser_posix.c: (Dito.)
|
||||
* ser_win32.c: (Dito.)
|
||||
* stk500.c: (Dito.)
|
||||
* stk500generic.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* term.c: (Dito.)
|
||||
* update.c: (Dito.)
|
||||
* usbasp.c: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
* usbtiny.c: (Dito.)
|
||||
* wiring.c: (Dito.)
|
||||
|
||||
2014-05-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Bump version, add libtool hooks
|
||||
* Makefile.am: First attempt to define building a shared library
|
||||
(not to be installed by now)
|
||||
|
||||
2014-05-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* dfu.c (dfu_open, dfu_init): Fix signature of the dummy functions
|
||||
(in the !HAVE_LIBUSB case) to match prototypes.
|
||||
|
||||
2014-05-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avr910.c: Replace all occurences of exit() in potential library
|
||||
functions by appropriate return values
|
||||
* avrftdi.c: (Dito.)
|
||||
* bitbang.c: (Dito.)
|
||||
* bitbang.h: (Dito.)
|
||||
* buspirate.c: (Dito.)
|
||||
* butterfly.c: (Dito.)
|
||||
* config.c: (Dito.)
|
||||
* flip2.c: (Dito.)
|
||||
* ft245r.c: (Dito.)
|
||||
* jtagmkI.c: (Dito.)
|
||||
* jtagmkII.c: (Dito.)
|
||||
* linuxgpio.c: (Dito.)
|
||||
* main.c: (Dito.)
|
||||
* par.c: (Dito.)
|
||||
* pgm.c: (Dito.)
|
||||
* pickit2.c: (Dito.)
|
||||
* pindefs.c: (Dito.)
|
||||
* pindefs.h: (Dito.)
|
||||
* ser_avrdoper.c: (Dito.)
|
||||
* ser_posix.c: (Dito.)
|
||||
* ser_win32.c: (Dito.)
|
||||
* serbb_posix.c: (Dito.)
|
||||
* serbb_win32.c: (Dito.)
|
||||
* stk500.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
|
||||
2014-05-07 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #42310: New part description for AT90PWM216
|
||||
* avrdude.conf.in: added pwm216 entry
|
||||
|
||||
2014-05-07 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #42158: Linux GPIO - Source Typo
|
||||
* pindefs.h: fixed typo
|
||||
|
||||
2014-04-14 Rene Liebscher <R.Liebscher@gmx.de>
|
||||
|
||||
bug #42056: double free or corruption triggered at exit
|
||||
* pgm.c: copy usbpid list in pgm_dup
|
||||
|
||||
2014-04-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.1: Remove the note that users might edit the system-wide
|
||||
config file. This file will be overwritten by the next
|
||||
installation, so it's not a good idea to manually modify it.
|
||||
Using the -C +file option is a much better way for user
|
||||
modifications.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
* avrdude.conf.in: Add a warning to not modify the file manually.
|
||||
|
||||
2014-03-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version for post-6.1.
|
||||
|
||||
2014-03-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (AC_INIT): Bump version to 6.1.
|
||||
|
||||
2014-03-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* pgm.c (pgm_free): Cleanup police: destroy the p->usbpid
|
||||
list when freeing the programmer struct.
|
||||
|
||||
2014-03-12 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #40782: Verify errors for object size > 16 k on x32e5 due
|
||||
to typo in avrdude.conf
|
||||
* avrdude.conf.in (ATmega8E5, ATmega32E5): fix boot location
|
||||
|
||||
2014-02-28 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in (atmelice, atmelice_pdi, atmelice_dw, atmelice_isp):
|
||||
New entries.
|
||||
* avrdude.1: Document the Atmel-ICE addition.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
* usbdevs.c (USB_DEVICE_ATMEL_ICE): New entry.
|
||||
|
||||
2014-02-28 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* main.c: Bump copyright year.
|
||||
|
||||
2014-02-28 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c (jtag3_recv): avoid memmov'ing more data than available
|
||||
|
||||
2014-02-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.1: Documentation update for EDBG.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2014-02-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c: For EDBG protocol, always use 512-byte block I/O. The
|
||||
lower layers will split this according to the EP's maxsize. This
|
||||
makes it work over USB 1.1 connections (albeit very slowly, due to
|
||||
the interrupt transfers used).
|
||||
|
||||
2014-02-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* config_gram.y: Turn the usbpid parameter of the programmer into
|
||||
a list of PIDs. Make the JTAGICE3 programmer handle a list of
|
||||
PIDs, by trying each of them in sequence. Use a single, central
|
||||
jtag3_open_common() function to handle the common code of all
|
||||
jtag3_open_* functions. Centralize all USB VID/PID definitions in
|
||||
usbdevs.h.
|
||||
* flip1.c: (Dito.)
|
||||
* ft245r.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* jtag3.c: (Dito.)
|
||||
* jtag3.h: (Dito.)
|
||||
* flip2.c: (Dito.)
|
||||
* usbdevs.h: (Dito.)
|
||||
* pgm.c: (Dito.)
|
||||
* serial.h: (Dito.)
|
||||
* pgm.h: (Dito.)
|
||||
* usbtiny.c: (Dito.)
|
||||
* usbasp.c: (Dito.)
|
||||
* avrftdi.c: (Dito.)
|
||||
* usbtiny.h: (Dito.)
|
||||
* avrdude.conf.in: (Dito.)
|
||||
* usbasp.h: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
|
||||
2014-02-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usb_libusb.c (usbdev_open): Replace all calls to exit(1) by
|
||||
return -1
|
||||
|
||||
2014-02-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3_private.h: Add EDBG/CMSIS-DAP specific constants.
|
||||
* jtag3.c: Add EDBG/CMSIS-DAP protocol implementation.
|
||||
* serial.h: (Dito.)
|
||||
* usbdevs.h: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
* configure.ac: (Dito.)
|
||||
* avrdude.conf.in: Add JTAGICE3 and XplainedPro entries using
|
||||
EDBG.
|
||||
* configure.ac: Bump version date.
|
||||
|
||||
2014-02-22 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usb_libusb.c (usbdev_recv_frame): Fix a bug where a new recv
|
||||
request was issued even though all desired data had aldready
|
||||
been received.
|
||||
|
||||
2014-02-21 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* serial.h: Change the second parameter of the ser_open method
|
||||
from "baud" into a "union pinfo", so the USB parameters can be
|
||||
passed without hacks.
|
||||
* arduino.c: (Dito.)
|
||||
* avr910.c: (Dito.)
|
||||
* buspirate.c: (Dito.)
|
||||
* butterfly.c: (Dito.)
|
||||
* jtag3.c: (Dito.)
|
||||
* jtagmkI.c: (Dito.)
|
||||
* jtagmkII.c: (Dito.)
|
||||
* ser_avrdoper.c: (Dito.)
|
||||
* ser_posix.c: (Dito.)
|
||||
* ser_win32.c: (Dito.)
|
||||
* stk500.c: (Dito.)
|
||||
* stk500v2.c: (Dito.)
|
||||
* usb_libusb.c: (Dito.)
|
||||
* wiring.c: (Dito.)
|
||||
|
||||
2014-01-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
[bug #41402] dfu.c missing include <stdint.h>
|
||||
* dfu.c: include <stdint.h> where uint16_t is defined
|
||||
|
||||
2014-01-28 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in (ATmega256RFR2 et al.): Fix EEPROM size.
|
||||
|
||||
2014-01-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
[bug #41357] OS X: Avrdude messes with the usb stack?
|
||||
* usb_libusb.c (usbdev_close): Only issue the usb_reset() for
|
||||
Linux systems, as these are the only ones that seem to require
|
||||
it under some circumstances.
|
||||
|
||||
2014-01-22 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (libelf): check against elf_getshdrstrndx() rather
|
||||
than just elf_begin() only, so it is clear we found a sufficiently
|
||||
recent libelf to work with.
|
||||
|
||||
2014-01-22 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Contributed by Alan Horstmann:
|
||||
bug #40897: AT Mega2560 not correctly programmed with stk500(v1) ISP (solution patch)
|
||||
* stk500.c: Implement extended address byte handling.
|
||||
* avrdude.conf.in (ATmega2560): enable stk500_devcode so
|
||||
STK500v1 protocol actually starts at all.
|
||||
|
||||
2014-01-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* flip1.c: Implement the meat of FLIP version 1 protocol.
|
||||
* avrdude.1: Document the new protocol.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2014-01-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* flip2.c (flip2_page_erase): Remove unimplemented function.
|
||||
* dfu.h: Correctly conditionalize <usb.h> vs. <lusb0_usb.h>;
|
||||
add adjustable timeout (struct dfu_dev); add dfu_abort()
|
||||
* dfu.c (dfu_abort): New function; implement adjustable timeout.
|
||||
|
||||
2014-01-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (libhid): Turn from AC_TRY_RUN into
|
||||
AC_TRY_COMPILE, so it also works for cross-compilation
|
||||
setups.
|
||||
|
||||
2014-01-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* dfu.c (dfu_init): Move the descriptor checks up into the
|
||||
FLIP protocol implementation.
|
||||
* flip2.c (flip2_initialize): (Dito.)
|
||||
* flip1.c (flip1_initialize): (Dito.)
|
||||
|
||||
2014-01-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* flip2.c: Rename from flip.c
|
||||
* flip2.h: Rename from flip.h
|
||||
* Makefile.am: Reflect the renaming.
|
||||
* dfu.c: Update information how to get GPL.
|
||||
* dfu.h: (Dito.)
|
||||
|
||||
2014-01-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* flip.c (flip2_initialize): Check user is running on an Xmega
|
||||
device.
|
||||
|
||||
2014-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* flip.c: Added some verbose-level messages (-vv)
|
||||
* dfu.c: Added some verbose-level messages (-vvvv)
|
||||
|
||||
2014-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Kirill Levchenko:
|
||||
patch #7896: DFU FLIPv2 programming support
|
||||
* pgm_type.c: Add the flip2 programmer type.
|
||||
* config_gram.y: Allow for the usbid keyword in a device definition.
|
||||
* avrdude.conf.in: Add usbpid values to those Xmega devices where
|
||||
applicable.
|
||||
* avrpart.h: Add usbpid device field.
|
||||
* dfu.c: (New file.)
|
||||
* dfu.h: (New file.)
|
||||
* flip.c: (New file.)
|
||||
* flip.h: (New file.)
|
||||
* Makefile.am: Add new files.
|
||||
* doc/avrdude.texi: Document the changes.
|
||||
* avrdude.1: (Dito.)
|
||||
|
||||
2014-01-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* ChangeLog-2013: Annual changelog rotation.
|
|
@ -0,0 +1,54 @@
|
|||
2015-12-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.1 (-C): Do not suggest users might change the
|
||||
default config file. It will be overwritten by updates.
|
||||
|
||||
2015-12-09 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #46610: Floating point exception (core dumped) arch linux rpi2
|
||||
bug #46483: version 6.2. ser_open(): can't set attributes for device
|
||||
* ser_posix.c: Back out change from patch #8380
|
||||
|
||||
2015-11-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Bump for post-release 6.2.
|
||||
|
||||
2015-11-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Released version 6.2.
|
||||
|
||||
2015-10-31 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Martino Facchin:
|
||||
bug #45727: Wrong atmega8u2 flash parameters
|
||||
* avrdude.conf.in (ATmega8U2): correct page and block size
|
||||
|
||||
2015-10-31 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Pasquale Cocchini:
|
||||
bug #46020: Add TIAO TUMPA to the conf file.
|
||||
* avrdude.conf.in (tumpa): New entry.
|
||||
|
||||
2015-10-31 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Pasquale Cocchini:
|
||||
bug #46021: Please add read in the memory lock section of ATtiny85
|
||||
* avrdude.conf.in (ATtiny25/45/85): add read pattern for lock bits
|
||||
|
||||
2015-10-31 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* Makefile.am (libavrdude_a_SOURCES): reflect recent changes
|
||||
(pgm.h is gone, config.h is new).
|
||||
|
||||
2015-04-09 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #44717: avrdude creates empty flash dump
|
||||
* update.c (do_op): When about to write an empty flash dump file,
|
||||
warn about this to avoid surprises.
|
||||
* avrdude.1: Document the truncation of trailing 0xFF bytes for
|
||||
flash memory areas.
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
2015-04-09 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Annual ChangeLog rotation.
|
|
@ -0,0 +1,95 @@
|
|||
2016-09-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* stk500v2.c (DEBUG, DEBUGRECV): define these unconditionally,
|
||||
as MSG_TRACE2 messages.
|
||||
|
||||
2016-05-10 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Hannes Jochriem:
|
||||
* avrdude.conf.in (ehajo-isp): New programmer.
|
||||
|
||||
2016-04-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac (libftdi1): Rather than hardcoding the library
|
||||
providing the libusb-1.0 API, use the result from the previous
|
||||
probe. This helps detecting libftdi1 on FreeBSD where the
|
||||
libusb-1.0 API is provided by the system's libusb.
|
||||
|
||||
2016-04-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usb_hidapi.c (usbhid_open): Correctly calculate the
|
||||
offset for serial number matching
|
||||
|
||||
2016-03-28 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #47550: Linux GPIO broken
|
||||
* linuxgpio.c: Replace %ud by %u in snprintf calls.
|
||||
|
||||
2016-03-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* usb_hidapi.c (usbhid_recv): Bump read timeout to 300 ms.
|
||||
|
||||
2016-02-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* jtag3.c: add support for libhidapi as (optional) transport for
|
||||
CMSIS-DAP compliant debuggers (JTAGICE3 with firmware 3+,
|
||||
AtmelICE, EDBG, mEDBG)
|
||||
* usb_hidapi.c: (New file)
|
||||
* libavrdude.h: Mention usbhid_serdev
|
||||
* configure.ac: Bump version date
|
||||
|
||||
2016-02-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
(Obtained from patch #8717: pattch for mcprog and libhidapi support)
|
||||
* configure.ac: Probe for libhidapi
|
||||
* Makefile.am: Add @LIBHIDAPI@
|
||||
|
||||
2016-02-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* doc/avrdude.texi: Bump copyright year.
|
||||
|
||||
2016-02-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Bump for post-release 6.3.
|
||||
|
||||
2016-02-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Released version 6.3.
|
||||
|
||||
2016-02-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #8894: Spelling in 6.2 doc
|
||||
* doc/avrdude.texi: Various spelling fixes.
|
||||
|
||||
2016-02-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #8895: Spelling in 6.2 code
|
||||
* avrftdi.c (avrftdi_open): Spell fix.
|
||||
|
||||
2016-02-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #8896: Silence cppcheck warnings in 6.2 code
|
||||
* linuxgpio.c: Use %ud to print GPIO values.
|
||||
|
||||
2016-02-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #8735: ATtiny28 support in avrdude.conf
|
||||
* avrdude.conf.in (ATtiny28): New device.
|
||||
|
||||
2016-02-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* avrdude.conf.in (ATmega48PB, ATmega88PB, ATmega168PB): New
|
||||
devices.
|
||||
|
||||
2016-02-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
patch #8435: Implementing mEDBG CMSIS-DAP protocol
|
||||
* usb_libusb.c: Add endpoint IDs for Xplained Mini, correctly
|
||||
transfer trailing ZLP when needed
|
||||
* avrdude.conf.in (xplainedmini, xplainedmini_dw): New entries.
|
||||
* jtag3.c (jtag3_edbg_send, jtag3_edbg_recv_frame): Implement
|
||||
fragmentation needed for the 64-byte EP size of the Xplained Mini
|
||||
* avrdude.1: Document the change
|
||||
* doc/avrdude.texi: (Dito.)
|
||||
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
2017-12-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
|
||||
patch #9507: Fix UPDI chip erase
|
||||
* jtag3.c (jtag3_chip_erase_updi): New function
|
||||
* jtag3_private.h: More constants
|
||||
|
||||
2017-12-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
|
||||
patch #9508: Add PowerDebugger and XPlained Mini in UPDI mode
|
||||
* avrdude.conf.in (xplainedmini_updi, powerdebugger,
|
||||
powerdebugger_pdi, powerdebugger_updi, powerdebugger_dw,
|
||||
powerdebugger_isp): New programmers
|
||||
|
||||
2017-12-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* bootstrap: Detect whether libtoolize is named
|
||||
`glibtoolize' (MacOS)
|
||||
|
||||
2017-11-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
* configure.ac: Bump version date, due to UPDI addition
|
||||
|
||||
2017-11-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
|
||||
patch #9482: Add support for UPDI and AVR8X
|
||||
* avrdude.conf.in (xplainedpro_updi): New programmer
|
||||
* avrdude.conf.in (.avr8x, ATtiny1617, ATtiny817): New device
|
||||
family and devices
|
||||
* config_gram.y: add K_OCD_BASE and K_HAS_UPDI
|
||||
* lexer.l: (Ditto.)
|
||||
* doc/avrdude.texi: Document "has_updi" flag
|
||||
* jtag3.c: Implement UPDI
|
||||
* jtag3.h: (Ditto.)
|
||||
* jtag3_private.h: (Ditto.)
|
||||
* libavrdude.h: Add ocd_base value and AVRPART_HAS_UPDI flag
|
||||
* pgm_type.c: Add jtagice3_updi
|
||||
|
||||
2017-11-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
|
||||
* avrdude.conf.in (ATmega328PB): New part
|
||||
|
||||
2017-11-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #48084: Avoid compiled-in timestamp for reproducible release builds
|
||||
* main.c: Remove "compiled on/at" string
|
||||
|
||||
2017-03-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
bug #47718: "lfuse reads as" not displayed in verbose mode - SOLUTION
|
||||
Reported by Roger A. Krupski:
|
||||
* safemode.c: Display lfuse at correct MSG level
|
||||
|
4
INSTALL
4
INSTALL
|
@ -1,4 +0,0 @@
|
|||
Installation Instructions
|
||||
*************************
|
||||
|
||||
See README.md.
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#
|
||||
# avrdude - A Downloader/Uploader for AVR device programmers
|
||||
# Copyright (C) 2003, 2004 Theodore A. Roth <troth@openavr.org>
|
||||
|
@ -31,6 +30,22 @@
|
|||
#
|
||||
|
||||
EXTRA_DIST = \
|
||||
ChangeLog \
|
||||
ChangeLog-2001 \
|
||||
ChangeLog-2002 \
|
||||
ChangeLog-2003 \
|
||||
ChangeLog-2004-2006 \
|
||||
ChangeLog-2007 \
|
||||
ChangeLog-2008 \
|
||||
ChangeLog-2009 \
|
||||
ChangeLog-2010 \
|
||||
ChangeLog-2011 \
|
||||
ChangeLog-2012 \
|
||||
ChangeLog-2013 \
|
||||
ChangeLog-2014 \
|
||||
ChangeLog-2015 \
|
||||
ChangeLog-2016 \
|
||||
ChangeLog-2017 \
|
||||
avrdude.1 \
|
||||
avrdude.spec \
|
||||
bootstrap
|
||||
|
@ -42,13 +57,14 @@ CLEANFILES = \
|
|||
|
||||
BUILT_SOURCES = $(CLEANFILES)
|
||||
|
||||
#SUBDIRS = doc
|
||||
#DIST_SUBDIRS = doc
|
||||
#SUBDIRS = doc @WINDOWS_DIRS@
|
||||
#DIST_SUBDIRS = doc windows
|
||||
|
||||
# . lets build this directory before the following in SUBDIRS
|
||||
SUBDIRS = .
|
||||
# doc comes here, and we want to use the built avrdude to generate the parts list
|
||||
SUBDIRS += @SUBDIRS_AC@
|
||||
SUBDIRS += @WINDOWS_DIRS@
|
||||
DIST_SUBDIRS = @DIST_SUBDIRS_AC@
|
||||
|
||||
AM_YFLAGS = -d
|
||||
|
@ -93,7 +109,6 @@ libavrdude_a_SOURCES = \
|
|||
avr.c \
|
||||
avr910.c \
|
||||
avr910.h \
|
||||
avrcache.c \
|
||||
avrdude.h \
|
||||
avrftdi.c \
|
||||
avrftdi.h \
|
||||
|
@ -134,12 +149,11 @@ libavrdude_a_SOURCES = \
|
|||
libavrdude.h \
|
||||
linuxgpio.c \
|
||||
linuxgpio.h \
|
||||
linuxspi.c \
|
||||
linuxspi.h \
|
||||
linux_ppdev.h \
|
||||
lists.c \
|
||||
micronucleus.c \
|
||||
micronucleus.h \
|
||||
my_ddk_hidsdi.h \
|
||||
par.c \
|
||||
par.h \
|
||||
pgm.c \
|
||||
|
@ -150,6 +164,7 @@ libavrdude_a_SOURCES = \
|
|||
ppi.c \
|
||||
ppi.h \
|
||||
ppiwin.c \
|
||||
safemode.c \
|
||||
serbb.h \
|
||||
serbb_posix.c \
|
||||
serbb_win32.c \
|
||||
|
@ -170,21 +185,6 @@ libavrdude_a_SOURCES = \
|
|||
tpi.h \
|
||||
usbasp.c \
|
||||
usbasp.h \
|
||||
serialupdi.c \
|
||||
serialupdi.h \
|
||||
updi_constants.h \
|
||||
updi_link.c \
|
||||
updi_link.h \
|
||||
updi_state.c \
|
||||
updi_state.h \
|
||||
updi_readwrite.c \
|
||||
updi_readwrite.h \
|
||||
updi_nvm.c \
|
||||
updi_nvm.h \
|
||||
urclock.c \
|
||||
urclock.h \
|
||||
urclock_hash.h \
|
||||
urclock_private.h \
|
||||
usbdevs.h \
|
||||
usb_hidapi.c \
|
||||
usb_libusb.c \
|
||||
|
@ -192,9 +192,7 @@ libavrdude_a_SOURCES = \
|
|||
usbtiny.c \
|
||||
update.c \
|
||||
wiring.h \
|
||||
wiring.c \
|
||||
xbee.h \
|
||||
xbee.c
|
||||
wiring.c
|
||||
libavrdude_la_SOURCES = $(libavrdude_a_SOURCES)
|
||||
libavrdude_la_LDFLAGS = -version-info 1:0
|
||||
|
||||
|
@ -202,13 +200,6 @@ include_HEADERS = libavrdude.h
|
|||
|
||||
avrdude_SOURCES = \
|
||||
main.c \
|
||||
whereami.c \
|
||||
whereami.h \
|
||||
avrintel.c \
|
||||
avrintel.h \
|
||||
developer_opts.c \
|
||||
developer_opts.h \
|
||||
developer_opts_private.h \
|
||||
term.c \
|
||||
term.h
|
||||
|
581
NEWS
581
NEWS
|
@ -2,506 +2,10 @@ $Id$
|
|||
|
||||
Approximate change log for AVRDUDE by version.
|
||||
|
||||
(For detailed changes, see the version control system logs.)
|
||||
(For more detailed changes, see the ChangeLog file.)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Changes since version 7.1:
|
||||
|
||||
* Major changes compared to the previous version:
|
||||
|
||||
* New devices supported: none
|
||||
|
||||
* New programmers supported:
|
||||
|
||||
* Issues fixed:
|
||||
|
||||
* Pull requests:
|
||||
|
||||
* Internals:
|
||||
|
||||
|
||||
Changes in version 7.1:
|
||||
|
||||
* Major changes compared to the previous version:
|
||||
|
||||
- Provide a new programmer -c urclock for bootloader urprotocol
|
||||
+ Urclock fully supports vector bootloaders at no extra code size
|
||||
+ Uprotocol
|
||||
https://github.com/stefanrueger/urboot/blob/main/urprotocol.md
|
||||
allows programming much shorter bootloaders with more features:
|
||||
* Exports a pgm_write_page(sram, progmem) function that the
|
||||
application can call at FLASHEND-4+1 to use flash as storage
|
||||
* Supports EEPROM reads/writes
|
||||
* Protects itself from overwriting
|
||||
* Vector bootloaders: can protect the reset vector
|
||||
* Offers Chip Erase function (quicker than uploading 0xff's)
|
||||
+ Urclock when compiled with libreadline supports bootloaders in
|
||||
terminal mode (preventing them from WDT timeout)
|
||||
+ The -c urclock programmer provides a metadata interface that
|
||||
allows unused flash to be used as storage
|
||||
+ avrdude -c urclock is backward compatible with avrdude -c arduino
|
||||
|
||||
- Add TPI support for Microchip tools #1205
|
||||
|
||||
- Add C-strings, C characters and double to terminal write
|
||||
|
||||
- Provide write flash in the terminal (using a cache)
|
||||
|
||||
- Provide page erase in the terminal as pgerase
|
||||
|
||||
- Add support for NetBSD and OpenBSD to build.sh
|
||||
|
||||
* New devices supported: none
|
||||
|
||||
* New programmers supported:
|
||||
|
||||
- urclock = Urclock programmer for bootloaders using urprotocol
|
||||
- xplainedmini_tpi = Atmel AVR XplainedMini in TPI mode
|
||||
- xplainedpro_pdi = Atmel AVR XplainedPro in PDI mode
|
||||
- atmelice_tpi = Atmel-ICE (ARM/AVR) in TPI mode
|
||||
- powerdebugger_tpi = Atmel PowerDebugger (ARM/AVR) in TPI mode
|
||||
- pickit4 = MPLAB(R) PICkit 4 in JTAG mode
|
||||
- pickit4_tpi = MPLAB(R) PICkit 4 in TPI mode
|
||||
- snap = MPLAB(R) SNAP in JTAG mode
|
||||
- snap_tpi = MPLAB(R) SNAP in TPI mode
|
||||
- arduino_gemma = Arduino Gemma bootloader disguised as USBtiny
|
||||
- adafruit_gemma = Adafruit Trinket Gemma bootloader disguised as USBtiny
|
||||
- digilent-hs2 = Digilient JTAG HS2 (MPSSE)
|
||||
- tigard = Tigard interface board
|
||||
|
||||
* Issues fixed:
|
||||
|
||||
- Fix micronucleus bootloader to check for unresponsive USB
|
||||
devices #945
|
||||
- Fix src/CMakeLists.txt to honor CMAKE_INSTALL_LIBDIR #972
|
||||
- [bug #43898] atmega644p remains stopped after JTAG
|
||||
transaction #366
|
||||
- Wrong timings for ATmega328PB and other parts in avrdude.conf
|
||||
#976
|
||||
- FT232R based programmer ATmega2560 Flash Reading Problem #995
|
||||
also #474
|
||||
- Enable avrdude to send full input file incl trailing 0xff
|
||||
#936
|
||||
- Portname default for linuxspi programmer not recognized #926
|
||||
- JTAG1 unable to write fuse and lock bits #443
|
||||
- Unknown option '-s' on command line (legacy) #1032
|
||||
- STK500/arduino/xbee programmers fail EEPROM r/w for some
|
||||
parts #967 also #421
|
||||
- Design issue: jtag2updi is hardcoded to fail for parts with
|
||||
has_pdi = yes #1037
|
||||
- Option parse error: after -U flash:w:program_to_upload.hex,
|
||||
subsequent -V ignored #441
|
||||
- Automatic verification is designed to fail for stdin #1044
|
||||
- Display correct number of bytes when input file has holes
|
||||
#1005
|
||||
- Cmake installs avrdude.1 in the wrong place on Linux #1064
|
||||
- avr910 -qq prompt too verbose #1081
|
||||
- avrftdi.c: paged write can fail at addr 0 #1073
|
||||
- Permission denied accessing /sys/class/gpio/gpioX/direction
|
||||
would leave pin exported #472 also #372
|
||||
- Raspberry Pi sysfs bug workaround for linuxgpio driver #386
|
||||
- Fix CMake avrdude.conf dependency to avrdude.conf.in #1035
|
||||
- CMake infrastructure does not handle documentation #947
|
||||
- New feature: ability to reset FLIPv2 targets #733
|
||||
- Fix Extended address not sent with avr109/butterfly #360
|
||||
and #454
|
||||
- Enable AVR JTAG ICE mkI program EEPROM in terminal mode
|
||||
#1054
|
||||
- Make flash writes work in terminal mode #1020
|
||||
- Add support for XMEGA specific AVR109 protocol extensions
|
||||
used by XBoot #200
|
||||
- jtag2updi can not write EEPROM in terminal mode #1116
|
||||
- Make UPDI programmers less verbose during initialization
|
||||
#1084
|
||||
- Quell mode isn't handled systematically #1114
|
||||
- Mixing the progress bar with warning messages #1136
|
||||
- Inconsistent terminal output re stdout and stderr #1130
|
||||
- Supress the warning for Microchip SNAP #1135
|
||||
- ATtiny85 communication problem with default bitclock #1133
|
||||
- [Regression] Optiboot for "modern AVRs" no longer works #1120
|
||||
- Cannot access EEPROM on some bootloader/part combos #970
|
||||
- -U writes sometimes more bytes to flash/memory than input
|
||||
file has #1050
|
||||
- debugWire using dragon_dw and jtag2dw not working #1168
|
||||
- && echo OK does not work after -c urclock #1192
|
||||
- Serial drain timeout needs calibrating for -c urclock #1193
|
||||
- avrdude -U file.elf misses second and following suitable
|
||||
sections in elf segements #1204
|
||||
- Avrdude on macOS has problems with libedit #1173
|
||||
- urclock support for optiboot_x and optiboot_dx #1200
|
||||
- Terminal does not continue read/dump correctly #1201
|
||||
- JTAG3 programmer info not available in ISP mode #1212
|
||||
- Extra avrdude> prompt with -qqt in terminal mode #1214
|
||||
- PICkit4 and SNAP serial numbers not read by Avrdude #1038
|
||||
- Optiboot EEPROM support cannot be detected by avrdude #1224
|
||||
- megaAVR JTAG programming doesn't work for SNAP and PICkit4
|
||||
#1052
|
||||
- urclock/FTDI communication issues #1245
|
||||
- stk500v2.c dumps core on open #1254
|
||||
- linuxgpio cannot use pin 0 #1228
|
||||
- Remove non-working butterfly page erase function
|
||||
- linuxgpio and linuxspi: input files with unset bytes don't program
|
||||
correctly #1263 #455
|
||||
|
||||
* Pull requests:
|
||||
|
||||
- Fix .Dd macro in manpage #949
|
||||
- fix M1 homebrew path #950
|
||||
- CMake Enhancements #962
|
||||
- Reduce programmer desc string length in avrdude.conf
|
||||
to < 80 characters #1000
|
||||
- Dragon JTAG fix #979
|
||||
- adding support for all Linux baud rates v.2 #993
|
||||
- Replace internal knowledge in jtag3.c by a public API #996
|
||||
- JTAG3 UPDI EEPROM fix #1013
|
||||
- Treat x bits in .conf SPI commands as 0 #943
|
||||
- Fix avrftdi support for ATmega2560 et al #998
|
||||
- Fix avrdude.conf timings for ATmega328PB and other parts #1001
|
||||
- Fix PICKit2 ATmega2560 flash paged flash read #1023
|
||||
- Fix ft245r paged read for ATmega2560 et al #1018
|
||||
- Add option -A that supresses trailing 0xff optimisation
|
||||
and automatically do so for -c arduino #936
|
||||
- Fix linuxspi default port #933
|
||||
- Add support for high-voltage UPDI im jtag3.c #1015
|
||||
- Fix terminal write edge cases; add one read mode; add quell
|
||||
command #1025
|
||||
- Fix usbtiny read for parts with more than 64 kB flash #1029
|
||||
- CMakeLists.txt: fix build without C++ #1016
|
||||
- Provide file format I: Intel HEX with comments that ignores
|
||||
checksum errors #1030
|
||||
- Enable writing fuse and lock bits for AVR-JTAGICE #1031
|
||||
- Ignore -s flag as safemode is no longer supported #1033
|
||||
- Developer options to describe parts and
|
||||
extend avrdude.conf syntax #1040
|
||||
- Deprecate original STK500 v1 protocol in favour of optiboot
|
||||
and Arduino as ISP #1046
|
||||
- Add jtagmkii_updi programmer option #1048
|
||||
- Enable stdin verification, display correct number of bytes
|
||||
written/verified, check -U memory names against spelling
|
||||
errors and exit but skip -U memory updates with known
|
||||
memories that the part lacks #1053
|
||||
- Handle invalid -U file format specifiers for input #1042
|
||||
- Implement a dry run for -U updates before opening the
|
||||
programmer #1056
|
||||
- Implement -c <wildcard>/dev_options for printing avrdude.conf
|
||||
show comments with -p*/s or -c*/s; Reduce -p */r raw output;
|
||||
specifying the full memory name now always works; stop
|
||||
listing programmers where id starts with dot #1059
|
||||
- Fix logfile short option in man-page; fix install dir for man
|
||||
page #1063
|
||||
- Use const for programmer functions where useful; add second
|
||||
argument for programmer enable interface function
|
||||
void (*enable)(PROGRAMMER *pgm, const AVRPART *p) #1078
|
||||
- Make avr910 programmer initialize() less verbose #1083
|
||||
- Fix flash paged write for avrftdi.c #1074
|
||||
- Fix 4 parts wrt to their interfaces in avrdude.conf; rewrite
|
||||
avrdude.conf.in file from avrdude -c* -p* output; reformat
|
||||
conditional programmers in avrdude.conf.in using -c*; fix
|
||||
reset=dedicated|io; entries #1086
|
||||
- Add prog_modes, a bitwise or of prgramming modes, to part and
|
||||
programmer definitions; add to part definition
|
||||
+ mcuid, a unique id in 0..2039 for 8-bit AVR
|
||||
+ n_interrupts, the number of interrupts
|
||||
+ n_page_erase, if set, the # of pages erased for NVM erase
|
||||
implement a simple calculator in config_gram.y for numeric
|
||||
values; set part prog_modes, mcuid, n_interrupts and
|
||||
n_page_erase in avrdude.conf.in; add external intelligence
|
||||
about AVRs avrintel.[ch] to the project and warn during
|
||||
parsing if mcuid is incompatible with it #1091
|
||||
- Fix permission denied error in linuxgpio programmer #917
|
||||
- Add a programmer arduino_gemma for the Arduino Gemma
|
||||
bootloader and another one, adafruit_gemma, for the Adafruit
|
||||
Trinket Gemma bootloader in avrdude.conf; #1093
|
||||
- Add digilent-hs2 programmer in avrdude.conf #1094
|
||||
- Fix dependency chain between avrdude.conf.in and
|
||||
avrdude.conf #1095
|
||||
- Build docs with CMake #1096
|
||||
- New feature so user can print all compatible parts for a
|
||||
programmer using -p\? -c programmer and vice versa #1099
|
||||
- Add extended parameter disable_no_cs for linuxspi programmer
|
||||
#1100
|
||||
- Fix avr109 extended address #1101
|
||||
- Add support for Flip 2 reset on exit #1102
|
||||
- Support for Power Debugger analog readings in terminal mode
|
||||
#1105
|
||||
- Provide cached byte-wise read/write API #1106
|
||||
- AVR109: support for prodsig read and usersig read/write #1108
|
||||
- Add missing AVR variants the original JTAG ICE supports #1109
|
||||
- Improve help message in terminal and provide new command
|
||||
pgerase #1113
|
||||
- Fix pointer truncation for Windows x64 #1119
|
||||
- Fix jtag3_page_erase for targets with UPDI #1112
|
||||
- Fix writing of last word on DWORD TPI parts #1115
|
||||
- Use byte-wise read/write when page size is 1 in terminal
|
||||
cache #1121
|
||||
- Suppress Teensy USB communication error message on reboot #1122
|
||||
- Fix UPDI erase when target is locked #1125
|
||||
- Review and overhaul AVRDUDE's messaging system #1126
|
||||
- Look for ~/.config/avrdude/avrdude.rc then ~/.avrduderc #1131
|
||||
- Revamp terminal output (progress bar, callback and
|
||||
stdout/stderr) #1132
|
||||
- Detect PICkit4 and SNAP in PIC mode #1138
|
||||
- Mention -B in the error message #1139
|
||||
- Support optiboot, optiboot_dx and optiboot_x bootloaders for
|
||||
-c arduino #1140
|
||||
- Always use paged access for programmers that serve
|
||||
bootloaders #1141
|
||||
- Add libreadline-dev for Linux github action build #1146
|
||||
- Implementation of SerialUPDI page erase operation #1151
|
||||
- Fix Type 2 HV UPDI #1164
|
||||
- Rewrite authors/copyrights #1182
|
||||
- Add fallback for EM_AVR #1181
|
||||
- Add a workaround for issue 1173 #1185
|
||||
- Add xplainedpro_pdi programmer #1147
|
||||
- Provide Urclock programmer #1171
|
||||
- Fix JTAGICE mkII (not initializing after chip erase) #1172
|
||||
- Ensure default_programmer from config files is used #1174
|
||||
- Make terminal write's automatic number width less surprising
|
||||
#1175
|
||||
- Print HAVE_LIBREADLINE status when making the project #1184
|
||||
- Pad pages with input file contents before avr_write() #1188
|
||||
- Deprecate mosi/miso in favour of sdo/sdi #1189
|
||||
- Provide bootloader-hash tool #1190
|
||||
- Fix JTAGICE mkII parameters for parts with bootloaders #1191
|
||||
- Fix shell exit value when chip erase is delayed #1194
|
||||
- Support autobaud for urclock programmer #1198
|
||||
- Fix userrow size and page_size for ATtiny3216/7 #1199
|
||||
- Added TPI support for Microchip tools #1205
|
||||
- Fix reading of .elf files #1206
|
||||
- Use libedit only in interactive mode #1207
|
||||
- Add urclock support for bootloaders in low flash #1208
|
||||
- Terminal read improvements #1209
|
||||
- Print meaningful error when a too slow ISP clock is detected #1216
|
||||
- Check alternative USB PID for PICkit4/SNAP in PIC mode #1219
|
||||
- Remove extraneous avrdude> prompt at end of terminal session #1220
|
||||
- Read programmer serial number from libusb or hidusb #1223
|
||||
- Hint at -xeepromrw option in EEPROM error messages #1226
|
||||
- Add JTAG support for PICkit4 and Snap. #1233
|
||||
- Mention developer options in documentation and Usage() #1234
|
||||
- Print expected signature on signature mismatch #1237
|
||||
- To work around Issue #1107 #1240
|
||||
- Update build.sh for NetBSD #1241
|
||||
- Add FT2232H support for Windows, Tigard programmer #1242
|
||||
- Modify recv timeouts to accommodate urclock sync with ftdi
|
||||
#1246
|
||||
- CMake updates #1243
|
||||
- Silence conf path detection debug output #1247
|
||||
- Make WIN32 ser_recv() fail on time-out #1248
|
||||
- Guard urclock_getsync() against initial spurious input #1251
|
||||
- Change definition of NO_PIN to 1+PIN_MAX #1231
|
||||
- Fix partial matches for locate_mem() and do_cmd() #1256
|
||||
- Add abbreviated q command in terminal
|
||||
- Move static usbsn into serdev struct and remove serno #1258
|
||||
- Clean up avrdude.conf.in fixing a couple of bugs #1260
|
||||
- Add readline library replacement for MSVC #1264
|
||||
- Ensure full words are loaded for ISP programming #1265
|
||||
- Silence page erase in cache code #1266
|
||||
- Update to latest MSVC fork of hidapi to include bug fixes
|
||||
#1269
|
||||
|
||||
* Internals:
|
||||
|
||||
- Implement -c <wildcard>/dev_opts and -p <wildcard>/dev_opts
|
||||
for printing avrdude.conf programmer and part entries
|
||||
|
||||
- Added shorter alternative ISP commands for avrdude.conf
|
||||
|
||||
- Reformatted avrdude.conf to canonical form
|
||||
|
||||
- Reviewed API for prgrammer functions: use const for
|
||||
programmer functions where useful; add second argument for
|
||||
void (*enable)(PROGRAMMER *pgm, const AVRPART *p) #1078
|
||||
|
||||
- Reviewed messaging system making warnings and errors explicit
|
||||
and treat them systematically
|
||||
|
||||
|
||||
Changes in version 7.0:
|
||||
|
||||
* Major changes compared to the previous version:
|
||||
|
||||
- Completely revamped Windows support, including MSVC
|
||||
- Started to add CMake (by now, parallel with autoconf/automake)
|
||||
- New-architecture devices (AVR8X mega and tiny) can access all
|
||||
fuses, and memory display shows meaningful alias names
|
||||
- The "safemode" feature has been removed. The major class of
|
||||
programmers it has been designed for (lowlevel bitbang
|
||||
programmers on parallel or serial ports) virtually doesn't exist
|
||||
anymore, and the fuse combination that was covered by it do not
|
||||
match the fuses of modern AVR devices anyway.
|
||||
- avrdude.conf is now being looked up in the location of the
|
||||
executable file first, before considering the configured default
|
||||
location; this eases a "portable use" where the entire suite is
|
||||
not installed into its configured default location. (Basically
|
||||
only relevant for unixoid systems; on Windows, this search order
|
||||
has been used for many years already.)
|
||||
|
||||
* New devices supported:
|
||||
|
||||
- ATtiny828, ATtiny87, ATtiny167, ATtiny48, ATtiny102, ATtiny104
|
||||
- LGT8F88P, LGT8F168P, LGT8F328P (fixed names of these parts)
|
||||
- ATmeg164A, ATmega169A, ATmega169P, ATmega169PA, ATmega329A,
|
||||
ATmega329PA, ATmega3290, ATmega3290A, ATmega3290PA, ATmega649A,
|
||||
ATmega649P, ATmega6490A, ATmega6490P, ATmega165, ATmega165A,
|
||||
ATmega165P, ATmega165PA, ATmega325A, ATmega325P, ATmega325PA,
|
||||
ATmega645A, ATmega645P, ATmega3250A, ATmega3250P, ATmega3250PA,
|
||||
ATmega6450A, ATmega6450P
|
||||
- ATmega48A/48PA/88A/88PA/168A/168PA, ATmega164A/644A/644PA,
|
||||
ATmega16A/32A/64A/128A, ATtiny13A, ATtiny24A/44A/84A,
|
||||
ATtiny261A/461A/861A, ATtiny828R, ATtiny2313A, ATtiny1634R
|
||||
- ATtiny3224, ATtiny3226 and ATtiny3227
|
||||
- AVR16DD14/20/28/32, AVR32DD14/20/28/32 and AVR64DD14/20/28/32
|
||||
- AVR8EA28/32, AVR16EA28/32/48, AVR32EA28/32/48 and AVR64EA28/32/64
|
||||
- ATmega16U4
|
||||
|
||||
|
||||
* New programmers supported:
|
||||
|
||||
- SerialUPDI (UPDI devices connected to serial port with few
|
||||
passive parts)
|
||||
- PicKit4 / SNAP (now also in ISP and PDI mode)
|
||||
- Teensy bootloader (PR #802)
|
||||
- Micronucleus bootloader (PR #786)
|
||||
- ft232h (generic variant, PR #842)
|
||||
- Kristech KT-LINK FT2232H interface with IO switching and voltage
|
||||
buffers (PR #930)
|
||||
|
||||
* Issues fixed:
|
||||
|
||||
- Curiosity Nano and terminal mode #790 (only the actual bugs
|
||||
reported)
|
||||
- CMake doesn't correctly handle conditionals in avrdude.conf.in
|
||||
#776
|
||||
- CMake doesn't detect FreeBSD's libusb-1.0 (compatibility) #775
|
||||
- CMake doesn't correctly handle conditionals in avrdude.conf.in
|
||||
#776
|
||||
- CMake: Recognize more than just bison #785
|
||||
- [bug #26007] ATTiny167 not supported #150
|
||||
- [bug #47375] ATtiny102/104 descriptions missing in configuration
|
||||
file #409
|
||||
- No error message when connecting to a not-connected AVRISP mkII
|
||||
programmer #813
|
||||
- [bug #53180] missing programmer or bad -P option argument
|
||||
doesn't result in error message #471
|
||||
- ATmega328P reported as lgt8fx328p #812
|
||||
- [bug #48004] Dead link for linuxgpio in avrdude description #419
|
||||
- Segmentation fault when writing ATtiny104 fuse #823
|
||||
- USBasp returns ERANGE for unknown error #848
|
||||
- Compiler warnings #856
|
||||
- Can't get serialupdi to work #874
|
||||
- Rework HID support for Windows #881
|
||||
- List of signing keys? #884
|
||||
- Pickit4 UPDI is writing at offset 0x4000 into flash instead of 0x0000. #892
|
||||
- SerialUPDI programmer can't write to usersig/userrow in terminal mode #889
|
||||
- Signature read command for ATmega165* was wrong (no-id)
|
||||
- Cannot use non-standard baud rates for uploading on MacOS #771
|
||||
- Wrong values in avrdude.conf #897
|
||||
- AVR-Eclipse plugin broken by missing -u commandline option #890
|
||||
- Timeout passed to hid_read_timeout() is too short for instances
|
||||
where the EDBG AVRISP 'Enter Programming Mode' command fails #900
|
||||
- Terminal write mode doesn't support string input (yet) #913
|
||||
- Terminal mode: memory fill with strings may cause Avrdude to crash. #922
|
||||
- Some parts have wrong or missing ISP commands #915
|
||||
- Incorrect -b conversion for linuxspi programmer #927
|
||||
- ATtiny43U calibration memory size #921
|
||||
|
||||
* Pull requests:
|
||||
|
||||
- GitHub Migration #765
|
||||
- Update toplevel files. #767
|
||||
- GitHub Migration part 2 #768
|
||||
- Remove 'windows' folder with giveio.sys driver #769
|
||||
- SerialUPDI implementation - release candidate 1 #772
|
||||
- Fix typos #777
|
||||
- Fix memory leaks #779
|
||||
- As promised, documentation for SerialUPDI programmer #782
|
||||
- Improve CMake project #783
|
||||
- Fix avr_read() for page reads #784
|
||||
- Serialupdi manpage #787
|
||||
- Add PicKit4 and SNAP programmers #791
|
||||
- Use yacc/byacc as an alternative to bison, closes #785 #793
|
||||
- Derive program version string from last commit #794
|
||||
- Find 'avrdude.conf' based on absolute path to executable #780
|
||||
- buspirate: fix -Wtautological-constant-out-of-range-compare #796
|
||||
- avrftdi: don't use the deprecated ftdi_usb_purge_buffers routine #792
|
||||
- Ignore ctags index file #804
|
||||
- term: fix memleakOnRealloc #806
|
||||
- Add missing ATtiny targets to avrdude.conf #803
|
||||
- Add support for Teensy bootloader #802
|
||||
- Conffile clean up #801
|
||||
- Fix typos all over the code #807
|
||||
- Add MSVC builds and better WinUSB/FTDI support #798
|
||||
- buspirate: fix invalidScanfArgType_int warning #808
|
||||
- Ignore ac_cfg.h.in~ #810
|
||||
- Notify open failure #814
|
||||
- Print expected part #817
|
||||
- pindefs: conform to the function declaration #818
|
||||
- Add support for Micronucleus bootloader #786
|
||||
- Remove ac_cfg.h from libavrdude.h #820
|
||||
- CMake: enable dynamic-link library for libavrdude #826
|
||||
- Fix for TPI fuse write (issue #823) #828
|
||||
- Add missing ATmega__5 and ATmega__9 targets to avrdude.conf #809
|
||||
- Add missing ATmega and ATtiny targets #832
|
||||
- Added missing RTS/DTR management feature to serialupdi
|
||||
programmer #811
|
||||
- Add missing tinyAVR-2, AVR DD and AVR EA targets #836
|
||||
- Add a new programmer ft232h #842
|
||||
- Reduce verbosity when setting fuses and uploading programs #845
|
||||
- jtagmkii: Reduce the number of sync attempts to 10 + print
|
||||
number of attempts #844
|
||||
- CMake: add initial support for installing lib and include files #829
|
||||
- Add SPI support to USBtiny #816
|
||||
- Add more memory sections to read from #815
|
||||
- Add a build script for Unix-like systems #849
|
||||
- Fix receive buffer implementation in ftdi_syncbb programmer #843
|
||||
- CMake: split configuration in two files #852
|
||||
- Set number of connection retry attempts for Arduino/STK500
|
||||
programmer #854
|
||||
- Fix libusb-1.0 error strings #850
|
||||
- Assign proper type to msg[] in errstr() #857
|
||||
- Fix Arduino retry attempts #855
|
||||
- CMake: use CMAKE_CURRENT_BINARY_DIR to locate avrdude.conf #858
|
||||
- Remove the "safemode" feature. #859
|
||||
- Add support for reading from more memory sections #863
|
||||
- Alias keyword #868
|
||||
- Add fuse name aliases to avrdude.conf + tweak update.c #869
|
||||
- Print JTAG3 clocks after configuration + string formatting #853
|
||||
- Tweak programmer info formatting strings #872
|
||||
- Remove libhid support in ser_avrdoper.c in favor of libhidapi #882
|
||||
- Reduce jtag3 output verbosity #877
|
||||
- Fix Curiosity Nano target voltage #878
|
||||
- Smallest possible fix for PL2303HX #885
|
||||
- Add missing USBtiny derived programmers #873
|
||||
- Cleanup of POSIX serial init code #886
|
||||
- Avrdude terminal write improvements #880
|
||||
- Add userrow and usersig aliases #888
|
||||
- For UPDI devices do not add offset when accessing flash. #895
|
||||
- Support both userrow and usersig names #893
|
||||
- Fix ugly terminal write bug #896
|
||||
- Improve terminal read functionality #894
|
||||
- Macos nonstandard baudrates #898
|
||||
- Fix errors in Avrdude.conf #899
|
||||
- Minor terminal write improvements #902
|
||||
- Term docs #903
|
||||
- Add progressbar for read and write command #912
|
||||
- Add MacOS serial/parallel port note #908
|
||||
- Add ATmega16U4 to avrdude.conf #910
|
||||
- Mask out unused ATmega32U4 efuse bits #909
|
||||
- Increased timeout passed to hid_read_timeout() #901
|
||||
- Add terminal write string functionality #914
|
||||
- Update documentation link to new URL #929
|
||||
- Fix terminal write buffer overflow issue #924
|
||||
- Fix linuxspi baud to clock period calculation #931
|
||||
- Added KT-LINK FT2232H interface with IO switching and voltage buffers. #930
|
||||
|
||||
* Internals:
|
||||
|
||||
- Development moved to Github
|
||||
- Addition of "alias" keyword to avrdude.conf.in syntax; used
|
||||
for fuse name aliases right now
|
||||
|
||||
|
||||
Version 6.4:
|
||||
Current:
|
||||
|
||||
* Major changes compared to the previous version:
|
||||
|
||||
|
@ -510,18 +14,9 @@ Version 6.4:
|
|||
debuggers (JTAGICE3 with firmware 3+, AtmelICE, EDBG, mEDBG)
|
||||
- UPDI support added (AVR8X family)
|
||||
- TPI support for USBtinyISP
|
||||
- TPI support for ft245r
|
||||
- TPI support for linuxgpio
|
||||
- AVR Doper uses libhidapi rather than raw libusb (patch #9033)
|
||||
- -P net:host:port can use IPv6 now (Posix systems only)
|
||||
- New configure option: -disable-libusb_1_0
|
||||
- extended UPDI device context (> 64 Ki flash)
|
||||
- major overhaul of ft245r driver (patch #9327/#9328)
|
||||
- some improvements in linuxspi driver
|
||||
- Use -B <bitclock> rather than -b <baudrate> for linuxspi driver
|
||||
- unused lock byte bits are not masked on read anymore
|
||||
- parport support disabled by default; configure with
|
||||
--enable-parport to explicitly enable it
|
||||
|
||||
* New devices supported:
|
||||
|
||||
|
@ -535,23 +30,13 @@ Version 6.4:
|
|||
ATmega4809
|
||||
- ATtiny841, ATtiny441
|
||||
- ATmega64M1
|
||||
- ATmega324A
|
||||
- ATmega808, ATmega809, ATmega1608, ATmega1609, AVR DA, AVR DB
|
||||
- LGT8FX88P, LGT8FX168P, LGT8FX328P
|
||||
- ATmega324PB
|
||||
- ATmega8A
|
||||
|
||||
* New programmers supported:
|
||||
|
||||
- ehajo-isp (commercial version of USBtiny)
|
||||
- XplainedPro in UPDI mode
|
||||
- XplainedMini in UPDI mode
|
||||
- JTAGICE3 in UPDI mode
|
||||
- Atmel Powerdebugger in all modes (JTAG, PDI, UPDI, debugWIRE, ISP)
|
||||
- linuxspi (direct SPI bus e.g. on Raspberry Pi devices)
|
||||
- PICkit4, Snap, PKoB
|
||||
- iseavrprog
|
||||
- XBeeBoot
|
||||
|
||||
* Bugfixes:
|
||||
bug #47550: Linux GPIO broken
|
||||
|
@ -559,27 +44,6 @@ Version 6.4:
|
|||
bug #48084: Avoid compiled-in timestamp for reproducible release builds
|
||||
bug #47376: ATtiny841 description missing in configuration file
|
||||
bug #49455: support for tiny441
|
||||
bug #57428: document when 'arduino' or 'wiring' should be used, and -D requirement of latter
|
||||
bug #58095: error setting efuse on atmega328pb variant
|
||||
bug #51409: Can't program EFUSE on ATmega32M1
|
||||
bug #60753: Patch #1436 breaks multiple programmer/device combinations on MacOS BigSur
|
||||
bug #59525: Bogus error message because Copy/Paste typo in stk500.c
|
||||
bug #58078: [PATCH] buspirate: remove compound literals (fixes GCC>=9)
|
||||
bug #57453: [PATCH] fix reference to nonexistant -m option by changing to -U
|
||||
bug #59227: Add new part. How does one get a part added to the CONF file?
|
||||
bug #55009: no efuses for m164a/pa
|
||||
bug #55734: USBtiny programming of ATmega328p broken by Patch #9278
|
||||
bug #58495: Add atmega324pb support to avrdude.conf.in
|
||||
bug #60863: avrftdi programming error probably caused by multiple, consecutive empty pages
|
||||
bug #50517: Reading fails if "immediate mode" for output file format is selected - fileio: invalid operation=1
|
||||
bug #50630: Erase Cycle Counter options ( -y -Y n ) should be removed from usage Message
|
||||
bug #48767: ser_drain() for TCP on Windows doesn't work
|
||||
bug #46759: avrdude 6.1 -> 6.2 regression: lock byte verification error
|
||||
bug #58440: linuxgpio PIN limit too low
|
||||
bug #55462: wrong programmer id check in jtag3_getsync() and jtag3_close()
|
||||
bug #58994: VPP PWM still enabled at the end of programming process
|
||||
bug #57338: if safemode has to change fuses avrdude should exit with non-zero exit code
|
||||
bug #60575: Permission denied on macOS Big Sur
|
||||
|
||||
* Patches:
|
||||
patch #9482: Add support for UPDI and AVR8X
|
||||
|
@ -600,43 +64,8 @@ Version 6.4:
|
|||
patch #8311: Add IPv6 support to the -Pnet:host:port option
|
||||
patch #9542: Correct "usersig" on avr8x devices
|
||||
patch #8128: Added new option to configure.ac script
|
||||
patch #8444: Proposal for modifications in -B and -U command options managment (partially)
|
||||
patch #9735: spelling error fix: psuedo -> pseudo
|
||||
patch #9893: [PATCH] Reader reads ftdi handle after main thread close it
|
||||
patch #9819: Address several leaks in SVN rev 1429
|
||||
patch #9820: Fix some out-of-bounds/uninitialized issues
|
||||
patch #9818: correct typos in SVN rev 1429
|
||||
patch #9732: usbtiny_paged_load overflows buffer e.g. when reading EEPROM
|
||||
patch #9966: Add JTAGICE3 in UPDI mode
|
||||
patch #9963: UsbAsp 3 MHz patch for UsbAsp-flash firmware
|
||||
patch #9816: Implement new programmer type: linuxspi
|
||||
patch #9811: ATmega328pb has efuse bit 3
|
||||
patch #9744: Patch for ATMega324A support
|
||||
patch #10000: Add support for extended UPDI device context
|
||||
patch #9697: Add iseavrprog support
|
||||
patch #10017: uspasp / tpi: Automatically clear configuration byte (fuse) before writing it
|
||||
patch #8957: Allow reading prodsig memory from stk500v2 on xmega devices
|
||||
patch #9110: Let reserved fuse bits to be read as *don't care*
|
||||
patch #9253: Fix for giving terminal_mode commands more than 20 arguments
|
||||
patch #9320: fix TPI RESET in bitbang.c
|
||||
patch #9079: Fix ftdi_syncbb teardown (supersedes #9893, superseded by #9328)
|
||||
patch #9122: Fixed MISO sampling in ftdi_syncbb
|
||||
patch #9123: ftdi_syncbb: use FT245R_CYCLES in ft245r_set_bitclock()
|
||||
patch #8719: Support Over-the-Air bootloading with XBeeBoot
|
||||
patch #9757: Fix ATtiny817 Xplained Mini programmer
|
||||
patch #9327: ft245r.c: add TPI support (patches 1-4)
|
||||
patch #9328: ft245r.c: add TPI support (patches 5-7)
|
||||
patch #10027: linuxspi: Add reset pulse, according to AVR programming algorithm
|
||||
patch #10028: linuxspi: close() only when necessary
|
||||
patch #10029: linuxspi: Report GPIO_GET_LINEHANDLE_IOCTL errors
|
||||
patch #10030: linuxspi: Support inverted GPIO pin
|
||||
patch #10031: linuxspi: Support GPIO uAPI v2
|
||||
(no-id): Improve documentation of linuxspi driver, provide portname default
|
||||
(no-id): Use -B <bitclock> rather than -b <baudrate> for linuxspi driver
|
||||
patch #9304: [Bug #48767] Implemented WinSock variation of "ser_drain(...)" functionality
|
||||
patch #8996: Remove lock byte read mask (bug#21954, bug#46759)
|
||||
patch #8923: Enable TPI for linuxgpio
|
||||
patch #10153: linuxspi: Support "-E reset" and "-E noreset"
|
||||
patch #8444: Proposal for modifications in -B and -U command options managment
|
||||
(partially)
|
||||
|
||||
* Internals:
|
||||
- New avrdude.conf keyword "family_id", used to verify SIB attributes
|
||||
|
@ -1239,7 +668,7 @@ Version 4.3.0:
|
|||
* Added "Troubleshooting"-Appendix to the manual.
|
||||
|
||||
* Add ATmega8515 support.
|
||||
Contributed by: Matthias Weißer <matthias@matwei.de>
|
||||
Contributed by: Matthias Weißer <matthias@matwei.de>
|
||||
|
||||
* Add ATmega64 support.
|
||||
Contributed by: Erik Christiansen <erik@dd.nec.com.au>
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
See the documentation file for the details.
|
||||
|
||||
The latest version of AVRDUDE is always available here:
|
||||
|
||||
http://savannah.nongnu.org/projects/avrdude
|
||||
|
||||
|
||||
Important environment variables for ./configure:
|
||||
================================================
|
||||
|
||||
CPPFLAGS: C preprocessor flags (*not* "C++")
|
||||
|
||||
This is the place to put additional (non-standard) -I options into.
|
||||
For example, if your Windows system has LibUSB-Win32 installed into
|
||||
\\WINDOWS\ProgramFiles\LibUSB-Win32, use
|
||||
|
||||
CPPFLAGS=-I/WINDOWS/ProgramFiles/LibUSB-Win32/include
|
||||
|
||||
to tell configure where to search for the header files. (The use of
|
||||
forward slashes rather than backslashes can often simplify things.
|
||||
Note that the Windows system services internally treat both the same.
|
||||
It's only cmd.exe which requires backslashes as the directory
|
||||
separator.)
|
||||
|
||||
LDFLAGS: Linker options
|
||||
|
||||
This is the place to make additional library locations known to the
|
||||
linker. To continue the above example, use
|
||||
|
||||
LDFLAGS=-L/WINDOWS/ProgramFiles/LibUSB-Win32/lib/gcc
|
||||
|
||||
to make the linker search for "libusb.a" in that directory.
|
||||
|
||||
|
||||
Linux users: make sure the header files are installed
|
||||
=====================================================
|
||||
|
||||
While many Linux distributions install the libraries needed by AVRDUDE
|
||||
(libusb, libelf) by default, they leave out the corresponding header
|
||||
files. Consequently, the configure script won't find them, so these
|
||||
libraries could not be used.
|
||||
|
||||
Usually, the packages with the header files (and static libraries) are
|
||||
derived from the regular package name by appending "-devel". Thus,
|
||||
make sure you have "libusb-devel" and "libelf-devel" installed before
|
||||
running the configure script. (Same goes for libftdi.)
|
|
@ -1,64 +0,0 @@
|
|||
# AVRDUDE
|
||||
|
||||
[![Build Status](https://github.com/avrdudes/avrdude/actions/workflows/build.yml/badge.svg)](https://github.com/avrdudes/avrdude/actions/workflows/build.yml)
|
||||
|
||||
AVRDUDE - AVR Downloader Uploader - is a program for downloading and uploading
|
||||
the on-chip memories of Microchip’s [AVR microcontrollers](https://en.wikipedia.org/wiki/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](./AUTHORS).
|
||||
|
||||
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](https://avrdudes.github.io/avrdude/).
|
||||
|
||||
## Getting AVRDUDE for Windows
|
||||
|
||||
To get AVRDUDE for Windows, install the latest version from the [Releases](http://download.savannah.gnu.org/releases/avrdude/) page.
|
||||
|
||||
Alternatively, you may [build AVRDUDE](https://github.com/avrdudes/avrdude/wiki) yourself from source.
|
||||
|
||||
## Getting AVRDUDE for Linux
|
||||
|
||||
To install AVRDUDE for Linux, install the package `avrdude` by running the following commands:
|
||||
|
||||
```console
|
||||
sudo apt-get install avrdude
|
||||
```
|
||||
|
||||
Alternatively, you may [build AVRDUDE](https://github.com/avrdudes/avrdude/wiki) yourself from source.
|
||||
|
||||
## Getting AVRDUDE for MacOS
|
||||
|
||||
On MacOS, AVRDUDE can be installed through Mac Ports.
|
||||
|
||||
Alternatively, you may [build AVRDUDE](https://github.com/avrdudes/avrdude/wiki) 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:
|
||||
|
||||
```console
|
||||
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:
|
||||
|
||||
```console
|
||||
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](https://avrdudes.github.io/avrdude/).
|
|
@ -38,13 +38,14 @@
|
|||
#include "arduino.h"
|
||||
|
||||
/* read signature bytes - arduino version */
|
||||
static int arduino_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m) {
|
||||
static int arduino_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m)
|
||||
{
|
||||
unsigned char buf[32];
|
||||
|
||||
/* Signature byte reads are always 3 bytes. */
|
||||
|
||||
if (m->size < 3) {
|
||||
pmsg_error("memsize too small for sig byte read");
|
||||
avrdude_message(MSG_INFO, "%s: memsize too small for sig byte read", progname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -56,16 +57,19 @@ static int arduino_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const
|
|||
if (serial_recv(&pgm->fd, buf, 5) < 0)
|
||||
return -1;
|
||||
if (buf[0] == Resp_STK_NOSYNC) {
|
||||
pmsg_error("programmer is out of sync\n");
|
||||
avrdude_message(MSG_INFO, "%s: stk500_cmd(): programmer is out of sync\n",
|
||||
progname);
|
||||
return -1;
|
||||
} else if (buf[0] != Resp_STK_INSYNC) {
|
||||
msg_error("\n");
|
||||
pmsg_error("protocol expects sync byte 0x%02x but got 0x%02x\n", Resp_STK_INSYNC, buf[0]);
|
||||
avrdude_message(MSG_INFO, "\n%s: arduino_read_sig_bytes(): (a) protocol error, "
|
||||
"expect=0x%02x, resp=0x%02x\n",
|
||||
progname, Resp_STK_INSYNC, buf[0]);
|
||||
return -2;
|
||||
}
|
||||
if (buf[4] != Resp_STK_OK) {
|
||||
msg_error("\n");
|
||||
pmsg_error("protocol expects OK byte 0x%02x but got 0x%02x\n", Resp_STK_OK, buf[4]);
|
||||
avrdude_message(MSG_INFO, "\n%s: arduino_read_sig_bytes(): (a) protocol error, "
|
||||
"expect=0x%02x, resp=0x%02x\n",
|
||||
progname, Resp_STK_OK, buf[4]);
|
||||
return -3;
|
||||
}
|
||||
|
||||
|
@ -76,11 +80,11 @@ static int arduino_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const
|
|||
return 3;
|
||||
}
|
||||
|
||||
static int arduino_open(PROGRAMMER *pgm, const char *port) {
|
||||
static int arduino_open(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
union pinfo pinfo;
|
||||
strcpy(pgm->port, port);
|
||||
pinfo.serialinfo.baud = pgm->baudrate? pgm->baudrate: 115200;
|
||||
pinfo.serialinfo.cflags = SERIAL_8N1;
|
||||
pinfo.baud = pgm->baudrate? pgm->baudrate: 115200;
|
||||
if (serial_open(port, pinfo, &pgm->fd)==-1) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -113,7 +117,8 @@ static void arduino_close(PROGRAMMER * pgm)
|
|||
|
||||
const char arduino_desc[] = "Arduino programmer";
|
||||
|
||||
void arduino_initpgm(PROGRAMMER *pgm) {
|
||||
void arduino_initpgm(PROGRAMMER * pgm)
|
||||
{
|
||||
/* This is mostly a STK500; just the signature is read
|
||||
differently than on real STK500v1
|
||||
and the DTR signal is set when opening the serial port
|
||||
|
@ -124,6 +129,4 @@ void arduino_initpgm(PROGRAMMER *pgm) {
|
|||
pgm->read_sig_bytes = arduino_read_sig_bytes;
|
||||
pgm->open = arduino_open;
|
||||
pgm->close = arduino_close;
|
||||
|
||||
disable_trailing_ff_removal(); /* so that arduino bootloader can ignore chip erase */
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
#define arduino_h__
|
||||
|
||||
extern const char arduino_desc[];
|
||||
void arduino_initpgm(PROGRAMMER *pgm);
|
||||
void arduino_initpgm (PROGRAMMER * pgm);
|
||||
|
||||
#endif
|
||||
|
|
@ -57,7 +57,8 @@ struct pdata
|
|||
static void avr910_setup(PROGRAMMER * pgm)
|
||||
{
|
||||
if ((pgm->cookie = malloc(sizeof(struct pdata))) == 0) {
|
||||
pmsg_error("out of memory allocating private data\n");
|
||||
avrdude_message(MSG_INFO, "%s: avr910_setup(): Out of memory allocating private data\n",
|
||||
progname);
|
||||
exit(1);
|
||||
}
|
||||
memset(pgm->cookie, 0, sizeof(struct pdata));
|
||||
|
@ -70,34 +71,40 @@ static void avr910_teardown(PROGRAMMER * pgm)
|
|||
}
|
||||
|
||||
|
||||
static int avr910_send(const PROGRAMMER *pgm, char *buf, size_t len) {
|
||||
static int avr910_send(PROGRAMMER * pgm, char * buf, size_t len)
|
||||
{
|
||||
return serial_send(&pgm->fd, (unsigned char *)buf, len);
|
||||
}
|
||||
|
||||
|
||||
static int avr910_recv(const PROGRAMMER *pgm, char *buf, size_t len) {
|
||||
static int avr910_recv(PROGRAMMER * pgm, char * buf, size_t len)
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = serial_recv(&pgm->fd, (unsigned char *)buf, len);
|
||||
if (rv < 0) {
|
||||
pmsg_error("programmer is not responding\n");
|
||||
avrdude_message(MSG_INFO, "%s: avr910_recv(): programmer is not responding\n",
|
||||
progname);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int avr910_drain(const PROGRAMMER *pgm, int display) {
|
||||
static int avr910_drain(PROGRAMMER * pgm, int display)
|
||||
{
|
||||
return serial_drain(&pgm->fd, display);
|
||||
}
|
||||
|
||||
|
||||
static int avr910_vfy_cmd_sent(const PROGRAMMER *pgm, char *errmsg) {
|
||||
static int avr910_vfy_cmd_sent(PROGRAMMER * pgm, char * errmsg)
|
||||
{
|
||||
char c;
|
||||
|
||||
avr910_recv(pgm, &c, 1);
|
||||
if (c != '\r') {
|
||||
pmsg_error("programmer did not respond to command: %s\n", errmsg);
|
||||
avrdude_message(MSG_INFO, "%s: error: programmer did not respond to command: %s\n",
|
||||
progname, errmsg);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -107,7 +114,8 @@ static int avr910_vfy_cmd_sent(const PROGRAMMER *pgm, char *errmsg) {
|
|||
/*
|
||||
* issue the 'chip erase' command to the AVR device
|
||||
*/
|
||||
static int avr910_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static int avr910_chip_erase(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
avr910_send(pgm, "e", 1);
|
||||
if (avr910_vfy_cmd_sent(pgm, "chip erase") < 0)
|
||||
return -1;
|
||||
|
@ -121,13 +129,15 @@ static int avr910_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
}
|
||||
|
||||
|
||||
static int avr910_enter_prog_mode(const PROGRAMMER *pgm) {
|
||||
static int avr910_enter_prog_mode(PROGRAMMER * pgm)
|
||||
{
|
||||
avr910_send(pgm, "P", 1);
|
||||
return avr910_vfy_cmd_sent(pgm, "enter prog mode");
|
||||
}
|
||||
|
||||
|
||||
static int avr910_leave_prog_mode(const PROGRAMMER *pgm) {
|
||||
static int avr910_leave_prog_mode(PROGRAMMER * pgm)
|
||||
{
|
||||
avr910_send(pgm, "L", 1);
|
||||
return avr910_vfy_cmd_sent(pgm, "leave prog mode");
|
||||
}
|
||||
|
@ -136,7 +146,8 @@ static int avr910_leave_prog_mode(const PROGRAMMER *pgm) {
|
|||
/*
|
||||
* issue the 'program enable' command to the AVR device
|
||||
*/
|
||||
static int avr910_program_enable(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static int avr910_program_enable(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -144,7 +155,8 @@ static int avr910_program_enable(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
/*
|
||||
* initialize the AVR device and prepare it to accept commands
|
||||
*/
|
||||
static int avr910_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
char id[8];
|
||||
char sw[2];
|
||||
char hw[2];
|
||||
|
@ -173,16 +185,16 @@ static int avr910_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
avr910_send(pgm, "p", 1);
|
||||
avr910_recv(pgm, &type, 1);
|
||||
|
||||
msg_notice("Programmer id = %s; type = %c\n", id, type);
|
||||
msg_notice("Software version = %c.%c; ", sw[0], sw[1]);
|
||||
msg_notice("Hardware version = %c.%c\n", hw[0], hw[1]);
|
||||
avrdude_message(MSG_INFO, "Found programmer: Id = \"%s\"; type = %c\n", id, type);
|
||||
avrdude_message(MSG_INFO, " Software Version = %c.%c; ", sw[0], sw[1]);
|
||||
avrdude_message(MSG_INFO, "Hardware Version = %c.%c\n", hw[0], hw[1]);
|
||||
|
||||
/* See if programmer supports autoincrement of address. */
|
||||
|
||||
avr910_send(pgm, "a", 1);
|
||||
avr910_recv(pgm, &PDATA(pgm)->has_auto_incr_addr, 1);
|
||||
if (PDATA(pgm)->has_auto_incr_addr == 'Y')
|
||||
msg_notice("programmer supports auto addr increment\n");
|
||||
avrdude_message(MSG_INFO, "Programmer supports auto addr increment.\n");
|
||||
|
||||
/* Check support for buffered memory access, ignore if not available */
|
||||
|
||||
|
@ -194,8 +206,8 @@ static int avr910_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
PDATA(pgm)->buffersize = (unsigned int)(unsigned char)c<<8;
|
||||
avr910_recv(pgm, &c, 1);
|
||||
PDATA(pgm)->buffersize += (unsigned int)(unsigned char)c;
|
||||
msg_notice("programmer supports buffered memory access with "
|
||||
"buffersize = %u bytes\n",
|
||||
avrdude_message(MSG_INFO, "Programmer supports buffered memory access with "
|
||||
"buffersize = %u bytes.\n",
|
||||
PDATA(pgm)->buffersize);
|
||||
PDATA(pgm)->use_blockmode = 1;
|
||||
} else {
|
||||
|
@ -212,7 +224,7 @@ static int avr910_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
/* Get list of devices that the programmer supports. */
|
||||
|
||||
avr910_send(pgm, "t", 1);
|
||||
msg_notice2("\nProgrammer supports the following devices:\n");
|
||||
avrdude_message(MSG_INFO, "\nProgrammer supports the following devices:\n");
|
||||
devtype_1st = 0;
|
||||
while (1) {
|
||||
avr910_recv(pgm, &c, 1);
|
||||
|
@ -222,23 +234,21 @@ static int avr910_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
break;
|
||||
part = locate_part_by_avr910_devcode(part_list, c);
|
||||
|
||||
msg_notice2(" Device code: 0x%02x = %s\n", c & 0xff, part? part->desc: "(unknown)");
|
||||
avrdude_message(MSG_INFO, " Device code: 0x%02x = %s\n", c, part ? part->desc : "(unknown)");
|
||||
|
||||
/* FIXME: Need to lookup devcode and report the device. */
|
||||
|
||||
if (p->avr910_devcode == c)
|
||||
dev_supported = 1;
|
||||
};
|
||||
msg_notice2("\n");
|
||||
avrdude_message(MSG_INFO, "\n");
|
||||
|
||||
if (!dev_supported) {
|
||||
if(ovsigck)
|
||||
pmsg_warning("selected device is not supported by programmer %s\n", p->id);
|
||||
else {
|
||||
pmsg_error("selected device is not supported by programmer %s\n", p->id);
|
||||
avrdude_message(MSG_INFO, "%s: %s: selected device is not supported by programmer: %s\n",
|
||||
progname, ovsigck? "warning": "error", p->id);
|
||||
if (!ovsigck)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/* If the user forced the selection, use the first device
|
||||
type that is supported by the programmer. */
|
||||
buf[1] = ovsigck? devtype_1st: p->avr910_devcode;
|
||||
|
@ -254,7 +264,8 @@ static int avr910_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
avr910_send(pgm, buf, 2);
|
||||
avr910_vfy_cmd_sent(pgm, "select device");
|
||||
|
||||
pmsg_notice("avr910_devcode selected: 0x%02x\n", (unsigned) buf[1]);
|
||||
avrdude_message(MSG_NOTICE, "%s: avr910_devcode selected: 0x%02x\n",
|
||||
progname, (unsigned)buf[1]);
|
||||
|
||||
avr910_enter_prog_mode(pgm);
|
||||
|
||||
|
@ -262,14 +273,16 @@ static int avr910_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
}
|
||||
|
||||
|
||||
static void avr910_disable(const PROGRAMMER *pgm) {
|
||||
static void avr910_disable(PROGRAMMER * pgm)
|
||||
{
|
||||
/* Do nothing. */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void avr910_enable(PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static void avr910_enable(PROGRAMMER * pgm)
|
||||
{
|
||||
/* Do nothing. */
|
||||
|
||||
return;
|
||||
|
@ -280,7 +293,7 @@ static void avr910_enable(PROGRAMMER *pgm, const AVRPART *p) {
|
|||
* transmit an AVR device command and return the results; 'cmd' and
|
||||
* 'res' must point to at least a 4 byte data buffer
|
||||
*/
|
||||
static int avr910_cmd(const PROGRAMMER *pgm, const unsigned char *cmd,
|
||||
static int avr910_cmd(PROGRAMMER * pgm, const unsigned char *cmd,
|
||||
unsigned char *res)
|
||||
{
|
||||
char buf[5];
|
||||
|
@ -305,7 +318,8 @@ static int avr910_cmd(const PROGRAMMER *pgm, const unsigned char *cmd,
|
|||
}
|
||||
|
||||
|
||||
static int avr910_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) {
|
||||
static int avr910_parseextparms(PROGRAMMER * pgm, LISTID extparms)
|
||||
{
|
||||
LNODEID ln;
|
||||
const char *extended_param;
|
||||
int rv = 0;
|
||||
|
@ -317,23 +331,27 @@ static int avr910_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) {
|
|||
int devcode;
|
||||
if (sscanf(extended_param, "devcode=%i", &devcode) != 1 ||
|
||||
devcode <= 0 || devcode > 255) {
|
||||
pmsg_error("invalid devcode '%s'\n", extended_param);
|
||||
avrdude_message(MSG_INFO, "%s: avr910_parseextparms(): invalid devcode '%s'\n",
|
||||
progname, extended_param);
|
||||
rv = -1;
|
||||
continue;
|
||||
}
|
||||
pmsg_notice2("avr910_parseextparms(): devcode overwritten as 0x%02x\n", devcode);
|
||||
avrdude_message(MSG_NOTICE2, "%s: avr910_parseextparms(): devcode overwritten as 0x%02x\n",
|
||||
progname, devcode);
|
||||
PDATA(pgm)->devcode = devcode;
|
||||
|
||||
continue;
|
||||
}
|
||||
if (strncmp(extended_param, "no_blockmode", strlen("no_blockmode")) == 0) {
|
||||
pmsg_notice2("avr910_parseextparms(-x): no testing for Blockmode\n");
|
||||
avrdude_message(MSG_NOTICE2, "%s: avr910_parseextparms(-x): no testing for Blockmode\n",
|
||||
progname);
|
||||
PDATA(pgm)->test_blockmode = 0;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
pmsg_error("invalid extended parameter '%s'\n", extended_param);
|
||||
avrdude_message(MSG_INFO, "%s: avr910_parseextparms(): invalid extended parameter '%s'\n",
|
||||
progname, extended_param);
|
||||
rv = -1;
|
||||
}
|
||||
|
||||
|
@ -341,7 +359,8 @@ static int avr910_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) {
|
|||
}
|
||||
|
||||
|
||||
static int avr910_open(PROGRAMMER *pgm, const char *port) {
|
||||
static int avr910_open(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
union pinfo pinfo;
|
||||
/*
|
||||
* If baudrate was not specified use 19.200 Baud
|
||||
|
@ -351,8 +370,7 @@ static int avr910_open(PROGRAMMER *pgm, const char *port) {
|
|||
}
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
pinfo.serialinfo.baud = pgm->baudrate;
|
||||
pinfo.serialinfo.cflags = SERIAL_8N1;
|
||||
pinfo.baud = pgm->baudrate;
|
||||
if (serial_open(port, pinfo, &pgm->fd)==-1) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -374,12 +392,14 @@ static void avr910_close(PROGRAMMER * pgm)
|
|||
}
|
||||
|
||||
|
||||
static void avr910_display(const PROGRAMMER *pgm, const char *p) {
|
||||
static void avr910_display(PROGRAMMER * pgm, const char * p)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void avr910_set_addr(const PROGRAMMER *pgm, unsigned long addr) {
|
||||
static void avr910_set_addr(PROGRAMMER * pgm, unsigned long addr)
|
||||
{
|
||||
char cmd[3];
|
||||
|
||||
cmd[0] = 'A';
|
||||
|
@ -391,7 +411,7 @@ static void avr910_set_addr(const PROGRAMMER *pgm, unsigned long addr) {
|
|||
}
|
||||
|
||||
|
||||
static int avr910_write_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avr910_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned long addr, unsigned char value)
|
||||
{
|
||||
char cmd[2];
|
||||
|
@ -424,7 +444,7 @@ static int avr910_write_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRM
|
|||
}
|
||||
|
||||
|
||||
static int avr910_read_byte_flash(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avr910_read_byte_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned long addr, unsigned char * value)
|
||||
{
|
||||
char buf[2];
|
||||
|
@ -447,7 +467,7 @@ static int avr910_read_byte_flash(const PROGRAMMER *pgm, const AVRPART *p, const
|
|||
}
|
||||
|
||||
|
||||
static int avr910_read_byte_eeprom(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avr910_read_byte_eeprom(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned long addr, unsigned char * value)
|
||||
{
|
||||
avr910_set_addr(pgm, addr);
|
||||
|
@ -458,7 +478,7 @@ static int avr910_read_byte_eeprom(const PROGRAMMER *pgm, const AVRPART *p, cons
|
|||
}
|
||||
|
||||
|
||||
static int avr910_read_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avr910_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned long addr, unsigned char * value)
|
||||
{
|
||||
if (strcmp(m->desc, "flash") == 0) {
|
||||
|
@ -473,7 +493,7 @@ static int avr910_read_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRME
|
|||
}
|
||||
|
||||
|
||||
static int avr910_paged_write_flash(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avr910_paged_write_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned int page_size,
|
||||
unsigned int addr, unsigned int n_bytes)
|
||||
{
|
||||
|
@ -532,8 +552,8 @@ static int avr910_paged_write_flash(const PROGRAMMER *pgm, const AVRPART *p, con
|
|||
}
|
||||
|
||||
|
||||
static int avr910_paged_write_eeprom(const PROGRAMMER *pgm, const AVRPART *p,
|
||||
const AVRMEM * m,
|
||||
static int avr910_paged_write_eeprom(PROGRAMMER * pgm, AVRPART * p,
|
||||
AVRMEM * m,
|
||||
unsigned int page_size,
|
||||
unsigned int addr, unsigned int n_bytes)
|
||||
{
|
||||
|
@ -561,7 +581,7 @@ static int avr910_paged_write_eeprom(const PROGRAMMER *pgm, const AVRPART *p,
|
|||
}
|
||||
|
||||
|
||||
static int avr910_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avr910_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned int page_size,
|
||||
unsigned int addr, unsigned int n_bytes)
|
||||
{
|
||||
|
@ -621,7 +641,7 @@ static int avr910_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const AVR
|
|||
}
|
||||
|
||||
|
||||
static int avr910_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avr910_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned int page_size,
|
||||
unsigned int addr, unsigned int n_bytes)
|
||||
{
|
||||
|
@ -698,11 +718,12 @@ static int avr910_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVRM
|
|||
|
||||
/* Signature byte reads are always 3 bytes. */
|
||||
|
||||
static int avr910_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m) {
|
||||
static int avr910_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m)
|
||||
{
|
||||
unsigned char tmp;
|
||||
|
||||
if (m->size < 3) {
|
||||
pmsg_error("memsize too small for sig byte read");
|
||||
avrdude_message(MSG_INFO, "%s: memsize too small for sig byte read", progname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -718,7 +739,8 @@ static int avr910_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const
|
|||
|
||||
const char avr910_desc[] = "Serial programmers using protocol described in application note AVR910";
|
||||
|
||||
void avr910_initpgm(PROGRAMMER *pgm) {
|
||||
void avr910_initpgm(PROGRAMMER * pgm)
|
||||
{
|
||||
strcpy(pgm->type, "avr910");
|
||||
|
||||
/*
|
|
@ -26,7 +26,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
extern const char avr910_desc[];
|
||||
void avr910_initpgm(PROGRAMMER *pgm);
|
||||
void avr910_initpgm (PROGRAMMER * pgm);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
.\"
|
||||
.\" avrdude - A Downloader/Uploader for AVR device programmers
|
||||
.\" Copyright (C) 2001, 2002, 2003, 2005 - 2020 Joerg Wunsch
|
||||
.\" Copyright (C) 2001, 2002, 2003, 2005 - 2016 Joerg Wunsch
|
||||
.\"
|
||||
.\" This program is free software; you can redistribute it and/or modify
|
||||
.\" it under the terms of the GNU General Public License as published by
|
||||
|
@ -18,7 +18,7 @@
|
|||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd July 12, 2022
|
||||
.Dd DATE February 15, 2016
|
||||
.Os
|
||||
.Dt AVRDUDE 1
|
||||
.Sh NAME
|
||||
|
@ -31,7 +31,6 @@
|
|||
.Op Fl B Ar bitclock
|
||||
.Op Fl c Ar programmer-id
|
||||
.Op Fl C Ar config-file
|
||||
.Op Fl A
|
||||
.Op Fl D
|
||||
.Op Fl e
|
||||
.Oo Fl E Ar exitspec Ns
|
||||
|
@ -39,12 +38,14 @@
|
|||
.Oc
|
||||
.Op Fl F
|
||||
.Op Fl i Ar delay
|
||||
.Op Fl l Ar logfile
|
||||
.Op Fl n logfile
|
||||
.Op Fl n
|
||||
.Op Fl O
|
||||
.Op Fl P Ar port
|
||||
.Op Fl q
|
||||
.Op Fl s
|
||||
.Op Fl t
|
||||
.Op Fl u
|
||||
.Op Fl U Ar memtype:op:filename:filefmt
|
||||
.Op Fl v
|
||||
.Op Fl x Ar extended_param
|
||||
|
@ -75,12 +76,10 @@ so, for the
|
|||
based programmer, the MCU signals
|
||||
.Ql /RESET ,
|
||||
.Ql SCK ,
|
||||
.Ql SDI
|
||||
.Ql MISO
|
||||
and
|
||||
.Ql SDO
|
||||
of the AVR's SPI interface need to be connected to the
|
||||
parallel port; older boards might use the labels MOSI for SDO or MISO for SDI.
|
||||
Optionally, some otherwise
|
||||
.Ql MOSI
|
||||
need to be connected to the parallel port. Optionally, some otherwise
|
||||
unused output pins of the parallel port can be used to supply power
|
||||
for the MCU part, so it is also possible to construct a passive
|
||||
stand-alone programming device. Some status LEDs indicating the
|
||||
|
@ -100,41 +99,16 @@ work at all, or to work abysmally slow.
|
|||
.Pp
|
||||
If you happen to have a Linux system with at least 4 hardware GPIOs
|
||||
available (like almost all embedded Linux boards) you can do without
|
||||
any additional hardware - just connect them to the SDO, SDI, RESET
|
||||
any additional hardware - just connect them to the MOSI, MISO, RESET
|
||||
and SCK pins on the AVR and use the linuxgpio programmer type. It bitbangs
|
||||
the lines using the Linux sysfs GPIO interface. Of course, care should
|
||||
be taken about voltage level compatibility. Also, although not strictly
|
||||
be taken about voltage level compatibility. Also, although not strictrly
|
||||
required, it is strongly advisable to protect the GPIO pins from
|
||||
overcurrent situations in some way. The simplest would be to just put
|
||||
some resistors in series or better yet use a 3-state buffer driver like
|
||||
the 74HC244. Have a look at http://kolev.info/blog/2013/01/06/avrdude-linuxgpio/ for a more
|
||||
the 74HC244. Have a look at http://kolev.info/avrdude-linuxgpio for a more
|
||||
detailed tutorial about using this programmer type.
|
||||
.Pp
|
||||
Under a Linux installation with direct access to the SPI bus and GPIO
|
||||
pins, such as would be found on a Raspberry Pi, the ``linuxspi''
|
||||
programmer type can be used to directly connect to and program a chip
|
||||
using the built in interfaces on the computer. The requirements to use
|
||||
this type are that an SPI interface is exposed along with one GPIO
|
||||
pin. The GPIO serves as the reset output since the Linux SPI drivers
|
||||
do not hold chip select down when a transfer is not occurring and thus
|
||||
it cannot be used as the reset pin. A readily available level
|
||||
translator should be used between the SPI bus/reset GPIO and the chip
|
||||
to avoid potentially damaging the computer's SPI controller in the
|
||||
event that the chip is running at 5V and the SPI runs at 3.3V. The
|
||||
GPIO chosen for reset can be configured in the avrdude configuration
|
||||
file using the
|
||||
.Li reset
|
||||
entry under the linuxspi programmer, or
|
||||
directly in the port specification. An external pull-up resistor
|
||||
should be connected between the AVR's reset pin and Vcc. If Vcc is not
|
||||
the same as the SPI voltage, this should be done on the AVR side of
|
||||
the level translator to protect the hardware from damage.
|
||||
.Pp
|
||||
The
|
||||
.Fl P Ar portname
|
||||
option for this programmer defaults to
|
||||
.Li /dev/spidev0.0:/dev/gpiochip0 .
|
||||
.Pp
|
||||
Atmel's STK500 programmer is also supported and connects to a serial
|
||||
port.
|
||||
Both, firmware versions 1.x and 2.x can be handled, but require a
|
||||
|
@ -143,29 +117,12 @@ Using firmware version 2, high-voltage programming is also supported,
|
|||
both parallel and serial
|
||||
(programmer types stk500pp and stk500hvsp).
|
||||
.Pp
|
||||
Wiring boards (e.g. Arduino Mega 2560 Rev3) are supported, utilizing STK500
|
||||
V2.x protocol, but a simple DTR/RTS toggle is used to set the boards into
|
||||
programming mode. The programmer type is ``wiring''. Note that the -D option
|
||||
will likely be required in this case, because the bootloader will rewrite the
|
||||
program memory, but no true chip erase can be performed.
|
||||
Wiring boards are supported, utilizing STK500 V2.x protocol, but
|
||||
a simple DTR/RTS toggle is used to set the boards into programming mode.
|
||||
The programmer type is ``wiring''.
|
||||
.Pp
|
||||
Serial bootloaders that run a skeleton of the STK500 1.x protocol are
|
||||
supported via their own programmer type ``arduino''. This programmer works
|
||||
for the Arduino Uno Rev3 or any AVR that runs the Optiboot bootloader.
|
||||
.Pp
|
||||
Urprotocol is a leaner version of the STK500 1.x protocol that is designed
|
||||
to be backwards compatible with STK500 v1.x, and allows bootloaders to be
|
||||
much smaller, e.g., as implemented in the urboot project
|
||||
https://github.com/stefanrueger/urboot. The programmer type ``urclock''
|
||||
caters for these urboot programmers. Owing to its backward compatibility,
|
||||
bootloaders that can be served by the arduino programmer can normally
|
||||
also be served by the urclock programmer. This may require specifying the
|
||||
size of (to avrdude) unknown bootloaders in bytes using the
|
||||
.Fl x Ar bootsize=<n>
|
||||
option, which is necessary for the urclock programmer to enable it to
|
||||
protect the bootloader from being overwritten. If an unknown bootloader
|
||||
has EEPROM read/write capability then the option -x eepromrw informs
|
||||
avrdude -c urclock of that capability.
|
||||
The Arduino (which is very similar to the STK500 1.x) is supported via
|
||||
its own programmer type specification ``arduino''.
|
||||
.Pp
|
||||
The BusPirate is a versatile tool that can also be used as an AVR programmer.
|
||||
A single BusPirate can be connected to up to 3 independent AVRs. See
|
||||
|
@ -194,7 +151,7 @@ has a revision 1 hardware and firmware version of at least 5.37 (decimal).
|
|||
For ATxmega devices, the JTAGICE3 is supported in PDI mode.
|
||||
.Pp
|
||||
Atmel-ICE (ARM/AVR) is supported in all modes (JTAG, PDI for Xmega, debugWIRE,
|
||||
ISP, UPDI).
|
||||
ISP).
|
||||
.Pp
|
||||
Atmel's XplainedPro boards, using the EDBG protocol (CMSIS-DAP compatible),
|
||||
are supported using the "jtag3" programmer type.
|
||||
|
@ -225,55 +182,12 @@ has been compiled in
|
|||
.Nm avrdude ,
|
||||
the avrftdi device adds support for many programmers using FTDI's 2232C/D/H
|
||||
and 4232H parts running in MPSSE mode, which hard-codes (in the chip)
|
||||
SCK to bit 1, SDO to bit 2, and SDI to bit 3. Reset is usually bit 4.
|
||||
SCK to bit 1, MOSI to bit 2, and MISO to bit 3. Reset is usually bit 4.
|
||||
.Pp
|
||||
The Atmel DFU bootloader is supported in both, FLIP protocol version 1
|
||||
(AT90USB* and ATmega*U* devices), as well as version 2 (Xmega devices).
|
||||
See below for some hints about FLIP version 1 protocol behaviour.
|
||||
.Pp
|
||||
The MPLAB(R) PICkit 4 and MPLAB(R) SNAP, are supported in JTAG, TPI, ISP,
|
||||
PDI and UPDI mode.
|
||||
The Curiosity Nano board is supported in UPDI mode. It is dubbed
|
||||
.Dq PICkit on Board ,
|
||||
thus the name
|
||||
.Pa pkobn_updi .
|
||||
.Pp
|
||||
SerialUPDI programmer implementation is based on Microchip's
|
||||
.Em pymcuprog Li https://github.com/microchip-pic-avr-tools/pymcuprog
|
||||
utility, but it also contains some performance improvements included in
|
||||
Spence Konde's
|
||||
.Em DxCore
|
||||
Arduino core
|
||||
.Li https://github.com/SpenceKonde/DxCore .
|
||||
In a nutshell, this programmer consists of simple USB->UART adapter, diode
|
||||
and couple of resistors. It uses serial connection to provide UPDI interface.
|
||||
See the texinfo documentation for more details and known issues.
|
||||
.Pp
|
||||
The jtag2updi programmer is supported,
|
||||
and can program AVRs with a UPDI interface.
|
||||
Jtag2updi is just a firmware that can be uploaded to an AVR,
|
||||
which enables it to interface with avrdude using the jtagice mkii protocol
|
||||
via a serial link.
|
||||
.Li https://github.com/ElTangas/jtag2updi
|
||||
.Pp
|
||||
The Micronucleus bootloader is supported for both protocol version V1
|
||||
and V2. As the bootloader does not support reading from flash memory,
|
||||
use the
|
||||
.Fl V
|
||||
option to prevent AVRDUDE from verifying the flash memory.
|
||||
See the section on
|
||||
.Em extended parameters
|
||||
for Micronucleus specific options.
|
||||
.Pp
|
||||
The Teensy bootloader is supported for all AVR boards.
|
||||
As the bootloader does not support reading from flash memory,
|
||||
use the
|
||||
.Fl V
|
||||
option to prevent AVRDUDE from verifying the flash memory.
|
||||
See the section on
|
||||
.Em extended parameters
|
||||
for Teensy specific options.
|
||||
.Pp
|
||||
Input files can be provided, and output files can be written in
|
||||
different file formats, such as raw binary files containing the data
|
||||
to download to the chip, Intel hex format, or Motorola S-record
|
||||
|
@ -299,7 +213,7 @@ lock bits can be programmed as well. These are implemented within
|
|||
.Nm
|
||||
as separate memory types and can be programmed using data from a file
|
||||
(see the
|
||||
.Fl U
|
||||
.Fl m
|
||||
option) or from terminal mode (see the
|
||||
.Ar dump
|
||||
and
|
||||
|
@ -310,7 +224,7 @@ file. Finally, a ``terminal'' mode is available that allows one to
|
|||
interactively communicate with the MCU, and to display or program
|
||||
individual memory cells.
|
||||
On the STK500 and STK600 programmer, several operational parameters (target supply
|
||||
voltage, target Aref voltage, programming clock) can be examined and changed
|
||||
voltage, target Aref voltage, master clock) can be examined and changed
|
||||
from within terminal mode as well.
|
||||
.Ss Options
|
||||
In order to control all the different operation modi, a number of options
|
||||
|
@ -318,15 +232,10 @@ need to be specified to
|
|||
.Nm avrdude .
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Fl p Ar partno
|
||||
This option specifies the MCU connected to the programmer. The MCU
|
||||
descriptions are read from the config file. For currently supported MCUs use
|
||||
? as partno, which will print a list of partno ids and official part names.
|
||||
Both can be used with the -p option. If -p ? is specified with a specific
|
||||
programmer, see -c below, then only those parts are output that the
|
||||
programmer expects to be able to handle, together with the programming
|
||||
interface(s) that can be used in that combination. In reality there can be
|
||||
deviations from this list, particularly if programming is directly via a
|
||||
bootloader.
|
||||
This is the only option that is mandatory for every invocation of
|
||||
.Nm avrdude .
|
||||
It specifies the type of the MCU connected to the programmer. These are read from the config file.
|
||||
For currently supported MCU types use ? as partno, this will print a list of partno ids and official part names on the terminal. (Both can be used with the -p option.)
|
||||
.Pp
|
||||
Following parts need special attention:
|
||||
.Bl -tag -width "ATmega1234"
|
||||
|
@ -345,29 +254,22 @@ and bit-bang programmers.
|
|||
The ATtiny11 can only be
|
||||
programmed in high-voltage serial mode.
|
||||
.El
|
||||
.It Fl p Ar wildcard/flags
|
||||
Run developer options for MCUs that are matched by wildcard. Whilst
|
||||
their main use is for developers some flags can be of utility for users, e.g.,
|
||||
avrdude -p m328p/S outputs AVRDUDE's understanding of ATmega328P MCU properties;
|
||||
for more information run avrdude -p x/h.
|
||||
.It Fl b Ar baudrate
|
||||
Override the RS-232 connection baud rate specified in the respective
|
||||
programmer's entry of the configuration file.
|
||||
.It Fl B Ar bitclock
|
||||
Specify the bit clock period for the JTAG, PDI, TPI, UPDI, or ISP
|
||||
interface. The value is a floating-point number in microseconds.
|
||||
Alternatively, the value might be suffixed with "Hz", "kHz" or
|
||||
"MHz" in order to specify the bit clock frequency rather than a
|
||||
period. Some programmers default their bit clock value to a 1
|
||||
microsecond bit clock period, suitable for target MCUs running at 4
|
||||
MHz clock and above. Slower MCUs need a correspondingly higher bit
|
||||
clock period. Some programmers reset their bit clock value to the
|
||||
default value when the programming software signs off, whilst others
|
||||
store the last used bit clock value. It is recommended to always
|
||||
specify the bit clock if read/write speed is important.
|
||||
Specify the bit clock period for the JTAG interface or the ISP clock (JTAG ICE only).
|
||||
The value is a floating-point number in microseconds.
|
||||
Alternatively, the value might be suffixed with "Hz", "kHz", or "MHz",
|
||||
in order to specify the bit clock frequency, rather than a period.
|
||||
The default value of the JTAG ICE results in about 1 microsecond bit
|
||||
clock period, suitable for target MCUs running at 4 MHz clock and
|
||||
above.
|
||||
Unlike certain parameters in the STK500, the JTAG ICE resets all its
|
||||
parameters to default values when the programming software signs
|
||||
off from the ICE, so for MCUs running at lower clock speeds, this
|
||||
parameter must be specified on the command-line.
|
||||
You can use the 'default_bitclock' keyword in your
|
||||
.Pa ${HOME}/.config/avrdude/avrdude.rc
|
||||
or
|
||||
.Pa ${HOME}/.avrduderc
|
||||
file to assign a default value to keep from having to specify this
|
||||
option on every invocation.
|
||||
|
@ -381,23 +283,11 @@ through the use of a config file to make
|
|||
work with different programmers as long as the programmer supports the
|
||||
Atmel AVR serial program method. You can use the 'default_programmer'
|
||||
keyword in your
|
||||
.Pa ${HOME}/.config/avrdude/avrdude.rc
|
||||
or
|
||||
.Pa ${HOME}/.avrduderc
|
||||
file to assign a default programmer to keep from having to specify
|
||||
this option on every invocation.
|
||||
A full list of all supported programmers is output to the terminal
|
||||
by using ? as programmer-id.
|
||||
If -c ? is specified with a specific part, see
|
||||
-p above, then only those programmers are output that expect
|
||||
to be able to handle this part, together with the programming interface(s) that can be
|
||||
used in that combination. In reality there can be deviations from this list,
|
||||
particularly if programming is directly via a bootloader.
|
||||
.It Fl c Ar wildcard/flags
|
||||
Run developer options for programmers that are matched by wildcard. Whilst
|
||||
their main use is for developers some flags can be of utility for users, e.g.,
|
||||
avrdude -c usbtiny/S shows AVRDUDE's understanding of usbtiny's properties;
|
||||
for more information run avrdude -c x/h.
|
||||
.It Fl C Ar config-file
|
||||
Use the specified config file to load configuration data. This file
|
||||
contains all programmer and part definitions that
|
||||
|
@ -416,20 +306,6 @@ files. This can be used to add entries to the configuration
|
|||
without patching your system wide configuration file. It can be used
|
||||
several times, the files are read in same order as given on the command
|
||||
line.
|
||||
.It Fl A
|
||||
Disable the automatic removal of trailing-0xFF sequences in file
|
||||
input that is to be programmed to flash and in AVR reads from
|
||||
flash memory. Normally, trailing 0xFFs can be discarded, as flash
|
||||
programming requires the memory be erased to 0xFF beforehand.
|
||||
.Fl A
|
||||
should be used when the programmer hardware, or bootloader
|
||||
software for that matter, does not carry out chip erase and
|
||||
instead handles the memory erase on a page level. Popular
|
||||
Arduino bootloaders exhibit this behaviour; for this reason
|
||||
.Fl A
|
||||
is engaged by default when specifying
|
||||
. Fl c
|
||||
arduino.
|
||||
.It Fl D
|
||||
Disable auto erase for flash. When the
|
||||
.Fl U
|
||||
|
@ -443,10 +319,6 @@ use page erase before writing each page so no explicit chip erase
|
|||
is required.
|
||||
Note however that any page not affected by the current operation
|
||||
will retain its previous contents.
|
||||
Setting
|
||||
.Fl D
|
||||
implies
|
||||
.Fl A.
|
||||
.It Fl e
|
||||
Causes a chip erase to be executed. This will reset the contents of the
|
||||
flash ROM and EEPROM to the value
|
||||
|
@ -459,7 +331,7 @@ contents would exclusively cause bits to be programmed from the value
|
|||
.Ql 1
|
||||
to
|
||||
.Ql 0 .
|
||||
Note that in order to reprogram EEPROM cells, no explicit prior chip
|
||||
Note that in order to reprogram EERPOM cells, no explicit prior chip
|
||||
erase is required since the MCU provides an auto-erase cycle in that
|
||||
case before programming the cell.
|
||||
.It Xo Fl E Ar exitspec Ns
|
||||
|
@ -492,17 +364,11 @@ MCU type, a previous invocation of
|
|||
.Nm
|
||||
with this option specified is one of the possible ways to guarantee this
|
||||
condition.
|
||||
.Em reset
|
||||
is supported by the linuxspi and flip2 programmer options, as well as all
|
||||
parallel port based programmers.
|
||||
.It Ar noreset
|
||||
The
|
||||
.Ql /RESET
|
||||
line will be deactivated at program exit, thus allowing the MCU target
|
||||
program to run while the programming hardware remains connected.
|
||||
.Em noreset
|
||||
is supported by the linuxspi and flip2 programmer options, as well as all
|
||||
parallel port based programmers.
|
||||
.It Ar vcc
|
||||
This option will leave those parallel port pins active
|
||||
.Pq \&i. \&e. Em high
|
||||
|
@ -538,8 +404,6 @@ actual connection to a target controller), this option can be used
|
|||
together with
|
||||
.Fl t
|
||||
to continue in terminal mode.
|
||||
Moreover, the option allows to continue despite failed initialization
|
||||
of connection between a programmer and a target.
|
||||
.It Fl i Ar delay
|
||||
For bitbang-type programmers, delay for approximately
|
||||
.Ar delay
|
||||
|
@ -624,28 +488,12 @@ be specified as
|
|||
Libhidapi support is required on Unix and Mac OS but not on Windows. For more
|
||||
information about AVR-Doper see http://www.obdev.at/avrusb/avrdoper.html.
|
||||
.Pp
|
||||
For the USBtinyISP, which is a simplistic device not implementing
|
||||
For the USBtinyISP, which is a simplicistic device not implementing
|
||||
serial numbers, multiple devices can be distinguished by their
|
||||
location in the USB hierarchy. See the respective
|
||||
location in the USB hierarchy. See the the respective
|
||||
.Em Troubleshooting
|
||||
entry in the detailed documentation for examples.
|
||||
.Pp
|
||||
For the XBee programmer the target MCU is to be programmed wirelessly over a
|
||||
ZigBee mesh using the XBeeBoot bootloader. The ZigBee 64-bit address for the
|
||||
target MCU's own XBee device must be supplied as a 16-character hexadecimal
|
||||
value as a
|
||||
.Ar port
|
||||
prefix, followed by the
|
||||
.Ql @
|
||||
character, and the serial device to connect to a second directly contactable
|
||||
XBee device associated with the same mesh (with a default baud rate of 9600).
|
||||
This may look similar to:
|
||||
.Pa 0013a20000000001@/dev/tty.serial .
|
||||
.Pp
|
||||
For diagnostic purposes, if the target MCU with an XBeeBoot bootloader is
|
||||
connected directly to the serial port, the 64-bit address field can be
|
||||
omitted. In this mode the default baud rate will be 19200.
|
||||
.Pp
|
||||
For programmers that attach to a serial port using some kind of
|
||||
higher level protocol (as opposed to bit-bang style programmers),
|
||||
.Ar port
|
||||
|
@ -672,15 +520,41 @@ Note: The ability to handle IPv6 hostnames and addresses is limited to
|
|||
Posix systems (by now).
|
||||
.It Fl q
|
||||
Disable (or quell) output of the progress bar while reading or writing
|
||||
to the device. Specify it more often for even quieter operations.
|
||||
.It Fl s, u
|
||||
These options used to control the obsolete "safemode" feature which
|
||||
is no longer present. They are silently ignored for backwards compatibility.
|
||||
to the device. Specify it a second time for even quieter operation.
|
||||
.It Fl s
|
||||
Disable safemode prompting. When safemode discovers that one or more
|
||||
fuse bits have unintentionally changed, it will prompt for
|
||||
confirmation regarding whether or not it should attempt to recover the
|
||||
fuse bit(s). Specifying this flag disables the prompt and assumes
|
||||
that the fuse bit(s) should be recovered without asking for
|
||||
confirmation first.
|
||||
.It Fl t
|
||||
Tells
|
||||
.Nm
|
||||
to enter the interactive ``terminal'' mode instead of up- or downloading
|
||||
files. See below for a detailed description of the terminal mode.
|
||||
.It Fl u
|
||||
Disable the safemode fuse bit checks. Safemode is enabled by default
|
||||
and is intended to prevent unintentional fuse bit changes. When
|
||||
enabled, safemode will issue a warning if the any fuse bits are found
|
||||
to be different at program exit than they were when
|
||||
.Nm
|
||||
was invoked. Safemode won't alter fuse bits itself, but rather will
|
||||
prompt for instructions, unless the terminal is non-interactive, in
|
||||
which case safemode is disabled. See the
|
||||
.Fl s
|
||||
option to disable safemode prompting.
|
||||
.Pp
|
||||
If one of the configuration files has a line
|
||||
.Dl "default_safemode = no;"
|
||||
safemode is disabled by default.
|
||||
The
|
||||
.Fl u
|
||||
option's effect is negated in that case, i. e. it
|
||||
.Em enables
|
||||
safemode.
|
||||
.Pp
|
||||
Safemode is always disabled for AVR32, Xmega and TPI devices.
|
||||
.It Xo Fl U Ar memtype Ns
|
||||
.Ar \&: Ns Ar op Ns
|
||||
.Ar \&: Ns Ar filename Ns
|
||||
|
@ -759,8 +633,6 @@ can be one of:
|
|||
.Bl -tag -width sss
|
||||
.It Ar i
|
||||
Intel Hex
|
||||
.It Ar I
|
||||
Intel Hex with comments on download and tolerance of checksum errors on upload
|
||||
.It Ar s
|
||||
Motorola S-record
|
||||
.It Ar r
|
||||
|
@ -785,17 +657,14 @@ fuse bit settings.
|
|||
hexadecimal; each value will get the string
|
||||
.Em 0x
|
||||
prepended.
|
||||
Only valid on output.
|
||||
.It Ar o
|
||||
octal; each value will get a
|
||||
.Em 0
|
||||
prepended unless it is less than 8 in which case it gets no prefix.
|
||||
Only valid on output.
|
||||
.It Ar b
|
||||
binary; each value will get the string
|
||||
.Em 0b
|
||||
prepended.
|
||||
Only valid on output.
|
||||
.El
|
||||
.Pp
|
||||
The default is to use auto detection for input files, and raw binary
|
||||
|
@ -845,128 +714,30 @@ abbreviated to the shortest unambiguous form. Terminal mode provides
|
|||
a command history using
|
||||
.Xr readline 3 ,
|
||||
so previously entered command lines can be recalled and edited. The
|
||||
following commands are currently implemented for all programmers:
|
||||
following commands are currently implemented:
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar dump memory addr len
|
||||
.It Ar dump memtype addr nbytes
|
||||
Read
|
||||
.Ar len
|
||||
.Ar nbytes
|
||||
bytes from the specified memory area, and display them in the usual
|
||||
hexadecimal and ASCII form.
|
||||
.It Ar dump memory addr ...
|
||||
Read all bytes from the specified memory starting at address
|
||||
.Ar addr,
|
||||
and display them.
|
||||
.It Ar dump memory addr
|
||||
Read 256 bytes from the specified memory area, and display them.
|
||||
.It Ar dump memory ...
|
||||
Read all bytes from the specified memory, and display them.
|
||||
.It Ar dump memory
|
||||
.It Ar dump
|
||||
Continue dumping the memory contents for another
|
||||
.Ar 256
|
||||
bytes where the previous
|
||||
.Ar nbytes
|
||||
where the previous
|
||||
.Ar dump
|
||||
command left off.
|
||||
.It Ar read
|
||||
can be used as an alias for dump
|
||||
.It Ar write memory addr data[,] {data[,]}
|
||||
.It Ar write memtype addr byte1 ... byteN
|
||||
Manually program the respective memory cells, starting at address
|
||||
.Ar addr ,
|
||||
using the data items provided.
|
||||
The terminal implements reading from and writing to flash and EEPROM type
|
||||
memories normally through a cache and paged access functions. All other
|
||||
memories are directly written to without use of a cache. Some
|
||||
older parts without paged access will also have flash and EEPROM directly
|
||||
accessed without cache.
|
||||
.Pp
|
||||
.Ar data
|
||||
can be hexadecimal, octal or decimal integers, floating point numbers
|
||||
or C-style strings and characters. For integers, an optional case-insensitive
|
||||
suffix specifies the data size: HH 8 bit, H/S 16 bit, L 32 bit, LL 64 bit.
|
||||
Suffix D indicates a 64-bit double, F a 32-bit float, whilst a floating point
|
||||
number without suffix defaults to 32-bit float. Hexadecimal floating point
|
||||
notation is supported. An ambiguous trailing suffix, e.g., 0x1.8D, is read as
|
||||
no-suffix float where D is part of the mantissa; use a zero exponent 0x1.8p0D
|
||||
to clarify.
|
||||
.Pp
|
||||
An optional U suffix makes integers unsigned. Ordinary 0x hex integers are
|
||||
always treated as unsigned. +0x or -0x hex numbers are treated as signed
|
||||
unless they have a U suffix. Unsigned integers cannot be larger than 2^64-1.
|
||||
If n is an unsigned integer then -n is also a valid unsigned integer as in C.
|
||||
Signed integers must fall into the [-2^63, 2^63-1] range or a correspondingly
|
||||
smaller range when a suffix specifies a smaller type.
|
||||
.Pp
|
||||
Ordinary 0x hex integers with n hex digits (counting leading zeros) use the
|
||||
smallest size of one, two, four and eight bytes that can accommodate any
|
||||
n-digit hex integer. If an integer suffix specifies a size explicitly the
|
||||
corresponding number of least significant bytes are written, and a warning
|
||||
shown if the number does not fit into the desired representation. Otherwise,
|
||||
unsigned integers occupy the smallest of one, two, four or eight bytes
|
||||
needed. Signed numbers are allowed to fit into the smallest signed or
|
||||
smallest unsigned representation: For example, 255 is stored as one byte as
|
||||
255U would fit in one byte, though as a signed number it would not fit into a
|
||||
one-byte interval [-128, 127]. The number -1 is stored in one byte whilst -1U
|
||||
needs eight bytes as it is the same as 0xFFFFffffFFFFffffU.
|
||||
.Pp
|
||||
One trailing comma at the end of
|
||||
.Ar data
|
||||
items is ignored to facilitate copy & paste of lists.
|
||||
.It Ar write memory addr len data[,] {data[,]} ...
|
||||
The ellipsis ... form writes <len> bytes padded by repeating the last
|
||||
.Ar data
|
||||
item.
|
||||
.It Ar flush
|
||||
Synchronise with the device all pending cached writes to EEPROM or flash.
|
||||
With some programmer and part combinations, flash (and sometimes EEPROM,
|
||||
too) looks like a NOR memory, ie, one can only write 0 bits, not 1 bits.
|
||||
When this is detected, either page erase is deployed (e.g., with parts that
|
||||
have PDI/UPDI interfaces), or if that is not available, both EEPROM and
|
||||
flash caches are fully read in, a chip erase command is issued and both
|
||||
EEPROM and flash are written back to the device. Hence, it can take
|
||||
minutes to ensure that a single previously cleared bit is set and,
|
||||
therefore, this command should be used sparingly.
|
||||
.It Ar abort
|
||||
Normally, caches are only ever
|
||||
actually written to the device when using the
|
||||
.Ar flush
|
||||
command, at the end of the terminal session after typing
|
||||
.Ar quit ,
|
||||
or after EOF on input is encountered. The abort command resets
|
||||
the cache discarding all previous writes to the flash and EEPROM cache.
|
||||
using the values
|
||||
.Ar byte1
|
||||
through
|
||||
.Ar byteN .
|
||||
This feature is not implemented for bank-addressed memories such as
|
||||
the flash memory of ATMega devices.
|
||||
.It Ar erase
|
||||
Perform a chip erase and discard all pending writes to EEPROM and flash.
|
||||
.It Ar sig
|
||||
Display the device signature bytes.
|
||||
.It Ar part
|
||||
Display the current part settings and parameters. Includes chip
|
||||
specific information including all memory types supported by the
|
||||
device, read/write timing, etc.
|
||||
.It Ar verbose Op Ar level
|
||||
Change (when
|
||||
.Ar level
|
||||
is provided), or display the verbosity level.
|
||||
The initial verbosity level is controlled by the number of
|
||||
.Fl v
|
||||
options given on the commandline.
|
||||
.It Ar quell Op Ar level
|
||||
Change (when
|
||||
.Ar level
|
||||
is provided), or display the quell level. 1 is used to suppress progress reports.
|
||||
2 or higher yields in progressively quieter operations.
|
||||
The initial quell level is controlled by the number of
|
||||
.Fl q
|
||||
options given on the commandline.
|
||||
.It Ar \&?
|
||||
.It Ar help
|
||||
Give a short on-line summary of the available commands.
|
||||
.It Ar quit
|
||||
Leave terminal mode and thus
|
||||
.Nm avrdude .
|
||||
.El
|
||||
.Pp
|
||||
The terminal commands below may only be implemented on some specific programmers, and may therefore not be available in the help menu.
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It pgerase memory addr
|
||||
Erase one page of the memory specified.
|
||||
Perform a chip erase.
|
||||
.It Ar send b1 b2 b3 b4
|
||||
Send raw instruction codes to the AVR device. If you need access to a
|
||||
feature of an AVR part that is not directly supported by
|
||||
|
@ -975,18 +746,24 @@ this command allows you to use it, even though
|
|||
.Nm
|
||||
does not implement the command. When using direct SPI mode, up to 3 bytes
|
||||
can be omitted.
|
||||
.It Ar sig
|
||||
Display the device signature bytes.
|
||||
.It Ar spi
|
||||
Enter direct SPI mode. The
|
||||
.Em pgmled
|
||||
pin acts as chip select.
|
||||
.Em Supported on parallel bitbang programmers, and partially by USBtiny.
|
||||
pin acts as slave select.
|
||||
.Em Only supported on parallel bitbang programmers.
|
||||
.It Ar part
|
||||
Display the current part settings and parameters. Includes chip
|
||||
specific information including all memory types supported by the
|
||||
device, read/write timing, etc.
|
||||
.It Ar pgm
|
||||
Return to programming mode (from direct SPI mode).
|
||||
.It Ar vtarg voltage
|
||||
Set the target's supply voltage to
|
||||
.Ar voltage
|
||||
Volts.
|
||||
.Em Supported on the STK500 and STK600 programmer.
|
||||
.Em Only supported on the STK500 and STK600 programmer.
|
||||
.It Ar varef Oo Ar channel Oc Ar voltage
|
||||
Set the adjustable voltage source to
|
||||
.Ar voltage
|
||||
|
@ -998,9 +775,9 @@ On the Atmel STK600, two reference voltages are available, which
|
|||
can be selected by the optional
|
||||
.Ar channel
|
||||
argument (either 0 or 1).
|
||||
.Em Supported on the STK500 and STK600 programmer.
|
||||
.Em Only supported on the STK500 and STK600 programmer.
|
||||
.It Ar fosc freq Ns Op M Ns \&| Ns k
|
||||
Set the programming oscillator to
|
||||
Set the master oscillator to
|
||||
.Ar freq
|
||||
Hz.
|
||||
An optional trailing letter
|
||||
|
@ -1008,16 +785,17 @@ An optional trailing letter
|
|||
multiplies by 1E6, a trailing letter
|
||||
.Ar \&k
|
||||
by 1E3.
|
||||
.Em Supported on the STK500 and STK600 programmer.
|
||||
.Em Only supported on the STK500 and STK600 programmer.
|
||||
.It Ar fosc off
|
||||
Turn the programming oscillator off.
|
||||
.Em Supported on the STK500 and STK600 programmer.
|
||||
Turn the master oscillator off.
|
||||
.Em Only supported on the STK500 and STK600 programmer.
|
||||
.It Ar sck period
|
||||
.Em STK500 and STK600 programmer:
|
||||
.Em STK500 and STK600 programmer only:
|
||||
Set the SCK clock period to
|
||||
.Ar period
|
||||
microseconds.
|
||||
.Em JTAG ICE:
|
||||
.Pp
|
||||
.Em JTAG ICE only:
|
||||
Set the JTAG ICE bit clock period to
|
||||
.Ar period
|
||||
microseconds.
|
||||
|
@ -1027,12 +805,24 @@ software signs off from the JTAG ICE.
|
|||
This parameter can also be used on the JTAG ICE mkII, JTAGICE3, and Atmel-ICE to specify the
|
||||
ISP clock period when operating the ICE in ISP mode.
|
||||
.It Ar parms
|
||||
.Em STK500 and STK600 programmer:
|
||||
Display the current voltage and programming oscillator parameters.
|
||||
.Em JTAG ICE:
|
||||
.Em STK500 and STK600 programmer only:
|
||||
Display the current voltage and master oscillator parameters.
|
||||
.Pp
|
||||
.Em JTAG ICE only:
|
||||
Display the current target supply voltage and JTAG bit clock rate/period.
|
||||
.Em Other programmers:
|
||||
Display the programmer specific parameters.
|
||||
.It Ar verbose Op Ar level
|
||||
Change (when
|
||||
.Ar level
|
||||
is provided), or display the verbosity level.
|
||||
The initial verbosity level is controlled by the number of
|
||||
.Fl v
|
||||
options given on the commandline.
|
||||
.It Ar \&?
|
||||
.It Ar help
|
||||
Give a short on-line summary of the available commands.
|
||||
.It Ar quit
|
||||
Leave terminal mode and thus
|
||||
.Nm avrdude .
|
||||
.El
|
||||
.Ss Default Parallel port pin connections
|
||||
(these can be changed, see the
|
||||
|
@ -1044,8 +834,8 @@ ll.
|
|||
2-5 Vcc (optional power supply to MCU)
|
||||
7 /RESET (to MCU)
|
||||
8 SCK (to MCU)
|
||||
9 SDO (to MCU)
|
||||
10 SDI (from MCU)
|
||||
9 MOSI (to MCU)
|
||||
10 MISO (from MCU)
|
||||
18-25 GND
|
||||
.TE
|
||||
.Ss debugWire limitations
|
||||
|
@ -1112,13 +902,9 @@ versions of the bootloader.
|
|||
.It Ar JTAG ICE mkII
|
||||
.It Ar JTAGICE3
|
||||
.It Ar Atmel-ICE
|
||||
.It Ar Power Debugger
|
||||
.It Ar PICkit 4
|
||||
.It Ar MPLAB SNAP
|
||||
.It Ar AVR Dragon
|
||||
When using the JTAG ICE mkII, JTAGICE3, Atmel-ICE, PICkit 4, MPLAB SNAP,
|
||||
Power Debugger or AVR Dragon in JTAG mode, the following extended parameter
|
||||
is accepted:
|
||||
When using the JTAG ICE mkII, JTAGICE3, Atmel-ICE or AVR Dragon in JTAG mode, the
|
||||
following extended parameter is accepted:
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar jtagchain=UB,UA,BB,BA
|
||||
Setup the JTAG scan chain for
|
||||
|
@ -1133,14 +919,6 @@ bits after the target AVR, respectively.
|
|||
Each AVR unit within the chain shifts by 4 bits.
|
||||
Other JTAG units might require a different bit shift count.
|
||||
.El
|
||||
.Pp
|
||||
The PICkit 4 and the Power Debugger also supports high-voltage UPDI programming.
|
||||
This is used to enable a UPDI pin that has previously been set to RESET or
|
||||
GPIO mode. High-voltage UPDI can be utilized by using an extended parameter:
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar hvupdi
|
||||
Enable high-voltage UPDI initialization for targets that supports this.
|
||||
.El
|
||||
.It Ar AVR910
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar devcode=VALUE
|
||||
|
@ -1166,125 +944,12 @@ only if your
|
|||
.Ar AVR910
|
||||
programmer creates errors during initial sequence.
|
||||
.El
|
||||
.It Ar Arduino
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar attemps[=<1..99>]
|
||||
Specify how many connection retry attemps to perform before exiting.
|
||||
Defaults to 10 if not specified.
|
||||
.El
|
||||
.It Ar Urclock
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar showall
|
||||
Show all info for the connected part, then exit. The -xshow... options
|
||||
below can be used to assemble a bespoke response consisting of a subset
|
||||
(or only one item) of all available relevant information about the
|
||||
connected part and bootloader.
|
||||
.It Ar showid
|
||||
Show a unique Urclock ID stored in either flash or EEPROM of the MCU, then exit.
|
||||
.It Ar id=<E|F>.<addr>.<len>
|
||||
Historically, the Urclock ID was a six-byte unique little-endian number
|
||||
stored in Urclock boards at EEPROM address 257. The location of this
|
||||
number can be set by the -xid=<E|F>.<addr>.<len> extended parameter. E
|
||||
stands for EEPROM and F stands for flash. A negative address addr counts
|
||||
from the end of EEPROM and flash, respectively. The length len of the
|
||||
Urclock ID can be between 1 and 8 bytes.
|
||||
.It Ar showdate
|
||||
Show the last-modified date of the input file for the flash application,
|
||||
then exit. If the input file was stdin, the date will be that of the
|
||||
programming. Date and filename are part of the metadata that the urclock
|
||||
programmer stores by default in high flash just under the bootloader; see also
|
||||
-xnometadata.
|
||||
.It Ar showfilename
|
||||
Show the input filename (or title) of the last flash writing session, then exit.
|
||||
.It Ar title=<string>
|
||||
When set, <string> will be used in lieu of the input filename. The maximum
|
||||
string length for the title/filename field is 254 bytes including
|
||||
terminating nul.
|
||||
.It Ar showapp
|
||||
Show the size of the programmed application, then exit.
|
||||
.It Ar showstore
|
||||
Show the size of the unused flash between the application and metadata, then exit.
|
||||
.It Ar showmeta
|
||||
Show the size of the metadata just below the bootloader, then exit.
|
||||
.It Ar showboot
|
||||
Show the size of the bootloader, then exit.
|
||||
.It Ar showversion
|
||||
Show bootloader version and capabilities, then exit.
|
||||
.It Ar showvector
|
||||
Show the vector number and name of the interrupt table vector used by the
|
||||
bootloader for starting the application, then exit. For hardware-supported
|
||||
bootloaders this will be vector 0 (Reset), and for vector bootloaders this
|
||||
will be any other vector number of the interrupt vector table or the slot
|
||||
just behind the vector table with the name VBL_ADDITIONAL_VECTOR.
|
||||
.It Ar showpart
|
||||
Show the part for which the bootloader was compiled, then exit.
|
||||
.It Ar bootsize=<size>
|
||||
Manual override for bootloader size. Urboot bootloaders put the number of
|
||||
used bootloader pages into a table at the top of the bootloader section,
|
||||
ie, typically top of flash, so the urclock programmer can look up the
|
||||
bootloader size itself. In backward-compatibility mode, when programming
|
||||
via other bootloaders, this option can be used to tell the programmer the
|
||||
size, and therefore the location, of the bootloader.
|
||||
.It Ar vectornum=<arg>
|
||||
Manual override for vector number. Urboot bootloaders put the vector
|
||||
number used by a vector bootloader into a table at the top of flash, so
|
||||
this option is normally not needed for urboot bootloaders. However, it is
|
||||
useful in backward-compatibility mode (or when the urboot bootloader does
|
||||
not offer flash read). Specifying a vector number in these circumstances
|
||||
implies a vector bootloader whilst the default assumption would be a
|
||||
hardware-supported bootloader.
|
||||
.It Ar eepromrw
|
||||
Manual override for asserting EEPROM read/write capability. Not normally
|
||||
needed for urboot bootloaders, but useful for in backward-compatibility
|
||||
mode if the bootloader offers EEPROM read/write.
|
||||
.It Ar emulate_ce
|
||||
If an urboot bootloader does not offer a chip erase command it will tell
|
||||
the urclock programmer so during handshake. In this case the urclock
|
||||
programmer emulates a chip erase, if warranted by user command line
|
||||
options, by filling the remainder of unused flash below the bootloader
|
||||
with 0xff. If this option is specified, the urclock programmer will assume
|
||||
that the bootloader cannot erase the chip itself. The option is useful
|
||||
for backwards-compatible bootloaders that do not implement chip erase.
|
||||
.It Ar restore
|
||||
Upload unchanged flash input files and trim below the bootloader if
|
||||
needed. This is most useful when one has a backup of the full flash and
|
||||
wants to play that back onto the device. No metadata are written in this
|
||||
case and no vector patching happens either if it is a vector bootloader.
|
||||
However, for vector bootloaders, even under the option -xrestore an
|
||||
input file will not be uploaded for which the reset vector does not point
|
||||
to the vector bootloader. This is to avoid writing an input file to the
|
||||
device that would render the vector bootloader not functional as it would
|
||||
not be reached after reset.
|
||||
.It Ar initstore
|
||||
On writing to flash fill the store space between the flash application and
|
||||
the metadata section with 0xff.
|
||||
.It Ar nofilename
|
||||
On writing to flash do not store the application input filename (nor a title).
|
||||
.It Ar nodate
|
||||
On writing to flash do not store the application input filename (nor a
|
||||
title) and no date either.
|
||||
.It Ar nometadata
|
||||
On writing to flash do not store any metadata. The full flash below the
|
||||
bootloader is available for the application. In particular, no data store
|
||||
frame is programmed.
|
||||
.It Ar delay=<n>
|
||||
Add a <n> ms delay after reset. This can be useful if a board takes a
|
||||
particularly long time to exit from external reset. <n> can be negative,
|
||||
in which case the default 120 ms delay after issuing reset will be
|
||||
shortened accordingly.
|
||||
.It Ar strict
|
||||
Urclock has a faster, but slightly different strategy than -c arduino to
|
||||
synchronise with the bootloader; some stk500v1 bootloaders cannot cope
|
||||
with this, and they need the -xstrict option.
|
||||
.It Ar help
|
||||
Show this help menu and exit
|
||||
.El
|
||||
.It Ar buspirate
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar reset={cs,aux,aux2}
|
||||
The default setup assumes the BusPirate's CS output pin connected to
|
||||
the RESET pin on AVR side. It is however possible to have multiple AVRs
|
||||
connected to the same BP with SDI, SDO and SCK lines common for all of them.
|
||||
connected to the same BP with MISO, MOSI and SCK lines common for all of them.
|
||||
In such a case one AVR should have its RESET connected to BusPirate's
|
||||
.Pa CS
|
||||
pin, second AVR's RESET connected to BusPirate's
|
||||
|
@ -1358,26 +1023,6 @@ Especially in ascii mode this happens very often, so setting a smaller value
|
|||
can speed up programming a lot.
|
||||
The default value is 100ms. Using 10ms might work in most cases.
|
||||
.El
|
||||
.It Ar Micronucleus bootloader
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar wait[=<timeout>]
|
||||
If the device is not connected, wait for the device to be plugged in.
|
||||
The optional
|
||||
.Ar timeout
|
||||
specifies the connection time-out in seconds.
|
||||
If no time-out is specified, AVRDUDE will wait indefinitely until the
|
||||
device is plugged in.
|
||||
.El
|
||||
.It Ar Teensy bootloader
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar wait[=<timeout>]
|
||||
If the device is not connected, wait for the device to be plugged in.
|
||||
The optional
|
||||
.Ar timeout
|
||||
specifies the connection time-out in seconds.
|
||||
If no time-out is specified, AVRDUDE will wait indefinitely until the
|
||||
device is plugged in.
|
||||
.El
|
||||
.It Ar Wiring
|
||||
When using the Wiring programmer type, the
|
||||
following optional extended parameter is accepted:
|
||||
|
@ -1397,9 +1042,9 @@ Connection to the PICkit2 programmer:
|
|||
RST - VPP/MCLR (1)
|
||||
VDD - VDD Target (2) -- possibly optional if AVR self powered
|
||||
GND - GND (3)
|
||||
SDI - PGD (4)
|
||||
MISO - PGD (4)
|
||||
SCLK - PDC (5)
|
||||
SDO - AUX (6)
|
||||
MOSI - AUX (6)
|
||||
|
||||
.Ed
|
||||
Extended commandline parameters:
|
||||
|
@ -1418,80 +1063,22 @@ Programmer will erase configuration section with option
|
|||
(chip erase), rather than entire chip.
|
||||
Only applicable to TPI devices (ATtiny 4/5/9/10/20/40).
|
||||
.El
|
||||
.It Ar xbee
|
||||
Extended parameters:
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar xbeeresetpin=<1..7>
|
||||
Select the XBee pin DIO<1..7> that is connected to the MCU's
|
||||
.Ql /RESET
|
||||
line. The programmer needs to know which DIO pin to use to reset into the
|
||||
bootloader. The default (3) is the DIO3 pin (XBee pin 17), but some
|
||||
commercial products use a different XBee pin.
|
||||
.Pp
|
||||
The remaining two necessary XBee-to-MCU connections are not selectable - the
|
||||
XBee DOUT pin (pin 2) must be connected to the MCU's
|
||||
.Ql RXD
|
||||
line, and the XBee DIN pin (pin 3) must be connected to the MCU's
|
||||
.Ql TXD
|
||||
line.
|
||||
.El
|
||||
.It Ar STK500
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar attemps[=<1..99>]
|
||||
Specify how many connection retry attemps to perform before exiting.
|
||||
Defaults to 10 if not specified.
|
||||
.El
|
||||
.It Ar serialupdi
|
||||
Extended parameters:
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar rtsdtr=low|high
|
||||
Forces RTS/DTR lines to assume low or high state during the whole
|
||||
programming session. Some programmers might use this signal to
|
||||
indicate UPDI programming state, but this is strictly hardware
|
||||
specific.
|
||||
.Pp
|
||||
When not provided, driver/OS default value will be used.
|
||||
.El
|
||||
.It Ar linuxspi
|
||||
Extended parameter:
|
||||
.Bl -tag -offset indent -width indent
|
||||
.It Ar disable_no_cs
|
||||
Ensures the programmer does not use the SPI_NO_CS bit for the SPI
|
||||
driver. This parameter is useful for kernels that do not support
|
||||
the CS line being managed outside the application.
|
||||
.El
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -offset indent -width /dev/ppi0XXX
|
||||
.It Pa /dev/ppi0
|
||||
Default device to be used for communication with the programming
|
||||
default device to be used for communication with the programming
|
||||
hardware
|
||||
.It Pa avrdude.conf
|
||||
Programmer and parts configuration file
|
||||
.Pp
|
||||
On Windows systems, this file is looked up in the same directory as the
|
||||
executable file.
|
||||
On all other systems, the file is first looked up in
|
||||
.Pa ../etc/ ,
|
||||
relative to the path of the executable, then in the same directory as
|
||||
the executable itself, and finally in the system default location
|
||||
.Pa ${PREFIX}/etc/avrdude.conf .
|
||||
.It Pa ${XDG_CONFIG_HOME}/avrdude/avrdude.rc
|
||||
Local programmer and parts configuration file (per-user overrides); it follows the same syntax as
|
||||
.Pa avrdude.conf ;
|
||||
if the
|
||||
.Pa ${XDG_CONFIG_HOME}
|
||||
environment variable is not set or empty, the directory
|
||||
.Pa ${HOME}/.config/
|
||||
is used instead.
|
||||
.It Pa ${PREFIX}/etc/avrdude.conf
|
||||
programmer and parts configuration file
|
||||
.It Pa ${HOME}/.avrduderc
|
||||
Alternative location of the per-user configuration file if above file does not exist
|
||||
programmer and parts configuration file (per-user overrides)
|
||||
.It Pa ~/.inputrc
|
||||
Initialization file for the
|
||||
.Xr readline 3
|
||||
library
|
||||
.It Pa <prefix>/doc/avrdude/avrdude.pdf
|
||||
User manual
|
||||
.It Pa ${PREFIX}/share/doc/avrdude/avrdude.pdf
|
||||
Schematic of programming hardware
|
||||
.El
|
||||
.\" .Sh EXAMPLES
|
||||
.Sh DIAGNOSTICS
|
||||
|
@ -1538,7 +1125,7 @@ This man page by
|
|||
.el Joerg Wunsch.
|
||||
.Sh BUGS
|
||||
Please report bugs via
|
||||
.Dl "https://github.com/avrdudes/avrdude/issues"
|
||||
.Dl "http://savannah.nongnu.org/bugs/?group=avrdude" .
|
||||
.Pp
|
||||
The JTAG ICE programmers currently cannot write to the flash ROM
|
||||
one byte at a time.
|
||||
|
@ -1555,9 +1142,6 @@ The USBasp and USBtinyISP drivers do not offer any option to distinguish multipl
|
|||
devices connected simultaneously, so effectively only a single device
|
||||
is supported.
|
||||
.Pp
|
||||
Chip Select must be externally held low for direct SPI when
|
||||
using USBtinyISP, and send must be a multiple of four bytes.
|
||||
.Pp
|
||||
The avrftdi driver allows one to select specific devices using any combination of vid,pid
|
||||
serial number (usbsn) vendor description (usbvendoror part description (usbproduct)
|
||||
as seen with lsusb or whatever tool used to view USB device information. Multiple
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* avrdude - A Downloader/Uploader for AVR device programmers
|
||||
* Copyright (C) 2007 Joerg Wunsch
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef avrdude_h
|
||||
#define avrdude_h
|
||||
|
||||
extern char * progname; /* name of program, for messages */
|
||||
extern char progbuf[]; /* spaces same length as progname */
|
||||
|
||||
extern int ovsigck; /* override signature check (-F) */
|
||||
extern int verbose; /* verbosity level (-v, -vv, ...) */
|
||||
extern int quell_progress; /* quiteness level (-q, -qq) */
|
||||
|
||||
int avrdude_message(const int msglvl, const char *format, ...);
|
||||
|
||||
#define MSG_INFO (0) /* no -v option, can be supressed with -qq */
|
||||
#define MSG_NOTICE (1) /* displayed with -v */
|
||||
#define MSG_NOTICE2 (2) /* displayed with -vv, used rarely */
|
||||
#define MSG_DEBUG (3) /* displayed with -vvv */
|
||||
#define MSG_TRACE (4) /* displayed with -vvvv, show trace commuication */
|
||||
#define MSG_TRACE2 (5) /* displayed with -vvvvv */
|
||||
|
||||
#if defined(WIN32NATIVE)
|
||||
|
||||
#include "ac_cfg.h"
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include "msvc/msvc_compat.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_USLEEP)
|
||||
int usleep(unsigned int us);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_GETTIMEOFDAY)
|
||||
struct timezone;
|
||||
int gettimeofday(struct timeval *tv, struct timezone *tz);
|
||||
#endif /* HAVE_GETTIMEOFDAY */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* defined(WIN32NATIVE) */
|
||||
|
||||
#endif
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30104.148
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avrdude", "avrdude.vcxproj", "{718DDC4C-324E-485F-BE18-2D211659A2F4}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libelf", "external\libelf\libelf.vcxproj", "{A2D07885-A0D1-473B-83B2-209CD008EE8F}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libhidapi", "external\libhidapi\libhidapi.vcxproj", "{17054837-6AE6-44D7-914D-9625EDEF4657}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb", "external\libusb\libusb.vcxproj", "{22615EC5-9DBC-4538-9C01-2CD535B3810B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libftdi1", "external\libftdi1\libftdi1.vcxproj", "{632649AB-A351-46D4-A81F-1D6E9A819A5C}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{743FA5F6-A0D7-46F7-B73D-632B64C732FB}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
.travis.yml = .travis.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{718DDC4C-324E-485F-BE18-2D211659A2F4}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{718DDC4C-324E-485F-BE18-2D211659A2F4}.Debug|x64.Build.0 = Debug|x64
|
||||
{718DDC4C-324E-485F-BE18-2D211659A2F4}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{718DDC4C-324E-485F-BE18-2D211659A2F4}.Debug|x86.Build.0 = Debug|Win32
|
||||
{718DDC4C-324E-485F-BE18-2D211659A2F4}.Release|x64.ActiveCfg = Release|x64
|
||||
{718DDC4C-324E-485F-BE18-2D211659A2F4}.Release|x64.Build.0 = Release|x64
|
||||
{718DDC4C-324E-485F-BE18-2D211659A2F4}.Release|x86.ActiveCfg = Release|Win32
|
||||
{718DDC4C-324E-485F-BE18-2D211659A2F4}.Release|x86.Build.0 = Release|Win32
|
||||
{A2D07885-A0D1-473B-83B2-209CD008EE8F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A2D07885-A0D1-473B-83B2-209CD008EE8F}.Debug|x64.Build.0 = Debug|x64
|
||||
{A2D07885-A0D1-473B-83B2-209CD008EE8F}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{A2D07885-A0D1-473B-83B2-209CD008EE8F}.Debug|x86.Build.0 = Debug|Win32
|
||||
{A2D07885-A0D1-473B-83B2-209CD008EE8F}.Release|x64.ActiveCfg = Release|x64
|
||||
{A2D07885-A0D1-473B-83B2-209CD008EE8F}.Release|x64.Build.0 = Release|x64
|
||||
{A2D07885-A0D1-473B-83B2-209CD008EE8F}.Release|x86.ActiveCfg = Release|Win32
|
||||
{A2D07885-A0D1-473B-83B2-209CD008EE8F}.Release|x86.Build.0 = Release|Win32
|
||||
{17054837-6AE6-44D7-914D-9625EDEF4657}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{17054837-6AE6-44D7-914D-9625EDEF4657}.Debug|x64.Build.0 = Debug|x64
|
||||
{17054837-6AE6-44D7-914D-9625EDEF4657}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{17054837-6AE6-44D7-914D-9625EDEF4657}.Debug|x86.Build.0 = Debug|Win32
|
||||
{17054837-6AE6-44D7-914D-9625EDEF4657}.Release|x64.ActiveCfg = Release|x64
|
||||
{17054837-6AE6-44D7-914D-9625EDEF4657}.Release|x64.Build.0 = Release|x64
|
||||
{17054837-6AE6-44D7-914D-9625EDEF4657}.Release|x86.ActiveCfg = Release|Win32
|
||||
{17054837-6AE6-44D7-914D-9625EDEF4657}.Release|x86.Build.0 = Release|Win32
|
||||
{22615EC5-9DBC-4538-9C01-2CD535B3810B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{22615EC5-9DBC-4538-9C01-2CD535B3810B}.Debug|x64.Build.0 = Debug|x64
|
||||
{22615EC5-9DBC-4538-9C01-2CD535B3810B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{22615EC5-9DBC-4538-9C01-2CD535B3810B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{22615EC5-9DBC-4538-9C01-2CD535B3810B}.Release|x64.ActiveCfg = Release|x64
|
||||
{22615EC5-9DBC-4538-9C01-2CD535B3810B}.Release|x64.Build.0 = Release|x64
|
||||
{22615EC5-9DBC-4538-9C01-2CD535B3810B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{22615EC5-9DBC-4538-9C01-2CD535B3810B}.Release|x86.Build.0 = Release|Win32
|
||||
{632649AB-A351-46D4-A81F-1D6E9A819A5C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{632649AB-A351-46D4-A81F-1D6E9A819A5C}.Debug|x64.Build.0 = Debug|x64
|
||||
{632649AB-A351-46D4-A81F-1D6E9A819A5C}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{632649AB-A351-46D4-A81F-1D6E9A819A5C}.Debug|x86.Build.0 = Debug|Win32
|
||||
{632649AB-A351-46D4-A81F-1D6E9A819A5C}.Release|x64.ActiveCfg = Release|x64
|
||||
{632649AB-A351-46D4-A81F-1D6E9A819A5C}.Release|x64.Build.0 = Release|x64
|
||||
{632649AB-A351-46D4-A81F-1D6E9A819A5C}.Release|x86.ActiveCfg = Release|Win32
|
||||
{632649AB-A351-46D4-A81F-1D6E9A819A5C}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {6126B4FE-5EEC-46A7-934A-F3B0314F6B75}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,306 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{718DDC4C-324E-485F-BE18-2D211659A2F4}</ProjectGuid>
|
||||
<RootNamespace>avrdude</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32NATIVE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;LOG_APPNAME="avrdude";WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>msvc;msvc\generated;.;external\libelf\include;external\libusb\include;external\libhidapi\include;external\libftdi1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>DEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32NATIVE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;LOG_APPNAME="avrdude";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>msvc;msvc\generated;.;external\libelf\include;external\libusb\include;external\libhidapi\include;external\libftdi1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>DEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32NATIVE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;LOG_APPNAME="avrdude";WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>msvc;msvc\generated;.;external\libelf\include;external\libusb\include;external\libhidapi\include;external\libftdi1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32NATIVE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;LOG_APPNAME="avrdude";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>msvc;msvc\generated;.;external\libelf\include;external\libusb\include;external\libhidapi\include;external\libftdi1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="arduino.c" />
|
||||
<ClCompile Include="avr.c" />
|
||||
<ClCompile Include="avr910.c" />
|
||||
<ClCompile Include="avrftdi.c" />
|
||||
<ClCompile Include="avrftdi_tpi.c" />
|
||||
<ClCompile Include="avrpart.c" />
|
||||
<ClCompile Include="bitbang.c" />
|
||||
<ClCompile Include="buspirate.c" />
|
||||
<ClCompile Include="butterfly.c" />
|
||||
<ClCompile Include="config.c" />
|
||||
<ClCompile Include="confwin.c" />
|
||||
<ClCompile Include="crc16.c" />
|
||||
<ClCompile Include="dfu.c" />
|
||||
<ClCompile Include="fileio.c" />
|
||||
<ClCompile Include="flip1.c" />
|
||||
<ClCompile Include="flip2.c" />
|
||||
<ClCompile Include="ft245r.c" />
|
||||
<ClCompile Include="jtag3.c" />
|
||||
<ClCompile Include="jtagmkI.c" />
|
||||
<ClCompile Include="jtagmkII.c" />
|
||||
<ClCompile Include="linuxgpio.c" />
|
||||
<ClCompile Include="lists.c" />
|
||||
<ClCompile Include="main.c" />
|
||||
<ClCompile Include="micronucleus.c" />
|
||||
<ClCompile Include="msvc\pthread.cpp" />
|
||||
<ClCompile Include="msvc\semaphore.cpp" />
|
||||
<ClCompile Include="par.c" />
|
||||
<ClCompile Include="pgm.c" />
|
||||
<ClCompile Include="pgm_type.c" />
|
||||
<ClCompile Include="pickit2.c" />
|
||||
<ClCompile Include="pindefs.c" />
|
||||
<ClCompile Include="ppi.c" />
|
||||
<ClCompile Include="ppiwin.c" />
|
||||
<ClCompile Include="safemode.c" />
|
||||
<ClCompile Include="serbb_posix.c" />
|
||||
<ClCompile Include="serbb_win32.c" />
|
||||
<ClCompile Include="ser_avrdoper.c" />
|
||||
<ClCompile Include="ser_posix.c" />
|
||||
<ClCompile Include="ser_win32.c" />
|
||||
<ClCompile Include="stk500.c" />
|
||||
<ClCompile Include="stk500generic.c" />
|
||||
<ClCompile Include="stk500v2.c" />
|
||||
<ClCompile Include="teensy.c" />
|
||||
<ClCompile Include="term.c" />
|
||||
<ClCompile Include="update.c" />
|
||||
<ClCompile Include="usbasp.c" />
|
||||
<ClCompile Include="usbtiny.c" />
|
||||
<ClCompile Include="usb_hidapi.c" />
|
||||
<ClCompile Include="usb_libusb.c" />
|
||||
<ClCompile Include="wiring.c" />
|
||||
<ClCompile Include="msvc\generated\config_gram.c" />
|
||||
<ClCompile Include="msvc\generated\lexer.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CONFIG_DIR=".";__STDC_VERSION__=199901L;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CONFIG_DIR=".";__STDC_VERSION__=199901L;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CONFIG_DIR=".";__STDC_VERSION__=199901L;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CONFIG_DIR=".";__STDC_VERSION__=199901L;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="msvc\getopt.c" />
|
||||
<ClCompile Include="msvc\gettimeofday.c" />
|
||||
<ClCompile Include="msvc\unistd.cpp" />
|
||||
<ClCompile Include="msvc\usb_com_helper.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="arduino.h" />
|
||||
<ClInclude Include="avr910.h" />
|
||||
<ClInclude Include="avrdude.h" />
|
||||
<ClInclude Include="avrftdi.h" />
|
||||
<ClInclude Include="avrftdi_private.h" />
|
||||
<ClInclude Include="avrftdi_tpi.h" />
|
||||
<ClInclude Include="bitbang.h" />
|
||||
<ClInclude Include="buspirate.h" />
|
||||
<ClInclude Include="butterfly.h" />
|
||||
<ClInclude Include="config.h" />
|
||||
<ClInclude Include="crc16.h" />
|
||||
<ClInclude Include="dfu.h" />
|
||||
<ClInclude Include="flip1.h" />
|
||||
<ClInclude Include="flip2.h" />
|
||||
<ClInclude Include="freebsd_ppi.h" />
|
||||
<ClInclude Include="ft245r.h" />
|
||||
<ClInclude Include="jtag3.h" />
|
||||
<ClInclude Include="jtag3_private.h" />
|
||||
<ClInclude Include="jtagmkI.h" />
|
||||
<ClInclude Include="jtagmkII.h" />
|
||||
<ClInclude Include="jtagmkII_private.h" />
|
||||
<ClInclude Include="jtagmkI_private.h" />
|
||||
<ClInclude Include="libavrdude.h" />
|
||||
<ClInclude Include="linuxgpio.h" />
|
||||
<ClInclude Include="linux_ppdev.h" />
|
||||
<ClInclude Include="micronucleus.h" />
|
||||
<ClInclude Include="msvc\IntegerHandleMap.h" />
|
||||
<ClInclude Include="msvc\pthread.h" />
|
||||
<ClInclude Include="msvc\ReaderWriterLock.h" />
|
||||
<ClInclude Include="msvc\resource.h" />
|
||||
<ClInclude Include="msvc\semaphore.h" />
|
||||
<ClInclude Include="msvc\version.h" />
|
||||
<ClInclude Include="my_ddk_hidsdi.h" />
|
||||
<ClInclude Include="par.h" />
|
||||
<ClInclude Include="pickit2.h" />
|
||||
<ClInclude Include="ppi.h" />
|
||||
<ClInclude Include="serbb.h" />
|
||||
<ClInclude Include="ser_win32.h" />
|
||||
<ClInclude Include="solaris_ecpp.h" />
|
||||
<ClInclude Include="stk500.h" />
|
||||
<ClInclude Include="stk500generic.h" />
|
||||
<ClInclude Include="stk500v2.h" />
|
||||
<ClInclude Include="stk500v2_private.h" />
|
||||
<ClInclude Include="stk500_private.h" />
|
||||
<ClInclude Include="teensy.h" />
|
||||
<ClInclude Include="term.h" />
|
||||
<ClInclude Include="tpi.h" />
|
||||
<ClInclude Include="usbasp.h" />
|
||||
<ClInclude Include="usbdevs.h" />
|
||||
<ClInclude Include="usbtiny.h" />
|
||||
<ClInclude Include="wiring.h" />
|
||||
<ClInclude Include="msvc\generated\ac_cfg.h" />
|
||||
<ClInclude Include="msvc\generated\config_gram.h" />
|
||||
<ClInclude Include="msvc\getopt.h" />
|
||||
<ClInclude Include="msvc\msvc_compat.h" />
|
||||
<ClInclude Include="msvc\sys\time.h" />
|
||||
<ClInclude Include="msvc\unistd.h" />
|
||||
<ClInclude Include="msvc\usb_com_helper.h" />
|
||||
<ClInclude Include="msvc\usb_com_locator.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="external\libelf\libelf.vcxproj">
|
||||
<Project>{a2d07885-a0d1-473b-83b2-209cd008ee8f}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="external\libftdi1\libftdi1.vcxproj">
|
||||
<Project>{632649ab-a351-46d4-a81f-1d6e9a819a5c}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="external\libhidapi\libhidapi.vcxproj">
|
||||
<Project>{17054837-6ae6-44d7-914d-9625edef4657}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="external\libusb\libusb.vcxproj">
|
||||
<Project>{22615ec5-9dbc-4538-9c01-2cd535b3810b}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="msvc\avrdude.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="msvc\res\resource.rc2">
|
||||
<FileType>Text</FileType>
|
||||
</None>
|
||||
<None Include="msvc\res\version.rc2">
|
||||
<FileType>Text</FileType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,387 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="2 Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="1 Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="3 Generated Files">
|
||||
<UniqueIdentifier>{be5ce6e6-223e-4d41-8915-29103d899c5a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="4 Resource Files">
|
||||
<UniqueIdentifier>{a7668888-00c6-4911-9e47-7af645f31778}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="5 msvc">
|
||||
<UniqueIdentifier>{dbbd7498-e1e9-4d80-b91f-137dc5b988f1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="5 msvc\sys">
|
||||
<UniqueIdentifier>{1cc9d4fb-f03f-48cb-8af7-3e96681dc03b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="arduino.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="avr.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="avr910.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="avrftdi.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="avrftdi_tpi.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="avrpart.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="bitbang.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="buspirate.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="butterfly.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="config.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="confwin.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="crc16.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dfu.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="fileio.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="flip1.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="flip2.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ft245r.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jtag3.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jtagmkI.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jtagmkII.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="linuxgpio.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lists.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="main.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="micronucleus.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="par.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pgm.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pgm_type.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pickit2.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pindefs.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ppi.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ppiwin.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="safemode.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ser_avrdoper.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ser_posix.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ser_win32.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="serbb_posix.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="serbb_win32.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stk500.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stk500generic.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stk500v2.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="teensy.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="term.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="update.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="usb_hidapi.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="usb_libusb.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="usbasp.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="usbtiny.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="wiring.c">
|
||||
<Filter>1 Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="msvc\generated\config_gram.c">
|
||||
<Filter>3 Generated Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="msvc\generated\lexer.c">
|
||||
<Filter>3 Generated Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="msvc\getopt.c">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="msvc\gettimeofday.c">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="msvc\unistd.cpp">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="msvc\usb_com_helper.cpp">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="msvc\pthread.cpp">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="msvc\semaphore.cpp">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="arduino.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="avr910.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="avrdude.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="avrftdi.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="avrftdi_private.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="avrftdi_tpi.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="bitbang.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="buspirate.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="butterfly.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="config.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="crc16.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dfu.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="flip1.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="flip2.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="freebsd_ppi.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ft245r.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jtag3.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jtag3_private.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jtagmkI.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jtagmkI_private.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jtagmkII.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jtagmkII_private.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libavrdude.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="linux_ppdev.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="linuxgpio.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="micronucleus.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="my_ddk_hidsdi.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="par.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pickit2.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ppi.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ser_win32.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="serbb.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="solaris_ecpp.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stk500.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stk500_private.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stk500generic.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stk500v2.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stk500v2_private.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="teensy.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="term.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tpi.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="usbasp.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="usbdevs.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="usbtiny.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="wiring.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\generated\ac_cfg.h">
|
||||
<Filter>3 Generated Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\generated\config_gram.h">
|
||||
<Filter>3 Generated Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\getopt.h">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\unistd.h">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\sys\time.h">
|
||||
<Filter>5 msvc\sys</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\msvc_compat.h">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\usb_com_helper.h">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\usb_com_locator.h">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\pthread.h">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\semaphore.h">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\ReaderWriterLock.h">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\IntegerHandleMap.h">
|
||||
<Filter>5 msvc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\resource.h">
|
||||
<Filter>2 Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="msvc\version.h">
|
||||
<Filter>4 Resource Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="msvc\avrdude.rc">
|
||||
<Filter>4 Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="msvc\res\resource.rc2">
|
||||
<Filter>4 Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="msvc\res\version.rc2">
|
||||
<Filter>4 Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -50,24 +50,28 @@
|
|||
|
||||
#ifdef DO_NOT_BUILD_AVRFTDI
|
||||
|
||||
static int avrftdi_noftdi_open(PROGRAMMER *pgm, const char *name) {
|
||||
pmsg_error("no libftdi or libusb support; install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again\n");
|
||||
static int avrftdi_noftdi_open (struct programmer_t *pgm, char * name)
|
||||
{
|
||||
avrdude_message(MSG_INFO, "%s: Error: no libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again.\n",
|
||||
progname);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void avrftdi_initpgm(PROGRAMMER *pgm) {
|
||||
void avrftdi_initpgm(PROGRAMMER * pgm)
|
||||
{
|
||||
strcpy(pgm->type, "avrftdi");
|
||||
pgm->open = avrftdi_noftdi_open;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
enum { FTDI_SCK = 0, FTDI_SDO, FTDI_SDI, FTDI_RESET };
|
||||
enum { FTDI_SCK = 0, FTDI_MOSI, FTDI_MISO, FTDI_RESET };
|
||||
|
||||
static int write_flush(avrftdi_t *);
|
||||
|
||||
/*
|
||||
* returns a human-readable name for a pin number. The name should match with
|
||||
* returns a human-readable name for a pin number. the name should match with
|
||||
* the pin names used in FTDI datasheets.
|
||||
*/
|
||||
static char*
|
||||
|
@ -121,7 +125,7 @@ ftdi_pin_name(avrftdi_t* pdata, struct pindef_t pin)
|
|||
}
|
||||
|
||||
/*
|
||||
* output function, to save if(vebose>level)-constructs. Also prefixes output
|
||||
* output function, to save if(vebose>level)-constructs. also prefixes output
|
||||
* with "avrftdi function-name(line-number):" to identify were messages came
|
||||
* from.
|
||||
* This function is the backend of the log_*-macros, but it can be used
|
||||
|
@ -138,14 +142,14 @@ void avrftdi_log(int level, const char * func, int line,
|
|||
if(!skip_prefix)
|
||||
{
|
||||
switch(level) {
|
||||
case ERR: msg_error("E "); break;
|
||||
case WARN: msg_error("W "); break;
|
||||
case INFO: msg_error("I "); break;
|
||||
case DEBUG: msg_error("D "); break;
|
||||
case TRACE: msg_error("T "); break;
|
||||
default: msg_error(" "); break;
|
||||
case ERR: avrdude_message(MSG_INFO, "E "); break;
|
||||
case WARN: avrdude_message(MSG_INFO, "W "); break;
|
||||
case INFO: avrdude_message(MSG_INFO, "I "); break;
|
||||
case DEBUG: avrdude_message(MSG_INFO, "D "); break;
|
||||
case TRACE: avrdude_message(MSG_INFO, "T "); break;
|
||||
default: avrdude_message(MSG_INFO, " "); break;
|
||||
}
|
||||
msg_error("%s(%d): ", func, line);
|
||||
avrdude_message(MSG_INFO, "%s(%d): ", func, line);
|
||||
}
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
|
@ -159,25 +163,25 @@ void avrftdi_log(int level, const char * func, int line,
|
|||
}
|
||||
|
||||
/*
|
||||
* helper function to print a binary buffer *buf of size len. Begin and end of
|
||||
* the dump are enclosed in the string contained in *desc. Offset denotes the
|
||||
* number of bytes which are printed on the first line (may be 0). After that
|
||||
* helper function to print a binary buffer *buf of size len. begin and end of
|
||||
* the dump are enclosed in the string contained in *desc. offset denotes the
|
||||
* number of bytes which are printed on the first line (may be 0). after that
|
||||
* width bytes are printed on each line
|
||||
*/
|
||||
static void buf_dump(const unsigned char *buf, int len, char *desc,
|
||||
int offset, int width)
|
||||
{
|
||||
int i;
|
||||
msg_info("%s begin:\n", desc);
|
||||
avrdude_message(MSG_INFO, "%s begin:\n", desc);
|
||||
for (i = 0; i < offset; i++)
|
||||
msg_info("%02x ", buf[i]);
|
||||
msg_info("\n");
|
||||
avrdude_message(MSG_INFO, "%02x ", buf[i]);
|
||||
avrdude_message(MSG_INFO, "\n");
|
||||
for (i++; i <= len; i++) {
|
||||
msg_info("%02x ", buf[i-1]);
|
||||
avrdude_message(MSG_INFO, "%02x ", buf[i-1]);
|
||||
if((i-offset) != 0 && (i-offset)%width == 0)
|
||||
msg_info("\n");
|
||||
avrdude_message(MSG_INFO, "\n");
|
||||
}
|
||||
msg_info("%s end\n", desc);
|
||||
avrdude_message(MSG_INFO, "%s end\n", desc);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -216,17 +220,15 @@ static int set_frequency(avrftdi_t* ftdi, uint32_t freq)
|
|||
}
|
||||
|
||||
/*
|
||||
* This function sets or clears any pin, except SCK, SDI and SDO. Depending
|
||||
* This function sets or clears any pin, except SCK, MISO and MOSI. Depending
|
||||
* on the pin configuration, a non-zero value sets the pin in the 'active'
|
||||
* state (high active, low active) and a zero value sets the pin in the
|
||||
* inactive state.
|
||||
* Because we configured the pin direction mask earlier, nothing bad can happen
|
||||
* here.
|
||||
*/
|
||||
static int set_pin(const PROGRAMMER *pgm, int pinfunc, int value) {
|
||||
if(pinfunc < 0 || pinfunc >= N_PINS)
|
||||
return -1;
|
||||
|
||||
static int set_pin(PROGRAMMER * pgm, int pinfunc, int value)
|
||||
{
|
||||
avrftdi_t* pdata = to_pdata(pgm);
|
||||
struct pindef_t pin = pgm->pin[pinfunc];
|
||||
|
||||
|
@ -248,50 +250,54 @@ static int set_pin(const PROGRAMMER *pgm, int pinfunc, int value) {
|
|||
/*
|
||||
* Mandatory callbacks which boil down to GPIO.
|
||||
*/
|
||||
static int set_led_pgm(const PROGRAMMER *pgm, int value) {
|
||||
static int set_led_pgm(struct programmer_t * pgm, int value)
|
||||
{
|
||||
return set_pin(pgm, PIN_LED_PGM, value);
|
||||
}
|
||||
|
||||
static int set_led_rdy(const PROGRAMMER *pgm, int value) {
|
||||
static int set_led_rdy(struct programmer_t * pgm, int value)
|
||||
{
|
||||
return set_pin(pgm, PIN_LED_RDY, value);
|
||||
}
|
||||
|
||||
static int set_led_err(const PROGRAMMER *pgm, int value) {
|
||||
static int set_led_err(struct programmer_t * pgm, int value)
|
||||
{
|
||||
return set_pin(pgm, PIN_LED_ERR, value);
|
||||
}
|
||||
|
||||
static int set_led_vfy(const PROGRAMMER *pgm, int value) {
|
||||
static int set_led_vfy(struct programmer_t * pgm, int value)
|
||||
{
|
||||
return set_pin(pgm, PIN_LED_VFY, value);
|
||||
}
|
||||
|
||||
static void avrftdi_enable(PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static void avrftdi_enable(PROGRAMMER * pgm)
|
||||
{
|
||||
set_pin(pgm, PPI_AVR_BUFF, ON);
|
||||
|
||||
// Switch to TPI initialisation in avrftdi_tpi.c
|
||||
if(p->prog_modes & PM_TPI)
|
||||
avrftdi_tpi_initpgm(pgm);
|
||||
}
|
||||
|
||||
static void avrftdi_disable(const PROGRAMMER *pgm) {
|
||||
static void avrftdi_disable(PROGRAMMER * pgm)
|
||||
{
|
||||
set_pin(pgm, PPI_AVR_BUFF, OFF);
|
||||
}
|
||||
|
||||
static void avrftdi_powerup(const PROGRAMMER *pgm) {
|
||||
static void avrftdi_powerup(PROGRAMMER * pgm)
|
||||
{
|
||||
set_pin(pgm, PPI_AVR_VCC, ON);
|
||||
}
|
||||
|
||||
static void avrftdi_powerdown(const PROGRAMMER *pgm) {
|
||||
static void avrftdi_powerdown(PROGRAMMER * pgm)
|
||||
{
|
||||
set_pin(pgm, PPI_AVR_VCC, OFF);
|
||||
}
|
||||
|
||||
static inline int set_data(const PROGRAMMER *pgm, unsigned char *buf, unsigned char data, bool read_data) {
|
||||
static inline int set_data(PROGRAMMER * pgm, unsigned char *buf, unsigned char data, bool read_data) {
|
||||
int j;
|
||||
int buf_pos = 0;
|
||||
unsigned char bit = 0x80;
|
||||
avrftdi_t* pdata = to_pdata(pgm);
|
||||
|
||||
for (j=0; j<8; j++) {
|
||||
pdata->pin_value = SET_BITS_0(pdata->pin_value,pgm,PIN_AVR_SDO,data & bit);
|
||||
pdata->pin_value = SET_BITS_0(pdata->pin_value,pgm,PIN_AVR_MOSI,data & bit);
|
||||
pdata->pin_value = SET_BITS_0(pdata->pin_value,pgm,PIN_AVR_SCK,0);
|
||||
buf[buf_pos++] = SET_BITS_LOW;
|
||||
buf[buf_pos++] = (pdata->pin_value) & 0xff;
|
||||
|
@ -318,7 +324,7 @@ static inline int set_data(const PROGRAMMER *pgm, unsigned char *buf, unsigned c
|
|||
return buf_pos;
|
||||
}
|
||||
|
||||
static inline unsigned char extract_data(const PROGRAMMER *pgm, unsigned char *buf, int offset) {
|
||||
static inline unsigned char extract_data(PROGRAMMER * pgm, unsigned char *buf, int offset) {
|
||||
int j;
|
||||
unsigned char bit = 0x80;
|
||||
unsigned char r = 0;
|
||||
|
@ -326,7 +332,7 @@ static inline unsigned char extract_data(const PROGRAMMER *pgm, unsigned char *b
|
|||
buf += offset * 16; // 2 bytes per bit, 8 bits
|
||||
for (j=0; j<8; j++) {
|
||||
uint16_t in = buf[0] | (buf[1] << 8);
|
||||
if (GET_BITS_0(in,pgm,PIN_AVR_SDI)) {
|
||||
if (GET_BITS_0(in,pgm,PIN_AVR_MISO)) {
|
||||
r |= bit;
|
||||
}
|
||||
buf += 2; // 2 bytes per input
|
||||
|
@ -336,7 +342,7 @@ static inline unsigned char extract_data(const PROGRAMMER *pgm, unsigned char *b
|
|||
}
|
||||
|
||||
|
||||
static int avrftdi_transmit_bb(const PROGRAMMER *pgm, unsigned char mode, const unsigned char *buf,
|
||||
static int avrftdi_transmit_bb(PROGRAMMER * pgm, unsigned char mode, const unsigned char *buf,
|
||||
unsigned char *data, int buf_size)
|
||||
{
|
||||
size_t remaining = buf_size;
|
||||
|
@ -345,13 +351,10 @@ static int avrftdi_transmit_bb(const PROGRAMMER *pgm, unsigned char mode, const
|
|||
size_t blocksize = pdata->rx_buffer_size/2; // we are reading 2 bytes per data byte
|
||||
|
||||
// determine a maximum size of data block
|
||||
size_t max_size = MIN(pdata->ftdic->max_packet_size, (unsigned int) pdata->tx_buffer_size);
|
||||
size_t max_size = MIN(pdata->ftdic->max_packet_size,pdata->tx_buffer_size);
|
||||
// select block size so that resulting commands does not exceed max_size if possible
|
||||
blocksize = MAX(1,(max_size-7)/((8*2*6)+(8*1*2)));
|
||||
// msg_info("blocksize %d \n", blocksize);
|
||||
|
||||
unsigned char* send_buffer = alloca((8 * 2 * 6) * blocksize + (8 * 1 * 2) * blocksize + 7);
|
||||
unsigned char* recv_buffer = alloca(2 * 16 * blocksize);
|
||||
//avrdude_message(MSG_INFO, "blocksize %d \n",blocksize);
|
||||
|
||||
while(remaining)
|
||||
{
|
||||
|
@ -361,9 +364,15 @@ static int avrftdi_transmit_bb(const PROGRAMMER *pgm, unsigned char mode, const
|
|||
// (8*2) outputs per data byte, 6 transmit bytes per output (SET_BITS_LOW/HIGH),
|
||||
// (8*1) inputs per data byte, 2 transmit bytes per input (GET_BITS_LOW/HIGH),
|
||||
// 1x SEND_IMMEDIATE
|
||||
#ifdef _MSC_VER
|
||||
unsigned char* send_buffer = _alloca((8 * 2 * 6) * transfer_size + (8 * 1 * 2) * transfer_size + 7);
|
||||
#else
|
||||
unsigned char send_buffer[(8*2*6)*transfer_size+(8*1*2)*transfer_size+7];
|
||||
#endif
|
||||
int len = 0;
|
||||
int i;
|
||||
|
||||
for(size_t i = 0 ; i < transfer_size; i++) {
|
||||
for(i = 0 ; i< transfer_size; i++) {
|
||||
len += set_data(pgm, send_buffer + len, buf[written+i], (mode & MPSSE_DO_READ) != 0);
|
||||
}
|
||||
|
||||
|
@ -379,15 +388,20 @@ static int avrftdi_transmit_bb(const PROGRAMMER *pgm, unsigned char mode, const
|
|||
|
||||
E(ftdi_write_data(pdata->ftdic, send_buffer, len) != len, pdata->ftdic);
|
||||
if (mode & MPSSE_DO_READ) {
|
||||
#ifdef _MSC_VER
|
||||
unsigned char* recv_buffer = _alloca(2 * 16 * transfer_size);
|
||||
#else
|
||||
unsigned char recv_buffer[2*16*transfer_size];
|
||||
#endif
|
||||
int n;
|
||||
size_t k = 0;
|
||||
int k = 0;
|
||||
do {
|
||||
n = ftdi_read_data(pdata->ftdic, &recv_buffer[k], 2*16*transfer_size - k);
|
||||
E(n < 0, pdata->ftdic);
|
||||
k += n;
|
||||
} while (k < transfer_size);
|
||||
|
||||
for(size_t i = 0 ; i< transfer_size; i++) {
|
||||
for(i = 0 ; i< transfer_size; i++) {
|
||||
data[written + i] = extract_data(pgm, recv_buffer, i);
|
||||
}
|
||||
}
|
||||
|
@ -430,7 +444,7 @@ static int avrftdi_transmit_mpsse(avrftdi_t* pdata, unsigned char mode, const un
|
|||
{
|
||||
size_t transfer_size = (remaining > blocksize) ? blocksize : remaining;
|
||||
|
||||
E((size_t) ftdi_write_data(pdata->ftdic, (unsigned char*)&buf[written], transfer_size) != transfer_size, pdata->ftdic);
|
||||
E(ftdi_write_data(pdata->ftdic, (unsigned char*)&buf[written], transfer_size) != transfer_size, pdata->ftdic);
|
||||
#if 0
|
||||
if(remaining < blocksize)
|
||||
E(ftdi_write_data(pdata->ftdic, &si, sizeof(si)) != sizeof(si), pdata->ftdic);
|
||||
|
@ -438,7 +452,7 @@ static int avrftdi_transmit_mpsse(avrftdi_t* pdata, unsigned char mode, const un
|
|||
|
||||
if (mode & MPSSE_DO_READ) {
|
||||
int n;
|
||||
size_t k = 0;
|
||||
int k = 0;
|
||||
do {
|
||||
n = ftdi_read_data(pdata->ftdic, &data[written + k], transfer_size - k);
|
||||
E(n < 0, pdata->ftdic);
|
||||
|
@ -454,7 +468,7 @@ static int avrftdi_transmit_mpsse(avrftdi_t* pdata, unsigned char mode, const un
|
|||
return written;
|
||||
}
|
||||
|
||||
static inline int avrftdi_transmit(const PROGRAMMER *pgm, unsigned char mode, const unsigned char *buf,
|
||||
static inline int avrftdi_transmit(PROGRAMMER * pgm, unsigned char mode, const unsigned char *buf,
|
||||
unsigned char *data, int buf_size)
|
||||
{
|
||||
avrftdi_t* pdata = to_pdata(pgm);
|
||||
|
@ -513,7 +527,8 @@ static int write_flush(avrftdi_t* pdata)
|
|||
|
||||
}
|
||||
|
||||
static int avrftdi_check_pins_bb(const PROGRAMMER *pgm, bool output) {
|
||||
static int avrftdi_check_pins_bb(PROGRAMMER * pgm, bool output)
|
||||
{
|
||||
int pin;
|
||||
|
||||
/* pin checklist. */
|
||||
|
@ -524,7 +539,7 @@ static int avrftdi_check_pins_bb(const PROGRAMMER *pgm, bool output) {
|
|||
/* value for 8/12/16 bit wide interface */
|
||||
int valid_mask = ((1 << pdata->pin_limit) - 1);
|
||||
|
||||
log_debug("Using valid mask bitbanging: 0x%08x\n", valid_mask);
|
||||
log_debug("Using valid mask bibanging: 0x%08x\n", valid_mask);
|
||||
static struct pindef_t valid_pins;
|
||||
valid_pins.mask[0] = valid_mask;
|
||||
valid_pins.inverse[0] = valid_mask ;
|
||||
|
@ -540,7 +555,8 @@ static int avrftdi_check_pins_bb(const PROGRAMMER *pgm, bool output) {
|
|||
return pins_check(pgm, pin_checklist, N_PINS, output);
|
||||
}
|
||||
|
||||
static int avrftdi_check_pins_mpsse(const PROGRAMMER *pgm, bool output) {
|
||||
static int avrftdi_check_pins_mpsse(PROGRAMMER * pgm, bool output)
|
||||
{
|
||||
int pin;
|
||||
|
||||
/* pin checklist. */
|
||||
|
@ -548,16 +564,16 @@ static int avrftdi_check_pins_mpsse(const PROGRAMMER *pgm, bool output) {
|
|||
|
||||
avrftdi_t* pdata = to_pdata(pgm);
|
||||
|
||||
/* SCK/SDO/SDI are fixed and not invertible? */
|
||||
/* TODO: inverted SCK/SDI/SDO */
|
||||
static const struct pindef_t valid_pins_SCK = {{0x01},{0x00}};
|
||||
static const struct pindef_t valid_pins_SDO = {{0x02},{0x00}};
|
||||
static const struct pindef_t valid_pins_SDI = {{0x04},{0x00}};
|
||||
/* SCK/MOSI/MISO are fixed and not invertable?*/
|
||||
/* TODO: inverted SCK/MISO/MOSI */
|
||||
static const struct pindef_t valid_pins_SCK = {{0x01},{0x00}} ;
|
||||
static const struct pindef_t valid_pins_MOSI = {{0x02},{0x00}} ;
|
||||
static const struct pindef_t valid_pins_MISO = {{0x04},{0x00}} ;
|
||||
|
||||
/* value for 8/12/16 bit wide interface for other pins */
|
||||
int valid_mask = ((1 << pdata->pin_limit) - 1);
|
||||
/* mask out SCK/SDI/SDO */
|
||||
valid_mask &= ~((1 << FTDI_SCK) | (1 << FTDI_SDO) | (1 << FTDI_SDI));
|
||||
/* mask out SCK/MISO/MOSI */
|
||||
valid_mask &= ~((1 << FTDI_SCK) | (1 << FTDI_MOSI) | (1 << FTDI_MISO));
|
||||
|
||||
log_debug("Using valid mask mpsse: 0x%08x\n", valid_mask);
|
||||
static struct pindef_t valid_pins_others;
|
||||
|
@ -574,17 +590,18 @@ static int avrftdi_check_pins_mpsse(const PROGRAMMER *pgm, bool output) {
|
|||
/* now set mpsse specific pins */
|
||||
pin_checklist[PIN_AVR_SCK].mandatory = 1;
|
||||
pin_checklist[PIN_AVR_SCK].valid_pins = &valid_pins_SCK;
|
||||
pin_checklist[PIN_AVR_SDO].mandatory = 1;
|
||||
pin_checklist[PIN_AVR_SDO].valid_pins = &valid_pins_SDO;
|
||||
pin_checklist[PIN_AVR_SDI].mandatory = 1;
|
||||
pin_checklist[PIN_AVR_SDI].valid_pins = &valid_pins_SDI;
|
||||
pin_checklist[PIN_AVR_MOSI].mandatory = 1;
|
||||
pin_checklist[PIN_AVR_MOSI].valid_pins = &valid_pins_MOSI;
|
||||
pin_checklist[PIN_AVR_MISO].mandatory = 1;
|
||||
pin_checklist[PIN_AVR_MISO].valid_pins = &valid_pins_MISO;
|
||||
pin_checklist[PIN_AVR_RESET].mandatory = 1;
|
||||
|
||||
/* assumes all checklists above have same number of entries */
|
||||
return pins_check(pgm, pin_checklist, N_PINS, output);
|
||||
}
|
||||
|
||||
static int avrftdi_pin_setup(const PROGRAMMER *pgm) {
|
||||
static int avrftdi_pin_setup(PROGRAMMER * pgm)
|
||||
{
|
||||
int pin;
|
||||
|
||||
/*************
|
||||
|
@ -602,31 +619,30 @@ static int avrftdi_pin_setup(const PROGRAMMER *pgm) {
|
|||
avrftdi_check_pins_bb(pgm, true);
|
||||
log_err("Pin configuration for FTDI MPSSE must be:\n");
|
||||
log_err("%s: 0, %s: 1, %s: 2 (is: %s, %s, %s)\n", avr_pin_name(PIN_AVR_SCK),
|
||||
avr_pin_name(PIN_AVR_SDO), avr_pin_name(PIN_AVR_SDI),
|
||||
avr_pin_name(PIN_AVR_MOSI), avr_pin_name(PIN_AVR_MISO),
|
||||
pins_to_str(&pgm->pin[PIN_AVR_SCK]),
|
||||
pins_to_str(&pgm->pin[PIN_AVR_SDO]),
|
||||
pins_to_str(&pgm->pin[PIN_AVR_SDI]));
|
||||
pins_to_str(&pgm->pin[PIN_AVR_MOSI]),
|
||||
pins_to_str(&pgm->pin[PIN_AVR_MISO]));
|
||||
log_err("If other pin configuration is used, fallback to slower bitbanging mode is used.\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
pdata->use_bitbanging = !pin_check_mpsse;
|
||||
if (pdata->use_bitbanging)
|
||||
log_info("Because of pin configuration fallback to bitbanging mode.\n");
|
||||
if (pdata->use_bitbanging) log_info("Because of pin configuration fallback to bitbanging mode.\n");
|
||||
|
||||
/*
|
||||
* TODO: No need to fail for a wrongly configured led or something.
|
||||
* Maybe we should only fail for SCK; SDI, SDO, RST (and probably
|
||||
* Maybe we should only fail for SCK; MISO, MOSI, RST (and probably
|
||||
* VCC and BUFF).
|
||||
*/
|
||||
|
||||
/* everything is an output, except SDI */
|
||||
/* everything is an output, except MISO */
|
||||
for(pin = 0; pin < N_PINS; ++pin) {
|
||||
pdata->pin_direction |= pgm->pin[pin].mask[0];
|
||||
pdata->pin_value = SET_BITS_0(pdata->pin_value, pgm, pin, OFF);
|
||||
}
|
||||
pdata->pin_direction &= ~pgm->pin[PIN_AVR_SDI].mask[0];
|
||||
pdata->pin_direction &= ~pgm->pin[PIN_AVR_MISO].mask[0];
|
||||
|
||||
for(pin = PIN_LED_ERR; pin < N_PINS; ++pin) {
|
||||
pdata->led_mask |= pgm->pin[pin].mask[0];
|
||||
|
@ -639,9 +655,10 @@ static int avrftdi_pin_setup(const PROGRAMMER *pgm) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int avrftdi_open(PROGRAMMER *pgm, const char *port) {
|
||||
static int avrftdi_open(PROGRAMMER * pgm, char *port)
|
||||
{
|
||||
int vid, pid, interface, index, err;
|
||||
const char *serial, *desc;
|
||||
char * serial, *desc;
|
||||
|
||||
avrftdi_t* pdata = to_pdata(pgm);
|
||||
|
||||
|
@ -661,7 +678,8 @@ static int avrftdi_open(PROGRAMMER *pgm, const char *port) {
|
|||
if (usbpid) {
|
||||
pid = *(int *)(ldata(usbpid));
|
||||
if (lnext(usbpid))
|
||||
pmsg_warning("using PID 0x%04x, ignoring remaining PIDs in list\n", pid);
|
||||
avrdude_message(MSG_INFO, "%s: Warning: using PID 0x%04x, ignoring remaining PIDs in list\n",
|
||||
progname, pid);
|
||||
} else
|
||||
pid = USB_DEVICE_FT2232;
|
||||
|
||||
|
@ -695,7 +713,7 @@ static int avrftdi_open(PROGRAMMER *pgm, const char *port) {
|
|||
if(err) {
|
||||
log_err("Error %d occurred: %s\n", err, ftdi_get_error_string(pdata->ftdic));
|
||||
//stupid hack, because avrdude calls pgm->close() even when pgm->open() fails
|
||||
//and usb_dev is initialized to the last usb device from probing
|
||||
//and usb_dev is intialized to the last usb device from probing
|
||||
pdata->ftdic->usb_dev = NULL;
|
||||
return err;
|
||||
} else {
|
||||
|
@ -710,11 +728,7 @@ static int avrftdi_open(PROGRAMMER *pgm, const char *port) {
|
|||
/* set SPI mode */
|
||||
E(ftdi_set_bitmode(pdata->ftdic, 0, BITMODE_RESET) < 0, pdata->ftdic);
|
||||
E(ftdi_set_bitmode(pdata->ftdic, pdata->pin_direction & 0xff, BITMODE_MPSSE) < 0, pdata->ftdic);
|
||||
#ifdef HAVE_FTDI_TCIOFLUSH
|
||||
E(ftdi_tcioflush(pdata->ftdic), pdata->ftdic);
|
||||
#else
|
||||
E(ftdi_usb_purge_buffers(pdata->ftdic), pdata->ftdic);
|
||||
#endif
|
||||
|
||||
write_flush(pdata);
|
||||
|
||||
|
@ -751,11 +765,7 @@ static int avrftdi_open(PROGRAMMER *pgm, const char *port) {
|
|||
pdata->tx_buffer_size = 1024;
|
||||
break;
|
||||
#else
|
||||
#ifdef _MSC_VER
|
||||
#pragma message("No support for 232H, use a newer libftdi, version >= 0.20")
|
||||
#else
|
||||
#warning No support for 232H, use a newer libftdi, version >= 0.20
|
||||
#endif
|
||||
#endif
|
||||
case TYPE_4232H:
|
||||
pdata->pin_limit = 8;
|
||||
|
@ -806,10 +816,11 @@ static void avrftdi_close(PROGRAMMER * pgm)
|
|||
return;
|
||||
}
|
||||
|
||||
static int avrftdi_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static int avrftdi_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
avrftdi_powerup(pgm);
|
||||
|
||||
if(p->prog_modes & PM_TPI)
|
||||
if(p->flags & AVRPART_HAS_TPI)
|
||||
{
|
||||
/* see avrftdi_tpi.c */
|
||||
avrftdi_tpi_initialize(pgm, p);
|
||||
|
@ -828,25 +839,28 @@ static int avrftdi_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
|
||||
/*setting rst back to 0 */
|
||||
set_pin(pgm, PIN_AVR_RESET, OFF);
|
||||
/*wait at least 20ms before issuing spi commands to avr */
|
||||
/*wait at least 20ms bevor issuing spi commands to avr */
|
||||
usleep(20 * 1000);
|
||||
}
|
||||
|
||||
return pgm->program_enable(pgm, p);
|
||||
}
|
||||
|
||||
static void avrftdi_display(const PROGRAMMER *pgm, const char *p) {
|
||||
// print the full pin definitions as in ft245r ?
|
||||
static void avrftdi_display(PROGRAMMER * pgm, const char *p)
|
||||
{
|
||||
// print the full pin definitiions as in ft245r ?
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static int avrftdi_cmd(const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res) {
|
||||
static int avrftdi_cmd(PROGRAMMER * pgm, const unsigned char *cmd, unsigned char *res)
|
||||
{
|
||||
return avrftdi_transmit(pgm, MPSSE_DO_READ | MPSSE_DO_WRITE, cmd, res, 4);
|
||||
}
|
||||
|
||||
|
||||
static int avrftdi_program_enable(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static int avrftdi_program_enable(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
int i;
|
||||
unsigned char buf[4];
|
||||
|
||||
|
@ -877,7 +891,8 @@ static int avrftdi_program_enable(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
}
|
||||
|
||||
|
||||
static int avrftdi_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static int avrftdi_chip_erase(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
unsigned char cmd[4];
|
||||
unsigned char res[4];
|
||||
|
||||
|
@ -899,20 +914,10 @@ static int avrftdi_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
|
||||
/* Load extended address byte command */
|
||||
static int
|
||||
avrftdi_lext(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned int address) {
|
||||
/* nothing to do if load extended address command unavailable */
|
||||
if(m->op[AVR_OP_LOAD_EXT_ADDR] == NULL)
|
||||
return 0;
|
||||
|
||||
avrftdi_t *pdata = to_pdata(pgm);
|
||||
avrftdi_lext(PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, unsigned int address)
|
||||
{
|
||||
unsigned char buf[] = { 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
/* only send load extended address command if high byte changed */
|
||||
if(pdata->lext_byte == (uint8_t) (address>>16))
|
||||
return 0;
|
||||
|
||||
pdata->lext_byte = (uint8_t) (address>>16);
|
||||
|
||||
avr_set_bits(m->op[AVR_OP_LOAD_EXT_ADDR], buf);
|
||||
avr_set_addr(m->op[AVR_OP_LOAD_EXT_ADDR], buf, address);
|
||||
|
||||
|
@ -926,7 +931,7 @@ avrftdi_lext(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, unsigned
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int avrftdi_eeprom_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avrftdi_eeprom_write(PROGRAMMER *pgm, AVRPART *p, AVRMEM *m,
|
||||
unsigned int page_size, unsigned int addr, unsigned int len)
|
||||
{
|
||||
unsigned char cmd[] = { 0x00, 0x00, 0x00, 0x00 };
|
||||
|
@ -948,13 +953,17 @@ static int avrftdi_eeprom_write(const PROGRAMMER *pgm, const AVRPART *p, const A
|
|||
return len;
|
||||
}
|
||||
|
||||
static int avrftdi_eeprom_read(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avrftdi_eeprom_read(PROGRAMMER *pgm, AVRPART *p, AVRMEM *m,
|
||||
unsigned int page_size, unsigned int addr, unsigned int len)
|
||||
{
|
||||
unsigned char cmd[4];
|
||||
unsigned int add;
|
||||
unsigned char* buffer = alloca(len);
|
||||
#ifdef _MSC_VER
|
||||
unsigned char* buffer = _alloca(len);
|
||||
unsigned char* bufptr = buffer;
|
||||
#else
|
||||
unsigned char buffer[len], *bufptr = buffer;
|
||||
#endif
|
||||
|
||||
memset(buffer, 0, len);
|
||||
|
||||
|
@ -974,19 +983,25 @@ static int avrftdi_eeprom_read(const PROGRAMMER *pgm, const AVRPART *p, const AV
|
|||
return len;
|
||||
}
|
||||
|
||||
static int avrftdi_flash_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned int page_size, unsigned int addr, unsigned int len)
|
||||
{
|
||||
int use_lext_address = m->op[AVR_OP_LOAD_EXT_ADDR] != NULL;
|
||||
|
||||
unsigned int word;
|
||||
unsigned int poll_index;
|
||||
unsigned int buf_size;
|
||||
|
||||
unsigned char poll_byte;
|
||||
unsigned char *buffer = &m->buf[addr];
|
||||
unsigned int buf_size = 4 * len + 4;
|
||||
unsigned char* buf = alloca(buf_size);
|
||||
#ifdef _MSC_VER
|
||||
unsigned char* buf = _alloca(4 * len + 4);
|
||||
unsigned char* bufptr = buf;
|
||||
#else
|
||||
unsigned char buf[4*len+4], *bufptr = buf;
|
||||
#endif
|
||||
|
||||
memset(buf, 0, buf_size);
|
||||
memset(buf, 0, 4 * len + 4);
|
||||
|
||||
/* pre-check opcodes */
|
||||
if (m->op[AVR_OP_LOADPAGE_LO] == NULL) {
|
||||
|
@ -998,19 +1013,29 @@ static int avrftdi_flash_write(const PROGRAMMER *pgm, const AVRPART *p, const AV
|
|||
return -1;
|
||||
}
|
||||
|
||||
if(page_size != (unsigned int) m->page_size) {
|
||||
if(page_size != m->page_size) {
|
||||
log_warn("Parameter page_size is %d, ", page_size);
|
||||
log_warn("but m->page_size is %d. Using the latter.\n", m->page_size);
|
||||
}
|
||||
|
||||
page_size = m->page_size;
|
||||
|
||||
/* on large-flash devices > 128k issue extended address command when needed */
|
||||
if(avrftdi_lext(pgm, p, m, addr/2) < 0)
|
||||
/* if we do cross a 64k word boundary (or write the
|
||||
* first page), we need to issue a 'load extended
|
||||
* address byte' command, which is defined as 0x4d
|
||||
* 0x00 <address byte> 0x00. As far as i know, this
|
||||
* is only available on 256k parts. 64k word is 128k
|
||||
* bytes.
|
||||
* write the command only once.
|
||||
*/
|
||||
if(use_lext_address && (((addr/2) & 0xffff0000))) {
|
||||
if (0 > avrftdi_lext(pgm, p, m, addr/2))
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* prepare the command stream for the whole page */
|
||||
/* addr is in bytes, but we program in words. */
|
||||
/* addr is in bytes, but we program in words. addr/2 should be something
|
||||
* like addr >> WORD_SHIFT, though */
|
||||
for(word = addr/2; word < (len + addr)/2; word++)
|
||||
{
|
||||
log_debug("-< bytes = %d of %d\n", word * 2, len + addr);
|
||||
|
@ -1039,14 +1064,6 @@ static int avrftdi_flash_write(const PROGRAMMER *pgm, const AVRPART *p, const AV
|
|||
bufptr += 4;
|
||||
}
|
||||
|
||||
/* find a poll byte. We cannot poll a value of 0xff, so look
|
||||
* for a value != 0xff
|
||||
*/
|
||||
for(poll_index = addr+len-1; poll_index+1 > addr; poll_index--)
|
||||
if(m->buf[poll_index] != 0xff)
|
||||
break;
|
||||
|
||||
if(poll_index+1 > addr) {
|
||||
buf_size = bufptr - buf;
|
||||
|
||||
if(verbose > TRACE)
|
||||
|
@ -1057,7 +1074,15 @@ static int avrftdi_flash_write(const PROGRAMMER *pgm, const AVRPART *p, const AV
|
|||
return -1;
|
||||
|
||||
bufptr = buf;
|
||||
/* find a poll byte. we cannot poll a value of 0xff, so look
|
||||
* for a value != 0xff
|
||||
*/
|
||||
for(poll_index = addr+len-1; poll_index > addr-1; poll_index--)
|
||||
if(m->buf[poll_index] != 0xff)
|
||||
break;
|
||||
|
||||
if((poll_index < addr + len) && m->buf[poll_index] != 0xff)
|
||||
{
|
||||
log_info("Using m->buf[%d] = 0x%02x as polling value ", poll_index,
|
||||
m->buf[poll_index]);
|
||||
/* poll page write ready */
|
||||
|
@ -1071,7 +1096,9 @@ static int avrftdi_flash_write(const PROGRAMMER *pgm, const AVRPART *p, const AV
|
|||
}
|
||||
else
|
||||
{
|
||||
log_warn("Skipping empty page (containing only 0xff bytes)\n");
|
||||
log_warn("No suitable byte (!=0xff) for polling found.\n");
|
||||
log_warn("Trying to sleep instead, but programming errors may occur.\n");
|
||||
log_warn("Be sure to verify programmed memory (no -V option)\n");
|
||||
/* TODO sync write */
|
||||
/* sleep */
|
||||
usleep((m->max_write_delay));
|
||||
|
@ -1083,18 +1110,25 @@ static int avrftdi_flash_write(const PROGRAMMER *pgm, const AVRPART *p, const AV
|
|||
/*
|
||||
*Reading from flash
|
||||
*/
|
||||
static int avrftdi_flash_read(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avrftdi_flash_read(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned int page_size, unsigned int addr, unsigned int len)
|
||||
{
|
||||
OPCODE * readop;
|
||||
int byte, word;
|
||||
int use_lext_address = m->op[AVR_OP_LOAD_EXT_ADDR] != NULL;
|
||||
unsigned int address = addr/2;
|
||||
unsigned int index;
|
||||
|
||||
unsigned int buf_size = 4 * len + 4;
|
||||
unsigned char* o_buf = alloca(buf_size);
|
||||
unsigned char* i_buf = alloca(buf_size);
|
||||
#ifdef _MSC_VER
|
||||
unsigned char* o_buf = _alloca(4 * len + 4);
|
||||
unsigned char* i_buf = _alloca(4 * len + 4);
|
||||
#else
|
||||
unsigned char o_buf[4*len+4];
|
||||
unsigned char i_buf[4*len+4];
|
||||
#endif
|
||||
|
||||
|
||||
memset(o_buf, 0, buf_size);
|
||||
memset(i_buf, 0, buf_size);
|
||||
memset(o_buf, 0, 4 * len + 4);
|
||||
memset(i_buf, 0, 4 * len + 4);
|
||||
|
||||
/* pre-check opcodes */
|
||||
if (m->op[AVR_OP_READ_LO] == NULL) {
|
||||
|
@ -1106,11 +1140,13 @@ static int avrftdi_flash_read(const PROGRAMMER *pgm, const AVRPART *p, const AVR
|
|||
return -1;
|
||||
}
|
||||
|
||||
if(avrftdi_lext(pgm, p, m, addr/2) < 0)
|
||||
if(use_lext_address && ((address & 0xffff0000))) {
|
||||
if (0 > avrftdi_lext(pgm, p, m, address))
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* word addressing! */
|
||||
for(unsigned int word = addr/2, index = 0; word < (addr + len)/2; word++)
|
||||
for(word = addr/2, index = 0; word < (addr + len)/2; word++)
|
||||
{
|
||||
/* one byte is transferred via a 4-byte opcode.
|
||||
* TODO: reduce magic numbers
|
||||
|
@ -1141,7 +1177,7 @@ static int avrftdi_flash_read(const PROGRAMMER *pgm, const AVRPART *p, const AVR
|
|||
memset(&m->buf[addr], 0, page_size);
|
||||
|
||||
/* every (read) op is 4 bytes in size and yields one byte of memory data */
|
||||
for(unsigned int byte = 0; byte < page_size; byte++) {
|
||||
for(byte = 0; byte < page_size; byte++) {
|
||||
if(byte & 1)
|
||||
readop = m->op[AVR_OP_READ_HI];
|
||||
else
|
||||
|
@ -1159,7 +1195,7 @@ static int avrftdi_flash_read(const PROGRAMMER *pgm, const AVRPART *p, const AVR
|
|||
return len;
|
||||
}
|
||||
|
||||
static int avrftdi_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avrftdi_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned int page_size, unsigned int addr, unsigned int n_bytes)
|
||||
{
|
||||
if (strcmp(m->desc, "flash") == 0)
|
||||
|
@ -1170,7 +1206,7 @@ static int avrftdi_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const AV
|
|||
return -2;
|
||||
}
|
||||
|
||||
static int avrftdi_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int avrftdi_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned int page_size, unsigned int addr, unsigned int n_bytes)
|
||||
{
|
||||
if (strcmp(m->desc, "flash") == 0)
|
||||
|
@ -1186,11 +1222,7 @@ avrftdi_setup(PROGRAMMER * pgm)
|
|||
{
|
||||
avrftdi_t* pdata;
|
||||
|
||||
|
||||
if(!(pgm->cookie = calloc(sizeof(avrftdi_t), 1))) {
|
||||
log_err("Error allocating memory.\n");
|
||||
exit(1);
|
||||
}
|
||||
pgm->cookie = malloc(sizeof(avrftdi_t));
|
||||
pdata = to_pdata(pgm);
|
||||
|
||||
pdata->ftdic = ftdi_new();
|
||||
|
@ -1204,7 +1236,6 @@ avrftdi_setup(PROGRAMMER * pgm)
|
|||
pdata->pin_value = 0;
|
||||
pdata->pin_direction = 0;
|
||||
pdata->led_mask = 0;
|
||||
pdata->lext_byte = 0xff;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1219,7 +1250,9 @@ avrftdi_teardown(PROGRAMMER * pgm)
|
|||
}
|
||||
}
|
||||
|
||||
void avrftdi_initpgm(PROGRAMMER *pgm) {
|
||||
void avrftdi_initpgm(PROGRAMMER * pgm)
|
||||
{
|
||||
|
||||
strcpy(pgm->type, "avrftdi");
|
||||
|
||||
/*
|
|
@ -29,7 +29,7 @@ extern "C" {
|
|||
|
||||
|
||||
extern const char avrftdi_desc[];
|
||||
void avrftdi_initpgm(PROGRAMMER *pgm);
|
||||
void avrftdi_initpgm (PROGRAMMER * pgm);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
#pragma once
|
||||
#include "ac_cfg.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(HAVE_LIBFTDI1) && defined(HAVE_LIBUSB_1_0)
|
||||
# if defined(HAVE_LIBUSB_1_0_LIBUSB_H)
|
||||
# include <libusb-1.0/libusb.h>
|
||||
# else
|
||||
# include <libusb.h>
|
||||
# endif
|
||||
# include <libftdi1/ftdi.h>
|
||||
# undef HAVE_LIBFTDI_TYPE_232H
|
||||
# define HAVE_LIBFTDI_TYPE_232H 1
|
||||
#elif defined(HAVE_LIBFTDI) && (defined(HAVE_USB_H) || defined(_MSC_VER))
|
||||
/* ftdi.h includes usb.h */
|
||||
#include <ftdi.h>
|
||||
#else
|
||||
#ifdef _MSC_VER
|
||||
#pragma message("No libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again.")
|
||||
#else
|
||||
#warning No libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again.
|
||||
#endif
|
||||
#define DO_NOT_BUILD_AVRFTDI
|
||||
#endif
|
||||
|
||||
#ifndef DO_NOT_BUILD_AVRFTDI
|
||||
|
||||
enum { ERR, WARN, INFO, DEBUG, TRACE };
|
||||
|
||||
#define __log(lvl, fmt, ...) \
|
||||
do { \
|
||||
avrftdi_log(lvl, __func__, __LINE__, fmt, ##__VA_ARGS__); \
|
||||
} while(0)
|
||||
|
||||
|
||||
#define log_err(fmt, ...) __log(ERR, fmt, ##__VA_ARGS__)
|
||||
#define log_warn(fmt, ...) __log(WARN, fmt, ##__VA_ARGS__)
|
||||
#define log_info(fmt, ...) __log(INFO, fmt, ##__VA_ARGS__)
|
||||
#define log_debug(fmt, ...) __log(DEBUG, fmt, ##__VA_ARGS__)
|
||||
#define log_trace(fmt, ...) __log(TRACE, fmt, ##__VA_ARGS__)
|
||||
|
||||
#define E(x, ftdi) \
|
||||
do { \
|
||||
if ((x)) \
|
||||
{ \
|
||||
avrdude_message(MSG_INFO, "%s:%d %s() %s: %s (%d)\n\t%s\n", \
|
||||
__FILE__, __LINE__, __FUNCTION__, \
|
||||
#x, strerror(errno), errno, ftdi_get_error_string(ftdi)); \
|
||||
return -1; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define E_VOID(x, ftdi) \
|
||||
do { \
|
||||
if ((x)) \
|
||||
{ \
|
||||
avrdude_message(MSG_INFO, "%s:%d %s() %s: %s (%d)\n\t%s\n", \
|
||||
__FILE__, __LINE__, __FUNCTION__, \
|
||||
#x, strerror(errno), errno, ftdi_get_error_string(ftdi)); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
||||
#define to_pdata(pgm) \
|
||||
((avrftdi_t *)((pgm)->cookie))
|
||||
|
||||
typedef struct avrftdi_s {
|
||||
/* pointer to struct maintained by libftdi to identify the device */
|
||||
struct ftdi_context* ftdic;
|
||||
/* bitmask of values for pins. bit 0 represents pin 0 ([A|B]DBUS0) */
|
||||
uint16_t pin_value;
|
||||
/* bitmask of pin direction. a '1' make a pin an output.
|
||||
* bit 0 corresponds to pin 0. */
|
||||
uint16_t pin_direction;
|
||||
/* don't know. not useful. someone put it in. */
|
||||
uint16_t led_mask;
|
||||
/* total number of pins supported by a programmer. varies with FTDI chips */
|
||||
int pin_limit;
|
||||
/* internal RX buffer of the device. needed for INOUT transfers */
|
||||
int rx_buffer_size;
|
||||
int tx_buffer_size;
|
||||
/* use bitbanging instead of mpsse spi */
|
||||
bool use_bitbanging;
|
||||
} avrftdi_t;
|
||||
|
||||
void avrftdi_log(int level, const char * func, int line, const char * fmt, ...);
|
||||
|
||||
#endif /* DO_NOT_BUILD_AVRFDTI */
|
||||
|
|
@ -13,10 +13,15 @@
|
|||
#include "avrftdi_tpi.h"
|
||||
#include "avrftdi_private.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <intrin.h>
|
||||
#define __builtin_popcount __popcnt
|
||||
#endif
|
||||
|
||||
#ifndef DO_NOT_BUILD_AVRFTDI
|
||||
|
||||
static void avrftdi_tpi_disable(const PROGRAMMER *);
|
||||
static int avrftdi_tpi_program_enable(const PROGRAMMER *pgm, const AVRPART *p);
|
||||
static void avrftdi_tpi_disable(PROGRAMMER *);
|
||||
static int avrftdi_tpi_program_enable(PROGRAMMER * pgm, AVRPART * p);
|
||||
|
||||
#ifdef notyet
|
||||
static void
|
||||
|
@ -63,16 +68,27 @@ avrftdi_debug_frame(uint16_t frame)
|
|||
#endif /* notyet */
|
||||
|
||||
int
|
||||
avrftdi_tpi_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
avrftdi_tpi_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
int ret;
|
||||
|
||||
avrftdi_t* pdata = to_pdata(pgm);
|
||||
unsigned char buf[] = { MPSSE_DO_WRITE | MPSSE_WRITE_NEG | MPSSE_LSB, 0x01, 0x00, 0xff, 0xff };
|
||||
|
||||
log_info("Using TPI interface\n");
|
||||
|
||||
pgm->program_enable = avrftdi_tpi_program_enable;
|
||||
pgm->cmd_tpi = avrftdi_cmd_tpi;
|
||||
pgm->chip_erase = avr_tpi_chip_erase;
|
||||
pgm->disable = avrftdi_tpi_disable;
|
||||
|
||||
pgm->paged_load = NULL;
|
||||
pgm->paged_write = NULL;
|
||||
|
||||
log_info("Setting /Reset pin low\n");
|
||||
pgm->setpin(pgm, PIN_AVR_RESET, OFF);
|
||||
pgm->setpin(pgm, PIN_AVR_SCK, OFF);
|
||||
pgm->setpin(pgm, PIN_AVR_SDO, ON);
|
||||
pgm->setpin(pgm, PIN_AVR_MOSI, ON);
|
||||
usleep(20 * 1000);
|
||||
|
||||
pgm->setpin(pgm, PIN_AVR_RESET, ON);
|
||||
|
@ -90,44 +106,13 @@ avrftdi_tpi_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void avrftdi_tpi_initpgm(PROGRAMMER *pgm) {
|
||||
log_info("Using TPI interface\n");
|
||||
|
||||
pgm->program_enable = avrftdi_tpi_program_enable;
|
||||
pgm->cmd_tpi = avrftdi_cmd_tpi;
|
||||
pgm->chip_erase = avr_tpi_chip_erase;
|
||||
pgm->disable = avrftdi_tpi_disable;
|
||||
|
||||
pgm->paged_load = NULL;
|
||||
pgm->paged_write = NULL;
|
||||
}
|
||||
|
||||
|
||||
#define TPI_PARITY_MASK 0x2000
|
||||
|
||||
static inline int count1s(unsigned int x)
|
||||
{
|
||||
#if defined(__GNUC__)
|
||||
return __builtin_popcount(x);
|
||||
#else
|
||||
int count = 0;
|
||||
|
||||
while (x)
|
||||
{
|
||||
count += x & 1;
|
||||
x >>= 1;
|
||||
}
|
||||
|
||||
return count;
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
tpi_byte2frame(uint8_t byte)
|
||||
{
|
||||
uint16_t frame = 0xc00f;
|
||||
int parity = count1s(byte) & 1;
|
||||
int parity = __builtin_popcount(byte) & 1;
|
||||
|
||||
frame |= ((byte << 5) & 0x1fe0);
|
||||
|
||||
|
@ -143,7 +128,7 @@ tpi_frame2byte(uint16_t frame, uint8_t * byte)
|
|||
/* drop idle and start bit(s) */
|
||||
*byte = (frame >> 5) & 0xff;
|
||||
|
||||
int parity = count1s(*byte) & 1;
|
||||
int parity = __builtin_popcount(*byte) & 1;
|
||||
int parity_rcvd = (frame & TPI_PARITY_MASK) ? 1 : 0;
|
||||
|
||||
return parity != parity_rcvd;
|
||||
|
@ -151,7 +136,8 @@ tpi_frame2byte(uint16_t frame, uint8_t * byte)
|
|||
|
||||
#ifdef notyet
|
||||
static int
|
||||
avrftdi_tpi_break(const PROGRAMMER *pgm) {
|
||||
avrftdi_tpi_break(PROGRAMMER * pgm)
|
||||
{
|
||||
unsigned char buffer[] = { MPSSE_DO_WRITE | MPSSE_WRITE_NEG | MPSSE_LSB, 1, 0, 0, 0 };
|
||||
E(ftdi_write_data(to_pdata(pgm)->ftdic, buffer, sizeof(buffer)) != sizeof(buffer), to_pdata(pgm)->ftdic);
|
||||
|
||||
|
@ -160,7 +146,8 @@ avrftdi_tpi_break(const PROGRAMMER *pgm) {
|
|||
#endif /* notyet */
|
||||
|
||||
static int
|
||||
avrftdi_tpi_write_byte(const PROGRAMMER *pgm, unsigned char byte) {
|
||||
avrftdi_tpi_write_byte(PROGRAMMER * pgm, unsigned char byte)
|
||||
{
|
||||
uint16_t frame;
|
||||
|
||||
struct ftdi_context* ftdic = to_pdata(pgm)->ftdic;
|
||||
|
@ -186,7 +173,8 @@ avrftdi_tpi_write_byte(const PROGRAMMER *pgm, unsigned char byte) {
|
|||
#define TPI_IDLE_BITS 2
|
||||
|
||||
static int
|
||||
avrftdi_tpi_read_byte(const PROGRAMMER *pgm, unsigned char *byte) {
|
||||
avrftdi_tpi_read_byte(PROGRAMMER * pgm, unsigned char * byte)
|
||||
{
|
||||
uint16_t frame;
|
||||
|
||||
/* use 2 guard bits, 2 default idle bits + 12 frame bits = 16 bits total */
|
||||
|
@ -230,12 +218,13 @@ avrftdi_tpi_read_byte(const PROGRAMMER *pgm, unsigned char *byte) {
|
|||
}
|
||||
|
||||
static int
|
||||
avrftdi_tpi_program_enable(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
avrftdi_tpi_program_enable(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
return avr_tpi_program_enable(pgm, p, TPIPCR_GT_2b);
|
||||
}
|
||||
|
||||
int
|
||||
avrftdi_cmd_tpi(const PROGRAMMER *pgm, const unsigned char *cmd, int cmd_len,
|
||||
avrftdi_cmd_tpi(PROGRAMMER * pgm, const unsigned char *cmd, int cmd_len,
|
||||
unsigned char *res, int res_len)
|
||||
{
|
||||
int i, err = 0;
|
||||
|
@ -258,7 +247,8 @@ avrftdi_cmd_tpi(const PROGRAMMER *pgm, const unsigned char *cmd, int cmd_len,
|
|||
}
|
||||
|
||||
static void
|
||||
avrftdi_tpi_disable(const PROGRAMMER *pgm) {
|
||||
avrftdi_tpi_disable(PROGRAMMER * pgm)
|
||||
{
|
||||
unsigned char cmd[] = {TPI_OP_SSTCS(TPIPCR), 0};
|
||||
pgm->cmd_tpi(pgm, cmd, sizeof(cmd), NULL, 0);
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
//int avrftdi_tpi_write_byte(PROGRAMMER * pgm, unsigned char byte);
|
||||
//int avrftdi_tpi_read_byte(PROGRAMMER * pgm, unsigned char * byte);
|
||||
int avrftdi_cmd_tpi(PROGRAMMER * pgm, const unsigned char *cmd, int cmd_len,
|
||||
unsigned char *res, int res_len);
|
||||
int avrftdi_tpi_initialize(PROGRAMMER * pgm, AVRPART * p);
|
||||
|
||||
|
|
@ -0,0 +1,680 @@
|
|||
|
||||
/*
|
||||
* avrdude - A Downloader/Uploader for AVR device programmers
|
||||
* Copyright (C) 2000-2004 Brian S. Dean <bsd@bsdhome.com>
|
||||
* Copyright (C) 2006 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "avrdude.h"
|
||||
#include "libavrdude.h"
|
||||
|
||||
/***
|
||||
*** Elementary functions dealing with OPCODE structures
|
||||
***/
|
||||
|
||||
OPCODE * avr_new_opcode(void)
|
||||
{
|
||||
OPCODE * m;
|
||||
|
||||
m = (OPCODE *)malloc(sizeof(*m));
|
||||
if (m == NULL) {
|
||||
avrdude_message(MSG_INFO, "avr_new_opcode(): out of memory\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memset(m, 0, sizeof(*m));
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
static OPCODE * avr_dup_opcode(OPCODE * op)
|
||||
{
|
||||
OPCODE * m;
|
||||
|
||||
/* this makes life easier */
|
||||
if (op == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m = (OPCODE *)malloc(sizeof(*m));
|
||||
if (m == NULL) {
|
||||
avrdude_message(MSG_INFO, "avr_dup_opcode(): out of memory\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memcpy(m, op, sizeof(*m));
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
void avr_free_opcode(OPCODE * op)
|
||||
{
|
||||
free(op);
|
||||
}
|
||||
|
||||
/*
|
||||
* avr_set_bits()
|
||||
*
|
||||
* Set instruction bits in the specified command based on the opcode.
|
||||
*/
|
||||
int avr_set_bits(OPCODE * op, unsigned char * cmd)
|
||||
{
|
||||
int i, j, bit;
|
||||
unsigned char mask;
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
if (op->bit[i].type == AVR_CMDBIT_VALUE) {
|
||||
j = 3 - i / 8;
|
||||
bit = i % 8;
|
||||
mask = 1 << bit;
|
||||
if (op->bit[i].value)
|
||||
cmd[j] = cmd[j] | mask;
|
||||
else
|
||||
cmd[j] = cmd[j] & ~mask;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* avr_set_addr()
|
||||
*
|
||||
* Set address bits in the specified command based on the opcode, and
|
||||
* the address.
|
||||
*/
|
||||
int avr_set_addr(OPCODE * op, unsigned char * cmd, unsigned long addr)
|
||||
{
|
||||
int i, j, bit;
|
||||
unsigned long value;
|
||||
unsigned char mask;
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
if (op->bit[i].type == AVR_CMDBIT_ADDRESS) {
|
||||
j = 3 - i / 8;
|
||||
bit = i % 8;
|
||||
mask = 1 << bit;
|
||||
value = addr >> op->bit[i].bitno & 0x01;
|
||||
if (value)
|
||||
cmd[j] = cmd[j] | mask;
|
||||
else
|
||||
cmd[j] = cmd[j] & ~mask;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* avr_set_input()
|
||||
*
|
||||
* Set input data bits in the specified command based on the opcode,
|
||||
* and the data byte.
|
||||
*/
|
||||
int avr_set_input(OPCODE * op, unsigned char * cmd, unsigned char data)
|
||||
{
|
||||
int i, j, bit;
|
||||
unsigned char value;
|
||||
unsigned char mask;
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
if (op->bit[i].type == AVR_CMDBIT_INPUT) {
|
||||
j = 3 - i / 8;
|
||||
bit = i % 8;
|
||||
mask = 1 << bit;
|
||||
value = data >> op->bit[i].bitno & 0x01;
|
||||
if (value)
|
||||
cmd[j] = cmd[j] | mask;
|
||||
else
|
||||
cmd[j] = cmd[j] & ~mask;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* avr_get_output()
|
||||
*
|
||||
* Retreive output data bits from the command results based on the
|
||||
* opcode data.
|
||||
*/
|
||||
int avr_get_output(OPCODE * op, unsigned char * res, unsigned char * data)
|
||||
{
|
||||
int i, j, bit;
|
||||
unsigned char value;
|
||||
unsigned char mask;
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
if (op->bit[i].type == AVR_CMDBIT_OUTPUT) {
|
||||
j = 3 - i / 8;
|
||||
bit = i % 8;
|
||||
mask = 1 << bit;
|
||||
value = ((res[j] & mask) >> bit) & 0x01;
|
||||
value = value << op->bit[i].bitno;
|
||||
if (value)
|
||||
*data = *data | value;
|
||||
else
|
||||
*data = *data & ~value;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* avr_get_output_index()
|
||||
*
|
||||
* Calculate the byte number of the output data based on the
|
||||
* opcode data.
|
||||
*/
|
||||
int avr_get_output_index(OPCODE * op)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
if (op->bit[i].type == AVR_CMDBIT_OUTPUT) {
|
||||
j = 3 - i / 8;
|
||||
return j;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
static char * avr_op_str(int op)
|
||||
{
|
||||
switch (op) {
|
||||
case AVR_OP_READ : return "READ"; break;
|
||||
case AVR_OP_WRITE : return "WRITE"; break;
|
||||
case AVR_OP_READ_LO : return "READ_LO"; break;
|
||||
case AVR_OP_READ_HI : return "READ_HI"; break;
|
||||
case AVR_OP_WRITE_LO : return "WRITE_LO"; break;
|
||||
case AVR_OP_WRITE_HI : return "WRITE_HI"; break;
|
||||
case AVR_OP_LOADPAGE_LO : return "LOADPAGE_LO"; break;
|
||||
case AVR_OP_LOADPAGE_HI : return "LOADPAGE_HI"; break;
|
||||
case AVR_OP_LOAD_EXT_ADDR : return "LOAD_EXT_ADDR"; break;
|
||||
case AVR_OP_WRITEPAGE : return "WRITEPAGE"; break;
|
||||
case AVR_OP_CHIP_ERASE : return "CHIP_ERASE"; break;
|
||||
case AVR_OP_PGM_ENABLE : return "PGM_ENABLE"; break;
|
||||
default : return "<unknown opcode>"; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static char * bittype(int type)
|
||||
{
|
||||
switch (type) {
|
||||
case AVR_CMDBIT_IGNORE : return "IGNORE"; break;
|
||||
case AVR_CMDBIT_VALUE : return "VALUE"; break;
|
||||
case AVR_CMDBIT_ADDRESS : return "ADDRESS"; break;
|
||||
case AVR_CMDBIT_INPUT : return "INPUT"; break;
|
||||
case AVR_CMDBIT_OUTPUT : return "OUTPUT"; break;
|
||||
default : return "<unknown bit type>"; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***
|
||||
*** Elementary functions dealing with AVRMEM structures
|
||||
***/
|
||||
|
||||
AVRMEM * avr_new_memtype(void)
|
||||
{
|
||||
AVRMEM * m;
|
||||
|
||||
m = (AVRMEM *)malloc(sizeof(*m));
|
||||
if (m == NULL) {
|
||||
avrdude_message(MSG_INFO, "avr_new_memtype(): out of memory\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memset(m, 0, sizeof(*m));
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Allocate and initialize memory buffers for each of the device's
|
||||
* defined memory regions.
|
||||
*/
|
||||
int avr_initmem(AVRPART * p)
|
||||
{
|
||||
LNODEID ln;
|
||||
AVRMEM * m;
|
||||
|
||||
for (ln=lfirst(p->mem); ln; ln=lnext(ln)) {
|
||||
m = ldata(ln);
|
||||
m->buf = (unsigned char *) malloc(m->size);
|
||||
if (m->buf == NULL) {
|
||||
avrdude_message(MSG_INFO, "%s: can't alloc buffer for %s size of %d bytes\n",
|
||||
progname, m->desc, m->size);
|
||||
return -1;
|
||||
}
|
||||
m->tags = (unsigned char *) malloc(m->size);
|
||||
if (m->tags == NULL) {
|
||||
avrdude_message(MSG_INFO, "%s: can't alloc buffer for %s size of %d bytes\n",
|
||||
progname, m->desc, m->size);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
AVRMEM * avr_dup_mem(AVRMEM * m)
|
||||
{
|
||||
AVRMEM * n;
|
||||
int i;
|
||||
|
||||
n = avr_new_memtype();
|
||||
|
||||
*n = *m;
|
||||
|
||||
if (m->buf != NULL) {
|
||||
n->buf = (unsigned char *)malloc(n->size);
|
||||
if (n->buf == NULL) {
|
||||
avrdude_message(MSG_INFO, "avr_dup_mem(): out of memory (memsize=%d)\n",
|
||||
n->size);
|
||||
exit(1);
|
||||
}
|
||||
memcpy(n->buf, m->buf, n->size);
|
||||
}
|
||||
|
||||
if (m->tags != NULL) {
|
||||
n->tags = (unsigned char *)malloc(n->size);
|
||||
if (n->tags == NULL) {
|
||||
avrdude_message(MSG_INFO, "avr_dup_mem(): out of memory (memsize=%d)\n",
|
||||
n->size);
|
||||
exit(1);
|
||||
}
|
||||
memcpy(n->tags, m->tags, n->size);
|
||||
}
|
||||
|
||||
for (i = 0; i < AVR_OP_MAX; i++) {
|
||||
n->op[i] = avr_dup_opcode(n->op[i]);
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
void avr_free_mem(AVRMEM * m)
|
||||
{
|
||||
int i;
|
||||
if (m->buf != NULL) {
|
||||
free(m->buf);
|
||||
m->buf = NULL;
|
||||
}
|
||||
if (m->tags != NULL) {
|
||||
free(m->tags);
|
||||
m->tags = NULL;
|
||||
}
|
||||
for(i=0;i<sizeof(m->op)/sizeof(m->op[0]);i++)
|
||||
{
|
||||
if (m->op[i] != NULL)
|
||||
{
|
||||
avr_free_opcode(m->op[i]);
|
||||
m->op[i] = NULL;
|
||||
}
|
||||
}
|
||||
free(m);
|
||||
}
|
||||
|
||||
AVRMEM * avr_locate_mem(AVRPART * p, char * desc)
|
||||
{
|
||||
AVRMEM * m, * match;
|
||||
LNODEID ln;
|
||||
int matches;
|
||||
int l;
|
||||
|
||||
l = strlen(desc);
|
||||
matches = 0;
|
||||
match = NULL;
|
||||
for (ln=lfirst(p->mem); ln; ln=lnext(ln)) {
|
||||
m = ldata(ln);
|
||||
if (strncmp(desc, m->desc, l) == 0) {
|
||||
match = m;
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
|
||||
if (matches == 1)
|
||||
return match;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void avr_mem_display(const char * prefix, FILE * f, AVRMEM * m, int type,
|
||||
int verbose)
|
||||
{
|
||||
int i, j;
|
||||
char * optr;
|
||||
|
||||
if (m == NULL) {
|
||||
fprintf(f,
|
||||
"%s Block Poll Page Polled\n"
|
||||
"%sMemory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack\n"
|
||||
"%s----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------\n",
|
||||
prefix, prefix, prefix);
|
||||
}
|
||||
else {
|
||||
if (verbose > 2) {
|
||||
fprintf(f,
|
||||
"%s Block Poll Page Polled\n"
|
||||
"%sMemory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack\n"
|
||||
"%s----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------\n",
|
||||
prefix, prefix, prefix);
|
||||
}
|
||||
fprintf(f,
|
||||
"%s%-11s %4d %5d %5d %4d %-6s %6d %4d %6d %5d %5d 0x%02x 0x%02x\n",
|
||||
prefix, m->desc, m->mode, m->delay, m->blocksize, m->pollindex,
|
||||
m->paged ? "yes" : "no",
|
||||
m->size,
|
||||
m->page_size,
|
||||
m->num_pages,
|
||||
m->min_write_delay,
|
||||
m->max_write_delay,
|
||||
m->readback[0],
|
||||
m->readback[1]);
|
||||
if (verbose > 4) {
|
||||
avrdude_message(MSG_TRACE2, "%s Memory Ops:\n"
|
||||
"%s Oeration Inst Bit Bit Type Bitno Value\n"
|
||||
"%s ----------- -------- -------- ----- -----\n",
|
||||
prefix, prefix, prefix);
|
||||
for (i=0; i<AVR_OP_MAX; i++) {
|
||||
if (m->op[i]) {
|
||||
for (j=31; j>=0; j--) {
|
||||
if (j==31)
|
||||
optr = avr_op_str(i);
|
||||
else
|
||||
optr = " ";
|
||||
fprintf(f,
|
||||
"%s %-11s %8d %8s %5d %5d\n",
|
||||
prefix, optr, j,
|
||||
bittype(m->op[i]->bit[j].type),
|
||||
m->op[i]->bit[j].bitno,
|
||||
m->op[i]->bit[j].value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Elementary functions dealing with AVRPART structures
|
||||
*/
|
||||
|
||||
|
||||
AVRPART * avr_new_part(void)
|
||||
{
|
||||
AVRPART * p;
|
||||
|
||||
p = (AVRPART *)malloc(sizeof(AVRPART));
|
||||
if (p == NULL) {
|
||||
avrdude_message(MSG_INFO, "new_part(): out of memory\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memset(p, 0, sizeof(*p));
|
||||
|
||||
p->id[0] = 0;
|
||||
p->desc[0] = 0;
|
||||
p->reset_disposition = RESET_DEDICATED;
|
||||
p->retry_pulse = PIN_AVR_SCK;
|
||||
p->flags = AVRPART_SERIALOK | AVRPART_PARALLELOK | AVRPART_ENABLEPAGEPROGRAMMING;
|
||||
p->config_file[0] = 0;
|
||||
p->lineno = 0;
|
||||
memset(p->signature, 0xFF, 3);
|
||||
p->ctl_stack_type = CTL_STACK_NONE;
|
||||
p->ocdrev = -1;
|
||||
|
||||
p->mem = lcreat(NULL, 0);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
AVRPART * avr_dup_part(AVRPART * d)
|
||||
{
|
||||
AVRPART * p;
|
||||
LISTID save;
|
||||
LNODEID ln;
|
||||
int i;
|
||||
|
||||
p = avr_new_part();
|
||||
save = p->mem;
|
||||
|
||||
*p = *d;
|
||||
|
||||
p->mem = save;
|
||||
|
||||
for (ln=lfirst(d->mem); ln; ln=lnext(ln)) {
|
||||
ladd(p->mem, avr_dup_mem(ldata(ln)));
|
||||
}
|
||||
|
||||
for (i = 0; i < AVR_OP_MAX; i++) {
|
||||
p->op[i] = avr_dup_opcode(p->op[i]);
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
void avr_free_part(AVRPART * d)
|
||||
{
|
||||
int i;
|
||||
ldestroy_cb(d->mem, (void(*)(void *))avr_free_mem);
|
||||
d->mem = NULL;
|
||||
for(i=0;i<sizeof(d->op)/sizeof(d->op[0]);i++)
|
||||
{
|
||||
if (d->op[i] != NULL)
|
||||
{
|
||||
avr_free_opcode(d->op[i]);
|
||||
d->op[i] = NULL;
|
||||
}
|
||||
}
|
||||
free(d);
|
||||
}
|
||||
|
||||
AVRPART * locate_part(LISTID parts, char * partdesc)
|
||||
{
|
||||
LNODEID ln1;
|
||||
AVRPART * p = NULL;
|
||||
int found;
|
||||
|
||||
found = 0;
|
||||
|
||||
for (ln1=lfirst(parts); ln1 && !found; ln1=lnext(ln1)) {
|
||||
p = ldata(ln1);
|
||||
if ((strcasecmp(partdesc, p->id) == 0) ||
|
||||
(strcasecmp(partdesc, p->desc) == 0))
|
||||
found = 1;
|
||||
}
|
||||
|
||||
if (found)
|
||||
return p;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AVRPART * locate_part_by_avr910_devcode(LISTID parts, int devcode)
|
||||
{
|
||||
LNODEID ln1;
|
||||
AVRPART * p = NULL;
|
||||
|
||||
for (ln1=lfirst(parts); ln1; ln1=lnext(ln1)) {
|
||||
p = ldata(ln1);
|
||||
if (p->avr910_devcode == devcode)
|
||||
return p;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AVRPART * locate_part_by_signature(LISTID parts, unsigned char * sig,
|
||||
int sigsize)
|
||||
{
|
||||
LNODEID ln1;
|
||||
AVRPART * p = NULL;
|
||||
int i;
|
||||
|
||||
if (sigsize == 3) {
|
||||
for (ln1=lfirst(parts); ln1; ln1=lnext(ln1)) {
|
||||
p = ldata(ln1);
|
||||
for (i=0; i<3; i++)
|
||||
if (p->signature[i] != sig[i])
|
||||
break;
|
||||
if (i == 3)
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Iterate over the list of avrparts given as "avrparts", and
|
||||
* call the callback function cb for each entry found. cb is being
|
||||
* passed the following arguments:
|
||||
* . the name of the avrpart (for -p)
|
||||
* . the descriptive text given in the config file
|
||||
* . the name of the config file this avrpart has been defined in
|
||||
* . the line number of the config file this avrpart has been defined at
|
||||
* . the "cookie" passed into walk_avrparts() (opaque client data)
|
||||
*/
|
||||
void walk_avrparts(LISTID avrparts, walk_avrparts_cb cb, void *cookie)
|
||||
{
|
||||
LNODEID ln1;
|
||||
AVRPART * p;
|
||||
|
||||
for (ln1 = lfirst(avrparts); ln1; ln1 = lnext(ln1)) {
|
||||
p = ldata(ln1);
|
||||
cb(p->id, p->desc, p->config_file, p->lineno, cookie);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare function to sort the list of programmers
|
||||
*/
|
||||
static int sort_avrparts_compare(AVRPART * p1,AVRPART * p2)
|
||||
{
|
||||
if(p1 == NULL || p2 == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return strncasecmp(p1->desc,p2->desc,AVR_DESCLEN);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sort the list of programmers given as "programmers"
|
||||
*/
|
||||
void sort_avrparts(LISTID avrparts)
|
||||
{
|
||||
lsort(avrparts,(int (*)(void*, void*)) sort_avrparts_compare);
|
||||
}
|
||||
|
||||
|
||||
static char * reset_disp_str(int r)
|
||||
{
|
||||
switch (r) {
|
||||
case RESET_DEDICATED : return "dedicated";
|
||||
case RESET_IO : return "possible i/o";
|
||||
default : return "<invalid>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void avr_display(FILE * f, AVRPART * p, const char * prefix, int verbose)
|
||||
{
|
||||
int i;
|
||||
char * buf;
|
||||
const char * px;
|
||||
LNODEID ln;
|
||||
AVRMEM * m;
|
||||
|
||||
fprintf(f,
|
||||
"%sAVR Part : %s\n"
|
||||
"%sChip Erase delay : %d us\n"
|
||||
"%sPAGEL : P%02X\n"
|
||||
"%sBS2 : P%02X\n"
|
||||
"%sRESET disposition : %s\n"
|
||||
"%sRETRY pulse : %s\n"
|
||||
"%sserial program mode : %s\n"
|
||||
"%sparallel program mode : %s\n"
|
||||
"%sTimeout : %d\n"
|
||||
"%sStabDelay : %d\n"
|
||||
"%sCmdexeDelay : %d\n"
|
||||
"%sSyncLoops : %d\n"
|
||||
"%sByteDelay : %d\n"
|
||||
"%sPollIndex : %d\n"
|
||||
"%sPollValue : 0x%02x\n"
|
||||
"%sMemory Detail :\n\n",
|
||||
prefix, p->desc,
|
||||
prefix, p->chip_erase_delay,
|
||||
prefix, p->pagel,
|
||||
prefix, p->bs2,
|
||||
prefix, reset_disp_str(p->reset_disposition),
|
||||
prefix, avr_pin_name(p->retry_pulse),
|
||||
prefix, (p->flags & AVRPART_SERIALOK) ? "yes" : "no",
|
||||
prefix, (p->flags & AVRPART_PARALLELOK) ?
|
||||
((p->flags & AVRPART_PSEUDOPARALLEL) ? "psuedo" : "yes") : "no",
|
||||
prefix, p->timeout,
|
||||
prefix, p->stabdelay,
|
||||
prefix, p->cmdexedelay,
|
||||
prefix, p->synchloops,
|
||||
prefix, p->bytedelay,
|
||||
prefix, p->pollindex,
|
||||
prefix, p->pollvalue,
|
||||
prefix);
|
||||
|
||||
px = prefix;
|
||||
i = strlen(prefix) + 5;
|
||||
buf = (char *)malloc(i);
|
||||
if (buf == NULL) {
|
||||
/* ugh, this is not important enough to bail, just ignore it */
|
||||
}
|
||||
else {
|
||||
strcpy(buf, prefix);
|
||||
strcat(buf, " ");
|
||||
px = buf;
|
||||
}
|
||||
|
||||
if (verbose <= 2) {
|
||||
avr_mem_display(px, f, NULL, 0, verbose);
|
||||
}
|
||||
for (ln=lfirst(p->mem); ln; ln=lnext(ln)) {
|
||||
m = ldata(ln);
|
||||
avr_mem_display(px, f, m, i, verbose);
|
||||
}
|
||||
|
||||
if (buf)
|
||||
free(buf);
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/* $Id$ */
|
||||
/* $Id$ */
|
||||
|
||||
#include "ac_cfg.h"
|
||||
|
||||
|
@ -28,12 +28,9 @@
|
|||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <signal.h>
|
||||
#include <sys/time.h>
|
||||
#if !defined(WIN32NATIVE)
|
||||
# include <signal.h>
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "avrdude.h"
|
||||
|
@ -46,7 +43,7 @@
|
|||
|
||||
static int delay_decrement;
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(WIN32NATIVE)
|
||||
static int has_perfcount;
|
||||
static LARGE_INTEGER freq;
|
||||
#else
|
||||
|
@ -60,14 +57,14 @@ static void alarmhandler(int signo)
|
|||
done = 1;
|
||||
signal(SIGALRM, saved_alarmhandler);
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32NATIVE */
|
||||
|
||||
/*
|
||||
* Calibrate the microsecond delay loop below.
|
||||
*/
|
||||
static void bitbang_calibrate_delay(void)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
#if defined(WIN32NATIVE)
|
||||
/*
|
||||
* If the hardware supports a high-resolution performance counter,
|
||||
* we ultimately prefer that one, as it gives quite accurate delays
|
||||
|
@ -76,7 +73,8 @@ static void bitbang_calibrate_delay(void)
|
|||
if (QueryPerformanceFrequency(&freq))
|
||||
{
|
||||
has_perfcount = 1;
|
||||
pmsg_notice2("using performance counter for bitbang delays\n");
|
||||
avrdude_message(MSG_NOTICE2, "%s: Using performance counter for bitbang delays\n",
|
||||
progname);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -89,14 +87,16 @@ static void bitbang_calibrate_delay(void)
|
|||
* auto-calibration figures seen on various Unix systems on
|
||||
* comparable hardware.
|
||||
*/
|
||||
pmsg_notice2("using guessed per-microsecond delay count for bitbang delays\n");
|
||||
avrdude_message(MSG_NOTICE2, "%s: Using guessed per-microsecond delay count for bitbang delays\n",
|
||||
progname);
|
||||
delay_decrement = 100;
|
||||
}
|
||||
#else /* !WIN32 */
|
||||
#else /* !WIN32NATIVE */
|
||||
struct itimerval itv;
|
||||
volatile int i;
|
||||
|
||||
pmsg_notice2("calibrating delay loop ...");
|
||||
avrdude_message(MSG_NOTICE2, "%s: Calibrating delay loop...",
|
||||
progname);
|
||||
i = 0;
|
||||
done = 0;
|
||||
saved_alarmhandler = signal(SIGALRM, alarmhandler);
|
||||
|
@ -122,9 +122,9 @@ static void bitbang_calibrate_delay(void)
|
|||
* Calculate back from 100 ms to 1 us.
|
||||
*/
|
||||
delay_decrement = -i / 100000;
|
||||
msg_notice2(" calibrated to %d cycles per us\n",
|
||||
avrdude_message(MSG_NOTICE2, " calibrated to %d cycles per us\n",
|
||||
delay_decrement);
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32NATIVE */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -134,7 +134,7 @@ static void bitbang_calibrate_delay(void)
|
|||
*/
|
||||
void bitbang_delay(unsigned int us)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
#if defined(WIN32NATIVE)
|
||||
LARGE_INTEGER countNow, countEnd;
|
||||
|
||||
if (has_perfcount)
|
||||
|
@ -147,20 +147,21 @@ void bitbang_delay(unsigned int us)
|
|||
}
|
||||
else /* no performance counters -- run normal uncalibrated delay */
|
||||
{
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32NATIVE */
|
||||
volatile unsigned int del = us * delay_decrement;
|
||||
|
||||
while (del > 0)
|
||||
del--;
|
||||
#if defined(WIN32)
|
||||
#if defined(WIN32NATIVE)
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32NATIVE */
|
||||
}
|
||||
|
||||
/*
|
||||
* transmit and receive a byte of data to/from the AVR device
|
||||
*/
|
||||
static unsigned char bitbang_txrx(const PROGRAMMER *pgm, unsigned char byte) {
|
||||
static unsigned char bitbang_txrx(PROGRAMMER * pgm, unsigned char byte)
|
||||
{
|
||||
int i;
|
||||
unsigned char r, b, rbyte;
|
||||
|
||||
|
@ -172,9 +173,9 @@ static unsigned char bitbang_txrx(const PROGRAMMER *pgm, unsigned char byte) {
|
|||
* one pgm->setpin()-call resp. par clrpin()-call, then
|
||||
* - SCK is high for 2T
|
||||
* - SCK is low for 2T
|
||||
* - SDO setuptime is 1T
|
||||
* - SDO holdtime is 3T
|
||||
* - SCK low to SDI read is 2T to 3T
|
||||
* - MOSI setuptime is 1T
|
||||
* - MOSI holdtime is 3T
|
||||
* - SCK low to MISO read is 2T to 3T
|
||||
* So we are within programming specs (expect for AT90S1200),
|
||||
* if and only if T>t_CLCL (t_CLCL=clock period of target system).
|
||||
*
|
||||
|
@ -186,7 +187,7 @@ static unsigned char bitbang_txrx(const PROGRAMMER *pgm, unsigned char byte) {
|
|||
b = (byte >> i) & 0x01;
|
||||
|
||||
/* set the data input line as desired */
|
||||
pgm->setpin(pgm, PIN_AVR_SDO, b);
|
||||
pgm->setpin(pgm, PIN_AVR_MOSI, b);
|
||||
|
||||
pgm->setpin(pgm, PIN_AVR_SCK, 1);
|
||||
|
||||
|
@ -194,7 +195,7 @@ static unsigned char bitbang_txrx(const PROGRAMMER *pgm, unsigned char byte) {
|
|||
* read the result bit (it is either valid from a previous falling
|
||||
* edge or it is ignored in the current context)
|
||||
*/
|
||||
r = pgm->getpin(pgm, PIN_AVR_SDI);
|
||||
r = pgm->getpin(pgm, PIN_AVR_MISO);
|
||||
|
||||
pgm->setpin(pgm, PIN_AVR_SCK, 0);
|
||||
|
||||
|
@ -204,23 +205,25 @@ static unsigned char bitbang_txrx(const PROGRAMMER *pgm, unsigned char byte) {
|
|||
return rbyte;
|
||||
}
|
||||
|
||||
static int bitbang_tpi_clk(const PROGRAMMER *pgm) {
|
||||
static int bitbang_tpi_clk(PROGRAMMER * pgm)
|
||||
{
|
||||
unsigned char r = 0;
|
||||
pgm->setpin(pgm, PIN_AVR_SCK, 1);
|
||||
|
||||
r = pgm->getpin(pgm, PIN_AVR_SDI);
|
||||
r = pgm->getpin(pgm, PIN_AVR_MISO);
|
||||
|
||||
pgm->setpin(pgm, PIN_AVR_SCK, 0);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void bitbang_tpi_tx(const PROGRAMMER *pgm, unsigned char byte) {
|
||||
void bitbang_tpi_tx(PROGRAMMER * pgm, unsigned char byte)
|
||||
{
|
||||
int i;
|
||||
unsigned char b, parity;
|
||||
|
||||
/* start bit */
|
||||
pgm->setpin(pgm, PIN_AVR_SDO, 0);
|
||||
pgm->setpin(pgm, PIN_AVR_MOSI, 0);
|
||||
bitbang_tpi_clk(pgm);
|
||||
|
||||
parity = 0;
|
||||
|
@ -229,26 +232,27 @@ void bitbang_tpi_tx(const PROGRAMMER *pgm, unsigned char byte) {
|
|||
parity ^= b;
|
||||
|
||||
/* set the data input line as desired */
|
||||
pgm->setpin(pgm, PIN_AVR_SDO, b);
|
||||
pgm->setpin(pgm, PIN_AVR_MOSI, b);
|
||||
bitbang_tpi_clk(pgm);
|
||||
}
|
||||
|
||||
/* parity bit */
|
||||
pgm->setpin(pgm, PIN_AVR_SDO, parity);
|
||||
pgm->setpin(pgm, PIN_AVR_MOSI, parity);
|
||||
bitbang_tpi_clk(pgm);
|
||||
|
||||
/* 2 stop bits */
|
||||
pgm->setpin(pgm, PIN_AVR_SDO, 1);
|
||||
pgm->setpin(pgm, PIN_AVR_MOSI, 1);
|
||||
bitbang_tpi_clk(pgm);
|
||||
bitbang_tpi_clk(pgm);
|
||||
}
|
||||
|
||||
int bitbang_tpi_rx(const PROGRAMMER *pgm) {
|
||||
int bitbang_tpi_rx(PROGRAMMER * pgm)
|
||||
{
|
||||
int i;
|
||||
unsigned char b, rbyte, parity;
|
||||
|
||||
/* make sure pin is on for "pullup" */
|
||||
pgm->setpin(pgm, PIN_AVR_SDO, 1);
|
||||
pgm->setpin(pgm, PIN_AVR_MOSI, 1);
|
||||
|
||||
/* wait for start bit (up to 10 bits) */
|
||||
b = 1;
|
||||
|
@ -258,7 +262,7 @@ int bitbang_tpi_rx(const PROGRAMMER *pgm) {
|
|||
break;
|
||||
}
|
||||
if (b != 0) {
|
||||
pmsg_error("start bit not received correctly\n");
|
||||
avrdude_message(MSG_INFO, "bitbang_tpi_rx: start bit not received correctly\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -273,7 +277,7 @@ int bitbang_tpi_rx(const PROGRAMMER *pgm) {
|
|||
|
||||
/* parity bit */
|
||||
if (bitbang_tpi_clk(pgm) != parity) {
|
||||
pmsg_error("parity bit is wrong\n");
|
||||
avrdude_message(MSG_INFO, "bitbang_tpi_rx: parity bit is wrong\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -282,29 +286,33 @@ int bitbang_tpi_rx(const PROGRAMMER *pgm) {
|
|||
b &= bitbang_tpi_clk(pgm);
|
||||
b &= bitbang_tpi_clk(pgm);
|
||||
if (b != 1) {
|
||||
pmsg_error("stop bits not received correctly\n");
|
||||
avrdude_message(MSG_INFO, "bitbang_tpi_rx: stop bits not received correctly\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return rbyte;
|
||||
}
|
||||
|
||||
int bitbang_rdy_led(const PROGRAMMER *pgm, int value) {
|
||||
int bitbang_rdy_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
pgm->setpin(pgm, PIN_LED_RDY, !value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bitbang_err_led(const PROGRAMMER *pgm, int value) {
|
||||
int bitbang_err_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
pgm->setpin(pgm, PIN_LED_ERR, !value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bitbang_pgm_led(const PROGRAMMER *pgm, int value) {
|
||||
int bitbang_pgm_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
pgm->setpin(pgm, PIN_LED_PGM, !value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bitbang_vfy_led(const PROGRAMMER *pgm, int value) {
|
||||
int bitbang_vfy_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
pgm->setpin(pgm, PIN_LED_VFY, !value);
|
||||
return 0;
|
||||
}
|
||||
|
@ -314,7 +322,7 @@ int bitbang_vfy_led(const PROGRAMMER *pgm, int value) {
|
|||
* transmit an AVR device command and return the results; 'cmd' and
|
||||
* 'res' must point to at least a 4 byte data buffer
|
||||
*/
|
||||
int bitbang_cmd(const PROGRAMMER *pgm, const unsigned char *cmd,
|
||||
int bitbang_cmd(PROGRAMMER * pgm, const unsigned char *cmd,
|
||||
unsigned char *res)
|
||||
{
|
||||
int i;
|
||||
|
@ -325,21 +333,21 @@ int bitbang_cmd(const PROGRAMMER *pgm, const unsigned char *cmd,
|
|||
|
||||
if(verbose >= 2)
|
||||
{
|
||||
msg_notice2("bitbang_cmd(): [ ");
|
||||
avrdude_message(MSG_NOTICE2, "bitbang_cmd(): [ ");
|
||||
for(i = 0; i < 4; i++)
|
||||
msg_notice2("%02X ", cmd[i]);
|
||||
msg_notice2("] [ ");
|
||||
avrdude_message(MSG_NOTICE2, "%02X ", cmd[i]);
|
||||
avrdude_message(MSG_NOTICE2, "] [ ");
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
msg_notice2("%02X ", res[i]);
|
||||
avrdude_message(MSG_NOTICE2, "%02X ", res[i]);
|
||||
}
|
||||
msg_notice2("]\n");
|
||||
avrdude_message(MSG_NOTICE2, "]\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bitbang_cmd_tpi(const PROGRAMMER *pgm, const unsigned char *cmd,
|
||||
int bitbang_cmd_tpi(PROGRAMMER * pgm, const unsigned char *cmd,
|
||||
int cmd_len, unsigned char *res, int res_len)
|
||||
{
|
||||
int i, r;
|
||||
|
@ -360,15 +368,15 @@ int bitbang_cmd_tpi(const PROGRAMMER *pgm, const unsigned char *cmd,
|
|||
|
||||
if(verbose >= 2)
|
||||
{
|
||||
msg_notice2("bitbang_cmd_tpi(): [ ");
|
||||
avrdude_message(MSG_NOTICE2, "bitbang_cmd_tpi(): [ ");
|
||||
for(i = 0; i < cmd_len; i++)
|
||||
msg_notice2("%02X ", cmd[i]);
|
||||
msg_notice2("] [ ");
|
||||
avrdude_message(MSG_NOTICE2, "%02X ", cmd[i]);
|
||||
avrdude_message(MSG_NOTICE2, "] [ ");
|
||||
for(i = 0; i < res_len; i++)
|
||||
{
|
||||
msg_notice2("%02X ", res[i]);
|
||||
avrdude_message(MSG_NOTICE2, "%02X ", res[i]);
|
||||
}
|
||||
msg_notice2("]\n");
|
||||
avrdude_message(MSG_NOTICE2, "]\n");
|
||||
}
|
||||
|
||||
pgm->pgm_led(pgm, OFF);
|
||||
|
@ -381,7 +389,7 @@ int bitbang_cmd_tpi(const PROGRAMMER *pgm, const unsigned char *cmd,
|
|||
* transmit bytes via SPI and return the results; 'cmd' and
|
||||
* 'res' must point to data buffers
|
||||
*/
|
||||
int bitbang_spi(const PROGRAMMER *pgm, const unsigned char *cmd,
|
||||
int bitbang_spi(PROGRAMMER * pgm, const unsigned char *cmd,
|
||||
unsigned char *res, int count)
|
||||
{
|
||||
int i;
|
||||
|
@ -396,15 +404,15 @@ int bitbang_spi(const PROGRAMMER *pgm, const unsigned char *cmd,
|
|||
|
||||
if(verbose >= 2)
|
||||
{
|
||||
msg_notice2("bitbang_cmd(): [ ");
|
||||
avrdude_message(MSG_NOTICE2, "bitbang_cmd(): [ ");
|
||||
for(i = 0; i < count; i++)
|
||||
msg_notice2("%02X ", cmd[i]);
|
||||
msg_notice2("] [ ");
|
||||
avrdude_message(MSG_NOTICE2, "%02X ", cmd[i]);
|
||||
avrdude_message(MSG_NOTICE2, "] [ ");
|
||||
for(i = 0; i < count; i++)
|
||||
{
|
||||
msg_notice2("%02X ", res[i]);
|
||||
avrdude_message(MSG_NOTICE2, "%02X ", res[i]);
|
||||
}
|
||||
msg_notice2("]\n");
|
||||
avrdude_message(MSG_NOTICE2, "]\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -414,12 +422,13 @@ int bitbang_spi(const PROGRAMMER *pgm, const unsigned char *cmd,
|
|||
/*
|
||||
* issue the 'chip erase' command to the AVR device
|
||||
*/
|
||||
int bitbang_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
int bitbang_chip_erase(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
unsigned char cmd[4];
|
||||
unsigned char res[4];
|
||||
AVRMEM *mem;
|
||||
|
||||
if (p->prog_modes & PM_TPI) {
|
||||
if (p->flags & AVRPART_HAS_TPI) {
|
||||
pgm->pgm_led(pgm, ON);
|
||||
|
||||
while (avr_tpi_poll_nvmbsy(pgm));
|
||||
|
@ -431,7 +440,8 @@ int bitbang_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
/* Set Pointer Register */
|
||||
mem = avr_locate_mem(p, "flash");
|
||||
if (mem == NULL) {
|
||||
pmsg_error("no flash memory to erase for part %s\n", p->desc);
|
||||
avrdude_message(MSG_INFO, "No flash memory to erase for part %s\n",
|
||||
p->desc);
|
||||
return -1;
|
||||
}
|
||||
bitbang_tpi_tx(pgm, TPI_CMD_SSTPR | 0);
|
||||
|
@ -451,7 +461,8 @@ int bitbang_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
}
|
||||
|
||||
if (p->op[AVR_OP_CHIP_ERASE] == NULL) {
|
||||
pmsg_error("chip erase instruction not defined for part %s\n", p->desc);
|
||||
avrdude_message(MSG_INFO, "chip erase instruction not defined for part \"%s\"\n",
|
||||
p->desc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -472,12 +483,13 @@ int bitbang_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
/*
|
||||
* issue the 'program enable' command to the AVR device
|
||||
*/
|
||||
int bitbang_program_enable(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
int bitbang_program_enable(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
unsigned char cmd[4];
|
||||
unsigned char res[4];
|
||||
int i;
|
||||
|
||||
if (p->prog_modes & PM_TPI) {
|
||||
if (p->flags & AVRPART_HAS_TPI) {
|
||||
/* enable NVM programming */
|
||||
bitbang_tpi_tx(pgm, TPI_CMD_SKEY);
|
||||
for (i = sizeof(tpi_skey) - 1; i >= 0; i--)
|
||||
|
@ -490,7 +502,8 @@ int bitbang_program_enable(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
}
|
||||
|
||||
if (p->op[AVR_OP_PGM_ENABLE] == NULL) {
|
||||
pmsg_error("program enable instruction not defined for part %s\n", p->desc);
|
||||
avrdude_message(MSG_INFO, "program enable instruction not defined for part \"%s\"\n",
|
||||
p->desc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -507,7 +520,8 @@ int bitbang_program_enable(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
/*
|
||||
* initialize the AVR device and prepare it to accept commands
|
||||
*/
|
||||
int bitbang_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
int bitbang_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
int rc;
|
||||
int tries;
|
||||
int i;
|
||||
|
@ -517,44 +531,42 @@ int bitbang_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
pgm->powerup(pgm);
|
||||
usleep(20000);
|
||||
|
||||
/* TPIDATA is a single line, so SDI & SDO should be connected */
|
||||
if (p->prog_modes & PM_TPI) {
|
||||
/* TPIDATA is a single line, so MISO & MOSI should be connected */
|
||||
if (p->flags & AVRPART_HAS_TPI) {
|
||||
/* make sure cmd_tpi() is defined */
|
||||
if (pgm->cmd_tpi == NULL) {
|
||||
pmsg_error("%s programmer does not support TPI\n", pgm->type);
|
||||
avrdude_message(MSG_INFO, "%s: Error: %s programmer does not support TPI\n",
|
||||
progname, pgm->type);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* bring RESET high first */
|
||||
pgm->setpin(pgm, PIN_AVR_RESET, 1);
|
||||
usleep(128000); /* wait t_TOUT (32-128ms) */
|
||||
usleep(1000);
|
||||
|
||||
/* RESET must be LOW in case the existing code is driving the TPI pins: */
|
||||
pgm->setpin(pgm, PIN_AVR_RESET, 0);
|
||||
avrdude_message(MSG_NOTICE2, "doing MOSI-MISO link check\n");
|
||||
|
||||
msg_notice2("doing SDO-SDI link check\n");
|
||||
|
||||
pgm->setpin(pgm, PIN_AVR_SDO, 0);
|
||||
if (pgm->getpin(pgm, PIN_AVR_SDI) != 0) {
|
||||
pmsg_error("SDO->SDI 0 failed\n");
|
||||
pgm->setpin(pgm, PIN_AVR_MOSI, 0);
|
||||
if (pgm->getpin(pgm, PIN_AVR_MISO) != 0) {
|
||||
avrdude_message(MSG_INFO, "MOSI->MISO 0 failed\n");
|
||||
return -1;
|
||||
}
|
||||
pgm->setpin(pgm, PIN_AVR_SDO, 1);
|
||||
if (pgm->getpin(pgm, PIN_AVR_SDI) != 1) {
|
||||
pmsg_error("SDO->SDI 1 failed\n");
|
||||
pgm->setpin(pgm, PIN_AVR_MOSI, 1);
|
||||
if (pgm->getpin(pgm, PIN_AVR_MISO) != 1) {
|
||||
avrdude_message(MSG_INFO, "MOSI->MISO 1 failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
msg_notice2("SDO-SDI link present\n");
|
||||
avrdude_message(MSG_NOTICE2, "MOSI-MISO link present\n");
|
||||
}
|
||||
|
||||
pgm->setpin(pgm, PIN_AVR_SCK, 0);
|
||||
pgm->setpin(pgm, PIN_AVR_RESET, 0);
|
||||
usleep(20000);
|
||||
|
||||
if (p->prog_modes & PM_TPI) {
|
||||
if (p->flags & AVRPART_HAS_TPI) {
|
||||
/* keep TPIDATA high for 16 clock cycles */
|
||||
pgm->setpin(pgm, PIN_AVR_SDO, 1);
|
||||
pgm->setpin(pgm, PIN_AVR_MOSI, 1);
|
||||
for (i = 0; i < 16; i++)
|
||||
pgm->highpulsepin(pgm, PIN_AVR_SCK);
|
||||
|
||||
|
@ -566,7 +578,7 @@ int bitbang_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
bitbang_tpi_tx(pgm, TPI_CMD_SLDCS | TPI_REG_TPIIR);
|
||||
rc = bitbang_tpi_rx(pgm);
|
||||
if (rc != 0x80) {
|
||||
pmsg_error("TPIIR not correct\n");
|
||||
avrdude_message(MSG_INFO, "TPIIR not correct\n");
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
|
@ -600,7 +612,7 @@ int bitbang_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
* can't sync with the device, maybe it's not attached?
|
||||
*/
|
||||
if (rc) {
|
||||
pmsg_error("AVR device not responding\n");
|
||||
avrdude_message(MSG_INFO, "%s: AVR device not responding\n", progname);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -608,14 +620,11 @@ int bitbang_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int verify_pin_assigned(const PROGRAMMER *pgm, int pinfunc, char *desc) {
|
||||
if(pinfunc < 0 || pinfunc >= N_PINS) {
|
||||
pmsg_error("invalid pin function number %d\n", pinfunc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((pgm->pinno[pinfunc] & PIN_MASK) > PIN_MAX) {
|
||||
pmsg_error("no pin has been assigned for %s\n", desc);
|
||||
static int verify_pin_assigned(PROGRAMMER * pgm, int pin, char * desc)
|
||||
{
|
||||
if (pgm->pinno[pin] == 0) {
|
||||
avrdude_message(MSG_INFO, "%s: error: no pin has been assigned for %s\n",
|
||||
progname, desc);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -625,19 +634,21 @@ static int verify_pin_assigned(const PROGRAMMER *pgm, int pinfunc, char *desc) {
|
|||
/*
|
||||
* Verify all prerequisites for a bit-bang programmer are present.
|
||||
*/
|
||||
int bitbang_check_prerequisites(const PROGRAMMER *pgm) {
|
||||
int bitbang_check_prerequisites(PROGRAMMER *pgm)
|
||||
{
|
||||
|
||||
if (verify_pin_assigned(pgm, PIN_AVR_RESET, "AVR RESET") < 0)
|
||||
return -1;
|
||||
if (verify_pin_assigned(pgm, PIN_AVR_SCK, "AVR SCK") < 0)
|
||||
return -1;
|
||||
if (verify_pin_assigned(pgm, PIN_AVR_SDI, "AVR SDI") < 0)
|
||||
if (verify_pin_assigned(pgm, PIN_AVR_MISO, "AVR MISO") < 0)
|
||||
return -1;
|
||||
if (verify_pin_assigned(pgm, PIN_AVR_SDO, "AVR SDO") < 0)
|
||||
if (verify_pin_assigned(pgm, PIN_AVR_MOSI, "AVR MOSI") < 0)
|
||||
return -1;
|
||||
|
||||
if (pgm->cmd == NULL) {
|
||||
pmsg_error("no cmd() method defined for bitbang programmer\n");
|
||||
avrdude_message(MSG_INFO, "%s: error: no cmd() method defined for bitbang programmer\n",
|
||||
progname);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
|
@ -31,25 +31,25 @@ int bitbang_getpin(int fd, int pin);
|
|||
int bitbang_highpulsepin(int fd, int pin);
|
||||
void bitbang_delay(unsigned int us);
|
||||
|
||||
int bitbang_check_prerequisites(const PROGRAMMER *pgm);
|
||||
int bitbang_check_prerequisites(PROGRAMMER *pgm);
|
||||
|
||||
int bitbang_rdy_led (const PROGRAMMER *pgm, int value);
|
||||
int bitbang_err_led (const PROGRAMMER *pgm, int value);
|
||||
int bitbang_pgm_led (const PROGRAMMER *pgm, int value);
|
||||
int bitbang_vfy_led (const PROGRAMMER *pgm, int value);
|
||||
int bitbang_cmd (const PROGRAMMER *pgm, const unsigned char *cmd,
|
||||
int bitbang_rdy_led (PROGRAMMER * pgm, int value);
|
||||
int bitbang_err_led (PROGRAMMER * pgm, int value);
|
||||
int bitbang_pgm_led (PROGRAMMER * pgm, int value);
|
||||
int bitbang_vfy_led (PROGRAMMER * pgm, int value);
|
||||
int bitbang_cmd (PROGRAMMER * pgm, const unsigned char *cmd,
|
||||
unsigned char *res);
|
||||
int bitbang_cmd_tpi (const PROGRAMMER *pgm, const unsigned char *cmd,
|
||||
int bitbang_cmd_tpi (PROGRAMMER * pgm, const unsigned char *cmd,
|
||||
int cmd_len, unsigned char *res, int res_len);
|
||||
int bitbang_spi (const PROGRAMMER *pgm, const unsigned char *cmd,
|
||||
int bitbang_spi (PROGRAMMER * pgm, const unsigned char *cmd,
|
||||
unsigned char *res, int count);
|
||||
int bitbang_chip_erase (const PROGRAMMER *pgm, const AVRPART *p);
|
||||
int bitbang_program_enable (const PROGRAMMER *pgm, const AVRPART *p);
|
||||
void bitbang_powerup (const PROGRAMMER *pgm);
|
||||
void bitbang_powerdown (const PROGRAMMER *pgm);
|
||||
int bitbang_initialize (const PROGRAMMER *pgm, const AVRPART *p);
|
||||
void bitbang_disable (const PROGRAMMER *pgm);
|
||||
void bitbang_enable (PROGRAMMER *pgm, const AVRPART *p);
|
||||
int bitbang_chip_erase (PROGRAMMER * pgm, AVRPART * p);
|
||||
int bitbang_program_enable (PROGRAMMER * pgm, AVRPART * p);
|
||||
void bitbang_powerup (PROGRAMMER * pgm);
|
||||
void bitbang_powerdown (PROGRAMMER * pgm);
|
||||
int bitbang_initialize (PROGRAMMER * pgm, AVRPART * p);
|
||||
void bitbang_disable (PROGRAMMER * pgm);
|
||||
void bitbang_enable (PROGRAMMER * pgm);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
92
build.sh
92
build.sh
|
@ -1,92 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Build script for Unix-like systems, using the CMake subsystem
|
||||
#
|
||||
# This script covers some common cases. It does *not* install any
|
||||
# prerequisites though.
|
||||
#
|
||||
# For documentation of AVRDUDE's build system, please refer to the
|
||||
# Wiki:
|
||||
#
|
||||
# https://github.com/avrdudes/avrdude/wiki
|
||||
|
||||
# Determine OS type
|
||||
#
|
||||
# So far, this script tries to handle three different Unix-like
|
||||
# systems:
|
||||
#
|
||||
# Linux
|
||||
# FreeBSD
|
||||
# Darwin (aka. MacOS)
|
||||
#
|
||||
# On Linux, if the machine is ARM-based, LINUXSPI and LINUXGPIO are
|
||||
# enabled.
|
||||
# On MacOS, an attempt is made to find out whether Mac ports or brew
|
||||
# are in place, and are assumed to have install the prerequisites.
|
||||
|
||||
ostype=$(uname | tr '[A-Z]' '[a-z]')
|
||||
|
||||
build_type=RelWithDebInfo
|
||||
# build_type=Release # no debug info
|
||||
|
||||
# See CMakeLists.txt for all options
|
||||
#
|
||||
# Use this to enable (historical) parallel-port based programmers:
|
||||
#extra_enable="-D HAVE_PARPORT=1"
|
||||
extra_enable=""
|
||||
|
||||
build_flags=""
|
||||
|
||||
case "${ostype}" in
|
||||
linux)
|
||||
# try to find out whether this is an Embedded Linux
|
||||
# platform (e.g. Raspberry Pi)
|
||||
machine=$(uname -m)
|
||||
if expr "${machine}" : '^\(arm\|aarch\)' >/dev/null
|
||||
then
|
||||
extra_enable="${extra_enable} -D HAVE_LINUXGPIO=1 -D HAVE_LINUXSPI=1"
|
||||
fi
|
||||
;;
|
||||
|
||||
darwin)
|
||||
# determine whether we are running using Mac Ports
|
||||
# if not, assume Mac Brew
|
||||
if [ -f /opt/local/bin/port ]
|
||||
then
|
||||
build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/opt/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/local/lib"
|
||||
else
|
||||
# Apple M1 (may be new version of homebrew also)
|
||||
if [ -d /opt/homebrew ]
|
||||
then
|
||||
build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/opt/homebrew/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/Cellar"
|
||||
else
|
||||
build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/usr/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/usr/local/Cellar"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
netbsd)
|
||||
build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/usr/pkg/include -D CMAKE_EXE_LINKER_FLAGS=-R/usr/pkg/lib -D CMAKE_INSTALL_PREFIX:PATH=/usr/pkg"
|
||||
;;
|
||||
|
||||
*bsd)
|
||||
build_flags="${build_flags} -D CMAKE_C_FLAGS=-I/usr/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/usr/local/lib"
|
||||
;;
|
||||
esac
|
||||
|
||||
cmake ${build_flags} ${extra_enable} -D CMAKE_BUILD_TYPE=${build_type} -B build_${ostype} ||\
|
||||
{ echo "CMake failed."; exit 1; }
|
||||
cmake --build build_${ostype} ||\
|
||||
{ echo "Build failed."; exit 1; }
|
||||
|
||||
cat <<EOF
|
||||
|
||||
Build succeeded.
|
||||
|
||||
Run
|
||||
|
||||
sudo cmake --build build_${ostype} --target install
|
||||
|
||||
to install.
|
||||
|
||||
EOF
|
File diff suppressed because it is too large
Load Diff
|
@ -26,7 +26,7 @@
|
|||
|
||||
extern const char buspirate_desc[];
|
||||
extern const char buspirate_bb_desc[];
|
||||
void buspirate_initpgm(PROGRAMMER *pgm);
|
||||
void buspirate_bb_initpgm(PROGRAMMER *pgm);
|
||||
void buspirate_initpgm (struct programmer_t *pgm);
|
||||
void buspirate_bb_initpgm (struct programmer_t *pgm);
|
||||
|
||||
#endif
|
|
@ -63,7 +63,8 @@ struct pdata
|
|||
static void butterfly_setup(PROGRAMMER * pgm)
|
||||
{
|
||||
if ((pgm->cookie = malloc(sizeof(struct pdata))) == 0) {
|
||||
pmsg_error("out of memory allocating private data\n");
|
||||
avrdude_message(MSG_INFO, "%s: butterfly_setup(): Out of memory allocating private data\n",
|
||||
progname);
|
||||
exit(1);
|
||||
}
|
||||
memset(pgm->cookie, 0, sizeof(struct pdata));
|
||||
|
@ -74,62 +75,72 @@ static void butterfly_teardown(PROGRAMMER * pgm)
|
|||
free(pgm->cookie);
|
||||
}
|
||||
|
||||
static int butterfly_send(const PROGRAMMER *pgm, char *buf, size_t len) {
|
||||
static int butterfly_send(PROGRAMMER * pgm, char * buf, size_t len)
|
||||
{
|
||||
return serial_send(&pgm->fd, (unsigned char *)buf, len);
|
||||
}
|
||||
|
||||
|
||||
static int butterfly_recv(const PROGRAMMER *pgm, char *buf, size_t len) {
|
||||
static int butterfly_recv(PROGRAMMER * pgm, char * buf, size_t len)
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = serial_recv(&pgm->fd, (unsigned char *)buf, len);
|
||||
if (rv < 0) {
|
||||
pmsg_error("programmer is not responding\n");
|
||||
avrdude_message(MSG_INFO, "%s: butterfly_recv(): programmer is not responding\n",
|
||||
progname);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int butterfly_drain(const PROGRAMMER *pgm, int display) {
|
||||
static int butterfly_drain(PROGRAMMER * pgm, int display)
|
||||
{
|
||||
return serial_drain(&pgm->fd, display);
|
||||
}
|
||||
|
||||
|
||||
static int butterfly_vfy_cmd_sent(const PROGRAMMER *pgm, char *errmsg) {
|
||||
static int butterfly_vfy_cmd_sent(PROGRAMMER * pgm, char * errmsg)
|
||||
{
|
||||
char c;
|
||||
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
if (c != '\r') {
|
||||
pmsg_error("programmer did not respond to command: %s\n", errmsg);
|
||||
avrdude_message(MSG_INFO, "%s: error: programmer did not respond to command: %s\n",
|
||||
progname, errmsg);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int butterfly_rdy_led(const PROGRAMMER *pgm, int value) {
|
||||
static int butterfly_rdy_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
/* Do nothing. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int butterfly_err_led(const PROGRAMMER *pgm, int value) {
|
||||
static int butterfly_err_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
/* Do nothing. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int butterfly_pgm_led(const PROGRAMMER *pgm, int value) {
|
||||
static int butterfly_pgm_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
/* Do nothing. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int butterfly_vfy_led(const PROGRAMMER *pgm, int value) {
|
||||
static int butterfly_vfy_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
/* Do nothing. */
|
||||
|
||||
return 0;
|
||||
|
@ -139,7 +150,8 @@ static int butterfly_vfy_led(const PROGRAMMER *pgm, int value) {
|
|||
/*
|
||||
* issue the 'chip erase' command to the butterfly board
|
||||
*/
|
||||
static int butterfly_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static int butterfly_chip_erase(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
butterfly_send(pgm, "e", 1);
|
||||
if (butterfly_vfy_cmd_sent(pgm, "chip erase") < 0)
|
||||
return -1;
|
||||
|
@ -148,13 +160,15 @@ static int butterfly_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
}
|
||||
|
||||
|
||||
static void butterfly_enter_prog_mode(const PROGRAMMER *pgm) {
|
||||
static void butterfly_enter_prog_mode(PROGRAMMER * pgm)
|
||||
{
|
||||
butterfly_send(pgm, "P", 1);
|
||||
butterfly_vfy_cmd_sent(pgm, "enter prog mode");
|
||||
}
|
||||
|
||||
|
||||
static void butterfly_leave_prog_mode(const PROGRAMMER *pgm) {
|
||||
static void butterfly_leave_prog_mode(PROGRAMMER * pgm)
|
||||
{
|
||||
butterfly_send(pgm, "L", 1);
|
||||
butterfly_vfy_cmd_sent(pgm, "leave prog mode");
|
||||
}
|
||||
|
@ -163,7 +177,8 @@ static void butterfly_leave_prog_mode(const PROGRAMMER *pgm) {
|
|||
/*
|
||||
* issue the 'program enable' command to the AVR device
|
||||
*/
|
||||
static int butterfly_program_enable(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static int butterfly_program_enable(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -171,7 +186,8 @@ static int butterfly_program_enable(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
/*
|
||||
* apply power to the AVR processor
|
||||
*/
|
||||
static void butterfly_powerup(const PROGRAMMER *pgm) {
|
||||
static void butterfly_powerup(PROGRAMMER * pgm)
|
||||
{
|
||||
/* Do nothing. */
|
||||
|
||||
return;
|
||||
|
@ -181,7 +197,8 @@ static void butterfly_powerup(const PROGRAMMER *pgm) {
|
|||
/*
|
||||
* remove power from the AVR processor
|
||||
*/
|
||||
static void butterfly_powerdown(const PROGRAMMER *pgm) {
|
||||
static void butterfly_powerdown(PROGRAMMER * pgm)
|
||||
{
|
||||
/* Do nothing. */
|
||||
|
||||
return;
|
||||
|
@ -192,7 +209,8 @@ static void butterfly_powerdown(const PROGRAMMER *pgm) {
|
|||
/*
|
||||
* initialize the AVR device and prepare it to accept commands
|
||||
*/
|
||||
static int butterfly_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
char id[8];
|
||||
char sw[2];
|
||||
char hw[2];
|
||||
|
@ -204,13 +222,13 @@ static int butterfly_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
* Send some ESC to activate butterfly bootloader. This is not needed
|
||||
* for plain avr109 bootloaders but does not harm there either.
|
||||
*/
|
||||
msg_notice("connecting to programmer: ");
|
||||
avrdude_message(MSG_INFO, "Connecting to programmer: ");
|
||||
if (pgm->flag & IS_BUTTERFLY_MK)
|
||||
{
|
||||
char mk_reset_cmd[6] = {"#aR@S\r"};
|
||||
unsigned char mk_timeout = 0;
|
||||
|
||||
msg_notice(".");
|
||||
putc('.', stderr);
|
||||
butterfly_send(pgm, mk_reset_cmd, sizeof(mk_reset_cmd));
|
||||
usleep(20000);
|
||||
|
||||
|
@ -222,15 +240,13 @@ static int butterfly_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
c = 0xaa;
|
||||
usleep(80000);
|
||||
butterfly_send(pgm, &c, 1);
|
||||
if (mk_timeout % 10 == 0)
|
||||
msg_notice(".");
|
||||
if (mk_timeout % 10 == 0) putc('.', stderr);
|
||||
} while (mk_timeout++ < 10);
|
||||
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
if ( c != 'M' && c != '?')
|
||||
{
|
||||
msg_error("\n");
|
||||
pmsg_error("connection failed");
|
||||
avrdude_message(MSG_INFO, "\nConnection FAILED.");
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
|
@ -241,13 +257,13 @@ static int butterfly_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
else
|
||||
{
|
||||
do {
|
||||
msg_notice(".");
|
||||
putc('.', stderr);
|
||||
butterfly_send(pgm, "\033", 1);
|
||||
butterfly_drain(pgm, 0);
|
||||
butterfly_send(pgm, "S", 1);
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
if (c != '?') {
|
||||
msg_notice("\n");
|
||||
putc('\n', stderr);
|
||||
/*
|
||||
* Got a useful response, continue getting the programmer
|
||||
* identifier. Programmer returns exactly 7 chars _without_
|
||||
|
@ -277,12 +293,12 @@ static int butterfly_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
butterfly_send(pgm, "p", 1);
|
||||
butterfly_recv(pgm, &type, 1);
|
||||
|
||||
msg_notice("Programmer id = %s; type = %c\n", id, type);
|
||||
msg_notice("Software version = %c.%c; ", sw[0], sw[1]);
|
||||
avrdude_message(MSG_INFO, "Found programmer: Id = \"%s\"; type = %c\n", id, type);
|
||||
avrdude_message(MSG_INFO, " Software Version = %c.%c; ", sw[0], sw[1]);
|
||||
if (hw[0]=='?') {
|
||||
msg_notice("no hardware version given\n");
|
||||
avrdude_message(MSG_INFO, "No Hardware Version given.\n");
|
||||
} else {
|
||||
msg_notice("Hardware version = %c.%c\n", hw[0], hw[1]);
|
||||
avrdude_message(MSG_INFO, "Hardware Version = %c.%c\n", hw[0], hw[1]);
|
||||
};
|
||||
|
||||
/* See if programmer supports autoincrement of address. */
|
||||
|
@ -290,28 +306,28 @@ static int butterfly_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
butterfly_send(pgm, "a", 1);
|
||||
butterfly_recv(pgm, &PDATA(pgm)->has_auto_incr_addr, 1);
|
||||
if (PDATA(pgm)->has_auto_incr_addr == 'Y')
|
||||
msg_notice("programmer supports auto addr increment\n");
|
||||
avrdude_message(MSG_INFO, "Programmer supports auto addr increment.\n");
|
||||
|
||||
/* Check support for buffered memory access, abort if not available */
|
||||
|
||||
butterfly_send(pgm, "b", 1);
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
if (c != 'Y') {
|
||||
pmsg_notice("buffered memory access not supported; maybe it isn't\n"\
|
||||
"a butterfly/AVR109 but a AVR910 device?\n");
|
||||
avrdude_message(MSG_INFO, "%s: error: buffered memory access not supported. Maybe it isn't\n"\
|
||||
"a butterfly/AVR109 but a AVR910 device?\n", progname);
|
||||
return -1;
|
||||
};
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
PDATA(pgm)->buffersize = (unsigned int)(unsigned char)c<<8;
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
PDATA(pgm)->buffersize += (unsigned int)(unsigned char)c;
|
||||
msg_notice("programmer supports buffered memory access with buffersize=%i bytes\n",
|
||||
avrdude_message(MSG_INFO, "Programmer supports buffered memory access with buffersize=%i bytes.\n",
|
||||
PDATA(pgm)->buffersize);
|
||||
|
||||
/* Get list of devices that the programmer supports. */
|
||||
|
||||
butterfly_send(pgm, "t", 1);
|
||||
msg_notice2("\nProgrammer supports the following devices:\n");
|
||||
avrdude_message(MSG_INFO, "\nProgrammer supports the following devices:\n");
|
||||
devtype_1st = 0;
|
||||
while (1) {
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
|
@ -320,9 +336,9 @@ static int butterfly_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
|
||||
if (c == 0)
|
||||
break;
|
||||
msg_notice2(" Device code: 0x%02x\n", (unsigned int) (unsigned char) c);
|
||||
avrdude_message(MSG_INFO, " Device code: 0x%02x\n", (unsigned int)(unsigned char)c);
|
||||
};
|
||||
msg_notice2("\n");
|
||||
avrdude_message(MSG_INFO, "\n");
|
||||
|
||||
/* Tell the programmer which part we selected.
|
||||
According to the AVR109 code, this is ignored by the bootloader. As
|
||||
|
@ -339,7 +355,9 @@ static int butterfly_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
if (butterfly_vfy_cmd_sent(pgm, "select device") < 0)
|
||||
return -1;
|
||||
|
||||
pmsg_notice("devcode selected: 0x%02x\n", (unsigned) buf[1]);
|
||||
if (verbose)
|
||||
avrdude_message(MSG_INFO, "%s: devcode selected: 0x%02x\n",
|
||||
progname, (unsigned)buf[1]);
|
||||
|
||||
butterfly_enter_prog_mode(pgm);
|
||||
butterfly_drain(pgm, 0);
|
||||
|
@ -349,19 +367,22 @@ static int butterfly_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
|||
|
||||
|
||||
|
||||
static void butterfly_disable(const PROGRAMMER *pgm) {
|
||||
static void butterfly_disable(PROGRAMMER * pgm)
|
||||
{
|
||||
butterfly_leave_prog_mode(pgm);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void butterfly_enable(PROGRAMMER *pgm, const AVRPART *p) {
|
||||
static void butterfly_enable(PROGRAMMER * pgm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static int butterfly_open(PROGRAMMER *pgm, const char *port) {
|
||||
static int butterfly_open(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
union pinfo pinfo;
|
||||
strcpy(pgm->port, port);
|
||||
/*
|
||||
|
@ -370,8 +391,7 @@ static int butterfly_open(PROGRAMMER *pgm, const char *port) {
|
|||
if(pgm->baudrate == 0) {
|
||||
pgm->baudrate = 19200;
|
||||
}
|
||||
pinfo.serialinfo.baud = pgm->baudrate;
|
||||
pinfo.serialinfo.cflags = SERIAL_8N1;
|
||||
pinfo.baud = pgm->baudrate;
|
||||
if (serial_open(port, pinfo, &pgm->fd)==-1) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -396,13 +416,14 @@ static void butterfly_close(PROGRAMMER * pgm)
|
|||
}
|
||||
|
||||
|
||||
static void butterfly_display(const PROGRAMMER *pgm, const char *p) {
|
||||
static void butterfly_display(PROGRAMMER * pgm, const char * p)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void butterfly_set_addr(const PROGRAMMER *pgm, unsigned long addr) {
|
||||
if( addr < 0x10000 ) {
|
||||
static void butterfly_set_addr(PROGRAMMER * pgm, unsigned long addr)
|
||||
{
|
||||
char cmd[3];
|
||||
|
||||
cmd[0] = 'A';
|
||||
|
@ -411,21 +432,11 @@ static void butterfly_set_addr(const PROGRAMMER *pgm, unsigned long addr) {
|
|||
|
||||
butterfly_send(pgm, cmd, sizeof(cmd));
|
||||
butterfly_vfy_cmd_sent(pgm, "set addr");
|
||||
} else {
|
||||
char cmd[4];
|
||||
|
||||
cmd[0] = 'H';
|
||||
cmd[1] = (addr >> 16) & 0xff;
|
||||
cmd[2] = (addr >> 8) & 0xff;
|
||||
cmd[3] = addr & 0xff;
|
||||
|
||||
butterfly_send(pgm, cmd, sizeof(cmd));
|
||||
butterfly_vfy_cmd_sent(pgm, "set extaddr");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void butterfly_set_extaddr(const PROGRAMMER *pgm, unsigned long addr) {
|
||||
static void butterfly_set_extaddr(PROGRAMMER * pgm, unsigned long addr)
|
||||
{
|
||||
char cmd[4];
|
||||
|
||||
cmd[0] = 'H';
|
||||
|
@ -439,7 +450,7 @@ static void butterfly_set_extaddr(const PROGRAMMER *pgm, unsigned long addr) {
|
|||
|
||||
|
||||
|
||||
static int butterfly_write_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int butterfly_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned long addr, unsigned char value)
|
||||
{
|
||||
char cmd[6];
|
||||
|
@ -483,7 +494,7 @@ static int butterfly_write_byte(const PROGRAMMER *pgm, const AVRPART *p, const A
|
|||
}
|
||||
|
||||
|
||||
static int butterfly_read_byte_flash(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int butterfly_read_byte_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned long addr, unsigned char * value)
|
||||
{
|
||||
static int cached = 0;
|
||||
|
@ -503,13 +514,9 @@ static int butterfly_read_byte_flash(const PROGRAMMER *pgm, const AVRPART *p, co
|
|||
} else {
|
||||
butterfly_set_addr(pgm, addr >> 1);
|
||||
}
|
||||
// Defaults to flash read ('F')
|
||||
char msg[4] = {'g', 0x00, 0x02, 'F'};
|
||||
if (strcmp(m->desc, "prodsig") == 0)
|
||||
msg[3] = 'P';
|
||||
else if (strcmp(m->desc, "usersig") == 0)
|
||||
msg[3] = 'U';
|
||||
butterfly_send(pgm, msg, 4);
|
||||
|
||||
butterfly_send(pgm, "g\000\002F", 4);
|
||||
|
||||
/* Read back the program mem word (MSB first) */
|
||||
butterfly_recv(pgm, buf, sizeof(buf));
|
||||
|
||||
|
@ -528,7 +535,7 @@ static int butterfly_read_byte_flash(const PROGRAMMER *pgm, const AVRPART *p, co
|
|||
}
|
||||
|
||||
|
||||
static int butterfly_read_byte_eeprom(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int butterfly_read_byte_eeprom(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned long addr, unsigned char * value)
|
||||
{
|
||||
butterfly_set_addr(pgm, addr);
|
||||
|
@ -537,14 +544,23 @@ static int butterfly_read_byte_eeprom(const PROGRAMMER *pgm, const AVRPART *p, c
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int butterfly_read_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int butterfly_page_erase(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, unsigned int addr)
|
||||
{
|
||||
if (strcmp(m->desc, "flash") == 0)
|
||||
return -1; /* not supported */
|
||||
if (strcmp(m->desc, "eeprom") == 0)
|
||||
return 0; /* nothing to do */
|
||||
avrdude_message(MSG_INFO, "%s: butterfly_page_erase() called on memory type \"%s\"\n",
|
||||
progname, m->desc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int butterfly_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned long addr, unsigned char * value)
|
||||
{
|
||||
char cmd;
|
||||
|
||||
if (strcmp(m->desc, "flash") == 0 ||
|
||||
strcmp(m->desc, "prodsig") == 0 ||
|
||||
strcmp(m->desc, "usersig") == 0) {
|
||||
if (strcmp(m->desc, "flash") == 0) {
|
||||
return butterfly_read_byte_flash(pgm, p, m, addr, value);
|
||||
}
|
||||
|
||||
|
@ -575,7 +591,7 @@ static int butterfly_read_byte(const PROGRAMMER *pgm, const AVRPART *p, const AV
|
|||
|
||||
|
||||
|
||||
static int butterfly_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int butterfly_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned int page_size,
|
||||
unsigned int addr, unsigned int n_bytes)
|
||||
{
|
||||
|
@ -585,9 +601,7 @@ static int butterfly_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const
|
|||
int use_ext_addr = m->op[AVR_OP_LOAD_EXT_ADDR] != NULL;
|
||||
unsigned int wr_size = 2;
|
||||
|
||||
if (strcmp(m->desc, "flash") &&
|
||||
strcmp(m->desc, "eeprom") &&
|
||||
strcmp(m->desc, "usersig"))
|
||||
if (strcmp(m->desc, "flash") && strcmp(m->desc, "eeprom"))
|
||||
return -2;
|
||||
|
||||
if (m->desc[0] == 'e')
|
||||
|
@ -632,7 +646,7 @@ static int butterfly_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const
|
|||
|
||||
|
||||
|
||||
static int butterfly_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
|
||||
static int butterfly_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
unsigned int page_size,
|
||||
unsigned int addr, unsigned int n_bytes)
|
||||
{
|
||||
|
@ -641,10 +655,8 @@ static int butterfly_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const A
|
|||
int blocksize = PDATA(pgm)->buffersize;
|
||||
int use_ext_addr = m->op[AVR_OP_LOAD_EXT_ADDR] != NULL;
|
||||
|
||||
/* check parameter syntax: only "flash", "eeprom" or "usersig" is allowed */
|
||||
if (strcmp(m->desc, "flash") &&
|
||||
strcmp(m->desc, "eeprom") &&
|
||||
strcmp(m->desc, "usersig"))
|
||||
/* check parameter syntax: only "flash" or "eeprom" is allowed */
|
||||
if (strcmp(m->desc, "flash") && strcmp(m->desc, "eeprom"))
|
||||
return -2;
|
||||
|
||||
if (m->desc[0] == 'e')
|
||||
|
@ -680,11 +692,12 @@ static int butterfly_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const A
|
|||
|
||||
|
||||
/* Signature byte reads are always 3 bytes. */
|
||||
static int butterfly_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m) {
|
||||
static int butterfly_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m)
|
||||
{
|
||||
unsigned char tmp;
|
||||
|
||||
if (m->size < 3) {
|
||||
pmsg_error("memsize too small for sig byte read");
|
||||
avrdude_message(MSG_INFO, "%s: memsize too small for sig byte read", progname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -700,7 +713,8 @@ static int butterfly_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, con
|
|||
|
||||
const char butterfly_desc[] = "Atmel Butterfly evaluation board; Atmel AppNotes AVR109, AVR911";
|
||||
|
||||
void butterfly_initpgm(PROGRAMMER *pgm) {
|
||||
void butterfly_initpgm(PROGRAMMER * pgm)
|
||||
{
|
||||
strcpy(pgm->type, "butterfly");
|
||||
|
||||
/*
|
||||
|
@ -727,6 +741,7 @@ void butterfly_initpgm(PROGRAMMER *pgm) {
|
|||
* optional functions
|
||||
*/
|
||||
|
||||
pgm->page_erase = butterfly_page_erase;
|
||||
pgm->paged_write = butterfly_paged_write;
|
||||
pgm->paged_load = butterfly_paged_load;
|
||||
|
||||
|
@ -739,7 +754,8 @@ void butterfly_initpgm(PROGRAMMER *pgm) {
|
|||
|
||||
const char butterfly_mk_desc[] = "Mikrokopter.de Butterfly";
|
||||
|
||||
void butterfly_mk_initpgm(PROGRAMMER *pgm) {
|
||||
void butterfly_mk_initpgm(PROGRAMMER * pgm)
|
||||
{
|
||||
butterfly_initpgm(pgm);
|
||||
strcpy(pgm->type, "butterfly_mk");
|
||||
pgm->flag = IS_BUTTERFLY_MK;
|
|
@ -27,8 +27,8 @@ extern "C" {
|
|||
|
||||
extern const char butterfly_desc[];
|
||||
extern const char butterfly_mk_desc[];
|
||||
void butterfly_initpgm(PROGRAMMER *pgm);
|
||||
void butterfly_mk_initpgm(PROGRAMMER *pgm);
|
||||
void butterfly_initpgm (PROGRAMMER * pgm);
|
||||
void butterfly_mk_initpgm (PROGRAMMER * pgm);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
@echo off
|
||||
rmdir /s /q ".vs" >nul 2>nul
|
||||
|
||||
rmdir /s /q "Debug" >nul 2>nul
|
||||
rmdir /s /q "Release" >nul 2>nul
|
||||
rmdir /s /q "x64" >nul 2>nul
|
||||
|
||||
rmdir /s /q "external\libelf\Debug" >nul 2>nul
|
||||
rmdir /s /q "external\libelf\Release" >nul 2>nul
|
||||
rmdir /s /q "external\libelf\x64" >nul 2>nul
|
||||
|
||||
rmdir /s /q "external\libftdi1\Debug" >nul 2>nul
|
||||
rmdir /s /q "external\libftdi1\Release" >nul 2>nul
|
||||
rmdir /s /q "external\libftdi1\x64" >nul 2>nul
|
||||
|
||||
rmdir /s /q "external\libhidapi\Debug" >nul 2>nul
|
||||
rmdir /s /q "external\libhidapi\Release" >nul 2>nul
|
||||
rmdir /s /q "external\libhidapi\x64" >nul 2>nul
|
||||
|
||||
rmdir /s /q "external\libusb\Debug" >nul 2>nul
|
||||
rmdir /s /q "external\libusb\Release" >nul 2>nul
|
||||
rmdir /s /q "external\libusb\x64" >nul 2>nul
|
||||
|
||||
rmdir /s /q .deps
|
||||
rmdir /s /q .libs
|
||||
rmdir /s /q autom4te.cache
|
||||
rmdir /s /q m4
|
||||
|
||||
del ac_cfg.h
|
||||
del ac_cfg.h.in
|
||||
del aclocal.m4
|
||||
del avrdude
|
||||
del avrdude.conf
|
||||
del avrdude.conf.tmp
|
||||
del avrdude.spec
|
||||
del compile
|
||||
del config.guess
|
||||
del config.log
|
||||
del config.status
|
||||
del config.sub
|
||||
del config_gram.c
|
||||
del config_gram.h
|
||||
del configure
|
||||
del depcomp
|
||||
del INSTALL
|
||||
del install-sh
|
||||
del lexer.c
|
||||
del libtool
|
||||
del ltmain.sh
|
||||
del Makefile
|
||||
del Makefile.in
|
||||
del mdate-sh
|
||||
del mkinstalldirs
|
||||
del missing
|
||||
del stamp-h.in
|
||||
del stamp-h1
|
||||
del texinfo.tex
|
||||
del y.output
|
||||
del y.tab.h
|
||||
del ylwrap
|
||||
del *.o
|
||||
del *.lo
|
||||
del *.a
|
||||
del *.la
|
||||
del *.diff
|
||||
del *.patch
|
|
@ -0,0 +1,349 @@
|
|||
/*
|
||||
* avrdude - A Downloader/Uploader for AVR device programmers
|
||||
* Copyright (C) 2000-2004 Brian S. Dean <bsd@bsdhome.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "ac_cfg.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "avrdude.h"
|
||||
#include "libavrdude.h"
|
||||
#include "config.h"
|
||||
|
||||
#include "config_gram.h"
|
||||
|
||||
char default_programmer[MAX_STR_CONST];
|
||||
char default_parallel[PATH_MAX];
|
||||
char default_serial[PATH_MAX];
|
||||
double default_bitclock;
|
||||
int default_safemode;
|
||||
|
||||
char string_buf[MAX_STR_CONST];
|
||||
char *string_buf_ptr;
|
||||
|
||||
LISTID string_list;
|
||||
LISTID number_list;
|
||||
PROGRAMMER * current_prog;
|
||||
AVRPART * current_part;
|
||||
AVRMEM * current_mem;
|
||||
LISTID part_list;
|
||||
LISTID programmers;
|
||||
|
||||
int lineno;
|
||||
const char * infile;
|
||||
|
||||
extern char * yytext;
|
||||
|
||||
#define DEBUG 0
|
||||
|
||||
void cleanup_config(void)
|
||||
{
|
||||
ldestroy_cb(part_list, (void(*)(void*))avr_free_part);
|
||||
ldestroy_cb(programmers, (void(*)(void*))pgm_free);
|
||||
ldestroy_cb(string_list, (void(*)(void*))free_token);
|
||||
ldestroy_cb(number_list, (void(*)(void*))free_token);
|
||||
}
|
||||
|
||||
int init_config(void)
|
||||
{
|
||||
string_list = lcreat(NULL, 0);
|
||||
number_list = lcreat(NULL, 0);
|
||||
current_prog = NULL;
|
||||
current_part = NULL;
|
||||
current_mem = NULL;
|
||||
part_list = lcreat(NULL, 0);
|
||||
programmers = lcreat(NULL, 0);
|
||||
|
||||
lineno = 1;
|
||||
infile = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int yywrap()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int yyerror(char * errmsg, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
char message[512];
|
||||
|
||||
va_start(args, errmsg);
|
||||
|
||||
vsnprintf(message, sizeof(message), errmsg, args);
|
||||
avrdude_message(MSG_INFO, "%s: error at %s:%d: %s\n", progname, infile, lineno, message);
|
||||
|
||||
va_end(args);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int yywarning(char * errmsg, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
char message[512];
|
||||
|
||||
va_start(args, errmsg);
|
||||
|
||||
vsnprintf(message, sizeof(message), errmsg, args);
|
||||
avrdude_message(MSG_INFO, "%s: warning at %s:%d: %s\n", progname, infile, lineno, message);
|
||||
|
||||
va_end(args);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
TOKEN * new_token(int primary)
|
||||
{
|
||||
TOKEN * tkn;
|
||||
|
||||
tkn = (TOKEN *)malloc(sizeof(TOKEN));
|
||||
if (tkn == NULL) {
|
||||
yyerror("new_token(): out of memory");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(tkn, 0, sizeof(TOKEN));
|
||||
|
||||
tkn->primary = primary;
|
||||
|
||||
return tkn;
|
||||
}
|
||||
|
||||
|
||||
void free_token(TOKEN * tkn)
|
||||
{
|
||||
if (tkn) {
|
||||
switch (tkn->value.type) {
|
||||
case V_STR:
|
||||
if (tkn->value.string)
|
||||
free(tkn->value.string);
|
||||
tkn->value.string = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
free(tkn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void free_tokens(int n, ...)
|
||||
{
|
||||
TOKEN * t;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, n);
|
||||
while (n--) {
|
||||
t = va_arg(ap, TOKEN *);
|
||||
free_token(t);
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
TOKEN * number(char * text)
|
||||
{
|
||||
struct token_t * tkn;
|
||||
|
||||
tkn = new_token(TKN_NUMBER);
|
||||
if (tkn == NULL) {
|
||||
return NULL; /* yyerror already called */
|
||||
}
|
||||
tkn->value.type = V_NUM;
|
||||
tkn->value.number = atoi(text);
|
||||
|
||||
#if DEBUG
|
||||
avrdude_message(MSG_INFO, "NUMBER(%d)\n", tkn->value.number);
|
||||
#endif
|
||||
|
||||
return tkn;
|
||||
}
|
||||
|
||||
TOKEN * number_real(char * text)
|
||||
{
|
||||
struct token_t * tkn;
|
||||
|
||||
tkn = new_token(TKN_NUMBER);
|
||||
tkn->value.type = V_NUM_REAL;
|
||||
tkn->value.number_real = atof(text);
|
||||
|
||||
#if DEBUG
|
||||
avrdude_message(MSG_INFO, "NUMBER(%g)\n", tkn->value.number_real);
|
||||
#endif
|
||||
|
||||
return tkn;
|
||||
}
|
||||
|
||||
TOKEN * hexnumber(char * text)
|
||||
{
|
||||
struct token_t * tkn;
|
||||
char * e;
|
||||
|
||||
tkn = new_token(TKN_NUMBER);
|
||||
if (tkn == NULL) {
|
||||
return NULL; /* yyerror already called */
|
||||
}
|
||||
tkn->value.type = V_NUM;
|
||||
tkn->value.number = strtoul(text, &e, 16);
|
||||
if ((e == text) || (*e != 0)) {
|
||||
yyerror("can't scan hex number \"%s\"", text);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
avrdude_message(MSG_INFO, "HEXNUMBER(%g)\n", tkn->value.number);
|
||||
#endif
|
||||
|
||||
return tkn;
|
||||
}
|
||||
|
||||
|
||||
TOKEN * string(char * text)
|
||||
{
|
||||
struct token_t * tkn;
|
||||
int len;
|
||||
|
||||
tkn = new_token(TKN_STRING);
|
||||
if (tkn == NULL) {
|
||||
return NULL; /* yyerror already called */
|
||||
}
|
||||
|
||||
len = strlen(text);
|
||||
|
||||
tkn->value.type = V_STR;
|
||||
tkn->value.string = (char *) malloc(len+1);
|
||||
if (tkn->value.string == NULL) {
|
||||
yyerror("string(): out of memory");
|
||||
return NULL;
|
||||
}
|
||||
strcpy(tkn->value.string, text);
|
||||
|
||||
#if DEBUG
|
||||
avrdude_message(MSG_INFO, "STRING(%s)\n", tkn->value.string);
|
||||
#endif
|
||||
|
||||
return tkn;
|
||||
}
|
||||
|
||||
|
||||
TOKEN * keyword(int primary)
|
||||
{
|
||||
struct token_t * tkn;
|
||||
|
||||
tkn = new_token(primary);
|
||||
|
||||
return tkn;
|
||||
}
|
||||
|
||||
|
||||
void print_token(TOKEN * tkn)
|
||||
{
|
||||
if (!tkn)
|
||||
return;
|
||||
|
||||
avrdude_message(MSG_INFO, "token = %d = ", tkn->primary);
|
||||
switch (tkn->value.type) {
|
||||
case V_NUM:
|
||||
avrdude_message(MSG_INFO, "NUMBER, value=%d", tkn->value.number);
|
||||
break;
|
||||
|
||||
case V_NUM_REAL:
|
||||
avrdude_message(MSG_INFO, "NUMBER, value=%g", tkn->value.number_real);
|
||||
break;
|
||||
|
||||
case V_STR:
|
||||
avrdude_message(MSG_INFO, "STRING, value=%s", tkn->value.string);
|
||||
break;
|
||||
|
||||
default:
|
||||
avrdude_message(MSG_INFO, "<other>");
|
||||
break;
|
||||
}
|
||||
|
||||
avrdude_message(MSG_INFO, "\n");
|
||||
}
|
||||
|
||||
|
||||
void pyytext(void)
|
||||
{
|
||||
#if DEBUG
|
||||
avrdude_message(MSG_INFO, "TOKEN: \"%s\"\n", yytext);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
char * dup_string(const char * str)
|
||||
{
|
||||
char * s;
|
||||
|
||||
s = strdup(str);
|
||||
if (s == NULL) {
|
||||
yyerror("dup_string(): out of memory");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
#ifdef HAVE_YYLEX_DESTROY
|
||||
/* reset lexer and free any allocated memory */
|
||||
extern int yylex_destroy(void);
|
||||
#endif
|
||||
|
||||
int read_config(const char * file)
|
||||
{
|
||||
FILE * f;
|
||||
int r;
|
||||
|
||||
f = fopen(file, "r");
|
||||
if (f == NULL) {
|
||||
avrdude_message(MSG_INFO, "%s: can't open config file \"%s\": %s\n",
|
||||
progname, file, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
lineno = 1;
|
||||
infile = file;
|
||||
yyin = f;
|
||||
|
||||
r = yyparse();
|
||||
|
||||
#ifdef HAVE_YYLEX_DESTROY
|
||||
/* reset lexer and free any allocated memory */
|
||||
yylex_destroy();
|
||||
#endif
|
||||
|
||||
fclose(f);
|
||||
|
||||
return r;
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* avrdude - A Downloader/Uploader for AVR device programmers
|
||||
* Copyright (C) 2000-2004 Brian S. Dean <bsd@bsdhome.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* These are the internal definitions needed for config parsing */
|
||||
|
||||
#ifndef config_h
|
||||
#define config_h
|
||||
|
||||
#include "libavrdude.h"
|
||||
|
||||
|
||||
#define MAX_STR_CONST 1024
|
||||
|
||||
enum { V_NONE, V_NUM, V_NUM_REAL, V_STR };
|
||||
typedef struct value_t {
|
||||
int type;
|
||||
/*union { TODO: use an anonymous union here ? */
|
||||
int number;
|
||||
double number_real;
|
||||
char * string;
|
||||
/*};*/
|
||||
} VALUE;
|
||||
|
||||
|
||||
typedef struct token_t {
|
||||
int primary;
|
||||
VALUE value;
|
||||
} TOKEN;
|
||||
typedef struct token_t *token_p;
|
||||
|
||||
|
||||
extern FILE * yyin;
|
||||
extern PROGRAMMER * current_prog;
|
||||
extern AVRPART * current_part;
|
||||
extern AVRMEM * current_mem;
|
||||
extern int lineno;
|
||||
extern const char * infile;
|
||||
extern LISTID string_list;
|
||||
extern LISTID number_list;
|
||||
|
||||
|
||||
#if !defined(HAS_YYSTYPE)
|
||||
#define YYSTYPE token_p
|
||||
#endif
|
||||
extern YYSTYPE yylval;
|
||||
|
||||
extern char string_buf[MAX_STR_CONST];
|
||||
extern char *string_buf_ptr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int yyparse(void);
|
||||
|
||||
int yyerror(char * errmsg, ...);
|
||||
|
||||
int yywarning(char * errmsg, ...);
|
||||
|
||||
TOKEN * new_token(int primary);
|
||||
|
||||
void free_token(TOKEN * tkn);
|
||||
|
||||
void free_tokens(int n, ...);
|
||||
|
||||
TOKEN * number(char * text);
|
||||
|
||||
TOKEN * number_real(char * text);
|
||||
|
||||
TOKEN * hexnumber(char * text);
|
||||
|
||||
TOKEN * string(char * text);
|
||||
|
||||
TOKEN * keyword(int primary);
|
||||
|
||||
void print_token(TOKEN * tkn);
|
||||
|
||||
void pyytext(void);
|
||||
|
||||
char * dup_string(const char * str);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -23,14 +23,14 @@
|
|||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT(avrdude, 7.1-20230108, avrdude-dev@nongnu.org)
|
||||
AC_INIT(avrdude, 6.3-20171130, avrdude-dev@nongnu.org)
|
||||
|
||||
AC_CANONICAL_BUILD
|
||||
AC_CANONICAL_HOST
|
||||
AC_CANONICAL_TARGET
|
||||
|
||||
AC_CONFIG_SRCDIR([main.c])
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_CONFIG_HEADERS(ac_cfg.h)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
|
@ -195,8 +195,6 @@ if test x$have_libftdi1 = xyes; then
|
|||
LIBFTDI1="-lftdi1"
|
||||
AC_DEFINE([HAVE_LIBFTDI1])
|
||||
AC_SUBST(LIBFTDI1, $LIBFTDI1)
|
||||
LIBS="${LIBS} ${LIBFTDI1}"
|
||||
AC_CHECK_FUNCS(ftdi_tcioflush)
|
||||
else
|
||||
if test x$have_libftdi = xyes; then
|
||||
LIBFTDI="-lftdi -lusb"
|
||||
|
@ -228,15 +226,23 @@ AC_HEADER_TIME
|
|||
|
||||
AC_CHECK_HEADERS([netinet/in.h])
|
||||
|
||||
# WinSock2
|
||||
AC_CHECK_LIB([ws2_32], [puts])
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS([memset select strcasecmp strdup strerror strncasecmp strtol strtoul gettimeofday usleep getaddrinfo])
|
||||
|
||||
AC_MSG_CHECKING([for a Win32 HID library])
|
||||
AC_MSG_CHECKING([for a Win32 HID libray])
|
||||
SAVED_LIBS="${LIBS}"
|
||||
case $target in
|
||||
*-*-mingw32* | *-*-cygwin* | *-*-windows*)
|
||||
LIBHID="-lhid -lsetupapi"
|
||||
HIDINCLUDE="#include <hidsdi.h>"
|
||||
if test $ac_cv_header_ddk_hidsdi_h = yes
|
||||
then
|
||||
HIDINCLUDE="#include <ddk/hidsdi.h>"
|
||||
else
|
||||
HIDINCLUDE="#include \"my_ddk_hidsdi.h\""
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
LIBHID=""
|
||||
|
@ -316,7 +322,7 @@ AC_ARG_ENABLE(
|
|||
no) enabled_parport=no ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for enable-parport option) ;;
|
||||
esac],
|
||||
[enabled_parport=no])
|
||||
[enabled_parport=yes])
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[linuxgpio],
|
||||
|
@ -330,19 +336,7 @@ AC_ARG_ENABLE(
|
|||
esac],
|
||||
[enabled_linuxgpio=no])
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[linuxspi],
|
||||
AC_HELP_STRING(
|
||||
[--enable-linuxspi],
|
||||
[Enable the Linux SPIDEV interface programmer type]),
|
||||
[case "${enableval}" in
|
||||
yes) enabled_linuxspi=yes ;;
|
||||
no) enabled_linuxspi=no ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for enable-linuxspi option) ;;
|
||||
esac],
|
||||
[enabled_linuxspi=no])
|
||||
|
||||
DIST_SUBDIRS_AC='doc'
|
||||
DIST_SUBDIRS_AC='doc windows'
|
||||
|
||||
if test "$enabled_doc" = "yes"; then
|
||||
SUBDIRS_AC='doc'
|
||||
|
@ -419,15 +413,7 @@ else
|
|||
fi
|
||||
|
||||
|
||||
if test "$enabled_linuxspi" = "yes"; then
|
||||
AC_DEFINE(HAVE_LINUXSPI, 1, [Linux SPI support enabled])
|
||||
confsubst="$confsubst -e /^@HAVE_LINUXSPI_/d"
|
||||
else
|
||||
confsubst="$confsubst -e /^@HAVE_LINUXSPI_BEGIN@/,/^@HAVE_LINUXSPI_END@/d"
|
||||
fi
|
||||
|
||||
|
||||
# If we are compiling with gcc, enable all warnings and make warnings errors.
|
||||
# If we are compiling with gcc, enable all warning and make warnings errors.
|
||||
if test "$GCC" = yes; then
|
||||
ENABLE_WARNINGS="-Wall"
|
||||
|
||||
|
@ -499,12 +485,15 @@ case $target in
|
|||
LDFLAGS="${LDFLAGS} -static"
|
||||
fi
|
||||
|
||||
WINDOWS_DIRS="windows"
|
||||
CFLAGS="${CFLAGS} -DWIN32NATIVE"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(WINDOWS_DIRS,$WINDOWS_DIRS)
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
doc/Makefile
|
||||
windows/Makefile
|
||||
avrdude.spec
|
||||
Makefile
|
||||
])
|
||||
|
@ -577,12 +566,6 @@ else
|
|||
echo "DON'T HAVE libhidapi"
|
||||
fi
|
||||
|
||||
if test x$have_readline = xyes; then
|
||||
echo "DO HAVE libreadline"
|
||||
else
|
||||
echo "DON'T HAVE libreadline"
|
||||
fi
|
||||
|
||||
if test x$have_pthread = xyes; then
|
||||
echo "DO HAVE pthread"
|
||||
else
|
||||
|
@ -607,9 +590,3 @@ else
|
|||
echo "DISABLED linuxgpio"
|
||||
fi
|
||||
|
||||
if test x$enabled_linuxspi = xyes; then
|
||||
echo "ENABLED linuxspi"
|
||||
else
|
||||
echo "DISABLED linuxspi"
|
||||
fi
|
||||
|
|
@ -17,33 +17,38 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "ac_cfg.h"
|
||||
#include "avrdude.h"
|
||||
#include "libavrdude.h"
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(WIN32NATIVE)
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <limits.h>
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
static char *filename;
|
||||
|
||||
|
||||
void win_sys_config_set(char sys_config[PATH_MAX])
|
||||
{
|
||||
sys_config[0] = 0;
|
||||
|
||||
/* Use Windows API call to search for the Windows default system config file.*/
|
||||
SearchPath(NULL, SYSTEM_CONF_FILE, NULL, PATH_MAX, sys_config, &filename);
|
||||
SearchPath(NULL, "avrdude.conf", NULL, PATH_MAX, sys_config, &filename);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void win_usr_config_set(char usr_config[PATH_MAX])
|
||||
{
|
||||
usr_config[0] = 0;
|
||||
|
||||
/* Use Windows API call to search for the Windows default user config file. */
|
||||
SearchPath(NULL, USER_CONF_FILE, NULL, PATH_MAX, usr_config, &filename);
|
||||
SearchPath(NULL, "avrdude.rc", NULL, PATH_MAX, usr_config, &filename);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -38,8 +38,9 @@
|
|||
|
||||
#ifndef HAVE_LIBUSB
|
||||
|
||||
struct dfu_dev *dfu_open(const char *port_name) {
|
||||
pmsg_error("no USB support compiled for avrdude\n");
|
||||
struct dfu_dev *dfu_open(char *port_name) {
|
||||
avrdude_message(MSG_INFO, "%s: Error: No USB support in this compile of avrdude\n",
|
||||
progname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -98,7 +99,8 @@ static char * get_usb_string(usb_dev_handle * dev_handle, int index);
|
|||
/* EXPORTED FUNCTION DEFINITIONS
|
||||
*/
|
||||
|
||||
struct dfu_dev *dfu_open(const char *port_spec) {
|
||||
struct dfu_dev * dfu_open(char *port_spec)
|
||||
{
|
||||
struct dfu_dev *dfu;
|
||||
char *bus_name = NULL;
|
||||
char *dev_name = NULL;
|
||||
|
@ -110,14 +112,16 @@ struct dfu_dev *dfu_open(const char *port_spec) {
|
|||
*/
|
||||
|
||||
if (strncmp(port_spec, "usb", 3) != 0) {
|
||||
pmsg_error("invalid port specification %s for USB device\n", port_spec);
|
||||
avrdude_message(MSG_INFO, "%s: Error: "
|
||||
"Invalid port specification \"%s\" for USB device\n",
|
||||
progname, port_spec);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(':' == port_spec[3]) {
|
||||
bus_name = strdup(port_spec + 3 + 1);
|
||||
if (bus_name == NULL) {
|
||||
pmsg_error("out of memory in strdup\n");
|
||||
avrdude_message(MSG_INFO, "%s: Out of memory in strdup\n", progname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -134,7 +138,7 @@ struct dfu_dev *dfu_open(const char *port_spec) {
|
|||
|
||||
if (dfu == NULL)
|
||||
{
|
||||
pmsg_error("out of memory\n");
|
||||
avrdude_message(MSG_INFO, "%s: out of memory\n", progname);
|
||||
free(bus_name);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -168,7 +172,9 @@ int dfu_init(struct dfu_dev *dfu, unsigned short vid, unsigned short pid)
|
|||
*/
|
||||
|
||||
if (pid == 0 && dfu->dev_name == NULL) {
|
||||
pmsg_error("no DFU support for part; specify PID in config or USB address (via -P) to override\n");
|
||||
avrdude_message(MSG_INFO, "%s: Error: No DFU support for part; "
|
||||
"specify PID in config or USB address (via -P) to override.\n",
|
||||
progname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -203,18 +209,20 @@ int dfu_init(struct dfu_dev *dfu, unsigned short vid, unsigned short pid)
|
|||
* why the match failed, and if we came across another DFU-capable part.
|
||||
*/
|
||||
|
||||
pmsg_error("no matching USB device found\n");
|
||||
avrdude_message(MSG_INFO, "%s: Error: No matching USB device found\n", progname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pmsg_notice("found VID=0x%04x PID=0x%04x at %s:%s\n",
|
||||
found->descriptor.idVendor, found->descriptor.idProduct,
|
||||
if(verbose)
|
||||
avrdude_message(MSG_INFO, "%s: Found VID=0x%04x PID=0x%04x at %s:%s\n",
|
||||
progname, found->descriptor.idVendor, found->descriptor.idProduct,
|
||||
found->bus->dirname, found->filename);
|
||||
|
||||
dfu->dev_handle = usb_open(found);
|
||||
|
||||
if (dfu->dev_handle == NULL) {
|
||||
pmsg_error("USB device at %s:%s: %s\n", found->bus->dirname, found->filename, usb_strerror());
|
||||
avrdude_message(MSG_INFO, "%s: Error: USB device at %s:%s: %s\n",
|
||||
progname, found->bus->dirname, found->filename, usb_strerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -264,28 +272,33 @@ int dfu_getstatus(struct dfu_dev *dfu, struct dfu_status *status)
|
|||
{
|
||||
int result;
|
||||
|
||||
pmsg_trace("dfu_getstatus(): issuing control IN message\n");
|
||||
avrdude_message(MSG_TRACE, "%s: dfu_getstatus(): issuing control IN message\n",
|
||||
progname);
|
||||
|
||||
result = usb_control_msg(dfu->dev_handle,
|
||||
0x80 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_GETSTATUS, 0, 0,
|
||||
(char*) status, sizeof(struct dfu_status), dfu->timeout);
|
||||
|
||||
if (result < 0) {
|
||||
pmsg_error("unable to get DFU status: %s\n", usb_strerror());
|
||||
avrdude_message(MSG_INFO, "%s: Error: Failed to get DFU status: %s\n",
|
||||
progname, usb_strerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (result < sizeof(struct dfu_status)) {
|
||||
pmsg_error("unable to get DFU status: %s\n", "short read");
|
||||
avrdude_message(MSG_INFO, "%s: Error: Failed to get DFU status: %s\n",
|
||||
progname, "short read");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (result > sizeof(struct dfu_status)) {
|
||||
pmsg_error("oversize read (should not happen); exiting\n");
|
||||
avrdude_message(MSG_INFO, "%s: Error: Oversize read (should not happen); "
|
||||
"exiting\n", progname);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
pmsg_trace("dfu_getstatus(): bStatus 0x%02x, bwPollTimeout %d, bState 0x%02x, iString %d\n",
|
||||
avrdude_message(MSG_TRACE, "%s: dfu_getstatus(): bStatus 0x%02x, bwPollTimeout %d, bState 0x%02x, iString %d\n",
|
||||
progname,
|
||||
status->bStatus,
|
||||
status->bwPollTimeout[0] | (status->bwPollTimeout[1] << 8) | (status->bwPollTimeout[2] << 16),
|
||||
status->bState,
|
||||
|
@ -298,14 +311,16 @@ int dfu_clrstatus(struct dfu_dev *dfu)
|
|||
{
|
||||
int result;
|
||||
|
||||
pmsg_trace("dfu_clrstatus(): issuing control OUT message\n");
|
||||
avrdude_message(MSG_TRACE, "%s: dfu_clrstatus(): issuing control OUT message\n",
|
||||
progname);
|
||||
|
||||
result = usb_control_msg(dfu->dev_handle,
|
||||
USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_CLRSTATUS, 0, 0,
|
||||
NULL, 0, dfu->timeout);
|
||||
|
||||
if (result < 0) {
|
||||
pmsg_error("unable to clear DFU status: %s\n", usb_strerror());
|
||||
avrdude_message(MSG_INFO, "%s: Error: Failed to clear DFU status: %s\n",
|
||||
progname, usb_strerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -316,14 +331,16 @@ int dfu_abort(struct dfu_dev *dfu)
|
|||
{
|
||||
int result;
|
||||
|
||||
pmsg_trace("dfu_abort(): issuing control OUT message\n");
|
||||
avrdude_message(MSG_TRACE, "%s: dfu_abort(): issuing control OUT message\n",
|
||||
progname);
|
||||
|
||||
result = usb_control_msg(dfu->dev_handle,
|
||||
USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_ABORT, 0, 0,
|
||||
NULL, 0, dfu->timeout);
|
||||
|
||||
if (result < 0) {
|
||||
pmsg_error("unable to reset DFU state: %s\n", usb_strerror());
|
||||
avrdude_message(MSG_INFO, "%s: Error: Failed to reset DFU state: %s\n",
|
||||
progname, usb_strerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -335,26 +352,29 @@ int dfu_dnload(struct dfu_dev *dfu, void *ptr, int size)
|
|||
{
|
||||
int result;
|
||||
|
||||
pmsg_trace("dfu_dnload(): issuing control OUT message, wIndex = %d, ptr = %p, size = %d\n",
|
||||
wIndex, ptr, size);
|
||||
avrdude_message(MSG_TRACE, "%s: dfu_dnload(): issuing control OUT message, wIndex = %d, ptr = %p, size = %d\n",
|
||||
progname, wIndex, ptr, size);
|
||||
|
||||
result = usb_control_msg(dfu->dev_handle,
|
||||
USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_DNLOAD, wIndex++, 0,
|
||||
ptr, size, dfu->timeout);
|
||||
|
||||
if (result < 0) {
|
||||
pmsg_error("DFU_DNLOAD failed: %s\n", usb_strerror());
|
||||
avrdude_message(MSG_INFO, "%s: Error: DFU_DNLOAD failed: %s\n",
|
||||
progname, usb_strerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (result < size) {
|
||||
pmsg_error("DFU_DNLOAD failed: short write\n");
|
||||
avrdude_message(MSG_INFO, "%s: Error: DFU_DNLOAD failed: %s\n",
|
||||
progname, "short write");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (result > size) {
|
||||
pmsg_error("DFU_DNLOAD failed: oversize write (should not happen)\n");
|
||||
return -1;
|
||||
avrdude_message(MSG_INFO, "%s: Error: Oversize write (should not happen); " \
|
||||
"exiting\n", progname);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -364,25 +384,28 @@ int dfu_upload(struct dfu_dev *dfu, void *ptr, int size)
|
|||
{
|
||||
int result;
|
||||
|
||||
pmsg_trace("dfu_upload(): issuing control IN message, wIndex = %d, ptr = %p, size = %d\n",
|
||||
wIndex, ptr, size);
|
||||
avrdude_message(MSG_TRACE, "%s: dfu_upload(): issuing control IN message, wIndex = %d, ptr = %p, size = %d\n",
|
||||
progname, wIndex, ptr, size);
|
||||
|
||||
result = usb_control_msg(dfu->dev_handle,
|
||||
0x80 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, DFU_UPLOAD, wIndex++, 0,
|
||||
ptr, size, dfu->timeout);
|
||||
|
||||
if (result < 0) {
|
||||
pmsg_error("DFU_UPLOAD failed: %s\n", usb_strerror());
|
||||
avrdude_message(MSG_INFO, "%s: Error: DFU_UPLOAD failed: %s\n",
|
||||
progname, usb_strerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (result < size) {
|
||||
pmsg_error("DFU_UPLOAD failed: %s\n", "short read");
|
||||
avrdude_message(MSG_INFO, "%s: Error: DFU_UPLOAD failed: %s\n",
|
||||
progname, "short read");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (result > size) {
|
||||
pmsg_error("oversize read (should not happen); exiting\n");
|
||||
avrdude_message(MSG_INFO, "%s: Error: Oversize read (should not happen); "
|
||||
"exiting\n", progname);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -392,26 +415,26 @@ int dfu_upload(struct dfu_dev *dfu, void *ptr, int size)
|
|||
void dfu_show_info(struct dfu_dev *dfu)
|
||||
{
|
||||
if (dfu->manf_str != NULL)
|
||||
msg_info(" USB Vendor : %s (0x%04hX)\n",
|
||||
avrdude_message(MSG_INFO, " USB Vendor : %s (0x%04hX)\n",
|
||||
dfu->manf_str, (unsigned short) dfu->dev_desc.idVendor);
|
||||
else
|
||||
msg_info(" USB Vendor : 0x%04hX\n",
|
||||
avrdude_message(MSG_INFO, " USB Vendor : 0x%04hX\n",
|
||||
(unsigned short) dfu->dev_desc.idVendor);
|
||||
|
||||
if (dfu->prod_str != NULL)
|
||||
msg_info(" USB Product : %s (0x%04hX)\n",
|
||||
avrdude_message(MSG_INFO, " USB Product : %s (0x%04hX)\n",
|
||||
dfu->prod_str, (unsigned short) dfu->dev_desc.idProduct);
|
||||
else
|
||||
msg_info(" USB Product : 0x%04hX\n",
|
||||
avrdude_message(MSG_INFO, " USB Product : 0x%04hX\n",
|
||||
(unsigned short) dfu->dev_desc.idProduct);
|
||||
|
||||
msg_info(" USB Release : %hu.%hu.%hu\n",
|
||||
avrdude_message(MSG_INFO, " USB Release : %hu.%hu.%hu\n",
|
||||
((unsigned short) dfu->dev_desc.bcdDevice >> 8) & 0xFF,
|
||||
((unsigned short) dfu->dev_desc.bcdDevice >> 4) & 0xF,
|
||||
((unsigned short) dfu->dev_desc.bcdDevice >> 0) & 0xF);
|
||||
|
||||
if (dfu->serno_str != NULL)
|
||||
msg_info(" USB Serial No : %s\n", dfu->serno_str);
|
||||
avrdude_message(MSG_INFO, " USB Serial No : %s\n", dfu->serno_str);
|
||||
}
|
||||
|
||||
/* INTERNAL FUNCTION DEFINITIONS
|
||||
|
@ -428,14 +451,15 @@ char * get_usb_string(usb_dev_handle * dev_handle, int index) {
|
|||
result = usb_get_string_simple(dev_handle, index, buffer, sizeof(buffer)-1);
|
||||
|
||||
if (result < 0) {
|
||||
pmsg_error("unable to read USB device string %d: %s\n", index, usb_strerror());
|
||||
avrdude_message(MSG_INFO, "%s: Warning: Failed to read USB device string %d: %s\n",
|
||||
progname, index, usb_strerror());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
str = malloc(result+1);
|
||||
|
||||
if (str == NULL) {
|
||||
pmsg_error("out of memory allocating a string\n");
|
||||
avrdude_message(MSG_INFO, "%s: Out of memory allocating a string\n", progname);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ struct dfu_dev
|
|||
#else
|
||||
|
||||
struct dfu_dev {
|
||||
int dummy;
|
||||
// empty
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -114,7 +114,7 @@ struct dfu_status {
|
|||
|
||||
// FUNCTIONS
|
||||
|
||||
extern struct dfu_dev *dfu_open(const char *port_spec);
|
||||
extern struct dfu_dev * dfu_open(char *port_spec);
|
||||
extern int dfu_init(struct dfu_dev *dfu,
|
||||
unsigned short vid, unsigned short pid);
|
||||
extern void dfu_close(struct dfu_dev *dfu);
|
|
@ -1,5 +1,4 @@
|
|||
avrdude.t2d/
|
||||
avrdude.t2p/
|
||||
.cvsignore
|
||||
Makefile
|
||||
Makefile.in
|
||||
avrdude-html
|
|
@ -40,7 +40,7 @@ all-local: info html ps pdf
|
|||
html: avrdude-html/avrdude.html
|
||||
|
||||
avrdude-html/avrdude.html: $(srcdir)/$(info_TEXINFOS) $(GENERATED_TEXINFOS)
|
||||
texi2html --split=node --css-include=$(srcdir)/avrdude.css $(srcdir)/$(info_TEXINFOS)
|
||||
texi2html -split_node $(srcdir)/$(info_TEXINFOS)
|
||||
if [ -e ./avrdude.html -o -e ./avrdude_1.html ]; then \
|
||||
mkdir -p avrdude-html ; \
|
||||
mv -f *.html avrdude-html ; \
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
- Man page needs updated for avr910 info.
|
||||
|
||||
- Website needs to link to docs:
|
||||
http://savannah.nongnu.org/download/avrdude/doc/avrdude-html/
|
||||
|
||||
- Add "skip empty pages" optimization on avr910 paged write. The stk500 has
|
||||
this optimization already.
|
||||
|
||||
- Fix "overfull \hbox" issues in building documentation.
|
||||
|
||||
- FIXME: term.c: terminal_get_input(): strip newlines in non-readline input
|
||||
code.
|
||||
|
||||
- FIXME: avr910.c: avr910_cmd(): Insert version check here.
|
||||
|
||||
- FIXME: ser_posix.c: serial_close(): Should really restore the terminal to
|
||||
original state here.
|
||||
|
||||
- FIXME: main.c, par.c: exitspecs don't work if RESET-pin is controlled over
|
||||
PPICTRL.
|
||||
|
||||
- transfer ppi-speedtuning to the windows version (CAVEAT: This will make
|
||||
programming too fast for chips with 500kHz clock)
|
||||
|
||||
- make SCK-period configurable for PPI-programmers
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,481 @@
|
|||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,332 @@
|
|||
This is the public release of libelf-0.8.13, a free ELF object
|
||||
file access library. If you have problems with applications
|
||||
that use libelf and work with the commercial (SVR4, Solaris)
|
||||
version but not with this one, please contact me.
|
||||
|
||||
IMPORTANT NOTE: If you have libelf-0.5.2 installed, you probably
|
||||
have a file .../include/elf.h that contains the single line
|
||||
``#include <libelf/elf.h>''. REMOVE THIS FILE BEFORE YOU RUN
|
||||
configure.
|
||||
|
||||
Installation is straightforward - the package is autoconf'ed. Just do
|
||||
``cd libelf-0.8.13; ./configure; make; make install''. Header files
|
||||
will be installed in .../include/libelf/. If your system does not
|
||||
provide its own versions of libelf.h, nlist.h or gelf.h, ``make
|
||||
install'' will add the missing headers. If you prefer not to have
|
||||
these files installed in /usr/include, use ``--disable-compat'' and
|
||||
add ``-I /usr/include/libelf'' to your CFLAGS when compiling
|
||||
libelf-based programs.
|
||||
|
||||
Note to distribution makers: You can install libelf in a separate root
|
||||
hierarchy by using the command ``make instroot=/my/root install''.
|
||||
You should also use the ``--enable-compat'' configure option in that
|
||||
case, or run ``make instroot=/my/root install-compat'' manually, to
|
||||
install all the required header files.
|
||||
|
||||
If you are running Linux with libc 5.* as the default C library,
|
||||
and you plan to use the 64-bit functions, you must either use
|
||||
``-I.../include/libelf'', or remove /usr/include/libelf.h and use
|
||||
``--enable-compat'' when running configure. Libc 6.* (aka glibc2)
|
||||
doesn't have its own <libelf.h>, <nlist.h> or <gelf.h>.
|
||||
|
||||
You need an ANSI/ISO C compiler to build libelf. Gcc is optimal.
|
||||
|
||||
On some systems (in particular, Solaris and all variants of Linux),
|
||||
``make'' will try to build a shared library. If you run into problems
|
||||
on your system, please pass ``--disable-shared'' to configure.
|
||||
If you build a shared library and want it to be installed as
|
||||
``libelf-0.8.13.so'' rather than ``libelf.so.0.8.13'', please use
|
||||
``./configure --enable-gnu-names''. Other files, e.g. ``libelf.so'' and
|
||||
``libelf.so.0'' are NOT affected.
|
||||
|
||||
Another configure option, ``--enable-debug'', adds debugging code to
|
||||
libelf; if you don't run into problems, you will probably not need it.
|
||||
|
||||
When creating an ELF shared library, it is possible to add references
|
||||
to other shared libraries in the DYNAMIC section of the resulting
|
||||
file. The make variable DEPSHLIBS contains a list of libraries to add.
|
||||
It is set to ``-lc'' on Linux systems, and empty otherwise. To
|
||||
override this setting, use something like ``make DEPSHLIBS="-la -lb"''.
|
||||
For Linux, `-lc' is included automagically.
|
||||
|
||||
NLS is available and enabled by default. To turn it off, pass the
|
||||
``--disable-nls'' option to configure.
|
||||
|
||||
Libelf can use gettext or catgets for accessing message
|
||||
catalogs. If gettext is available AND is part of libc (i.e. not
|
||||
in a separate library), it will be used. Otherwise, configure
|
||||
will look for catgets. If you have gettext in a separate
|
||||
library and want to use it, you should pass the library's name
|
||||
to configure, e.g. ``LIBS=-lintl ./configure''. Note that you
|
||||
MUST link your libelf-based applications with -lintl then,
|
||||
which is probably not what you want, or change the DEPSHLIBS variable
|
||||
described above (in case you're building a shared library).
|
||||
|
||||
If you have GNU gettext 0.10 installed on your system, and if GNU gettext
|
||||
runs on top of the catgets interface (rather old Linux systems, using
|
||||
libc5), configure will refuse to use it and use catgets instead. If you
|
||||
absolutely want to use GNU gettext, go ahead and rebuild it (which is
|
||||
IMHO a good idea in general in this case):
|
||||
|
||||
cd .../gettext-0.10
|
||||
ac_cv_func_catgets=no ac_cv_func_gettext=no ./configure
|
||||
make
|
||||
make install
|
||||
|
||||
After that, return to the libelf build directory, remove
|
||||
config.cache, and start over.
|
||||
|
||||
*** Large File Support (LFS) applications ***
|
||||
|
||||
Some 32-bit systems support files that are larger than the address space
|
||||
of the architecture. On these, the `off_t' data type may have 32 or
|
||||
64 bits, depending on the API you choose. Since off_t is also part of
|
||||
the libelf API, in particular the Elf_Data and Elf_Arhdr structures,
|
||||
an application compiled with large file support will need a version of
|
||||
libelf that has also been compiled with LFS; otherwise, it won't work
|
||||
correctly. Similarly, a program compiled without LFS needs a library
|
||||
compiled without LFS.
|
||||
|
||||
Note that libelf is currently unable to process large files on 32-bit
|
||||
architectures, whether you compile it for LFS or not, for the simple
|
||||
reason that the files won't fit into the processes' address space.
|
||||
Therefore, libelf is compiled without LFS by default. It can of course
|
||||
read and write ELF files for 64-bit architectures, but they will be
|
||||
limited in length on a 32-bit system.
|
||||
|
||||
You may compile libelf with large file support by setting CPPFLAGS at
|
||||
configuration time:
|
||||
|
||||
CPPFLAGS=`getconf LFS_CFLAGS` ./configure
|
||||
|
||||
But I really, really recommend you don't, because it breaks binary
|
||||
compatibility with existing libelf based applications.
|
||||
|
||||
*** 64-bit support ***
|
||||
|
||||
Starting with libelf-0.7.0, libelf also supports 64-bit ELF files.
|
||||
This is enabled by default unless your system (or your compiler) does
|
||||
not support 64-bit integers, or lacks 64-bit declarations in <elf.h>.
|
||||
If you have problems building with 64-bit support, please do
|
||||
|
||||
./configure --disable-elf64
|
||||
|
||||
for the moment, and contact me. Please note that I haven't tested 64-bit
|
||||
support much. There are still some unresolved problems, e.g. IRIX
|
||||
uses different Elf64_Rel and Elf64_Rela structures (they replaced the
|
||||
r_info member), and the enumeration values for Elf_Type differ from
|
||||
the commercial (SVR4) implementation of libelf - they broke binary
|
||||
compatibility for no good reason, and I'm not willing to follow their
|
||||
footsteps. The result is that libelf-0.7.* ist upward compatible with
|
||||
libelf-0.6.4 (as it should be) but INCOMPATIBLE WITH SVR4 LIBELF. If you
|
||||
have both versions installed, you'd better make sure that you link with
|
||||
the library that matches the <libelf.h> you're #include'ing.
|
||||
|
||||
*** Symbol Versioning ***
|
||||
|
||||
Libelf >= 0.8.0 supports the data structures and definitions used for
|
||||
symbol versioning on Solaris and Linux, in particular, the Elfxx_Verdef,
|
||||
Elfxx_Verdaux, Elfxx_Verneed, Elfxx_Vernaux and Elfxx_Versym structures
|
||||
and the SHT_XXX_verdef, SHT_XXX_verneed and SHT_XXX_versym section types
|
||||
(where `xx' is either `32' or `64', and `XXX' is either `SUNW' or `GNU').
|
||||
Libelf now translates versioning sections to/from their external
|
||||
representation properly (earlier versions left them in `raw' format,
|
||||
with the data type set to ELF_T_BYTE). This may cause problems on
|
||||
systems which use the same (OS-specific) section types for different
|
||||
purposes. The configure program tries to figure out if your OS uses
|
||||
versioning; if that check fails, you can use
|
||||
|
||||
./configure --disable-versioning
|
||||
|
||||
to turn off versioning translation support.
|
||||
|
||||
*** W32 Support ***
|
||||
|
||||
There is now some support for building on W32 systems (requires Microsoft
|
||||
VC++). In order to build a W32 DLL, cd into the `lib' subdirectory, edit
|
||||
build.bat if necessary (it needs the path to your compiler binaries) and
|
||||
run it. If you're lucky, libelf.dll and the import/export libraries will
|
||||
be built. If not, please drop me a line.
|
||||
|
||||
I tested it on XP Pro (SP2), using VC++ 2005 Express Edition.
|
||||
Apparently, Visual Studio .NET 2003 works fine as well.
|
||||
|
||||
Various notes regarding the W32 port:
|
||||
|
||||
- When you open() an ELF file, remember to use the O_BINARY flag.
|
||||
- You may have to add /MD to the linker command line.
|
||||
|
||||
*** Missing things ***
|
||||
|
||||
* There is no documentation. You can use the Solaris
|
||||
manpages instead (available at http://docs.sun.com/).
|
||||
The ELF file format is described in several places;
|
||||
among them Suns "Linker and Libraries Guide" and the
|
||||
"System V Application Binary Interface" documents;
|
||||
http://www.caldera.com/developer/devspecs/gabi41.pdf and
|
||||
http://www.caldera.com/developer/gabi/ are probably good
|
||||
starting points. Processor-specific documentation is spread
|
||||
across a number of `Processor Supplement' documents, one
|
||||
for each architecture; you'll have to use a search engine to
|
||||
find them.
|
||||
|
||||
* The COFF file format is not understood. This is so obsolete
|
||||
that it will probably never be implemented.
|
||||
|
||||
* nlist(3) is incomplete; the n_type and n_sclass
|
||||
members of struct nl are set to zero even if type
|
||||
(that is, debug) information is available.
|
||||
|
||||
* Libelf does not translate Solaris' `Move' and `Syminfo'
|
||||
sections. You can read them using elf_getdata(), but you'll
|
||||
only get raw (untranslated) bytes.
|
||||
|
||||
Changes since 0.8.12:
|
||||
|
||||
* New function elf_getaroff().
|
||||
|
||||
* Build fixes.
|
||||
|
||||
Changes since 0.8.11:
|
||||
|
||||
* Due to some unfortunate confusion, the elf_getphnum(),
|
||||
elf_getshnum() and elf_getshstrndx() are not compatible
|
||||
between libelf implementations. Therefore, the developers
|
||||
decided to replace them with new functions: elf_getphdrnum(),
|
||||
elf_getshdrnum() and elf_getshdrstrndx(), which will always
|
||||
return -1 on failure and 0 on success. Code using the old
|
||||
interface should be upgraded to increase portability.
|
||||
|
||||
Changes since 0.8.10:
|
||||
|
||||
* Fixed a bug in elf_rawfile().
|
||||
* If you use ELF_F_LAYOUT together with ELF_F_LAYOUT_OVERLAP,
|
||||
elf_update() will now tolerate overlapping sections.
|
||||
|
||||
Changes since 0.8.9:
|
||||
|
||||
* Ported to QNX Neutrino.
|
||||
* Fixed Windows build errors.
|
||||
* Parallel (make -j) installation should work now.
|
||||
|
||||
* It's now possible to enable and disable select sanity checks
|
||||
libelf performs. Currently, this affects the "NUL terminated
|
||||
string table entry" check performed in elf_strptr(). By
|
||||
default, the function will return an error if the string
|
||||
requested is not properly terminated - because some
|
||||
applications might dump core otherwise. If you configure
|
||||
libelf with `--disable-sanity-checks', however, the check
|
||||
(and, in the future, probably others as well) is disabled
|
||||
by default. You can still turn it on and off at runtime by
|
||||
setting the LIBELF_SANITY_CHECKS environment variable to
|
||||
an integer value:
|
||||
|
||||
# disable all sanity checks
|
||||
export LIBELF_SANITY_CHECKS=0
|
||||
|
||||
# enable all sanity checks
|
||||
export LIBELF_SANITY_CHECKS=-1
|
||||
|
||||
Each bit of the value corresponds to a particular check,
|
||||
so you could use LIBELF_SANITY_CHECKS=1 to enable only
|
||||
the elf_strptr() check. You may also use a value in hex
|
||||
(0x...) or octal (0...) format.
|
||||
|
||||
Changes since 0.8.8:
|
||||
|
||||
* Improved translator for symbol versioning sections.
|
||||
* The W32 library is now built in the `lib' subdirectory.
|
||||
* Windows DLLs should work now.
|
||||
|
||||
Changes since 0.8.6:
|
||||
|
||||
* added elf_getphnum().
|
||||
* added elf_getshnum().
|
||||
* added elf_getshstrndx().
|
||||
* added elfx_update_shstrndx().
|
||||
* handle interrupted reads/writes more gracefully.
|
||||
* added (partial) support for unusual e_[ps]hentsize values.
|
||||
* fixed the bugs introduced in 0.8.7.
|
||||
|
||||
Changes since 0.8.5:
|
||||
|
||||
* added W32 support.
|
||||
* added workaround for alignment errors in archive members.
|
||||
* my email address has changed again ;)
|
||||
|
||||
Changes since 0.8.4:
|
||||
|
||||
* elf_strptr() should now work more safely with fragmented
|
||||
or badly formatted string tables.
|
||||
|
||||
Changes since 0.8.3:
|
||||
|
||||
* Fixed a bug in elf_update() that was introduced in 0.8.3.
|
||||
|
||||
Changes since 0.8.2:
|
||||
|
||||
* Should compile on MacOSX now.
|
||||
|
||||
* Can read and write files with more than 65280 sections
|
||||
|
||||
* Tries to handle 64-bit ELF files that use 8-byte hash table
|
||||
entries. In particular, libelf tries to guess the data type in
|
||||
elf_getdata(), and doesn't override sh_entsize in elf_update()
|
||||
any longer. If you want the library to pick the entry size,
|
||||
you must set its value to 0 before you call elf_update().
|
||||
|
||||
* No longer dumps core in elf_update() when a versioning section
|
||||
has no data. Instead, it returns an error message. Note that
|
||||
you're supposed to provide a valid d_buf for any section, unless
|
||||
it's empty or has SHT_NOBITS type.
|
||||
|
||||
* Building a shared library is now the default (if supported).
|
||||
|
||||
Changes since 0.8.0:
|
||||
|
||||
* Corrected typo in lib/{32,64}.xlatetof.c that sometimes
|
||||
caused a compilation failure.
|
||||
|
||||
* Use open(name, O_RDONLY|O_BINARY) in lib/nlist.c.
|
||||
|
||||
Changes since 0.7.0:
|
||||
|
||||
* I implemented the gelf_* interface, as found on Solaris.
|
||||
I don't know whether it's compatible -- the Solaris manpage
|
||||
isn't very specific, so I had to guess return values etc. in
|
||||
some cases.
|
||||
|
||||
* Added elf{32,64}_checksum (supposed to be compatible with
|
||||
Solaris).
|
||||
|
||||
* Added symbol versioning support.
|
||||
|
||||
Changes since 0.6.4:
|
||||
|
||||
* Fixed configure for IRIX systems
|
||||
* Added check for truncated archive members
|
||||
* Added check for misaligned SHDR/PHDR tables
|
||||
* Support for building libelf together with GNU libc
|
||||
* Added elf_memory(3)
|
||||
* Added 64-bit support
|
||||
|
||||
Changes since 0.5.2:
|
||||
|
||||
* some bug fixes
|
||||
* mmap support
|
||||
* new directory layout
|
||||
* There is a new function, elf_delscn(), that deletes
|
||||
a section from an ELF file. It also adjusts the
|
||||
sh_link and sh_info members in the section header
|
||||
table, if (and ONLY if) the ELF standard indicates
|
||||
that these values are section indices. References
|
||||
to the deleted section will be cleared, so be careful.
|
||||
* my email address has changed ;)
|
||||
|
||||
Where to get libelf:
|
||||
|
||||
ftp://ftp.ibiblio.org/pub/Linux/libs/
|
||||
http://www.mr511.de/software/
|
||||
|
||||
Michael "Tired" Riepe
|
||||
<libelf@mr511.de>
|
|
@ -0,0 +1 @@
|
|||
0.8.13
|
|
@ -0,0 +1,305 @@
|
|||
/*
|
||||
* libelf.h - public header file for libelf.
|
||||
* Copyright (C) 1995 - 2008 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/* @(#) $Id: libelf.h,v 1.29 2009/07/07 17:57:43 michael Exp $ */
|
||||
|
||||
#ifndef _LIBELF_H
|
||||
#define _LIBELF_H
|
||||
|
||||
#include <stddef.h> /* for size_t */
|
||||
#include <sys/types.h>
|
||||
|
||||
#if __LIBELF_INTERNAL__
|
||||
#include <sys_elf.h>
|
||||
#else /* __LIBELF_INTERNAL__ */
|
||||
#include <libelf/sys_elf.h>
|
||||
#endif /* __LIBELF_INTERNAL__ */
|
||||
|
||||
#if defined __GNUC__ && !defined __cplusplus
|
||||
#define DEPRECATED __attribute__((deprecated))
|
||||
#else
|
||||
#define DEPRECATED /* nothing */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef __P
|
||||
# if (__STDC__ + 0) || defined(__cplusplus) || defined(_WIN32)
|
||||
# define __P(args) args
|
||||
# else /* __STDC__ || defined(__cplusplus) */
|
||||
# define __P(args) ()
|
||||
# endif /* __STDC__ || defined(__cplusplus) */
|
||||
#endif /* __P */
|
||||
|
||||
/*
|
||||
* Commands
|
||||
*/
|
||||
typedef enum {
|
||||
ELF_C_NULL = 0, /* must be first, 0 */
|
||||
ELF_C_READ,
|
||||
ELF_C_WRITE,
|
||||
ELF_C_CLR,
|
||||
ELF_C_SET,
|
||||
ELF_C_FDDONE,
|
||||
ELF_C_FDREAD,
|
||||
ELF_C_RDWR,
|
||||
ELF_C_NUM /* must be last */
|
||||
} Elf_Cmd;
|
||||
|
||||
/*
|
||||
* Flags
|
||||
*/
|
||||
#define ELF_F_DIRTY 0x1
|
||||
#define ELF_F_LAYOUT 0x4
|
||||
/*
|
||||
* Allow sections to overlap when ELF_F_LAYOUT is in effect.
|
||||
* Note that this flag ist NOT portable, and that it may render
|
||||
* the output file unusable. Use with extreme caution!
|
||||
*/
|
||||
#define ELF_F_LAYOUT_OVERLAP 0x10000000
|
||||
|
||||
/*
|
||||
* File types
|
||||
*/
|
||||
typedef enum {
|
||||
ELF_K_NONE = 0, /* must be first, 0 */
|
||||
ELF_K_AR,
|
||||
ELF_K_COFF,
|
||||
ELF_K_ELF,
|
||||
ELF_K_NUM /* must be last */
|
||||
} Elf_Kind;
|
||||
|
||||
/*
|
||||
* Data types
|
||||
*/
|
||||
typedef enum {
|
||||
ELF_T_BYTE = 0, /* must be first, 0 */
|
||||
ELF_T_ADDR,
|
||||
ELF_T_DYN,
|
||||
ELF_T_EHDR,
|
||||
ELF_T_HALF,
|
||||
ELF_T_OFF,
|
||||
ELF_T_PHDR,
|
||||
ELF_T_RELA,
|
||||
ELF_T_REL,
|
||||
ELF_T_SHDR,
|
||||
ELF_T_SWORD,
|
||||
ELF_T_SYM,
|
||||
ELF_T_WORD,
|
||||
/*
|
||||
* New stuff for 64-bit.
|
||||
*
|
||||
* Most implementations add ELF_T_SXWORD after ELF_T_SWORD
|
||||
* which breaks binary compatibility with earlier versions.
|
||||
* If this causes problems for you, contact me.
|
||||
*/
|
||||
ELF_T_SXWORD,
|
||||
ELF_T_XWORD,
|
||||
/*
|
||||
* Symbol versioning. Sun broke binary compatibility (again!),
|
||||
* but I won't.
|
||||
*/
|
||||
ELF_T_VDEF,
|
||||
ELF_T_VNEED,
|
||||
ELF_T_NUM /* must be last */
|
||||
} Elf_Type;
|
||||
|
||||
/*
|
||||
* Elf descriptor
|
||||
*/
|
||||
typedef struct Elf Elf;
|
||||
|
||||
/*
|
||||
* Section descriptor
|
||||
*/
|
||||
typedef struct Elf_Scn Elf_Scn;
|
||||
|
||||
/*
|
||||
* Archive member header
|
||||
*/
|
||||
typedef struct {
|
||||
char* ar_name;
|
||||
time_t ar_date;
|
||||
long ar_uid;
|
||||
long ar_gid;
|
||||
unsigned long ar_mode;
|
||||
off_t ar_size;
|
||||
char* ar_rawname;
|
||||
} Elf_Arhdr;
|
||||
|
||||
/*
|
||||
* Archive symbol table
|
||||
*/
|
||||
typedef struct {
|
||||
char* as_name;
|
||||
size_t as_off;
|
||||
unsigned long as_hash;
|
||||
} Elf_Arsym;
|
||||
|
||||
/*
|
||||
* Data descriptor
|
||||
*/
|
||||
typedef struct {
|
||||
void* d_buf;
|
||||
Elf_Type d_type;
|
||||
size_t d_size;
|
||||
off_t d_off;
|
||||
size_t d_align;
|
||||
unsigned d_version;
|
||||
} Elf_Data;
|
||||
|
||||
/*
|
||||
* Function declarations
|
||||
*/
|
||||
extern Elf *elf_begin __P((int __fd, Elf_Cmd __cmd, Elf *__ref));
|
||||
extern Elf *elf_memory __P((char *__image, size_t __size));
|
||||
extern int elf_cntl __P((Elf *__elf, Elf_Cmd __cmd));
|
||||
extern int elf_end __P((Elf *__elf));
|
||||
extern const char *elf_errmsg __P((int __err));
|
||||
extern int elf_errno __P((void));
|
||||
extern void elf_fill __P((int __fill));
|
||||
extern unsigned elf_flagdata __P((Elf_Data *__data, Elf_Cmd __cmd,
|
||||
unsigned __flags));
|
||||
extern unsigned elf_flagehdr __P((Elf *__elf, Elf_Cmd __cmd,
|
||||
unsigned __flags));
|
||||
extern unsigned elf_flagelf __P((Elf *__elf, Elf_Cmd __cmd,
|
||||
unsigned __flags));
|
||||
extern unsigned elf_flagphdr __P((Elf *__elf, Elf_Cmd __cmd,
|
||||
unsigned __flags));
|
||||
extern unsigned elf_flagscn __P((Elf_Scn *__scn, Elf_Cmd __cmd,
|
||||
unsigned __flags));
|
||||
extern unsigned elf_flagshdr __P((Elf_Scn *__scn, Elf_Cmd __cmd,
|
||||
unsigned __flags));
|
||||
extern size_t elf32_fsize __P((Elf_Type __type, size_t __count,
|
||||
unsigned __ver));
|
||||
extern Elf_Arhdr *elf_getarhdr __P((Elf *__elf));
|
||||
extern Elf_Arsym *elf_getarsym __P((Elf *__elf, size_t *__ptr));
|
||||
extern off_t elf_getbase __P((Elf *__elf));
|
||||
extern Elf_Data *elf_getdata __P((Elf_Scn *__scn, Elf_Data *__data));
|
||||
extern Elf32_Ehdr *elf32_getehdr __P((Elf *__elf));
|
||||
extern char *elf_getident __P((Elf *__elf, size_t *__ptr));
|
||||
extern Elf32_Phdr *elf32_getphdr __P((Elf *__elf));
|
||||
extern Elf_Scn *elf_getscn __P((Elf *__elf, size_t __index));
|
||||
extern Elf32_Shdr *elf32_getshdr __P((Elf_Scn *__scn));
|
||||
extern unsigned long elf_hash __P((const unsigned char *__name));
|
||||
extern Elf_Kind elf_kind __P((Elf *__elf));
|
||||
extern size_t elf_ndxscn __P((Elf_Scn *__scn));
|
||||
extern Elf_Data *elf_newdata __P((Elf_Scn *__scn));
|
||||
extern Elf32_Ehdr *elf32_newehdr __P((Elf *__elf));
|
||||
extern Elf32_Phdr *elf32_newphdr __P((Elf *__elf, size_t __count));
|
||||
extern Elf_Scn *elf_newscn __P((Elf *__elf));
|
||||
extern Elf_Cmd elf_next __P((Elf *__elf));
|
||||
extern Elf_Scn *elf_nextscn __P((Elf *__elf, Elf_Scn *__scn));
|
||||
extern size_t elf_rand __P((Elf *__elf, size_t __offset));
|
||||
extern Elf_Data *elf_rawdata __P((Elf_Scn *__scn, Elf_Data *__data));
|
||||
extern char *elf_rawfile __P((Elf *__elf, size_t *__ptr));
|
||||
extern char *elf_strptr __P((Elf *__elf, size_t __section, size_t __offset));
|
||||
extern off_t elf_update __P((Elf *__elf, Elf_Cmd __cmd));
|
||||
extern unsigned elf_version __P((unsigned __ver));
|
||||
extern Elf_Data *elf32_xlatetof __P((Elf_Data *__dst, const Elf_Data *__src,
|
||||
unsigned __encode));
|
||||
extern Elf_Data *elf32_xlatetom __P((Elf_Data *__dst, const Elf_Data *__src,
|
||||
unsigned __encode));
|
||||
|
||||
/*
|
||||
* Additional functions found on Solaris
|
||||
*/
|
||||
extern long elf32_checksum __P((Elf *__elf));
|
||||
|
||||
#if __LIBELF64
|
||||
/*
|
||||
* 64-bit ELF functions
|
||||
* Not available on all platforms
|
||||
*/
|
||||
extern Elf64_Ehdr *elf64_getehdr __P((Elf *__elf));
|
||||
extern Elf64_Ehdr *elf64_newehdr __P((Elf *__elf));
|
||||
extern Elf64_Phdr *elf64_getphdr __P((Elf *__elf));
|
||||
extern Elf64_Phdr *elf64_newphdr __P((Elf *__elf, size_t __count));
|
||||
extern Elf64_Shdr *elf64_getshdr __P((Elf_Scn *__scn));
|
||||
extern size_t elf64_fsize __P((Elf_Type __type, size_t __count,
|
||||
unsigned __ver));
|
||||
extern Elf_Data *elf64_xlatetof __P((Elf_Data *__dst, const Elf_Data *__src,
|
||||
unsigned __encode));
|
||||
extern Elf_Data *elf64_xlatetom __P((Elf_Data *__dst, const Elf_Data *__src,
|
||||
unsigned __encode));
|
||||
|
||||
/*
|
||||
* Additional functions found on Solaris
|
||||
*/
|
||||
extern long elf64_checksum __P((Elf *__elf));
|
||||
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* ELF format extensions
|
||||
*
|
||||
* These functions return 0 on failure, 1 on success. Since other
|
||||
* implementations of libelf may behave differently (there was quite
|
||||
* some confusion about the correct values), they are now officially
|
||||
* deprecated and should be replaced with the three new functions below.
|
||||
*/
|
||||
DEPRECATED extern int elf_getphnum __P((Elf *__elf, size_t *__resultp));
|
||||
DEPRECATED extern int elf_getshnum __P((Elf *__elf, size_t *__resultp));
|
||||
DEPRECATED extern int elf_getshstrndx __P((Elf *__elf, size_t *__resultp));
|
||||
/*
|
||||
* Replacement functions (return -1 on failure, 0 on success).
|
||||
*/
|
||||
extern int elf_getphdrnum __P((Elf *__elf, size_t *__resultp));
|
||||
extern int elf_getshdrnum __P((Elf *__elf, size_t *__resultp));
|
||||
extern int elf_getshdrstrndx __P((Elf *__elf, size_t *__resultp));
|
||||
|
||||
/*
|
||||
* Convenience functions
|
||||
*
|
||||
* elfx_update_shstrndx is elf_getshstrndx's counterpart.
|
||||
* It should be used to set the e_shstrndx member.
|
||||
* There is no update function for e_shnum or e_phnum
|
||||
* because libelf handles them internally.
|
||||
*/
|
||||
extern int elfx_update_shstrndx __P((Elf *__elf, size_t __index));
|
||||
|
||||
/*
|
||||
* Experimental extensions:
|
||||
*
|
||||
* elfx_movscn() moves section `__scn' directly after section `__after'.
|
||||
* elfx_remscn() removes section `__scn'. Both functions update
|
||||
* the section indices; elfx_remscn() also adjusts the ELF header's
|
||||
* e_shnum member. The application is responsible for updating other
|
||||
* data (in particular, e_shstrndx and the section headers' sh_link and
|
||||
* sh_info members).
|
||||
*
|
||||
* elfx_movscn() returns the new index of the moved section.
|
||||
* elfx_remscn() returns the original index of the removed section.
|
||||
* A return value of zero indicates an error.
|
||||
*/
|
||||
extern size_t elfx_movscn __P((Elf *__elf, Elf_Scn *__scn, Elf_Scn *__after));
|
||||
extern size_t elfx_remscn __P((Elf *__elf, Elf_Scn *__scn));
|
||||
|
||||
/*
|
||||
* elf_delscn() is obsolete. Please use elfx_remscn() instead.
|
||||
*/
|
||||
extern size_t elf_delscn __P((Elf *__elf, Elf_Scn *__scn));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _LIBELF_H */
|
|
@ -0,0 +1,996 @@
|
|||
/*
|
||||
* elf_repl.h - public header file for systems that lack it.
|
||||
* Copyright (C) 1995 - 2006 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/* @(#) $Id: elf_repl.h,v 1.22 2009/11/01 13:04:19 michael Exp $ */
|
||||
|
||||
/*
|
||||
* NEVER INCLUDE THIS FILE DIRECTLY - USE <libelf.h> INSTEAD!
|
||||
*/
|
||||
|
||||
#ifndef _ELF_REPL_H
|
||||
#define _ELF_REPL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Scalar data types
|
||||
*/
|
||||
typedef __libelf_u32_t Elf32_Addr;
|
||||
typedef __libelf_u16_t Elf32_Half;
|
||||
typedef __libelf_u32_t Elf32_Off;
|
||||
typedef __libelf_i32_t Elf32_Sword;
|
||||
typedef __libelf_u32_t Elf32_Word;
|
||||
|
||||
#define ELF32_FSZ_ADDR 4
|
||||
#define ELF32_FSZ_HALF 2
|
||||
#define ELF32_FSZ_OFF 4
|
||||
#define ELF32_FSZ_SWORD 4
|
||||
#define ELF32_FSZ_WORD 4
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
typedef __libelf_u64_t Elf64_Addr;
|
||||
typedef __libelf_u16_t Elf64_Half;
|
||||
typedef __libelf_u64_t Elf64_Off;
|
||||
typedef __libelf_i32_t Elf64_Sword;
|
||||
typedef __libelf_u32_t Elf64_Word;
|
||||
typedef __libelf_i64_t Elf64_Sxword;
|
||||
typedef __libelf_u64_t Elf64_Xword;
|
||||
|
||||
#define ELF64_FSZ_ADDR 8
|
||||
#define ELF64_FSZ_HALF 2
|
||||
#define ELF64_FSZ_OFF 8
|
||||
#define ELF64_FSZ_SWORD 4
|
||||
#define ELF64_FSZ_WORD 4
|
||||
#define ELF64_FSZ_SXWORD 8
|
||||
#define ELF64_FSZ_XWORD 8
|
||||
|
||||
/*
|
||||
* Blame Sun for this...
|
||||
*/
|
||||
typedef __libelf_u64_t Elf64_Lword;
|
||||
typedef __libelf_u64_t Elf32_Lword;
|
||||
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* ELF header
|
||||
*/
|
||||
#define EI_NIDENT 16
|
||||
|
||||
typedef struct {
|
||||
unsigned char e_ident[EI_NIDENT];
|
||||
Elf32_Half e_type;
|
||||
Elf32_Half e_machine;
|
||||
Elf32_Word e_version;
|
||||
Elf32_Addr e_entry;
|
||||
Elf32_Off e_phoff;
|
||||
Elf32_Off e_shoff;
|
||||
Elf32_Word e_flags;
|
||||
Elf32_Half e_ehsize;
|
||||
Elf32_Half e_phentsize;
|
||||
Elf32_Half e_phnum;
|
||||
Elf32_Half e_shentsize;
|
||||
Elf32_Half e_shnum;
|
||||
Elf32_Half e_shstrndx;
|
||||
} Elf32_Ehdr;
|
||||
|
||||
#if __LIBELF64
|
||||
typedef struct {
|
||||
unsigned char e_ident[EI_NIDENT];
|
||||
Elf64_Half e_type;
|
||||
Elf64_Half e_machine;
|
||||
Elf64_Word e_version;
|
||||
Elf64_Addr e_entry;
|
||||
Elf64_Off e_phoff;
|
||||
Elf64_Off e_shoff;
|
||||
Elf64_Word e_flags;
|
||||
Elf64_Half e_ehsize;
|
||||
Elf64_Half e_phentsize;
|
||||
Elf64_Half e_phnum;
|
||||
Elf64_Half e_shentsize;
|
||||
Elf64_Half e_shnum;
|
||||
Elf64_Half e_shstrndx;
|
||||
} Elf64_Ehdr;
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* e_ident
|
||||
*/
|
||||
#define EI_MAG0 0
|
||||
#define EI_MAG1 1
|
||||
#define EI_MAG2 2
|
||||
#define EI_MAG3 3
|
||||
#define EI_CLASS 4
|
||||
#define EI_DATA 5
|
||||
#define EI_VERSION 6
|
||||
#define EI_OSABI 7
|
||||
#define EI_ABIVERSION 8
|
||||
#define EI_PAD 9
|
||||
|
||||
#define ELFMAG0 0x7f
|
||||
#define ELFMAG1 'E'
|
||||
#define ELFMAG2 'L'
|
||||
#define ELFMAG3 'F'
|
||||
#define ELFMAG "\177ELF"
|
||||
#define SELFMAG 4
|
||||
|
||||
/*
|
||||
* e_ident[EI_CLASS]
|
||||
*/
|
||||
#define ELFCLASSNONE 0
|
||||
#define ELFCLASS32 1
|
||||
#define ELFCLASS64 2
|
||||
#define ELFCLASSNUM 3
|
||||
|
||||
/*
|
||||
* e_ident[EI_DATA]
|
||||
*/
|
||||
#define ELFDATANONE 0
|
||||
#define ELFDATA2LSB 1
|
||||
#define ELFDATA2MSB 2
|
||||
#define ELFDATANUM 3
|
||||
|
||||
/*
|
||||
* e_ident[EI_OSABI]
|
||||
*/
|
||||
#define ELFOSABI_NONE 0 /* No extensions or unspecified */
|
||||
#define ELFOSABI_SYSV ELFOSABI_NONE
|
||||
#define ELFOSABI_HPUX 1 /* Hewlett-Packard HP-UX */
|
||||
#define ELFOSABI_NETBSD 2 /* NetBSD */
|
||||
#define ELFOSABI_LINUX 3 /* Linux */
|
||||
#define ELFOSABI_SOLARIS 6 /* Sun Solaris */
|
||||
#define ELFOSABI_AIX 7 /* AIX */
|
||||
#define ELFOSABI_IRIX 8 /* IRIX */
|
||||
#define ELFOSABI_FREEBSD 9 /* FreeBSD */
|
||||
#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX */
|
||||
#define ELFOSABI_MODESTO 11 /* Novell Modesto */
|
||||
#define ELFOSABI_OPENBSD 12 /* Open BSD */
|
||||
#define ELFOSABI_OPENVMS 13 /* Open VMS */
|
||||
#define ELFOSABI_NSK 14 /* Hewlett-Packard Non-Stop Kernel */
|
||||
#define ELFOSABI_AROS 15 /* Amiga Research OS */
|
||||
/* these are probably obsolete: */
|
||||
#define ELFOSABI_ARM 97 /* ARM */
|
||||
#define ELFOSABI_STANDALONE 255 /* standalone (embedded) application */
|
||||
|
||||
|
||||
/*
|
||||
* e_type
|
||||
*/
|
||||
#define ET_NONE 0
|
||||
#define ET_REL 1
|
||||
#define ET_EXEC 2
|
||||
#define ET_DYN 3
|
||||
#define ET_CORE 4
|
||||
#define ET_NUM 5
|
||||
#define ET_LOOS 0xfe00
|
||||
#define ET_HIOS 0xfeff
|
||||
#define ET_LOPROC 0xff00
|
||||
#define ET_HIPROC 0xffff
|
||||
|
||||
/*
|
||||
* e_machine
|
||||
*/
|
||||
#define EM_NONE 0 /* No machine */
|
||||
#define EM_M32 1 /* AT&T WE 32100 */
|
||||
#define EM_SPARC 2 /* SPARC */
|
||||
#define EM_386 3 /* Intel 80386 */
|
||||
#define EM_68K 4 /* Motorola 68000 */
|
||||
#define EM_88K 5 /* Motorola 88000 */
|
||||
#define EM_486 6 /* Intel i486 (DO NOT USE THIS ONE) */
|
||||
#define EM_860 7 /* Intel 80860 */
|
||||
#define EM_MIPS 8 /* MIPS I Architecture */
|
||||
#define EM_S370 9 /* IBM System/370 Processor */
|
||||
#define EM_MIPS_RS3_LE 10 /* MIPS RS3000 Little-endian */
|
||||
#define EM_SPARC64 11 /* SPARC 64-bit */
|
||||
#define EM_PARISC 15 /* Hewlett-Packard PA-RISC */
|
||||
#define EM_VPP500 17 /* Fujitsu VPP500 */
|
||||
#define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */
|
||||
#define EM_960 19 /* Intel 80960 */
|
||||
#define EM_PPC 20 /* PowerPC */
|
||||
#define EM_PPC64 21 /* 64-bit PowerPC */
|
||||
#define EM_S390 22 /* IBM System/390 Processor */
|
||||
#define EM_V800 36 /* NEC V800 */
|
||||
#define EM_FR20 37 /* Fujitsu FR20 */
|
||||
#define EM_RH32 38 /* TRW RH-32 */
|
||||
#define EM_RCE 39 /* Motorola RCE */
|
||||
#define EM_ARM 40 /* Advanced RISC Machines ARM */
|
||||
#define EM_ALPHA 41 /* Digital Alpha */
|
||||
#define EM_SH 42 /* Hitachi SH */
|
||||
#define EM_SPARCV9 43 /* SPARC Version 9 */
|
||||
#define EM_TRICORE 44 /* Siemens TriCore embedded processor */
|
||||
#define EM_ARC 45 /* Argonaut RISC Core, Argonaut Technologies Inc. */
|
||||
#define EM_H8_300 46 /* Hitachi H8/300 */
|
||||
#define EM_H8_300H 47 /* Hitachi H8/300H */
|
||||
#define EM_H8S 48 /* Hitachi H8S */
|
||||
#define EM_H8_500 49 /* Hitachi H8/500 */
|
||||
#define EM_IA_64 50 /* Intel IA-64 processor architecture */
|
||||
#define EM_MIPS_X 51 /* Stanford MIPS-X */
|
||||
#define EM_COLDFIRE 52 /* Motorola ColdFire */
|
||||
#define EM_68HC12 53 /* Motorola M68HC12 */
|
||||
#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */
|
||||
#define EM_PCP 55 /* Siemens PCP */
|
||||
#define EM_NCPU 56 /* Sony nCPU embedded RISC processor */
|
||||
#define EM_NDR1 57 /* Denso NDR1 microprocessor */
|
||||
#define EM_STARCORE 58 /* Motorola Star*Core processor */
|
||||
#define EM_ME16 59 /* Toyota ME16 processor */
|
||||
#define EM_ST100 60 /* STMicroelectronics ST100 processor */
|
||||
#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ embedded processor family */
|
||||
#define EM_X86_64 62 /* AMD x86-64 architecture */
|
||||
#define EM_AMD64 EM_X86_64
|
||||
#define EM_PDSP 63 /* Sony DSP Processor */
|
||||
#define EM_FX66 66 /* Siemens FX66 microcontroller */
|
||||
#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */
|
||||
#define EM_ST7 68 /* STMicroelectronics ST7 8-bit microcontroller */
|
||||
#define EM_68HC16 69 /* Motorola MC68HC16 Microcontroller */
|
||||
#define EM_68HC11 70 /* Motorola MC68HC11 Microcontroller */
|
||||
#define EM_68HC08 71 /* Motorola MC68HC08 Microcontroller */
|
||||
#define EM_68HC05 72 /* Motorola MC68HC05 Microcontroller */
|
||||
#define EM_SVX 73 /* Silicon Graphics SVx */
|
||||
#define EM_ST19 74 /* STMicroelectronics ST19 8-bit microcontroller */
|
||||
#define EM_VAX 75 /* Digital VAX */
|
||||
#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
|
||||
#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */
|
||||
#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
|
||||
#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
|
||||
#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */
|
||||
#define EM_HUANY 81 /* Harvard University machine-independent object files */
|
||||
#define EM_PRISM 82 /* SiTera Prism */
|
||||
#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
|
||||
#define EM_FR30 84 /* Fujitsu FR30 */
|
||||
#define EM_D10V 85 /* Mitsubishi D10V */
|
||||
#define EM_D30V 86 /* Mitsubishi D30V */
|
||||
#define EM_V850 87 /* NEC v850 */
|
||||
#define EM_M32R 88 /* Mitsubishi M32R */
|
||||
#define EM_MN10300 89 /* Matsushita MN10300 */
|
||||
#define EM_MN10200 90 /* Matsushita MN10200 */
|
||||
#define EM_PJ 91 /* picoJava */
|
||||
#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
|
||||
#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
|
||||
#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
|
||||
#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */
|
||||
#define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Processor */
|
||||
#define EM_NS32K 97 /* National Semiconductor 32000 series */
|
||||
#define EM_TPC 98 /* Tenor Network TPC processor */
|
||||
#define EM_SNP1K 99 /* Trebia SNP 1000 processor */
|
||||
#define EM_ST200 100 /* STMicroelectronics (www.st.com) ST200 microcontroller */
|
||||
#define EM_IP2K 101 /* Ubicom IP2xxx microcontroller family */
|
||||
#define EM_MAX 102 /* MAX Processor */
|
||||
#define EM_CR 103 /* National Semiconductor CompactRISC microprocessor */
|
||||
#define EM_F2MC16 104 /* Fujitsu F2MC16 */
|
||||
#define EM_MSP430 105 /* Texas Instruments embedded microcontroller msp430 */
|
||||
#define EM_BLACKFIN 106 /* Analog Devices Blackfin (DSP) processor */
|
||||
#define EM_SE_C33 107 /* S1C33 Family of Seiko Epson processors */
|
||||
#define EM_SEP 108 /* Sharp embedded microprocessor */
|
||||
#define EM_ARCA 109 /* Arca RISC Microprocessor */
|
||||
#define EM_UNICORE 110 /* Microprocessor series from PKU-Unity Ltd. and MPRC of Peking University */
|
||||
#define EM_NUM 111
|
||||
|
||||
/*
|
||||
* e_ident[EI_VERSION], e_version
|
||||
*/
|
||||
#define EV_NONE 0
|
||||
#define EV_CURRENT 1
|
||||
#define EV_NUM 2
|
||||
|
||||
/*
|
||||
* Section header
|
||||
*/
|
||||
typedef struct {
|
||||
Elf32_Word sh_name;
|
||||
Elf32_Word sh_type;
|
||||
Elf32_Word sh_flags;
|
||||
Elf32_Addr sh_addr;
|
||||
Elf32_Off sh_offset;
|
||||
Elf32_Word sh_size;
|
||||
Elf32_Word sh_link;
|
||||
Elf32_Word sh_info;
|
||||
Elf32_Word sh_addralign;
|
||||
Elf32_Word sh_entsize;
|
||||
} Elf32_Shdr;
|
||||
|
||||
#if __LIBELF64
|
||||
typedef struct {
|
||||
Elf64_Word sh_name;
|
||||
Elf64_Word sh_type;
|
||||
Elf64_Xword sh_flags;
|
||||
Elf64_Addr sh_addr;
|
||||
Elf64_Off sh_offset;
|
||||
Elf64_Xword sh_size;
|
||||
Elf64_Word sh_link;
|
||||
Elf64_Word sh_info;
|
||||
Elf64_Xword sh_addralign;
|
||||
Elf64_Xword sh_entsize;
|
||||
} Elf64_Shdr;
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Special section indices
|
||||
*/
|
||||
#define SHN_UNDEF 0
|
||||
#define SHN_LORESERVE 0xff00
|
||||
#define SHN_LOPROC 0xff00
|
||||
#define SHN_HIPROC 0xff1f
|
||||
#define SHN_LOOS 0xff20
|
||||
#define SHN_HIOS 0xff3f
|
||||
#define SHN_ABS 0xfff1
|
||||
#define SHN_COMMON 0xfff2
|
||||
#define SHN_XINDEX 0xffff
|
||||
#define SHN_HIRESERVE 0xffff
|
||||
|
||||
/*
|
||||
* sh_type
|
||||
*/
|
||||
#define SHT_NULL 0
|
||||
#define SHT_PROGBITS 1
|
||||
#define SHT_SYMTAB 2
|
||||
#define SHT_STRTAB 3
|
||||
#define SHT_RELA 4
|
||||
#define SHT_HASH 5
|
||||
#define SHT_DYNAMIC 6
|
||||
#define SHT_NOTE 7
|
||||
#define SHT_NOBITS 8
|
||||
#define SHT_REL 9
|
||||
#define SHT_SHLIB 10
|
||||
#define SHT_DYNSYM 11
|
||||
#define SHT_INIT_ARRAY 14
|
||||
#define SHT_FINI_ARRAY 15
|
||||
#define SHT_PREINIT_ARRAY 16
|
||||
#define SHT_GROUP 17
|
||||
#define SHT_SYMTAB_SHNDX 18
|
||||
#define SHT_NUM 19
|
||||
#define SHT_LOOS 0x60000000
|
||||
#define SHT_HIOS 0x6fffffff
|
||||
#define SHT_LOPROC 0x70000000
|
||||
#define SHT_HIPROC 0x7fffffff
|
||||
#define SHT_LOUSER 0x80000000
|
||||
#define SHT_HIUSER 0xffffffff
|
||||
|
||||
/*
|
||||
* Solaris extensions
|
||||
*/
|
||||
#define SHT_LOSUNW 0x6ffffff4
|
||||
#define SHT_SUNW_dof 0x6ffffff4
|
||||
#define SHT_SUNW_cap 0x6ffffff5
|
||||
#define SHT_SUNW_SIGNATURE 0x6ffffff6
|
||||
#define SHT_SUNW_ANNOTATE 0x6ffffff7
|
||||
#define SHT_SUNW_DEBUGSTR 0x6ffffff8
|
||||
#define SHT_SUNW_DEBUG 0x6ffffff9
|
||||
#define SHT_SUNW_move 0x6ffffffa
|
||||
#define SHT_SUNW_COMDAT 0x6ffffffb
|
||||
#define SHT_SUNW_syminfo 0x6ffffffc
|
||||
#define SHT_SUNW_verdef 0x6ffffffd
|
||||
#define SHT_SUNW_verneed 0x6ffffffe
|
||||
#define SHT_SUNW_versym 0x6fffffff
|
||||
#define SHT_HISUNW 0x6fffffff
|
||||
|
||||
#define SHT_SPARC_GOTDATA 0x70000000
|
||||
#define SHT_AMD64_UNWIND 0x70000001
|
||||
|
||||
/*
|
||||
* GNU extensions
|
||||
*/
|
||||
#define SHT_GNU_verdef 0x6ffffffd
|
||||
#define SHT_GNU_verneed 0x6ffffffe
|
||||
#define SHT_GNU_versym 0x6fffffff
|
||||
|
||||
/*
|
||||
* sh_flags
|
||||
*/
|
||||
#define SHF_WRITE 0x1
|
||||
#define SHF_ALLOC 0x2
|
||||
#define SHF_EXECINSTR 0x4
|
||||
#define SHF_MERGE 0x10
|
||||
#define SHF_STRINGS 0x20
|
||||
#define SHF_INFO_LINK 0x40
|
||||
#define SHF_LINK_ORDER 0x80
|
||||
#define SHF_OS_NONCONFORMING 0x100
|
||||
#define SHF_GROUP 0x200
|
||||
#define SHF_TLS 0x400
|
||||
#define SHF_MASKOS 0x0ff00000
|
||||
#define SHF_MASKPROC 0xf0000000
|
||||
|
||||
/*
|
||||
* Solaris extensions
|
||||
*/
|
||||
#define SHF_AMD64_LARGE 0x10000000
|
||||
#define SHF_ORDERED 0x40000000
|
||||
#define SHF_EXCLUDE 0x80000000
|
||||
|
||||
/*
|
||||
* Section group flags
|
||||
*/
|
||||
#define GRP_COMDAT 0x1
|
||||
#define GRP_MASKOS 0x0ff00000
|
||||
#define GRP_MASKPROC 0xf0000000
|
||||
|
||||
/*
|
||||
* Symbol table
|
||||
*/
|
||||
typedef struct {
|
||||
Elf32_Word st_name;
|
||||
Elf32_Addr st_value;
|
||||
Elf32_Word st_size;
|
||||
unsigned char st_info;
|
||||
unsigned char st_other;
|
||||
Elf32_Half st_shndx;
|
||||
} Elf32_Sym;
|
||||
|
||||
#if __LIBELF64
|
||||
typedef struct {
|
||||
Elf64_Word st_name;
|
||||
unsigned char st_info;
|
||||
unsigned char st_other;
|
||||
Elf64_Half st_shndx;
|
||||
Elf64_Addr st_value;
|
||||
Elf64_Xword st_size;
|
||||
} Elf64_Sym;
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Special symbol indices
|
||||
*/
|
||||
#define STN_UNDEF 0
|
||||
|
||||
/*
|
||||
* Macros for manipulating st_info
|
||||
*/
|
||||
#define ELF32_ST_BIND(i) ((i)>>4)
|
||||
#define ELF32_ST_TYPE(i) ((i)&0xf)
|
||||
#define ELF32_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
|
||||
|
||||
#if __LIBELF64
|
||||
#define ELF64_ST_BIND(i) ((i)>>4)
|
||||
#define ELF64_ST_TYPE(i) ((i)&0xf)
|
||||
#define ELF64_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Symbol binding
|
||||
*/
|
||||
#define STB_LOCAL 0
|
||||
#define STB_GLOBAL 1
|
||||
#define STB_WEAK 2
|
||||
#define STB_NUM 3
|
||||
#define STB_LOOS 10
|
||||
#define STB_HIOS 12
|
||||
#define STB_LOPROC 13
|
||||
#define STB_HIPROC 15
|
||||
|
||||
/*
|
||||
* Symbol types
|
||||
*/
|
||||
#define STT_NOTYPE 0
|
||||
#define STT_OBJECT 1
|
||||
#define STT_FUNC 2
|
||||
#define STT_SECTION 3
|
||||
#define STT_FILE 4
|
||||
#define STT_COMMON 5
|
||||
#define STT_TLS 6
|
||||
#define STT_NUM 7
|
||||
#define STT_LOOS 10
|
||||
#define STT_HIOS 12
|
||||
#define STT_LOPROC 13
|
||||
#define STT_HIPROC 15
|
||||
|
||||
/*
|
||||
* Macros for manipulating st_other
|
||||
*/
|
||||
#define ELF32_ST_VISIBILITY(o) ((o)&0x3)
|
||||
#if __LIBELF64
|
||||
#define ELF64_ST_VISIBILITY(o) ((o)&0x3)
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Symbol visibility
|
||||
*/
|
||||
#define STV_DEFAULT 0
|
||||
#define STV_INTERNAL 1
|
||||
#define STV_HIDDEN 2
|
||||
#define STV_PROTECTED 3
|
||||
|
||||
/*
|
||||
* Relocation
|
||||
*/
|
||||
typedef struct {
|
||||
Elf32_Addr r_offset;
|
||||
Elf32_Word r_info;
|
||||
} Elf32_Rel;
|
||||
|
||||
typedef struct {
|
||||
Elf32_Addr r_offset;
|
||||
Elf32_Word r_info;
|
||||
Elf32_Sword r_addend;
|
||||
} Elf32_Rela;
|
||||
|
||||
#if __LIBELF64
|
||||
typedef struct {
|
||||
Elf64_Addr r_offset;
|
||||
Elf64_Xword r_info;
|
||||
} Elf64_Rel;
|
||||
|
||||
typedef struct {
|
||||
Elf64_Addr r_offset;
|
||||
Elf64_Xword r_info;
|
||||
Elf64_Sxword r_addend;
|
||||
} Elf64_Rela;
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Macros for manipulating r_info
|
||||
*/
|
||||
#define ELF32_R_SYM(i) ((i)>>8)
|
||||
#define ELF32_R_TYPE(i) ((unsigned char)(i))
|
||||
#define ELF32_R_INFO(s,t) (((s)<<8)+(unsigned char)(t))
|
||||
|
||||
#if __LIBELF64
|
||||
#define ELF64_R_SYM(i) ((Elf64_Xword)(i)>>32)
|
||||
#define ELF64_R_TYPE(i) ((i)&0xffffffffL)
|
||||
#define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Note entry header
|
||||
*/
|
||||
typedef struct {
|
||||
Elf32_Word n_namesz; /* name size */
|
||||
Elf32_Word n_descsz; /* descriptor size */
|
||||
Elf32_Word n_type; /* descriptor type */
|
||||
} Elf32_Nhdr;
|
||||
|
||||
#if __LIBELF64
|
||||
/* Solaris and GNU use this layout. Be compatible. */
|
||||
/* XXX: Latest ELF specs say it's 64-bit!!! */
|
||||
typedef struct {
|
||||
Elf64_Word n_namesz; /* name size */
|
||||
Elf64_Word n_descsz; /* descriptor size */
|
||||
Elf64_Word n_type; /* descriptor type */
|
||||
} Elf64_Nhdr;
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Well-known descriptor types for ET_CORE files
|
||||
*/
|
||||
#define NT_PRSTATUS 1
|
||||
#define NT_PRFPREG 2
|
||||
#define NT_PRPSINFO 3
|
||||
|
||||
/*
|
||||
* Program header
|
||||
*/
|
||||
typedef struct {
|
||||
Elf32_Word p_type;
|
||||
Elf32_Off p_offset;
|
||||
Elf32_Addr p_vaddr;
|
||||
Elf32_Addr p_paddr;
|
||||
Elf32_Word p_filesz;
|
||||
Elf32_Word p_memsz;
|
||||
Elf32_Word p_flags;
|
||||
Elf32_Word p_align;
|
||||
} Elf32_Phdr;
|
||||
|
||||
#if __LIBELF64
|
||||
typedef struct {
|
||||
Elf64_Word p_type;
|
||||
Elf64_Word p_flags;
|
||||
Elf64_Off p_offset;
|
||||
Elf64_Addr p_vaddr;
|
||||
Elf64_Addr p_paddr;
|
||||
Elf64_Xword p_filesz;
|
||||
Elf64_Xword p_memsz;
|
||||
Elf64_Xword p_align;
|
||||
} Elf64_Phdr;
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Special numbers
|
||||
*/
|
||||
#define PN_XNUM 0xffff
|
||||
|
||||
/*
|
||||
* p_type
|
||||
*/
|
||||
#define PT_NULL 0
|
||||
#define PT_LOAD 1
|
||||
#define PT_DYNAMIC 2
|
||||
#define PT_INTERP 3
|
||||
#define PT_NOTE 4
|
||||
#define PT_SHLIB 5
|
||||
#define PT_PHDR 6
|
||||
#define PT_TLS 7
|
||||
#define PT_NUM 8
|
||||
#define PT_LOOS 0x60000000
|
||||
#define PT_HIOS 0x6fffffff
|
||||
#define PT_LOPROC 0x70000000
|
||||
#define PT_HIPROC 0x7fffffff
|
||||
|
||||
/*
|
||||
* Solaris extensions
|
||||
*/
|
||||
|
||||
#define PT_SUNW_UNWIND 0x6464e550
|
||||
#define PT_LOSUNW 0x6ffffffa
|
||||
#define PT_SUNWBSS 0x6ffffffa
|
||||
#define PT_SUNWSTACK 0x6ffffffb
|
||||
#define PT_SUNWDTRACE 0x6ffffffc
|
||||
#define PT_SUNWCAP 0x6ffffffd
|
||||
#define PT_HISUNW 0x6fffffff
|
||||
|
||||
/*
|
||||
* p_flags
|
||||
*/
|
||||
#define PF_X 0x1
|
||||
#define PF_W 0x2
|
||||
#define PF_R 0x4
|
||||
#define PF_MASKOS 0x0ff00000
|
||||
#define PF_MASKPROC 0xf0000000
|
||||
|
||||
/*
|
||||
* Dynamic structure
|
||||
*/
|
||||
typedef struct {
|
||||
Elf32_Sword d_tag;
|
||||
union {
|
||||
Elf32_Word d_val;
|
||||
Elf32_Addr d_ptr;
|
||||
} d_un;
|
||||
} Elf32_Dyn;
|
||||
|
||||
#if __LIBELF64
|
||||
typedef struct {
|
||||
Elf64_Sxword d_tag;
|
||||
union {
|
||||
Elf64_Xword d_val;
|
||||
Elf64_Addr d_ptr;
|
||||
} d_un;
|
||||
} Elf64_Dyn;
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Dynamic array tags
|
||||
*/
|
||||
/* d_un exec shared */
|
||||
#define DT_NULL 0 /* ign. mand. mand. */
|
||||
#define DT_NEEDED 1 /* d_val opt. opt. */
|
||||
#define DT_PLTRELSZ 2 /* d_val opt. opt. */
|
||||
#define DT_PLTGOT 3 /* d_ptr opt. opt. */
|
||||
#define DT_HASH 4 /* d_ptr mand. mand. */
|
||||
#define DT_STRTAB 5 /* d_ptr mand. mand. */
|
||||
#define DT_SYMTAB 6 /* d_ptr mand. mand. */
|
||||
#define DT_RELA 7 /* d_ptr mand. opt. */
|
||||
#define DT_RELASZ 8 /* d_val mand. opt. */
|
||||
#define DT_RELAENT 9 /* d_val mand. opt. */
|
||||
#define DT_STRSZ 10 /* d_val mand. mand. */
|
||||
#define DT_SYMENT 11 /* d_val mand. mand. */
|
||||
#define DT_INIT 12 /* d_ptr opt. opt. */
|
||||
#define DT_FINI 13 /* d_ptr opt. opt. */
|
||||
#define DT_SONAME 14 /* d_val ign. opt. */
|
||||
#define DT_RPATH 15 /* d_val opt. ign. */
|
||||
#define DT_SYMBOLIC 16 /* ign. ign. opt. */
|
||||
#define DT_REL 17 /* d_ptr mand. opt. */
|
||||
#define DT_RELSZ 18 /* d_val mand. opt. */
|
||||
#define DT_RELENT 19 /* d_val mand. opt. */
|
||||
#define DT_PLTREL 20 /* d_val opt. opt. */
|
||||
#define DT_DEBUG 21 /* d_ptr opt. ign. */
|
||||
#define DT_TEXTREL 22 /* ign. opt. opt. */
|
||||
#define DT_JMPREL 23 /* d_ptr opt. opt. */
|
||||
#define DT_BIND_NOW 24 /* ign. opt. opt. */
|
||||
#define DT_INIT_ARRAY 25 /* d_ptr opt. opt. */
|
||||
#define DT_FINI_ARRAY 26 /* d_ptr opt. opt. */
|
||||
#define DT_INIT_ARRAYSZ 27 /* d_val opt. opt. */
|
||||
#define DT_FINI_ARRAYSZ 28 /* d_val opt. opt. */
|
||||
#define DT_RUNPATH 29 /* d_val opt. opt. */
|
||||
#define DT_FLAGS 30 /* d_val opt. opt. */
|
||||
#define DT_ENCODING 32 /* odd/even encoding rule starts here */
|
||||
#define DT_PREINIT_ARRAY 32 /* d_ptr opt. ign. */
|
||||
#define DT_PREINIT_ARRAYSZ 33 /* d_val opt. ign. */
|
||||
#define DT_NUM 34
|
||||
#define DT_LOOS 0x6000000D
|
||||
#define DT_HIOS 0x6ffff000
|
||||
#define DT_LOPROC 0x70000000
|
||||
#define DT_HIPROC 0x7fffffff
|
||||
|
||||
/*
|
||||
* DT_FLAGS values
|
||||
*/
|
||||
#define DF_ORIGIN 0x1
|
||||
#define DF_SYMBOLIC 0x2
|
||||
#define DF_TEXTREL 0x4
|
||||
#define DF_BIND_NOW 0x8
|
||||
#define DF_STATIC_TLS 0x10
|
||||
|
||||
/*
|
||||
* Solaris extensions
|
||||
*/
|
||||
#define DT_VALRNGLO 0x6ffffd00
|
||||
#define DT_CHECKSUM 0x6ffffdf8
|
||||
#define DT_PLTPADSZ 0x6ffffdf9
|
||||
#define DT_MOVEENT 0x6ffffdfa
|
||||
#define DT_MOVESZ 0x6ffffdfb
|
||||
#define DT_FEATURE_1 0x6ffffdfc
|
||||
#define DT_POSFLAG_1 0x6ffffdfd
|
||||
#define DT_SYMINSZ 0x6ffffdfe
|
||||
#define DT_SYMINENT 0x6ffffdff
|
||||
#define DT_VALRNGHI 0x6ffffdff
|
||||
|
||||
#define DT_ADDRRNGLO 0x6ffffe00
|
||||
#define DT_CONFIG 0x6ffffefa
|
||||
#define DT_DEPAUDIT 0x6ffffefb
|
||||
#define DT_AUDIT 0x6ffffefc
|
||||
#define DT_PLTPAD 0x6ffffefd
|
||||
#define DT_MOVETAB 0x6ffffefe
|
||||
#define DT_SYMINFO 0x6ffffeff
|
||||
#define DT_ADDRRNGHI 0x6ffffeff
|
||||
|
||||
#define DT_RELACOUNT 0x6ffffff9
|
||||
#define DT_RELCOUNT 0x6ffffffa
|
||||
#define DT_FLAGS_1 0x6ffffffb
|
||||
#define DT_VERDEF 0x6ffffffc
|
||||
#define DT_VERDEFNUM 0x6ffffffd
|
||||
#define DT_VERNEED 0x6ffffffe
|
||||
#define DT_VERNEEDNUM 0x6fffffff
|
||||
|
||||
#define DT_AUXILIARY 0x7ffffffd
|
||||
#define DT_USED 0x7ffffffe
|
||||
#define DT_FILTER 0x7fffffff
|
||||
|
||||
/*
|
||||
* GNU extensions
|
||||
*/
|
||||
#define DT_VERSYM 0x6ffffff0
|
||||
|
||||
/*
|
||||
* DT_FEATURE_1 values
|
||||
*/
|
||||
#define DTF_1_PARINIT 0x1
|
||||
#define DTF_1_CONFEXP 0x2
|
||||
|
||||
/*
|
||||
* DT_POSFLAG_1 values
|
||||
*/
|
||||
#define DF_P1_LAZYLOAD 0x1
|
||||
#define DF_P1_GROUPPERM 0x2
|
||||
|
||||
/*
|
||||
* DT_FLAGS_1 values
|
||||
*/
|
||||
#define DF_1_NOW 0x00000001
|
||||
#define DF_1_GLOBAL 0x00000002
|
||||
#define DF_1_GROUP 0x00000004
|
||||
#define DF_1_NODELETE 0x00000008
|
||||
#define DF_1_LOADFLTR 0x00000010
|
||||
#define DF_1_INITFIRST 0x00000020
|
||||
#define DF_1_NOOPEN 0x00000040
|
||||
#define DF_1_ORIGIN 0x00000080
|
||||
#define DF_1_DIRECT 0x00000100
|
||||
#define DF_1_TRANS 0x00000200
|
||||
#define DF_1_INTERPOSE 0x00000400
|
||||
#define DF_1_NODEFLIB 0x00000800
|
||||
#define DF_1_NODUMP 0x00001000
|
||||
#define DF_1_CONFALT 0x00002000
|
||||
#define DF_1_ENDFILTEE 0x00004000
|
||||
#define DF_1_DISPRELDNE 0x00008000
|
||||
#define DF_1_DISPRELPND 0x00010000
|
||||
|
||||
/*
|
||||
* Syminfo structure
|
||||
*/
|
||||
typedef struct {
|
||||
Elf32_Half si_boundto;
|
||||
Elf32_Half si_flags;
|
||||
} Elf32_Syminfo;
|
||||
|
||||
#if __LIBELF64
|
||||
typedef struct {
|
||||
Elf64_Half si_boundto;
|
||||
Elf64_Half si_flags;
|
||||
} Elf64_Syminfo;
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Syminfo version (stored in unused first entry)
|
||||
*/
|
||||
#define SYMINFO_NONE 0
|
||||
#define SYMINFO_CURRENT 1
|
||||
#define SYMINFO_NUM 2
|
||||
|
||||
/*
|
||||
* si_boundto special values
|
||||
*/
|
||||
#define SYMINFO_BT_LOWRESERVE 0xff00
|
||||
#define SYMINFO_BT_PARENT 0xfffe /* bound to parent */
|
||||
#define SYMINFO_BT_SELF 0xffff /* bound to self */
|
||||
|
||||
/*
|
||||
* si_flags
|
||||
*/
|
||||
#define SYMINFO_FLG_DIRECT 0x01 /* bound to an object */
|
||||
#define SYMINFO_FLG_PASSTHRU 0x02 /* pass-thru symbol */
|
||||
#define SYMINFO_FLG_COPY 0x04 /* result of a copy relocation */
|
||||
#define SYMINFO_FLG_LAZYLOAD 0x08 /* bound to lazy-loaded object */
|
||||
|
||||
/*
|
||||
* Version definitions
|
||||
*/
|
||||
typedef struct {
|
||||
Elf32_Half vd_version;
|
||||
Elf32_Half vd_flags;
|
||||
Elf32_Half vd_ndx;
|
||||
Elf32_Half vd_cnt;
|
||||
Elf32_Word vd_hash;
|
||||
Elf32_Word vd_aux;
|
||||
Elf32_Word vd_next;
|
||||
} Elf32_Verdef;
|
||||
|
||||
typedef struct {
|
||||
Elf32_Word vda_name;
|
||||
Elf32_Word vda_next;
|
||||
} Elf32_Verdaux;
|
||||
|
||||
typedef struct {
|
||||
Elf32_Half vn_version;
|
||||
Elf32_Half vn_cnt;
|
||||
Elf32_Word vn_file;
|
||||
Elf32_Word vn_aux;
|
||||
Elf32_Word vn_next;
|
||||
} Elf32_Verneed;
|
||||
|
||||
typedef struct {
|
||||
Elf32_Word vna_hash;
|
||||
Elf32_Half vna_flags;
|
||||
Elf32_Half vna_other;
|
||||
Elf32_Word vna_name;
|
||||
Elf32_Word vna_next;
|
||||
} Elf32_Vernaux;
|
||||
|
||||
typedef Elf32_Half Elf32_Versym;
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
typedef struct {
|
||||
Elf64_Half vd_version;
|
||||
Elf64_Half vd_flags;
|
||||
Elf64_Half vd_ndx;
|
||||
Elf64_Half vd_cnt;
|
||||
Elf64_Word vd_hash;
|
||||
Elf64_Word vd_aux;
|
||||
Elf64_Word vd_next;
|
||||
} Elf64_Verdef;
|
||||
|
||||
typedef struct {
|
||||
Elf64_Word vda_name;
|
||||
Elf64_Word vda_next;
|
||||
} Elf64_Verdaux;
|
||||
|
||||
typedef struct {
|
||||
Elf64_Half vn_version;
|
||||
Elf64_Half vn_cnt;
|
||||
Elf64_Word vn_file;
|
||||
Elf64_Word vn_aux;
|
||||
Elf64_Word vn_next;
|
||||
} Elf64_Verneed;
|
||||
|
||||
typedef struct {
|
||||
Elf64_Word vna_hash;
|
||||
Elf64_Half vna_flags;
|
||||
Elf64_Half vna_other;
|
||||
Elf64_Word vna_name;
|
||||
Elf64_Word vna_next;
|
||||
} Elf64_Vernaux;
|
||||
|
||||
typedef Elf64_Half Elf64_Versym;
|
||||
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* vd_version
|
||||
*/
|
||||
#define VER_DEF_NONE 0
|
||||
#define VER_DEF_CURRENT 1
|
||||
#define VER_DEF_NUM 2
|
||||
|
||||
/*
|
||||
* vn_version
|
||||
*/
|
||||
#define VER_NEED_NONE 0
|
||||
#define VER_NEED_CURRENT 1
|
||||
#define VER_NEED_NUM 2
|
||||
|
||||
/*
|
||||
* vd_flags / vna_flags
|
||||
*/
|
||||
#define VER_FLG_BASE 0x1 /* vd_flags only */
|
||||
#define VER_FLG_WEAK 0x2
|
||||
|
||||
/*
|
||||
* Elf*_Versym special values
|
||||
*/
|
||||
#define VER_NDX_LOCAL 0
|
||||
#define VER_NDX_GLOBAL 1
|
||||
|
||||
/*
|
||||
* Solaris extensions
|
||||
*/
|
||||
|
||||
/*
|
||||
* Move section
|
||||
*/
|
||||
#if __LIBELF64
|
||||
|
||||
typedef struct {
|
||||
Elf32_Lword m_value;
|
||||
Elf32_Word m_info;
|
||||
Elf32_Word m_poffset;
|
||||
Elf32_Half m_repeat;
|
||||
Elf32_Half m_stride;
|
||||
} Elf32_Move;
|
||||
|
||||
typedef struct {
|
||||
Elf64_Lword m_value;
|
||||
Elf64_Xword m_info;
|
||||
Elf64_Xword m_poffset;
|
||||
Elf64_Half m_repeat;
|
||||
Elf64_Half m_stride;
|
||||
} Elf64_Move;
|
||||
|
||||
#define ELF32_M_SYM(info) ((info)>>8)
|
||||
#define ELF32_M_SIZE(info) ((unsigned char)(info))
|
||||
#define ELF32_M_INFO(sym, sz) (((sym)<<8)+(unsigned char)(sz))
|
||||
|
||||
#define ELF64_M_SYM(info) ((Elf64_Xword)(info)>>8)
|
||||
#define ELF64_M_SIZE(info) ((unsigned char)(info))
|
||||
#define ELF64_M_INFO(sym, sz) (((Elf64_Xword)(sym)<<8)+(unsigned char)(sz))
|
||||
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
/*
|
||||
* Capabilities
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
Elf32_Word c_tag;
|
||||
union {
|
||||
Elf32_Word c_val;
|
||||
Elf32_Addr c_ptr;
|
||||
} c_un;
|
||||
} Elf32_Cap;
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
typedef struct {
|
||||
Elf64_Xword c_tag;
|
||||
union {
|
||||
Elf64_Xword c_val;
|
||||
Elf64_Addr c_ptr;
|
||||
} c_un;
|
||||
} Elf64_Cap;
|
||||
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
#define CA_SUNW_NULL 0 /* c_un ignored */
|
||||
#define CA_SUNW_HW_1 1 /* c_un.c_val */
|
||||
#define CA_SUNW_SF_1 2 /* c_un.c_val */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _ELF_REPL_H */
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
* lib/sys_elf.h.w32 - internal configuration file for W32 port
|
||||
* Copyright (C) 2004 - 2006 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* @(#) $Id: sys_elf.h.w32,v 1.2 2006/09/07 15:55:42 michael Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* DO NOT USE THIS IN APPLICATIONS - #include <libelf.h> INSTEAD!
|
||||
*/
|
||||
|
||||
/* Define to `<elf.h>' or `<sys/elf.h>' if one of them is present */
|
||||
#undef __LIBELF_HEADER_ELF_H
|
||||
|
||||
/* Define if Elf32_Dyn is declared in <link.h> */
|
||||
#undef __LIBELF_NEED_LINK_H
|
||||
|
||||
/* Define if Elf32_Dyn is declared in <sys/link.h> */
|
||||
#undef __LIBELF_NEED_SYS_LINK_H
|
||||
|
||||
/* Define if you want 64-bit support (and your system supports it) */
|
||||
#define __LIBELF64 1
|
||||
|
||||
/* Define if you want 64-bit support, and are running IRIX */
|
||||
#undef __LIBELF64_IRIX
|
||||
|
||||
/* Define if you want 64-bit support, and are running Linux */
|
||||
#undef __LIBELF64_LINUX
|
||||
|
||||
/* Define if you want symbol versioning (and your system supports it) */
|
||||
#define __LIBELF_SYMBOL_VERSIONS 1
|
||||
|
||||
/* Define to a 64-bit signed integer type if one exists */
|
||||
#define __libelf_i64_t __int64
|
||||
|
||||
/* Define to a 64-bit unsigned integer type if one exists */
|
||||
#define __libelf_u64_t unsigned __int64
|
||||
|
||||
/* Define to a 32-bit signed integer type if one exists */
|
||||
#define __libelf_i32_t int
|
||||
|
||||
/* Define to a 32-bit unsigned integer type if one exists */
|
||||
#define __libelf_u32_t unsigned int
|
||||
|
||||
/* Define to a 16-bit signed integer type if one exists */
|
||||
#define __libelf_i16_t short int
|
||||
|
||||
/* Define to a 16-bit unsigned integer type if one exists */
|
||||
#define __libelf_u16_t unsigned short int
|
||||
|
||||
/*
|
||||
* Ok, now get the correct instance of elf.h...
|
||||
*/
|
||||
#ifdef __LIBELF_HEADER_ELF_H
|
||||
# include __LIBELF_HEADER_ELF_H
|
||||
#else /* __LIBELF_HEADER_ELF_H */
|
||||
# if __LIBELF_INTERNAL__
|
||||
# include <elf_repl.h>
|
||||
# else /* __LIBELF_INTERNAL__ */
|
||||
# include <libelf/elf_repl.h>
|
||||
# endif /* __LIBELF_INTERNAL__ */
|
||||
#endif /* __LIBELF_HEADER_ELF_H */
|
||||
|
||||
/*
|
||||
* On some systems, <elf.h> is severely broken. Try to fix it.
|
||||
*/
|
||||
#ifdef __LIBELF_HEADER_ELF_H
|
||||
|
||||
# ifndef ELF32_FSZ_ADDR
|
||||
# define ELF32_FSZ_ADDR 4
|
||||
# define ELF32_FSZ_HALF 2
|
||||
# define ELF32_FSZ_OFF 4
|
||||
# define ELF32_FSZ_SWORD 4
|
||||
# define ELF32_FSZ_WORD 4
|
||||
# endif /* ELF32_FSZ_ADDR */
|
||||
|
||||
# ifndef STN_UNDEF
|
||||
# define STN_UNDEF 0
|
||||
# endif /* STN_UNDEF */
|
||||
|
||||
# if __LIBELF64
|
||||
|
||||
# ifndef ELF64_FSZ_ADDR
|
||||
# define ELF64_FSZ_ADDR 8
|
||||
# define ELF64_FSZ_HALF 2
|
||||
# define ELF64_FSZ_OFF 8
|
||||
# define ELF64_FSZ_SWORD 4
|
||||
# define ELF64_FSZ_WORD 4
|
||||
# define ELF64_FSZ_SXWORD 8
|
||||
# define ELF64_FSZ_XWORD 8
|
||||
# endif /* ELF64_FSZ_ADDR */
|
||||
|
||||
# ifndef ELF64_ST_BIND
|
||||
# define ELF64_ST_BIND(i) ((i)>>4)
|
||||
# define ELF64_ST_TYPE(i) ((i)&0xf)
|
||||
# define ELF64_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
|
||||
# endif /* ELF64_ST_BIND */
|
||||
|
||||
# ifndef ELF64_R_SYM
|
||||
# define ELF64_R_SYM(i) ((Elf64_Xword)(i)>>32)
|
||||
# define ELF64_R_TYPE(i) ((i)&0xffffffffL)
|
||||
# define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
|
||||
# endif /* ELF64_R_SYM */
|
||||
|
||||
# if __LIBELF64_LINUX
|
||||
typedef __libelf_u64_t Elf64_Addr;
|
||||
typedef __libelf_u16_t Elf64_Half;
|
||||
typedef __libelf_u64_t Elf64_Off;
|
||||
typedef __libelf_i32_t Elf64_Sword;
|
||||
typedef __libelf_u32_t Elf64_Word;
|
||||
typedef __libelf_i64_t Elf64_Sxword;
|
||||
typedef __libelf_u64_t Elf64_Xword;
|
||||
# endif /* __LIBELF64_LINUX */
|
||||
|
||||
# endif /* __LIBELF64 */
|
||||
#endif /* __LIBELF_HEADER_ELF_H */
|
|
@ -0,0 +1,222 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\32.fsize.c" />
|
||||
<ClCompile Include="src\32.getehdr.c" />
|
||||
<ClCompile Include="src\32.getphdr.c" />
|
||||
<ClCompile Include="src\32.getshdr.c" />
|
||||
<ClCompile Include="src\32.newehdr.c" />
|
||||
<ClCompile Include="src\32.newphdr.c" />
|
||||
<ClCompile Include="src\32.xlatetof.c" />
|
||||
<ClCompile Include="src\64.xlatetof.c" />
|
||||
<ClCompile Include="src\assert.c" />
|
||||
<ClCompile Include="src\begin.c" />
|
||||
<ClCompile Include="src\checksum.c" />
|
||||
<ClCompile Include="src\cntl.c" />
|
||||
<ClCompile Include="src\cook.c" />
|
||||
<ClCompile Include="src\data.c" />
|
||||
<ClCompile Include="src\end.c" />
|
||||
<ClCompile Include="src\errmsg.c" />
|
||||
<ClCompile Include="src\errno.c" />
|
||||
<ClCompile Include="src\fill.c" />
|
||||
<ClCompile Include="src\flag.c" />
|
||||
<ClCompile Include="src\gelfehdr.c" />
|
||||
<ClCompile Include="src\gelfphdr.c" />
|
||||
<ClCompile Include="src\gelfshdr.c" />
|
||||
<ClCompile Include="src\gelftrans.c" />
|
||||
<ClCompile Include="src\getarhdr.c" />
|
||||
<ClCompile Include="src\getaroff.c" />
|
||||
<ClCompile Include="src\getarsym.c" />
|
||||
<ClCompile Include="src\getbase.c" />
|
||||
<ClCompile Include="src\getdata.c" />
|
||||
<ClCompile Include="src\getident.c" />
|
||||
<ClCompile Include="src\getscn.c" />
|
||||
<ClCompile Include="src\hash.c" />
|
||||
<ClCompile Include="src\input.c" />
|
||||
<ClCompile Include="src\kind.c" />
|
||||
<ClCompile Include="src\memset.c" />
|
||||
<ClCompile Include="src\ndxscn.c" />
|
||||
<ClCompile Include="src\newdata.c" />
|
||||
<ClCompile Include="src\newscn.c" />
|
||||
<ClCompile Include="src\next.c" />
|
||||
<ClCompile Include="src\nextscn.c" />
|
||||
<ClCompile Include="src\nlist.c" />
|
||||
<ClCompile Include="src\opt.delscn.c" />
|
||||
<ClCompile Include="src\rand.c" />
|
||||
<ClCompile Include="src\rawdata.c" />
|
||||
<ClCompile Include="src\rawfile.c" />
|
||||
<ClCompile Include="src\strptr.c" />
|
||||
<ClCompile Include="src\swap64.c" />
|
||||
<ClCompile Include="src\update.c" />
|
||||
<ClCompile Include="src\verdef_32_tof.c" />
|
||||
<ClCompile Include="src\verdef_32_tom.c" />
|
||||
<ClCompile Include="src\verdef_64_tof.c" />
|
||||
<ClCompile Include="src\verdef_64_tom.c" />
|
||||
<ClCompile Include="src\version.c" />
|
||||
<ClCompile Include="src\x.elfext.c" />
|
||||
<ClCompile Include="src\x.movscn.c" />
|
||||
<ClCompile Include="src\x.remscn.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\libelf.h" />
|
||||
<ClInclude Include="include\libelf\elf_repl.h" />
|
||||
<ClInclude Include="include\libelf\sys_elf.h" />
|
||||
<ClInclude Include="src\byteswap.h" />
|
||||
<ClInclude Include="src\config.h" />
|
||||
<ClInclude Include="src\errors.h" />
|
||||
<ClInclude Include="src\ext_types.h" />
|
||||
<ClInclude Include="src\gelf.h" />
|
||||
<ClInclude Include="src\nlist.h" />
|
||||
<ClInclude Include="src\private.h" />
|
||||
<ClInclude Include="src\verdef.h" />
|
||||
<ClInclude Include="src\verneed.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{a2d07885-a0d1-473b-83b2-209cd008ee8f}</ProjectGuid>
|
||||
<RootNamespace>libelf</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>libelf</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>include;include\libelf;src</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4244;4267;4311</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>include;include\libelf;src</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4244;4267;4311</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_CONFIG_H=1;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>include;include\libelf;src</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4244;4267;4311</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_CONFIG_H=1;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>include;include\libelf;src</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4244;4267;4311</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\32.fsize.c" />
|
||||
<ClCompile Include="src\32.getehdr.c" />
|
||||
<ClCompile Include="src\32.getphdr.c" />
|
||||
<ClCompile Include="src\32.getshdr.c" />
|
||||
<ClCompile Include="src\32.newehdr.c" />
|
||||
<ClCompile Include="src\32.newphdr.c" />
|
||||
<ClCompile Include="src\32.xlatetof.c" />
|
||||
<ClCompile Include="src\64.xlatetof.c" />
|
||||
<ClCompile Include="src\assert.c" />
|
||||
<ClCompile Include="src\begin.c" />
|
||||
<ClCompile Include="src\checksum.c" />
|
||||
<ClCompile Include="src\cntl.c" />
|
||||
<ClCompile Include="src\cook.c" />
|
||||
<ClCompile Include="src\data.c" />
|
||||
<ClCompile Include="src\end.c" />
|
||||
<ClCompile Include="src\errmsg.c" />
|
||||
<ClCompile Include="src\errno.c" />
|
||||
<ClCompile Include="src\fill.c" />
|
||||
<ClCompile Include="src\flag.c" />
|
||||
<ClCompile Include="src\gelfehdr.c" />
|
||||
<ClCompile Include="src\gelfphdr.c" />
|
||||
<ClCompile Include="src\gelfshdr.c" />
|
||||
<ClCompile Include="src\gelftrans.c" />
|
||||
<ClCompile Include="src\getarhdr.c" />
|
||||
<ClCompile Include="src\getaroff.c" />
|
||||
<ClCompile Include="src\getarsym.c" />
|
||||
<ClCompile Include="src\getbase.c" />
|
||||
<ClCompile Include="src\getdata.c" />
|
||||
<ClCompile Include="src\getident.c" />
|
||||
<ClCompile Include="src\getscn.c" />
|
||||
<ClCompile Include="src\hash.c" />
|
||||
<ClCompile Include="src\input.c" />
|
||||
<ClCompile Include="src\kind.c" />
|
||||
<ClCompile Include="src\memset.c" />
|
||||
<ClCompile Include="src\ndxscn.c" />
|
||||
<ClCompile Include="src\newdata.c" />
|
||||
<ClCompile Include="src\newscn.c" />
|
||||
<ClCompile Include="src\next.c" />
|
||||
<ClCompile Include="src\nextscn.c" />
|
||||
<ClCompile Include="src\nlist.c" />
|
||||
<ClCompile Include="src\opt.delscn.c" />
|
||||
<ClCompile Include="src\rand.c" />
|
||||
<ClCompile Include="src\rawdata.c" />
|
||||
<ClCompile Include="src\rawfile.c" />
|
||||
<ClCompile Include="src\strptr.c" />
|
||||
<ClCompile Include="src\swap64.c" />
|
||||
<ClCompile Include="src\update.c" />
|
||||
<ClCompile Include="src\verdef_32_tof.c" />
|
||||
<ClCompile Include="src\verdef_32_tom.c" />
|
||||
<ClCompile Include="src\verdef_64_tof.c" />
|
||||
<ClCompile Include="src\verdef_64_tom.c" />
|
||||
<ClCompile Include="src\version.c" />
|
||||
<ClCompile Include="src\x.elfext.c" />
|
||||
<ClCompile Include="src\x.movscn.c" />
|
||||
<ClCompile Include="src\x.remscn.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\byteswap.h" />
|
||||
<ClInclude Include="src\config.h" />
|
||||
<ClInclude Include="src\errors.h" />
|
||||
<ClInclude Include="src\ext_types.h" />
|
||||
<ClInclude Include="src\gelf.h" />
|
||||
<ClInclude Include="src\nlist.h" />
|
||||
<ClInclude Include="src\private.h" />
|
||||
<ClInclude Include="src\verdef.h" />
|
||||
<ClInclude Include="src\verneed.h" />
|
||||
<ClInclude Include="include\libelf\elf_repl.h" />
|
||||
<ClInclude Include="include\libelf\sys_elf.h" />
|
||||
<ClInclude Include="include\libelf.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
32.fsize.c - implementation of the elf{32,64}_fsize(3) functions.
|
||||
Copyright (C) 1995 - 2001 Michael Riepe
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
#include <ext_types.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: 32.fsize.c,v 1.13 2008/05/23 08:15:33 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
const size_t
|
||||
_elf_fmsize[2][EV_CURRENT - EV_NONE][ELF_T_NUM][2] = {
|
||||
/* ELFCLASS32 */
|
||||
{
|
||||
/* version 1 */
|
||||
{
|
||||
{ sizeof(unsigned char), sizeof(unsigned char) },
|
||||
{ sizeof(Elf32_Addr), sizeof(__ext_Elf32_Addr) },
|
||||
{ sizeof(Elf32_Dyn), sizeof(__ext_Elf32_Dyn) },
|
||||
{ sizeof(Elf32_Ehdr), sizeof(__ext_Elf32_Ehdr) },
|
||||
{ sizeof(Elf32_Half), sizeof(__ext_Elf32_Half) },
|
||||
{ sizeof(Elf32_Off), sizeof(__ext_Elf32_Off) },
|
||||
{ sizeof(Elf32_Phdr), sizeof(__ext_Elf32_Phdr) },
|
||||
{ sizeof(Elf32_Rela), sizeof(__ext_Elf32_Rela) },
|
||||
{ sizeof(Elf32_Rel), sizeof(__ext_Elf32_Rel) },
|
||||
{ sizeof(Elf32_Shdr), sizeof(__ext_Elf32_Shdr) },
|
||||
{ sizeof(Elf32_Sword), sizeof(__ext_Elf32_Sword) },
|
||||
{ sizeof(Elf32_Sym), sizeof(__ext_Elf32_Sym) },
|
||||
{ sizeof(Elf32_Word), sizeof(__ext_Elf32_Word) },
|
||||
{ 0, 0 }, /* there is no Elf32_Sxword */
|
||||
{ 0, 0 }, /* there is no Elf32_Xword */
|
||||
/* XXX: check Solaris values */
|
||||
{ 0, 0 }, /* Elf32_Verdef/Verdaux size varies */
|
||||
{ 0, 0 }, /* Elf32_Verneed/Vernaux size varies */
|
||||
},
|
||||
},
|
||||
#if __LIBELF64
|
||||
/* ELFCLASS64 */
|
||||
{
|
||||
/* version 1 */
|
||||
{
|
||||
{ sizeof(unsigned char), sizeof(unsigned char) },
|
||||
{ sizeof(Elf64_Addr), sizeof(__ext_Elf64_Addr) },
|
||||
{ sizeof(Elf64_Dyn), sizeof(__ext_Elf64_Dyn) },
|
||||
{ sizeof(Elf64_Ehdr), sizeof(__ext_Elf64_Ehdr) },
|
||||
{ sizeof(Elf64_Half), sizeof(__ext_Elf64_Half) },
|
||||
{ sizeof(Elf64_Off), sizeof(__ext_Elf64_Off) },
|
||||
{ sizeof(Elf64_Phdr), sizeof(__ext_Elf64_Phdr) },
|
||||
{ sizeof(Elf64_Rela), sizeof(__ext_Elf64_Rela) },
|
||||
{ sizeof(Elf64_Rel), sizeof(__ext_Elf64_Rel) },
|
||||
{ sizeof(Elf64_Shdr), sizeof(__ext_Elf64_Shdr) },
|
||||
{ sizeof(Elf64_Sword), sizeof(__ext_Elf64_Sword) },
|
||||
{ sizeof(Elf64_Sym), sizeof(__ext_Elf64_Sym) },
|
||||
{ sizeof(Elf64_Word), sizeof(__ext_Elf64_Word) },
|
||||
{ sizeof(Elf64_Sxword), sizeof(__ext_Elf64_Sxword) },
|
||||
{ sizeof(Elf64_Xword), sizeof(__ext_Elf64_Xword) },
|
||||
/* XXX: check Solaris values */
|
||||
{ 0, 0 }, /* Elf64_Verdef/Verdaux size varies */
|
||||
{ 0, 0 }, /* Elf64_Verneed/Vernaux size varies */
|
||||
},
|
||||
},
|
||||
#endif /* __LIBELF64 */
|
||||
};
|
||||
|
||||
static size_t
|
||||
_elf_fsize(unsigned cls, Elf_Type type, unsigned ver) {
|
||||
size_t n = 0;
|
||||
|
||||
if (!valid_version(ver)) {
|
||||
seterr(ERROR_UNKNOWN_VERSION);
|
||||
}
|
||||
else if (!valid_type(type)) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
}
|
||||
else if (!(n = _fsize(cls, ver, type))) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t
|
||||
elf32_fsize(Elf_Type type, size_t count, unsigned ver) {
|
||||
return count * _elf_fsize(ELFCLASS32, type, ver);
|
||||
}
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
size_t
|
||||
elf64_fsize(Elf_Type type, size_t count, unsigned ver) {
|
||||
return count * _elf_fsize(ELFCLASS64, type, ver);
|
||||
}
|
||||
|
||||
size_t
|
||||
gelf_fsize(Elf *elf, Elf_Type type, size_t count, unsigned ver) {
|
||||
if (elf) {
|
||||
if (elf->e_kind != ELF_K_ELF) {
|
||||
seterr(ERROR_NOTELF);
|
||||
}
|
||||
else if (valid_class(elf->e_class)) {
|
||||
return count * _elf_fsize(elf->e_class, type, ver);
|
||||
}
|
||||
else {
|
||||
seterr(ERROR_UNKNOWN_CLASS);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Extension: report memory size
|
||||
*/
|
||||
size_t
|
||||
gelf_msize(Elf *elf, Elf_Type type, size_t count, unsigned ver) {
|
||||
size_t n;
|
||||
|
||||
if (elf) {
|
||||
if (elf->e_kind != ELF_K_ELF) {
|
||||
seterr(ERROR_NOTELF);
|
||||
}
|
||||
else if (!valid_class(elf->e_class)) {
|
||||
seterr(ERROR_UNKNOWN_CLASS);
|
||||
}
|
||||
else if (!valid_version(ver)) {
|
||||
seterr(ERROR_UNKNOWN_VERSION);
|
||||
}
|
||||
else if (!valid_type(type)) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
}
|
||||
else if (!(n = _msize(elf->e_class, ver, type))) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
}
|
||||
else {
|
||||
return count * n;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* __LIBELF64 */
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
32.getehdr.c - implementation of the elf{32,64}_getehdr(3) functions.
|
||||
Copyright (C) 1995 - 1998 Michael Riepe
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: 32.getehdr.c,v 1.9 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
char*
|
||||
_elf_getehdr(Elf *elf, unsigned cls) {
|
||||
if (!elf) {
|
||||
return NULL;
|
||||
}
|
||||
elf_assert(elf->e_magic == ELF_MAGIC);
|
||||
if (elf->e_kind != ELF_K_ELF) {
|
||||
seterr(ERROR_NOTELF);
|
||||
}
|
||||
else if (elf->e_class != cls) {
|
||||
seterr(ERROR_CLASSMISMATCH);
|
||||
}
|
||||
else if (elf->e_ehdr || _elf_cook(elf)) {
|
||||
return elf->e_ehdr;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Elf32_Ehdr*
|
||||
elf32_getehdr(Elf *elf) {
|
||||
return (Elf32_Ehdr*)_elf_getehdr(elf, ELFCLASS32);
|
||||
}
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
Elf64_Ehdr*
|
||||
elf64_getehdr(Elf *elf) {
|
||||
return (Elf64_Ehdr*)_elf_getehdr(elf, ELFCLASS64);
|
||||
}
|
||||
|
||||
#endif /* __LIBELF64 */
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
32.getphdr.c - implementation of the elf{32,64}_getphdr(3) functions.
|
||||
Copyright (C) 1995 - 2000 Michael Riepe
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: 32.getphdr.c,v 1.11 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
char*
|
||||
_elf_getphdr(Elf *elf, unsigned cls) {
|
||||
if (!elf) {
|
||||
return NULL;
|
||||
}
|
||||
elf_assert(elf->e_magic == ELF_MAGIC);
|
||||
if (elf->e_kind != ELF_K_ELF) {
|
||||
seterr(ERROR_NOTELF);
|
||||
}
|
||||
else if (elf->e_class != cls) {
|
||||
seterr(ERROR_CLASSMISMATCH);
|
||||
}
|
||||
else if (elf->e_ehdr || _elf_cook(elf)) {
|
||||
return elf->e_phdr;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Elf32_Phdr*
|
||||
elf32_getphdr(Elf *elf) {
|
||||
return (Elf32_Phdr*)_elf_getphdr(elf, ELFCLASS32);
|
||||
}
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
Elf64_Phdr*
|
||||
elf64_getphdr(Elf *elf) {
|
||||
return (Elf64_Phdr*)_elf_getphdr(elf, ELFCLASS64);
|
||||
}
|
||||
|
||||
#endif /* __LIBELF64 */
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
32.getshdr.c - implementation of the elf{32,64}_getshdr(3) functions.
|
||||
Copyright (C) 1995 - 1998 Michael Riepe
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: 32.getshdr.c,v 1.10 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
Elf32_Shdr*
|
||||
elf32_getshdr(Elf_Scn *scn) {
|
||||
if (!scn) {
|
||||
return NULL;
|
||||
}
|
||||
elf_assert(scn->s_magic == SCN_MAGIC);
|
||||
elf_assert(scn->s_elf);
|
||||
elf_assert(scn->s_elf->e_magic == ELF_MAGIC);
|
||||
if (scn->s_elf->e_class == ELFCLASS32) {
|
||||
return &scn->s_shdr32;
|
||||
}
|
||||
seterr(ERROR_CLASSMISMATCH);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
Elf64_Shdr*
|
||||
elf64_getshdr(Elf_Scn *scn) {
|
||||
if (!scn) {
|
||||
return NULL;
|
||||
}
|
||||
elf_assert(scn->s_magic == SCN_MAGIC);
|
||||
elf_assert(scn->s_elf);
|
||||
elf_assert(scn->s_elf->e_magic == ELF_MAGIC);
|
||||
if (scn->s_elf->e_class == ELFCLASS64) {
|
||||
return &scn->s_shdr64;
|
||||
}
|
||||
seterr(ERROR_CLASSMISMATCH);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* __LIBELF64 */
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 32.newehdr.c - implementation of the elf{32,64}_newehdr(3) functions.
|
||||
* Copyright (C) 1995 - 2006 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: 32.newehdr.c,v 1.16 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
static char*
|
||||
_elf_newehdr(Elf *elf, unsigned cls) {
|
||||
size_t size;
|
||||
|
||||
if (!elf) {
|
||||
return NULL;
|
||||
}
|
||||
elf_assert(elf->e_magic == ELF_MAGIC);
|
||||
if (elf->e_readable) {
|
||||
return _elf_getehdr(elf, cls);
|
||||
}
|
||||
else if (!elf->e_ehdr) {
|
||||
size = _msize(cls, _elf_version, ELF_T_EHDR);
|
||||
elf_assert(size);
|
||||
if ((elf->e_ehdr = (char*)malloc(size))) {
|
||||
memset(elf->e_ehdr, 0, size);
|
||||
elf->e_ehdr_flags |= ELF_F_DIRTY;
|
||||
elf->e_kind = ELF_K_ELF;
|
||||
elf->e_class = cls;
|
||||
return elf->e_ehdr;
|
||||
}
|
||||
seterr(ERROR_MEM_EHDR);
|
||||
}
|
||||
else if (elf->e_class != cls) {
|
||||
seterr(ERROR_CLASSMISMATCH);
|
||||
}
|
||||
else {
|
||||
elf_assert(elf->e_kind == ELF_K_ELF);
|
||||
return elf->e_ehdr;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Elf32_Ehdr*
|
||||
elf32_newehdr(Elf *elf) {
|
||||
return (Elf32_Ehdr*)_elf_newehdr(elf, ELFCLASS32);
|
||||
}
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
Elf64_Ehdr*
|
||||
elf64_newehdr(Elf *elf) {
|
||||
return (Elf64_Ehdr*)_elf_newehdr(elf, ELFCLASS64);
|
||||
}
|
||||
|
||||
unsigned long
|
||||
gelf_newehdr(Elf *elf, int cls) {
|
||||
if (!valid_class(cls) || !_msize(cls, _elf_version, ELF_T_EHDR)) {
|
||||
seterr(ERROR_UNKNOWN_CLASS);
|
||||
return 0;
|
||||
}
|
||||
return (unsigned long)_elf_newehdr(elf, cls);
|
||||
}
|
||||
|
||||
#endif /* __LIBELF64 */
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* 32.newphdr.c - implementation of the elf{32,64}_newphdr(3) functions.
|
||||
* Copyright (C) 1995 - 2006 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: 32.newphdr.c,v 1.16 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
static char*
|
||||
_elf_newphdr(Elf *elf, size_t count, unsigned cls) {
|
||||
size_t extcount = 0;
|
||||
Elf_Scn *scn = NULL;
|
||||
char *phdr = NULL;
|
||||
size_t size;
|
||||
|
||||
if (!elf) {
|
||||
return NULL;
|
||||
}
|
||||
elf_assert(elf->e_magic == ELF_MAGIC);
|
||||
if (!elf->e_ehdr && !elf->e_readable) {
|
||||
seterr(ERROR_NOEHDR);
|
||||
}
|
||||
else if (elf->e_kind != ELF_K_ELF) {
|
||||
seterr(ERROR_NOTELF);
|
||||
}
|
||||
else if (elf->e_class != cls) {
|
||||
seterr(ERROR_CLASSMISMATCH);
|
||||
}
|
||||
else if (elf->e_ehdr || _elf_cook(elf)) {
|
||||
size = _msize(cls, _elf_version, ELF_T_PHDR);
|
||||
elf_assert(size);
|
||||
if (!(scn = _elf_first_scn(elf))) {
|
||||
return NULL;
|
||||
}
|
||||
if (count) {
|
||||
if (!(phdr = (char*)malloc(count * size))) {
|
||||
seterr(ERROR_MEM_PHDR);
|
||||
return NULL;
|
||||
}
|
||||
memset(phdr, 0, count * size);
|
||||
}
|
||||
elf_assert(elf->e_ehdr);
|
||||
elf->e_phnum = count;
|
||||
if (count >= PN_XNUM) {
|
||||
/*
|
||||
* get NULL section (create it if necessary)
|
||||
*/
|
||||
extcount = count;
|
||||
count = PN_XNUM;
|
||||
}
|
||||
if (cls == ELFCLASS32) {
|
||||
((Elf32_Ehdr*)elf->e_ehdr)->e_phnum = count;
|
||||
scn->s_shdr32.sh_info = extcount;
|
||||
}
|
||||
#if __LIBELF64
|
||||
else if (cls == ELFCLASS64) {
|
||||
((Elf64_Ehdr*)elf->e_ehdr)->e_phnum = count;
|
||||
scn->s_shdr64.sh_info = extcount;
|
||||
}
|
||||
#endif /* __LIBELF64 */
|
||||
else {
|
||||
seterr(ERROR_UNIMPLEMENTED);
|
||||
if (phdr) {
|
||||
free(phdr);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (elf->e_phdr) {
|
||||
free(elf->e_phdr);
|
||||
}
|
||||
elf->e_phdr = phdr;
|
||||
elf->e_phdr_flags |= ELF_F_DIRTY;
|
||||
elf->e_ehdr_flags |= ELF_F_DIRTY;
|
||||
scn->s_scn_flags |= ELF_F_DIRTY;
|
||||
return phdr;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Elf32_Phdr*
|
||||
elf32_newphdr(Elf *elf, size_t count) {
|
||||
return (Elf32_Phdr*)_elf_newphdr(elf, count, ELFCLASS32);
|
||||
}
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
Elf64_Phdr*
|
||||
elf64_newphdr(Elf *elf, size_t count) {
|
||||
return (Elf64_Phdr*)_elf_newphdr(elf, count, ELFCLASS64);
|
||||
}
|
||||
|
||||
unsigned long
|
||||
gelf_newphdr(Elf *elf, size_t phnum) {
|
||||
if (!valid_class(elf->e_class)) {
|
||||
seterr(ERROR_UNKNOWN_CLASS);
|
||||
return 0;
|
||||
}
|
||||
return (unsigned long)_elf_newphdr(elf, phnum, elf->e_class);
|
||||
}
|
||||
|
||||
#endif /* __LIBELF64 */
|
|
@ -0,0 +1,438 @@
|
|||
/*
|
||||
* 32.xlatetof.c - implementation of the elf32_xlateto[fm](3) functions.
|
||||
* Copyright (C) 1995 - 2006 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
#include <ext_types.h>
|
||||
#include <byteswap.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: 32.xlatetof.c,v 1.27 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
/*
|
||||
* Ugly, ugly
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
# define Cat2(a,b)a##b
|
||||
# define Cat3(a,b,c)a##b##c
|
||||
# define Ex1(m1,m2,a,b)m1##m2(a##b)
|
||||
# define Ex2(m1,m2,a,b,c)m1##m2(a,b##c)
|
||||
#else /* _WIN32 */
|
||||
# define x
|
||||
# if defined/**/x
|
||||
# define Cat2(a,b)a##b
|
||||
# define Cat3(a,b,c)a##b##c
|
||||
# define Ex1(m1,m2,a,b)m1##m2(a##b)
|
||||
# define Ex2(m1,m2,a,b,c)m1##m2(a,b##c)
|
||||
# else
|
||||
# define Cat2(a,b)a/**/b
|
||||
# define Cat3(a,b,c)a/**/b/**/c
|
||||
# define Ex1(m1,m2,a,b)m1/**/m2(a/**/b)
|
||||
# define Ex2(m1,m2,a,b,c)m1/**/m2(a,b/**/c)
|
||||
# endif
|
||||
# undef x
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/*
|
||||
* auxiliary macros for execution order reversal
|
||||
*/
|
||||
#define seq_forw(a,b) a b
|
||||
#define seq_back(a,b) b a
|
||||
|
||||
/*
|
||||
* function instantiator
|
||||
*/
|
||||
#define copy_type_e_io(name,e,io,tfrom,tto,copy) \
|
||||
static size_t \
|
||||
Cat3(name,_,io)(unsigned char *dst, const unsigned char *src, size_t n) { \
|
||||
n /= sizeof(tfrom); \
|
||||
if (n && dst) { \
|
||||
const tfrom *from = (const tfrom*)src; \
|
||||
tto *to = (tto*)dst; \
|
||||
size_t i; \
|
||||
\
|
||||
if (sizeof(tfrom) < sizeof(tto)) { \
|
||||
from += n; \
|
||||
to += n; \
|
||||
for (i = 0; i < n; i++) { \
|
||||
--from; \
|
||||
--to; \
|
||||
copy(e,io,seq_back) \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
for (i = 0; i < n; i++) { \
|
||||
copy(e,io,seq_forw) \
|
||||
from++; \
|
||||
to++; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
return n * sizeof(tto); \
|
||||
}
|
||||
|
||||
#define copy_type_e(name,e,type,copy) \
|
||||
copy_type_e_io(name,e,tom,Cat2(__ext_,type),type,copy) \
|
||||
copy_type_e_io(name,e,tof,type,Cat2(__ext_,type),copy)
|
||||
|
||||
/*
|
||||
* master function instantiator
|
||||
*/
|
||||
#define copy_type(name,version,type,copy) \
|
||||
copy_type_e(Cat3(name,L,version),L,type,copy) \
|
||||
copy_type_e(Cat3(name,M,version),M,type,copy)
|
||||
|
||||
/*
|
||||
* scalar copying
|
||||
*/
|
||||
#define copy_scalar_tom(type) *to = Cat2(__load_,type)(*from);
|
||||
#define copy_scalar_tof(type) Cat2(__store_,type)(*to, *from);
|
||||
|
||||
/*
|
||||
* structure member copying
|
||||
*/
|
||||
#define copy_tom(mb,type) to->mb = Cat2(__load_,type)(from->mb);
|
||||
#define copy_tof(mb,type) Cat2(__store_,type)(to->mb, from->mb);
|
||||
|
||||
/*
|
||||
* structure member copying (direction independent)
|
||||
*/
|
||||
#define copy_byte(e,io,mb) to->mb = from->mb;
|
||||
#define copy_addr(e,io,mb) Ex2(copy_,io,mb,u32,e)
|
||||
#define copy_half(e,io,mb) Ex2(copy_,io,mb,u16,e)
|
||||
#define copy_off(e,io,mb) Ex2(copy_,io,mb,u32,e)
|
||||
#define copy_sword(e,io,mb) Ex2(copy_,io,mb,i32,e)
|
||||
#define copy_word(e,io,mb) Ex2(copy_,io,mb,u32,e)
|
||||
#define copy_arr(e,io,mb) \
|
||||
array_copy(to->mb, sizeof(to->mb), from->mb, sizeof(from->mb));
|
||||
|
||||
/*
|
||||
* scalar copying (direction independent)
|
||||
* these macros are used as `copy' arguments to copy_type()
|
||||
*/
|
||||
#define copy_addr_11(e,io,seq) Ex1(copy_scalar_,io,u32,e)
|
||||
#define copy_half_11(e,io,seq) Ex1(copy_scalar_,io,u16,e)
|
||||
#define copy_off_11(e,io,seq) Ex1(copy_scalar_,io,u32,e)
|
||||
#define copy_sword_11(e,io,seq) Ex1(copy_scalar_,io,i32,e)
|
||||
#define copy_word_11(e,io,seq) Ex1(copy_scalar_,io,u32,e)
|
||||
|
||||
/*
|
||||
* structure copying (direction independent)
|
||||
* these macros are used as `copy' arguments to copy_type()
|
||||
*/
|
||||
#define copy_dyn_11(e,io,seq) \
|
||||
seq(copy_sword(e,io,d_tag), \
|
||||
seq(copy_addr(e,io,d_un.d_ptr), \
|
||||
nullcopy))
|
||||
#define copy_ehdr_11(e,io,seq) \
|
||||
seq(copy_arr(e,io,e_ident), \
|
||||
seq(copy_half(e,io,e_type), \
|
||||
seq(copy_half(e,io,e_machine), \
|
||||
seq(copy_word(e,io,e_version), \
|
||||
seq(copy_addr(e,io,e_entry), \
|
||||
seq(copy_off(e,io,e_phoff), \
|
||||
seq(copy_off(e,io,e_shoff), \
|
||||
seq(copy_word(e,io,e_flags), \
|
||||
seq(copy_half(e,io,e_ehsize), \
|
||||
seq(copy_half(e,io,e_phentsize), \
|
||||
seq(copy_half(e,io,e_phnum), \
|
||||
seq(copy_half(e,io,e_shentsize), \
|
||||
seq(copy_half(e,io,e_shnum), \
|
||||
seq(copy_half(e,io,e_shstrndx), \
|
||||
nullcopy))))))))))))))
|
||||
#define copy_phdr_11(e,io,seq) \
|
||||
seq(copy_word(e,io,p_type), \
|
||||
seq(copy_off(e,io,p_offset), \
|
||||
seq(copy_addr(e,io,p_vaddr), \
|
||||
seq(copy_addr(e,io,p_paddr), \
|
||||
seq(copy_word(e,io,p_filesz), \
|
||||
seq(copy_word(e,io,p_memsz), \
|
||||
seq(copy_word(e,io,p_flags), \
|
||||
seq(copy_word(e,io,p_align), \
|
||||
nullcopy))))))))
|
||||
#define copy_rela_11(e,io,seq) \
|
||||
seq(copy_addr(e,io,r_offset), \
|
||||
seq(copy_word(e,io,r_info), \
|
||||
seq(copy_sword(e,io,r_addend), \
|
||||
nullcopy)))
|
||||
#define copy_rel_11(e,io,seq) \
|
||||
seq(copy_addr(e,io,r_offset), \
|
||||
seq(copy_word(e,io,r_info), \
|
||||
nullcopy))
|
||||
#define copy_shdr_11(e,io,seq) \
|
||||
seq(copy_word(e,io,sh_name), \
|
||||
seq(copy_word(e,io,sh_type), \
|
||||
seq(copy_word(e,io,sh_flags), \
|
||||
seq(copy_addr(e,io,sh_addr), \
|
||||
seq(copy_off(e,io,sh_offset), \
|
||||
seq(copy_word(e,io,sh_size), \
|
||||
seq(copy_word(e,io,sh_link), \
|
||||
seq(copy_word(e,io,sh_info), \
|
||||
seq(copy_word(e,io,sh_addralign), \
|
||||
seq(copy_word(e,io,sh_entsize), \
|
||||
nullcopy))))))))))
|
||||
#define copy_sym_11(e,io,seq) \
|
||||
seq(copy_word(e,io,st_name), \
|
||||
seq(copy_addr(e,io,st_value), \
|
||||
seq(copy_word(e,io,st_size), \
|
||||
seq(copy_byte(e,io,st_info), \
|
||||
seq(copy_byte(e,io,st_other), \
|
||||
seq(copy_half(e,io,st_shndx), \
|
||||
nullcopy))))))
|
||||
|
||||
#define nullcopy /**/
|
||||
|
||||
static size_t
|
||||
byte_copy(unsigned char *dst, const unsigned char *src, size_t n) {
|
||||
if (n && dst && dst != src) {
|
||||
#if HAVE_BROKEN_MEMMOVE
|
||||
size_t i;
|
||||
|
||||
if (dst >= src + n || dst + n <= src) {
|
||||
memcpy(dst, src, n);
|
||||
}
|
||||
else if (dst < src) {
|
||||
for (i = 0; i < n; i++) {
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = n; --i; ) {
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
#else /* HAVE_BROKEN_MEMMOVE */
|
||||
memmove(dst, src, n);
|
||||
#endif /* HAVE_BROKEN_MEMMOVE */
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
static void
|
||||
array_copy(unsigned char *dst, size_t dlen, const unsigned char *src, size_t slen) {
|
||||
byte_copy(dst, src, dlen < slen ? dlen : slen);
|
||||
if (dlen > slen) {
|
||||
memset(dst + slen, 0, dlen - slen);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* instantiate copy functions
|
||||
*/
|
||||
copy_type(addr_32,_,Elf32_Addr,copy_addr_11)
|
||||
copy_type(half_32,_,Elf32_Half,copy_half_11)
|
||||
copy_type(off_32,_,Elf32_Off,copy_off_11)
|
||||
copy_type(sword_32,_,Elf32_Sword,copy_sword_11)
|
||||
copy_type(word_32,_,Elf32_Word,copy_word_11)
|
||||
copy_type(dyn_32,11,Elf32_Dyn,copy_dyn_11)
|
||||
copy_type(ehdr_32,11,Elf32_Ehdr,copy_ehdr_11)
|
||||
copy_type(phdr_32,11,Elf32_Phdr,copy_phdr_11)
|
||||
copy_type(rela_32,11,Elf32_Rela,copy_rela_11)
|
||||
copy_type(rel_32,11,Elf32_Rel,copy_rel_11)
|
||||
copy_type(shdr_32,11,Elf32_Shdr,copy_shdr_11)
|
||||
copy_type(sym_32,11,Elf32_Sym,copy_sym_11)
|
||||
|
||||
typedef size_t (*xlator)(unsigned char*, const unsigned char*, size_t);
|
||||
typedef xlator xltab[ELF_T_NUM][2];
|
||||
|
||||
/*
|
||||
* translation table (32-bit, version 1 -> version 1)
|
||||
*/
|
||||
#if PIC
|
||||
static xltab
|
||||
#else /* PIC */
|
||||
static const xltab
|
||||
#endif /* PIC */
|
||||
xlate32_11[/*encoding*/] = {
|
||||
{
|
||||
{ byte_copy, byte_copy },
|
||||
{ addr_32L__tom, addr_32L__tof },
|
||||
{ dyn_32L11_tom, dyn_32L11_tof },
|
||||
{ ehdr_32L11_tom, ehdr_32L11_tof },
|
||||
{ half_32L__tom, half_32L__tof },
|
||||
{ off_32L__tom, off_32L__tof },
|
||||
{ phdr_32L11_tom, phdr_32L11_tof },
|
||||
{ rela_32L11_tom, rela_32L11_tof },
|
||||
{ rel_32L11_tom, rel_32L11_tof },
|
||||
{ shdr_32L11_tom, shdr_32L11_tof },
|
||||
{ sword_32L__tom, sword_32L__tof },
|
||||
{ sym_32L11_tom, sym_32L11_tof },
|
||||
{ word_32L__tom, word_32L__tof },
|
||||
{ 0, 0 }, /* there is no Sxword */
|
||||
{ 0, 0 }, /* there is no Xword */
|
||||
#if __LIBELF_SYMBOL_VERSIONS
|
||||
{ _elf_verdef_32L11_tom, _elf_verdef_32L11_tof },
|
||||
{ _elf_verneed_32L11_tom, _elf_verneed_32L11_tof },
|
||||
#else /* __LIBELF_SYMBOL_VERSIONS */
|
||||
{ 0, 0 },
|
||||
{ 0, 0 },
|
||||
#endif /* __LIBELF_SYMBOL_VERSIONS */
|
||||
},
|
||||
{
|
||||
{ byte_copy, byte_copy },
|
||||
{ addr_32M__tom, addr_32M__tof },
|
||||
{ dyn_32M11_tom, dyn_32M11_tof },
|
||||
{ ehdr_32M11_tom, ehdr_32M11_tof },
|
||||
{ half_32M__tom, half_32M__tof },
|
||||
{ off_32M__tom, off_32M__tof },
|
||||
{ phdr_32M11_tom, phdr_32M11_tof },
|
||||
{ rela_32M11_tom, rela_32M11_tof },
|
||||
{ rel_32M11_tom, rel_32M11_tof },
|
||||
{ shdr_32M11_tom, shdr_32M11_tof },
|
||||
{ sword_32M__tom, sword_32M__tof },
|
||||
{ sym_32M11_tom, sym_32M11_tof },
|
||||
{ word_32M__tom, word_32M__tof },
|
||||
{ 0, 0 }, /* there is no Sxword */
|
||||
{ 0, 0 }, /* there is no Xword */
|
||||
#if __LIBELF_SYMBOL_VERSIONS
|
||||
{ _elf_verdef_32M11_tom, _elf_verdef_32M11_tof },
|
||||
{ _elf_verneed_32M11_tom, _elf_verneed_32M11_tof },
|
||||
#else /* __LIBELF_SYMBOL_VERSIONS */
|
||||
{ 0, 0 },
|
||||
{ 0, 0 },
|
||||
#endif /* __LIBELF_SYMBOL_VERSIONS */
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* main translation table (32-bit)
|
||||
*/
|
||||
#if PIC
|
||||
static xltab*
|
||||
#else /* PIC */
|
||||
static const xltab *const
|
||||
#endif /* PIC */
|
||||
xlate32[EV_CURRENT - EV_NONE][EV_CURRENT - EV_NONE] = {
|
||||
{ xlate32_11, },
|
||||
};
|
||||
|
||||
#define translator(sv,dv,enc,type,d) \
|
||||
(xlate32[(sv) - EV_NONE - 1] \
|
||||
[(dv) - EV_NONE - 1] \
|
||||
[(enc) - ELFDATA2LSB] \
|
||||
[(type) - ELF_T_BYTE] \
|
||||
[d])
|
||||
|
||||
/*
|
||||
* destination buffer size
|
||||
*/
|
||||
size_t
|
||||
_elf32_xltsize(const Elf_Data *src, unsigned dv, unsigned encode, int tof) {
|
||||
Elf_Type type = src->d_type;
|
||||
unsigned sv = src->d_version;
|
||||
xlator op;
|
||||
|
||||
if (!valid_version(sv) || !valid_version(dv)) {
|
||||
seterr(ERROR_UNKNOWN_VERSION);
|
||||
return (size_t)-1;
|
||||
}
|
||||
if (tof) {
|
||||
/*
|
||||
* Encoding doesn't really matter (the translator only looks at
|
||||
* the source, which resides in memory), but we need a proper
|
||||
* encoding to select a translator...
|
||||
*/
|
||||
encode = ELFDATA2LSB;
|
||||
}
|
||||
else if (!valid_encoding(encode)) {
|
||||
seterr(ERROR_UNKNOWN_ENCODING);
|
||||
return (size_t)-1;
|
||||
}
|
||||
if (!valid_type(type)) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
return (size_t)-1;
|
||||
}
|
||||
if (!(op = translator(sv, dv, encode, type, tof))) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
return (size_t)-1;
|
||||
}
|
||||
return (*op)(NULL, src->d_buf, src->d_size);
|
||||
}
|
||||
|
||||
/*
|
||||
* direction-independent translation
|
||||
*/
|
||||
static Elf_Data*
|
||||
elf32_xlate(Elf_Data *dst, const Elf_Data *src, unsigned encode, int tof) {
|
||||
Elf_Type type;
|
||||
int dv;
|
||||
int sv;
|
||||
size_t dsize;
|
||||
size_t tmp;
|
||||
xlator op;
|
||||
|
||||
if (!src || !dst) {
|
||||
return NULL;
|
||||
}
|
||||
if (!src->d_buf || !dst->d_buf) {
|
||||
seterr(ERROR_NULLBUF);
|
||||
return NULL;
|
||||
}
|
||||
if (!valid_encoding(encode)) {
|
||||
seterr(ERROR_UNKNOWN_ENCODING);
|
||||
return NULL;
|
||||
}
|
||||
sv = src->d_version;
|
||||
dv = dst->d_version;
|
||||
if (!valid_version(sv) || !valid_version(dv)) {
|
||||
seterr(ERROR_UNKNOWN_VERSION);
|
||||
return NULL;
|
||||
}
|
||||
type = src->d_type;
|
||||
if (!valid_type(type)) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
return NULL;
|
||||
}
|
||||
op = translator(sv, dv, encode, type, tof);
|
||||
if (!op) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
return NULL;
|
||||
}
|
||||
dsize = (*op)(NULL, src->d_buf, src->d_size);
|
||||
if (dsize == (size_t)-1) {
|
||||
return NULL;
|
||||
}
|
||||
if (dst->d_size < dsize) {
|
||||
seterr(ERROR_DST2SMALL);
|
||||
return NULL;
|
||||
}
|
||||
if (dsize) {
|
||||
tmp = (*op)(dst->d_buf, src->d_buf, src->d_size);
|
||||
if (tmp == (size_t)-1) {
|
||||
return NULL;
|
||||
}
|
||||
elf_assert(tmp == dsize);
|
||||
}
|
||||
dst->d_size = dsize;
|
||||
dst->d_type = type;
|
||||
return dst;
|
||||
}
|
||||
|
||||
/*
|
||||
* finally, the "official" translation functions
|
||||
*/
|
||||
Elf_Data*
|
||||
elf32_xlatetom(Elf_Data *dst, const Elf_Data *src, unsigned encode) {
|
||||
return elf32_xlate(dst, src, encode, 0);
|
||||
}
|
||||
|
||||
Elf_Data*
|
||||
elf32_xlatetof(Elf_Data *dst, const Elf_Data *src, unsigned encode) {
|
||||
return elf32_xlate(dst, src, encode, 1);
|
||||
}
|
|
@ -0,0 +1,512 @@
|
|||
/*
|
||||
* 64.xlatetof.c - implementation of the elf64_xlateto[fm](3) functions.
|
||||
* Copyright (C) 1995 - 2006 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
#include <ext_types.h>
|
||||
#include <byteswap.h>
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: 64.xlatetof.c,v 1.27 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
/*
|
||||
* Ugly, ugly
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
# define Cat2(a,b)a##b
|
||||
# define Cat3(a,b,c)a##b##c
|
||||
# define Ex1(m1,m2,a,b)m1##m2(a##b)
|
||||
# define Ex2(m1,m2,a,b,c)m1##m2(a,b##c)
|
||||
#else /* _WIN32 */
|
||||
# define x
|
||||
# if defined/**/x
|
||||
# define Cat2(a,b)a##b
|
||||
# define Cat3(a,b,c)a##b##c
|
||||
# define Ex1(m1,m2,a,b)m1##m2(a##b)
|
||||
# define Ex2(m1,m2,a,b,c)m1##m2(a,b##c)
|
||||
# else
|
||||
# define Cat2(a,b)a/**/b
|
||||
# define Cat3(a,b,c)a/**/b/**/c
|
||||
# define Ex1(m1,m2,a,b)m1/**/m2(a/**/b)
|
||||
# define Ex2(m1,m2,a,b,c)m1/**/m2(a,b/**/c)
|
||||
# endif
|
||||
# undef x
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/*
|
||||
* auxiliary macros for execution order reversal
|
||||
*/
|
||||
#define seq_forw(a,b) a b
|
||||
#define seq_back(a,b) b a
|
||||
|
||||
/*
|
||||
* function instantiator
|
||||
*/
|
||||
#define copy_type_e_io(name,e,io,tfrom,tto,copy) \
|
||||
static size_t \
|
||||
Cat3(name,_,io)(unsigned char *dst, const unsigned char *src, size_t n) { \
|
||||
n /= sizeof(tfrom); \
|
||||
if (n && dst) { \
|
||||
const tfrom *from = (const tfrom*)src; \
|
||||
tto *to = (tto*)dst; \
|
||||
size_t i; \
|
||||
\
|
||||
if (sizeof(tfrom) < sizeof(tto)) { \
|
||||
from += n; \
|
||||
to += n; \
|
||||
for (i = 0; i < n; i++) { \
|
||||
--from; \
|
||||
--to; \
|
||||
copy(e,io,seq_back) \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
for (i = 0; i < n; i++) { \
|
||||
copy(e,io,seq_forw) \
|
||||
from++; \
|
||||
to++; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
return n * sizeof(tto); \
|
||||
}
|
||||
|
||||
#define copy_type_e(name,e,type,copy) \
|
||||
copy_type_e_io(name,e,tom,Cat2(__ext_,type),type,copy) \
|
||||
copy_type_e_io(name,e,tof,type,Cat2(__ext_,type),copy)
|
||||
|
||||
/*
|
||||
* master function instantiator
|
||||
*/
|
||||
#define copy_type(name,version,type,copy) \
|
||||
copy_type_e(Cat3(name,L,version),L,type,copy) \
|
||||
copy_type_e(Cat3(name,M,version),M,type,copy)
|
||||
|
||||
/*
|
||||
* scalar copying
|
||||
*/
|
||||
#define copy_scalar_tom(type) *to = Cat2(__load_,type)(*from);
|
||||
#define copy_scalar_tof(type) Cat2(__store_,type)(*to, *from);
|
||||
|
||||
/*
|
||||
* structure member copying
|
||||
*/
|
||||
#define copy_tom(mb,type) to->mb = Cat2(__load_,type)(from->mb);
|
||||
#define copy_tof(mb,type) Cat2(__store_,type)(to->mb, from->mb);
|
||||
|
||||
/*
|
||||
* structure member copying (direction independent)
|
||||
*/
|
||||
#define copy_byte(e,io,mb) to->mb = from->mb;
|
||||
#define copy_addr(e,io,mb) Ex2(copy_,io,mb,u64,e)
|
||||
#define copy_half(e,io,mb) Ex2(copy_,io,mb,u16,e)
|
||||
#define copy_off(e,io,mb) Ex2(copy_,io,mb,u64,e)
|
||||
#define copy_sword(e,io,mb) Ex2(copy_,io,mb,i32,e)
|
||||
#define copy_word(e,io,mb) Ex2(copy_,io,mb,u32,e)
|
||||
#define copy_sxword(e,io,mb) Ex2(copy_,io,mb,i64,e)
|
||||
#define copy_xword(e,io,mb) Ex2(copy_,io,mb,u64,e)
|
||||
#define copy_arr(e,io,mb) \
|
||||
array_copy(to->mb, sizeof(to->mb), from->mb, sizeof(from->mb));
|
||||
|
||||
/*
|
||||
* scalar copying (direction independent)
|
||||
* these macros are used as `copy' arguments to copy_type()
|
||||
*/
|
||||
#define copy_addr_11(e,io,seq) Ex1(copy_scalar_,io,u64,e)
|
||||
#define copy_half_11(e,io,seq) Ex1(copy_scalar_,io,u16,e)
|
||||
#define copy_off_11(e,io,seq) Ex1(copy_scalar_,io,u64,e)
|
||||
#define copy_sword_11(e,io,seq) Ex1(copy_scalar_,io,i32,e)
|
||||
#define copy_word_11(e,io,seq) Ex1(copy_scalar_,io,u32,e)
|
||||
#define copy_sxword_11(e,io,seq)Ex1(copy_scalar_,io,i64,e)
|
||||
#define copy_xword_11(e,io,seq) Ex1(copy_scalar_,io,u64,e)
|
||||
|
||||
/*
|
||||
* structure copying (direction independent)
|
||||
* these macros are used as `copy' arguments to copy_type()
|
||||
*/
|
||||
#define copy_dyn_11(e,io,seq) \
|
||||
seq(copy_xword(e,io,d_tag), \
|
||||
seq(copy_addr(e,io,d_un.d_ptr), \
|
||||
nullcopy))
|
||||
#define copy_ehdr_11(e,io,seq) \
|
||||
seq(copy_arr(e,io,e_ident), \
|
||||
seq(copy_half(e,io,e_type), \
|
||||
seq(copy_half(e,io,e_machine), \
|
||||
seq(copy_word(e,io,e_version), \
|
||||
seq(copy_addr(e,io,e_entry), \
|
||||
seq(copy_off(e,io,e_phoff), \
|
||||
seq(copy_off(e,io,e_shoff), \
|
||||
seq(copy_word(e,io,e_flags), \
|
||||
seq(copy_half(e,io,e_ehsize), \
|
||||
seq(copy_half(e,io,e_phentsize), \
|
||||
seq(copy_half(e,io,e_phnum), \
|
||||
seq(copy_half(e,io,e_shentsize), \
|
||||
seq(copy_half(e,io,e_shnum), \
|
||||
seq(copy_half(e,io,e_shstrndx), \
|
||||
nullcopy))))))))))))))
|
||||
#define copy_phdr_11(e,io,seq) \
|
||||
seq(copy_word(e,io,p_type), \
|
||||
seq(copy_word(e,io,p_flags), \
|
||||
seq(copy_off(e,io,p_offset), \
|
||||
seq(copy_addr(e,io,p_vaddr), \
|
||||
seq(copy_addr(e,io,p_paddr), \
|
||||
seq(copy_xword(e,io,p_filesz), \
|
||||
seq(copy_xword(e,io,p_memsz), \
|
||||
seq(copy_xword(e,io,p_align), \
|
||||
nullcopy))))))))
|
||||
#if __LIBELF64_IRIX
|
||||
#define copy_rela_11(e,io,seq) \
|
||||
seq(copy_addr(e,io,r_offset), \
|
||||
seq(copy_word(e,io,r_sym), \
|
||||
seq(copy_byte(e,io,r_ssym), \
|
||||
seq(copy_byte(e,io,r_type3), \
|
||||
seq(copy_byte(e,io,r_type2), \
|
||||
seq(copy_byte(e,io,r_type), \
|
||||
seq(copy_sxword(e,io,r_addend), \
|
||||
nullcopy)))))))
|
||||
#define copy_rel_11(e,io,seq) \
|
||||
seq(copy_addr(e,io,r_offset), \
|
||||
seq(copy_word(e,io,r_sym), \
|
||||
seq(copy_byte(e,io,r_ssym), \
|
||||
seq(copy_byte(e,io,r_type3), \
|
||||
seq(copy_byte(e,io,r_type2), \
|
||||
seq(copy_byte(e,io,r_type), \
|
||||
nullcopy))))))
|
||||
#else /* __LIBELF64_IRIX */
|
||||
#define copy_rela_11(e,io,seq) \
|
||||
seq(copy_addr(e,io,r_offset), \
|
||||
seq(copy_xword(e,io,r_info), \
|
||||
seq(copy_sxword(e,io,r_addend), \
|
||||
nullcopy)))
|
||||
#define copy_rel_11(e,io,seq) \
|
||||
seq(copy_addr(e,io,r_offset), \
|
||||
seq(copy_xword(e,io,r_info), \
|
||||
nullcopy))
|
||||
#endif /* __LIBELF64_IRIX */
|
||||
#define copy_shdr_11(e,io,seq) \
|
||||
seq(copy_word(e,io,sh_name), \
|
||||
seq(copy_word(e,io,sh_type), \
|
||||
seq(copy_xword(e,io,sh_flags), \
|
||||
seq(copy_addr(e,io,sh_addr), \
|
||||
seq(copy_off(e,io,sh_offset), \
|
||||
seq(copy_xword(e,io,sh_size), \
|
||||
seq(copy_word(e,io,sh_link), \
|
||||
seq(copy_word(e,io,sh_info), \
|
||||
seq(copy_xword(e,io,sh_addralign), \
|
||||
seq(copy_xword(e,io,sh_entsize), \
|
||||
nullcopy))))))))))
|
||||
#define copy_sym_11(e,io,seq) \
|
||||
seq(copy_word(e,io,st_name), \
|
||||
seq(copy_byte(e,io,st_info), \
|
||||
seq(copy_byte(e,io,st_other), \
|
||||
seq(copy_half(e,io,st_shndx), \
|
||||
seq(copy_addr(e,io,st_value), \
|
||||
seq(copy_xword(e,io,st_size), \
|
||||
nullcopy))))))
|
||||
|
||||
#define nullcopy /**/
|
||||
|
||||
static size_t
|
||||
byte_copy(unsigned char *dst, const unsigned char *src, size_t n) {
|
||||
if (n && dst && dst != src) {
|
||||
#if HAVE_BROKEN_MEMMOVE
|
||||
size_t i;
|
||||
|
||||
if (dst >= src + n || dst + n <= src) {
|
||||
memcpy(dst, src, n);
|
||||
}
|
||||
else if (dst < src) {
|
||||
for (i = 0; i < n; i++) {
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = n; --i; ) {
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
#else /* HAVE_BROKEN_MEMMOVE */
|
||||
memmove(dst, src, n);
|
||||
#endif /* HAVE_BROKEN_MEMMOVE */
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
static void
|
||||
array_copy(unsigned char *dst, size_t dlen, const unsigned char *src, size_t slen) {
|
||||
byte_copy(dst, src, dlen < slen ? dlen : slen);
|
||||
if (dlen > slen) {
|
||||
memset(dst + slen, 0, dlen - slen);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* instantiate copy functions
|
||||
*/
|
||||
copy_type(addr_64,_,Elf64_Addr,copy_addr_11)
|
||||
copy_type(half_64,_,Elf64_Half,copy_half_11)
|
||||
copy_type(off_64,_,Elf64_Off,copy_off_11)
|
||||
copy_type(sword_64,_,Elf64_Sword,copy_sword_11)
|
||||
copy_type(word_64,_,Elf64_Word,copy_word_11)
|
||||
copy_type(sxword_64,_,Elf64_Sxword,copy_sxword_11)
|
||||
copy_type(xword_64,_,Elf64_Xword,copy_xword_11)
|
||||
copy_type(dyn_64,11,Elf64_Dyn,copy_dyn_11)
|
||||
copy_type(ehdr_64,11,Elf64_Ehdr,copy_ehdr_11)
|
||||
copy_type(phdr_64,11,Elf64_Phdr,copy_phdr_11)
|
||||
copy_type(rela_64,11,Elf64_Rela,copy_rela_11)
|
||||
copy_type(rel_64,11,Elf64_Rel,copy_rel_11)
|
||||
copy_type(shdr_64,11,Elf64_Shdr,copy_shdr_11)
|
||||
copy_type(sym_64,11,Elf64_Sym,copy_sym_11)
|
||||
|
||||
typedef size_t (*xlator)(unsigned char*, const unsigned char*, size_t);
|
||||
typedef xlator xltab[ELF_T_NUM][2];
|
||||
|
||||
/*
|
||||
* translation table (64-bit, version 1 -> version 1)
|
||||
*/
|
||||
#if PIC
|
||||
static xltab
|
||||
#else /* PIC */
|
||||
static const xltab
|
||||
#endif /* PIC */
|
||||
xlate64_11[/*encoding*/] = {
|
||||
{
|
||||
{ byte_copy, byte_copy },
|
||||
{ addr_64L__tom, addr_64L__tof },
|
||||
{ dyn_64L11_tom, dyn_64L11_tof },
|
||||
{ ehdr_64L11_tom, ehdr_64L11_tof },
|
||||
{ half_64L__tom, half_64L__tof },
|
||||
{ off_64L__tom, off_64L__tof },
|
||||
{ phdr_64L11_tom, phdr_64L11_tof },
|
||||
{ rela_64L11_tom, rela_64L11_tof },
|
||||
{ rel_64L11_tom, rel_64L11_tof },
|
||||
{ shdr_64L11_tom, shdr_64L11_tof },
|
||||
{ sword_64L__tom, sword_64L__tof },
|
||||
{ sym_64L11_tom, sym_64L11_tof },
|
||||
{ word_64L__tom, word_64L__tof },
|
||||
{ sxword_64L__tom, sxword_64L__tof },
|
||||
{ xword_64L__tom, xword_64L__tof },
|
||||
#if __LIBELF_SYMBOL_VERSIONS
|
||||
{ _elf_verdef_64L11_tom, _elf_verdef_64L11_tof },
|
||||
{ _elf_verneed_64L11_tom, _elf_verneed_64L11_tof },
|
||||
#else /* __LIBELF_SYMBOL_VERSIONS */
|
||||
{ 0, 0 },
|
||||
{ 0, 0 },
|
||||
#endif /* __LIBELF_SYMBOL_VERSIONS */
|
||||
},
|
||||
{
|
||||
{ byte_copy, byte_copy },
|
||||
{ addr_64M__tom, addr_64M__tof },
|
||||
{ dyn_64M11_tom, dyn_64M11_tof },
|
||||
{ ehdr_64M11_tom, ehdr_64M11_tof },
|
||||
{ half_64M__tom, half_64M__tof },
|
||||
{ off_64M__tom, off_64M__tof },
|
||||
{ phdr_64M11_tom, phdr_64M11_tof },
|
||||
{ rela_64M11_tom, rela_64M11_tof },
|
||||
{ rel_64M11_tom, rel_64M11_tof },
|
||||
{ shdr_64M11_tom, shdr_64M11_tof },
|
||||
{ sword_64M__tom, sword_64M__tof },
|
||||
{ sym_64M11_tom, sym_64M11_tof },
|
||||
{ word_64M__tom, word_64M__tof },
|
||||
{ sxword_64M__tom, sxword_64M__tof },
|
||||
{ xword_64M__tom, xword_64M__tof },
|
||||
#if __LIBELF_SYMBOL_VERSIONS
|
||||
{ _elf_verdef_64M11_tom, _elf_verdef_64M11_tof },
|
||||
{ _elf_verneed_64M11_tom, _elf_verneed_64M11_tof },
|
||||
#else /* __LIBELF_SYMBOL_VERSIONS */
|
||||
{ 0, 0 },
|
||||
{ 0, 0 },
|
||||
#endif /* __LIBELF_SYMBOL_VERSIONS */
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* main translation table (64-bit)
|
||||
*/
|
||||
#if PIC
|
||||
static xltab*
|
||||
#else /* PIC */
|
||||
static const xltab *const
|
||||
#endif /* PIC */
|
||||
xlate64[EV_CURRENT - EV_NONE][EV_CURRENT - EV_NONE] = {
|
||||
{ xlate64_11, },
|
||||
};
|
||||
|
||||
#define translator(sv,dv,enc,type,d) \
|
||||
(xlate64[(sv) - EV_NONE - 1] \
|
||||
[(dv) - EV_NONE - 1] \
|
||||
[(enc) - ELFDATA2LSB] \
|
||||
[(type) - ELF_T_BYTE] \
|
||||
[d])
|
||||
|
||||
/*
|
||||
* destination buffer size
|
||||
*/
|
||||
size_t
|
||||
_elf64_xltsize(const Elf_Data *src, unsigned dv, unsigned encode, int tof) {
|
||||
Elf_Type type = src->d_type;
|
||||
unsigned sv = src->d_version;
|
||||
xlator op;
|
||||
|
||||
if (!valid_version(sv) || !valid_version(dv)) {
|
||||
seterr(ERROR_UNKNOWN_VERSION);
|
||||
return (size_t)-1;
|
||||
}
|
||||
if (tof) {
|
||||
/*
|
||||
* Encoding doesn't really matter (the translator only looks at
|
||||
* the source, which resides in memory), but we need a proper
|
||||
* encoding to select a translator...
|
||||
*/
|
||||
encode = ELFDATA2LSB;
|
||||
}
|
||||
else if (!valid_encoding(encode)) {
|
||||
seterr(ERROR_UNKNOWN_ENCODING);
|
||||
return (size_t)-1;
|
||||
}
|
||||
if (!valid_type(type)) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
return (size_t)-1;
|
||||
}
|
||||
if (!(op = translator(sv, dv, encode, type, tof))) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
return (size_t)-1;
|
||||
}
|
||||
return (*op)(NULL, src->d_buf, src->d_size);
|
||||
}
|
||||
|
||||
/*
|
||||
* direction-independent translation
|
||||
*/
|
||||
static Elf_Data*
|
||||
elf64_xlate(Elf_Data *dst, const Elf_Data *src, unsigned encode, int tof) {
|
||||
Elf_Type type;
|
||||
int dv;
|
||||
int sv;
|
||||
size_t dsize;
|
||||
size_t tmp;
|
||||
xlator op;
|
||||
|
||||
if (!src || !dst) {
|
||||
return NULL;
|
||||
}
|
||||
if (!src->d_buf || !dst->d_buf) {
|
||||
seterr(ERROR_NULLBUF);
|
||||
return NULL;
|
||||
}
|
||||
if (!valid_encoding(encode)) {
|
||||
seterr(ERROR_UNKNOWN_ENCODING);
|
||||
return NULL;
|
||||
}
|
||||
sv = src->d_version;
|
||||
dv = dst->d_version;
|
||||
if (!valid_version(sv) || !valid_version(dv)) {
|
||||
seterr(ERROR_UNKNOWN_VERSION);
|
||||
return NULL;
|
||||
}
|
||||
type = src->d_type;
|
||||
if (!valid_type(type)) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
return NULL;
|
||||
}
|
||||
op = translator(sv, dv, encode, type, tof);
|
||||
if (!op) {
|
||||
seterr(ERROR_UNKNOWN_TYPE);
|
||||
return NULL;
|
||||
}
|
||||
dsize = (*op)(NULL, src->d_buf, src->d_size);
|
||||
if (dsize == (size_t)-1) {
|
||||
return NULL;
|
||||
}
|
||||
if (dst->d_size < dsize) {
|
||||
seterr(ERROR_DST2SMALL);
|
||||
return NULL;
|
||||
}
|
||||
if (dsize) {
|
||||
tmp = (*op)(dst->d_buf, src->d_buf, src->d_size);
|
||||
if (tmp == (size_t)-1) {
|
||||
return NULL;
|
||||
}
|
||||
elf_assert(tmp == dsize);
|
||||
}
|
||||
dst->d_size = dsize;
|
||||
dst->d_type = type;
|
||||
return dst;
|
||||
}
|
||||
|
||||
/*
|
||||
* finally, the "official" translation functions
|
||||
*/
|
||||
Elf_Data*
|
||||
elf64_xlatetom(Elf_Data *dst, const Elf_Data *src, unsigned encode) {
|
||||
return elf64_xlate(dst, src, encode, 0);
|
||||
}
|
||||
|
||||
Elf_Data*
|
||||
elf64_xlatetof(Elf_Data *dst, const Elf_Data *src, unsigned encode) {
|
||||
return elf64_xlate(dst, src, encode, 1);
|
||||
}
|
||||
|
||||
Elf_Data*
|
||||
gelf_xlatetom(Elf *elf, Elf_Data *dst, const Elf_Data *src, unsigned encode) {
|
||||
if (elf) {
|
||||
if (elf->e_kind != ELF_K_ELF) {
|
||||
seterr(ERROR_NOTELF);
|
||||
}
|
||||
else if (elf->e_class == ELFCLASS32) {
|
||||
return elf32_xlatetom(dst, src, encode);
|
||||
}
|
||||
else if (elf->e_class == ELFCLASS64) {
|
||||
return elf64_xlatetom(dst, src, encode);
|
||||
}
|
||||
else if (valid_class(elf->e_class)) {
|
||||
seterr(ERROR_UNIMPLEMENTED);
|
||||
}
|
||||
else {
|
||||
seterr(ERROR_UNKNOWN_CLASS);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Elf_Data*
|
||||
gelf_xlatetof(Elf *elf, Elf_Data *dst, const Elf_Data *src, unsigned encode) {
|
||||
if (elf) {
|
||||
if (elf->e_kind != ELF_K_ELF) {
|
||||
seterr(ERROR_NOTELF);
|
||||
}
|
||||
else if (elf->e_class == ELFCLASS32) {
|
||||
return elf32_xlatetof(dst, src, encode);
|
||||
}
|
||||
else if (elf->e_class == ELFCLASS64) {
|
||||
return elf64_xlatetof(dst, src, encode);
|
||||
}
|
||||
else if (valid_class(elf->e_class)) {
|
||||
seterr(ERROR_UNIMPLEMENTED);
|
||||
}
|
||||
else {
|
||||
seterr(ERROR_UNKNOWN_CLASS);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* __LIBELF64__ */
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
assert.c - assert function for libelf.
|
||||
Copyright (C) 1999 Michael Riepe
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: assert.c,v 1.5 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
__elf_assert(const char *file, unsigned line, const char *cond) {
|
||||
fprintf(stderr, "%s:%u: libelf assertion failure: %s\n",
|
||||
file, line, cond);
|
||||
abort();
|
||||
}
|
|
@ -0,0 +1,429 @@
|
|||
/*
|
||||
* begin.c - implementation of the elf_begin(3) and elf_memory(3) functions.
|
||||
* Copyright (C) 1995 - 2004 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: begin.c,v 1.22 2009/11/01 13:04:19 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
static const Elf _elf_init = INIT_ELF;
|
||||
static const char fmag[] = ARFMAG;
|
||||
|
||||
static unsigned long
|
||||
getnum(const char *str, size_t len, int base, size_t *err) {
|
||||
unsigned long result = 0;
|
||||
|
||||
while (len && *str == ' ') {
|
||||
str++; len--;
|
||||
}
|
||||
while (len && *str >= '0' && (*str - '0') < base) {
|
||||
result = base * result + *str++ - '0'; len--;
|
||||
}
|
||||
while (len && *str == ' ') {
|
||||
str++; len--;
|
||||
}
|
||||
if (len) {
|
||||
*err = len;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
_elf_init_ar(Elf *elf) {
|
||||
struct ar_hdr *hdr;
|
||||
size_t offset;
|
||||
size_t size;
|
||||
size_t err = 0;
|
||||
|
||||
elf->e_kind = ELF_K_AR;
|
||||
elf->e_idlen = SARMAG;
|
||||
elf->e_off = SARMAG;
|
||||
|
||||
/* process special members */
|
||||
offset = SARMAG;
|
||||
while (!elf->e_strtab && offset + sizeof(*hdr) <= elf->e_size) {
|
||||
hdr = (struct ar_hdr*)(elf->e_data + offset);
|
||||
if (memcmp(hdr->ar_fmag, fmag, sizeof(fmag) - 1)) {
|
||||
break;
|
||||
}
|
||||
if (hdr->ar_name[0] != '/') {
|
||||
break;
|
||||
}
|
||||
size = getnum(hdr->ar_size, sizeof(hdr->ar_size), 10, &err);
|
||||
if (err || !size) {
|
||||
break;
|
||||
}
|
||||
offset += sizeof(*hdr);
|
||||
if (offset + size > elf->e_size) {
|
||||
break;
|
||||
}
|
||||
if (hdr->ar_name[1] == '/' && hdr->ar_name[2] == ' ') {
|
||||
elf->e_strtab = elf->e_data + offset;
|
||||
elf->e_strlen = size;
|
||||
break;
|
||||
}
|
||||
if (hdr->ar_name[1] != ' ') {
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* Windows (.lib) archives provide two symbol tables
|
||||
* The first one is the one we want.
|
||||
*/
|
||||
if (!elf->e_symtab) {
|
||||
elf->e_symtab = elf->e_data + offset;
|
||||
elf->e_symlen = size;
|
||||
}
|
||||
offset += size + (size & 1);
|
||||
}
|
||||
}
|
||||
|
||||
static Elf_Arhdr*
|
||||
_elf_arhdr(Elf *arf) {
|
||||
struct ar_hdr *hdr;
|
||||
Elf_Arhdr *arhdr;
|
||||
size_t namelen;
|
||||
size_t tmp;
|
||||
char *name;
|
||||
size_t err = 0;
|
||||
|
||||
if (arf->e_off == arf->e_size) {
|
||||
/* no error! */
|
||||
return NULL;
|
||||
}
|
||||
if (arf->e_off < 0 || arf->e_off > arf->e_size) {
|
||||
seterr(ERROR_OUTSIDE);
|
||||
return NULL;
|
||||
}
|
||||
if (arf->e_off + sizeof(*hdr) > arf->e_size) {
|
||||
seterr(ERROR_TRUNC_ARHDR);
|
||||
return NULL;
|
||||
}
|
||||
elf_assert(arf->e_data != NULL);
|
||||
hdr = (struct ar_hdr*)(arf->e_data + arf->e_off);
|
||||
if (memcmp(hdr->ar_fmag, fmag, sizeof(fmag) - 1)) {
|
||||
seterr(ERROR_ARFMAG);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
name = hdr->ar_name;
|
||||
for (namelen = sizeof(hdr->ar_name); namelen > 0; namelen--) {
|
||||
if (name[namelen - 1] != ' ') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (name[0] == '/') {
|
||||
if (name[1] >= '0' && name[1] <= '9') {
|
||||
if (!arf->e_strtab) {
|
||||
seterr(ERROR_ARSTRTAB);
|
||||
return NULL;
|
||||
}
|
||||
tmp = getnum(&name[1], namelen - 1, 10, &err);
|
||||
if (err) {
|
||||
seterr(ERROR_ARSPECIAL);
|
||||
return NULL;
|
||||
}
|
||||
if (tmp < 0 || tmp >= arf->e_strlen) {
|
||||
seterr(ERROR_ARSTRTAB);
|
||||
return NULL;
|
||||
}
|
||||
for (namelen = tmp; namelen < arf->e_strlen; namelen++) {
|
||||
if (arf->e_strtab[namelen] == '/') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (namelen == arf->e_strlen) {
|
||||
seterr(ERROR_ARSTRTAB);
|
||||
return NULL;
|
||||
}
|
||||
name = arf->e_strtab + tmp;
|
||||
namelen -= tmp;
|
||||
}
|
||||
else if (namelen != 1 && !(namelen == 2 && name[1] == '/')) {
|
||||
seterr(ERROR_ARSPECIAL);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else if (namelen > 0 && name[namelen - 1] == '/') {
|
||||
namelen--;
|
||||
}
|
||||
/* XXX some broken software omits the trailing slash
|
||||
else {
|
||||
namelen = 0;
|
||||
}
|
||||
*/
|
||||
|
||||
if (!(arhdr = (Elf_Arhdr*)malloc(sizeof(*arhdr) +
|
||||
sizeof(hdr->ar_name) + namelen + 2))) {
|
||||
seterr(ERROR_MEM_ARHDR);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
arhdr->ar_name = NULL;
|
||||
arhdr->ar_rawname = (char*)(arhdr + 1);
|
||||
arhdr->ar_date = getnum(hdr->ar_date, sizeof(hdr->ar_date), 10, &err);
|
||||
arhdr->ar_uid = getnum(hdr->ar_uid, sizeof(hdr->ar_uid), 10, &err);
|
||||
arhdr->ar_gid = getnum(hdr->ar_gid, sizeof(hdr->ar_gid), 10, &err);
|
||||
arhdr->ar_mode = getnum(hdr->ar_mode, sizeof(hdr->ar_mode), 8, &err);
|
||||
arhdr->ar_size = getnum(hdr->ar_size, sizeof(hdr->ar_size), 10, &err);
|
||||
if (err) {
|
||||
free(arhdr);
|
||||
seterr(ERROR_ARHDR);
|
||||
return NULL;
|
||||
}
|
||||
if (arf->e_off + sizeof(struct ar_hdr) + arhdr->ar_size > arf->e_size) {
|
||||
free(arhdr);
|
||||
seterr(ERROR_TRUNC_MEMBER);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(arhdr->ar_rawname, hdr->ar_name, sizeof(hdr->ar_name));
|
||||
arhdr->ar_rawname[sizeof(hdr->ar_name)] = '\0';
|
||||
|
||||
if (namelen) {
|
||||
arhdr->ar_name = arhdr->ar_rawname + sizeof(hdr->ar_name) + 1;
|
||||
memcpy(arhdr->ar_name, name, namelen);
|
||||
arhdr->ar_name[namelen] = '\0';
|
||||
}
|
||||
|
||||
return arhdr;
|
||||
}
|
||||
|
||||
static void
|
||||
_elf_check_type(Elf *elf, size_t size) {
|
||||
elf->e_idlen = size;
|
||||
if (size >= EI_NIDENT && !memcmp(elf->e_data, ELFMAG, SELFMAG)) {
|
||||
elf->e_kind = ELF_K_ELF;
|
||||
elf->e_idlen = EI_NIDENT;
|
||||
elf->e_class = elf->e_data[EI_CLASS];
|
||||
elf->e_encoding = elf->e_data[EI_DATA];
|
||||
elf->e_version = elf->e_data[EI_VERSION];
|
||||
}
|
||||
else if (size >= SARMAG && !memcmp(elf->e_data, ARMAG, SARMAG)) {
|
||||
_elf_init_ar(elf);
|
||||
}
|
||||
}
|
||||
|
||||
Elf*
|
||||
elf_begin(int fd, Elf_Cmd cmd, Elf *ref) {
|
||||
Elf_Arhdr *arhdr = NULL;
|
||||
size_t size = 0;
|
||||
off_t off;
|
||||
Elf *elf;
|
||||
|
||||
elf_assert(_elf_init.e_magic == ELF_MAGIC);
|
||||
if (_elf_version == EV_NONE) {
|
||||
seterr(ERROR_VERSION_UNSET);
|
||||
return NULL;
|
||||
}
|
||||
else if (cmd == ELF_C_NULL) {
|
||||
return NULL;
|
||||
}
|
||||
else if (cmd == ELF_C_WRITE) {
|
||||
ref = NULL;
|
||||
}
|
||||
else if (cmd != ELF_C_READ && cmd != ELF_C_RDWR) {
|
||||
seterr(ERROR_INVALID_CMD);
|
||||
return NULL;
|
||||
}
|
||||
else if (ref) {
|
||||
elf_assert(ref->e_magic == ELF_MAGIC);
|
||||
if (!ref->e_readable || (cmd == ELF_C_RDWR && !ref->e_writable)) {
|
||||
seterr(ERROR_CMDMISMATCH);
|
||||
return NULL;
|
||||
}
|
||||
if (ref->e_kind != ELF_K_AR) {
|
||||
ref->e_count++;
|
||||
return ref;
|
||||
}
|
||||
if (cmd == ELF_C_RDWR) {
|
||||
seterr(ERROR_MEMBERWRITE);
|
||||
return NULL;
|
||||
}
|
||||
if (ref->e_memory) {
|
||||
fd = ref->e_fd;
|
||||
}
|
||||
else if (fd != ref->e_fd) {
|
||||
seterr(ERROR_FDMISMATCH);
|
||||
return NULL;
|
||||
}
|
||||
if (!(arhdr = _elf_arhdr(ref))) {
|
||||
return NULL;
|
||||
}
|
||||
size = arhdr->ar_size;
|
||||
}
|
||||
else if ((off = lseek(fd, (off_t)0, SEEK_END)) == (off_t)-1
|
||||
|| (off_t)(size = off) != off) {
|
||||
seterr(ERROR_IO_GETSIZE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(elf = (Elf*)malloc(sizeof(Elf)))) {
|
||||
seterr(ERROR_MEM_ELF);
|
||||
return NULL;
|
||||
}
|
||||
*elf = _elf_init;
|
||||
elf->e_fd = fd;
|
||||
elf->e_parent = ref;
|
||||
elf->e_size = elf->e_dsize = size;
|
||||
|
||||
if (cmd != ELF_C_READ) {
|
||||
elf->e_writable = 1;
|
||||
}
|
||||
if (cmd != ELF_C_WRITE) {
|
||||
elf->e_readable = 1;
|
||||
}
|
||||
else {
|
||||
return elf;
|
||||
}
|
||||
|
||||
if (ref) {
|
||||
size_t offset = ref->e_off + sizeof(struct ar_hdr);
|
||||
Elf *xelf;
|
||||
|
||||
elf_assert(arhdr);
|
||||
elf->e_arhdr = arhdr;
|
||||
elf->e_base = ref->e_base + offset;
|
||||
/*
|
||||
* Share the archive's memory image. To avoid
|
||||
* multiple independent elf descriptors if the
|
||||
* same member is requested twice, scan the list
|
||||
* of open members for duplicates.
|
||||
*
|
||||
* I don't know how SVR4 handles this case. Don't rely on it.
|
||||
*/
|
||||
for (xelf = ref->e_members; xelf; xelf = xelf->e_link) {
|
||||
elf_assert(xelf->e_parent == ref);
|
||||
if (xelf->e_base == elf->e_base) {
|
||||
free(arhdr);
|
||||
free(elf);
|
||||
xelf->e_count++;
|
||||
return xelf;
|
||||
}
|
||||
}
|
||||
if (size == 0) {
|
||||
elf->e_data = NULL;
|
||||
}
|
||||
#if 1
|
||||
else {
|
||||
/*
|
||||
* Archive members may be misaligned. Freezing them will
|
||||
* cause libelf to allocate buffers for translated data,
|
||||
* which should be properly aligned in all cases.
|
||||
*/
|
||||
elf_assert(!ref->e_cooked);
|
||||
elf->e_data = elf->e_rawdata = ref->e_data + offset;
|
||||
}
|
||||
#else
|
||||
else if (ref->e_data == ref->e_rawdata) {
|
||||
elf_assert(!ref->e_cooked);
|
||||
/*
|
||||
* archive is frozen - freeze member, too
|
||||
*/
|
||||
elf->e_data = elf->e_rawdata = ref->e_data + offset;
|
||||
}
|
||||
else {
|
||||
elf_assert(!ref->e_memory);
|
||||
elf->e_data = ref->e_data + offset;
|
||||
/*
|
||||
* The member's memory image may have been modified if
|
||||
* the member has been processed before. Since we need the
|
||||
* original image, we have to re-read the archive file.
|
||||
* Will fail if the archive's file descriptor is disabled.
|
||||
*/
|
||||
if (!ref->e_cooked) {
|
||||
ref->e_cooked = 1;
|
||||
}
|
||||
else if (!_elf_read(ref, elf->e_data, offset, size)) {
|
||||
free(arhdr);
|
||||
free(elf);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
elf->e_next = offset + size + (size & 1);
|
||||
elf->e_disabled = ref->e_disabled;
|
||||
elf->e_memory = ref->e_memory;
|
||||
/* parent/child linking */
|
||||
elf->e_link = ref->e_members;
|
||||
ref->e_members = elf;
|
||||
ref->e_count++;
|
||||
/* Slowaris compatibility - do not rely on this! */
|
||||
ref->e_off = elf->e_next;
|
||||
}
|
||||
else if (size) {
|
||||
#if HAVE_MMAP
|
||||
/*
|
||||
* Using mmap on writable files will interfere with elf_update
|
||||
*/
|
||||
if (!elf->e_writable && (elf->e_data = _elf_mmap(elf))) {
|
||||
elf->e_unmap_data = 1;
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_MMAP */
|
||||
if (!(elf->e_data = _elf_read(elf, NULL, 0, size))) {
|
||||
free(elf);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
_elf_check_type(elf, size);
|
||||
return elf;
|
||||
}
|
||||
|
||||
Elf*
|
||||
elf_memory(char *image, size_t size) {
|
||||
Elf *elf;
|
||||
|
||||
elf_assert(_elf_init.e_magic == ELF_MAGIC);
|
||||
if (_elf_version == EV_NONE) {
|
||||
seterr(ERROR_VERSION_UNSET);
|
||||
return NULL;
|
||||
}
|
||||
else if (size == 0 || image == NULL) {
|
||||
/* TODO: set error code? */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(elf = (Elf*)malloc(sizeof(Elf)))) {
|
||||
seterr(ERROR_MEM_ELF);
|
||||
return NULL;
|
||||
}
|
||||
*elf = _elf_init;
|
||||
elf->e_size = elf->e_dsize = size;
|
||||
elf->e_data = elf->e_rawdata = image;
|
||||
elf->e_readable = 1;
|
||||
elf->e_disabled = 1;
|
||||
elf->e_memory = 1;
|
||||
|
||||
_elf_check_type(elf, size);
|
||||
return elf;
|
||||
}
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
int
|
||||
gelf_getclass(Elf *elf) {
|
||||
if (elf && elf->e_kind == ELF_K_ELF && valid_class(elf->e_class)) {
|
||||
return elf->e_class;
|
||||
}
|
||||
return ELFCLASSNONE;
|
||||
}
|
||||
|
||||
#endif /* __LIBELF64 */
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
byteswap.h - functions and macros for byte swapping.
|
||||
Copyright (C) 1995 - 2001 Michael Riepe
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/* @(#) $Id: byteswap.h,v 1.7 2008/05/23 08:15:34 michael Exp $ */
|
||||
|
||||
#ifndef _BYTESWAP_H
|
||||
#define _BYTESWAP_H
|
||||
|
||||
#define lu(from,i,s) (((__libelf_u32_t)((unsigned char*)(from))[i])<<(s))
|
||||
#define li(from,i,s) (((__libelf_i32_t)(( signed char*)(from))[i])<<(s))
|
||||
|
||||
#define __load_u16L(from) ((__libelf_u32_t) \
|
||||
(lu(from,1,8) | lu(from,0,0)))
|
||||
#define __load_u16M(from) ((__libelf_u32_t) \
|
||||
(lu(from,0,8) | lu(from,1,0)))
|
||||
#define __load_i16L(from) ((__libelf_i32_t) \
|
||||
(li(from,1,8) | lu(from,0,0)))
|
||||
#define __load_i16M(from) ((__libelf_i32_t) \
|
||||
(li(from,0,8) | lu(from,1,0)))
|
||||
|
||||
#define __load_u32L(from) ((__libelf_u32_t) \
|
||||
(lu(from,3,24) | lu(from,2,16) | lu(from,1,8) | lu(from,0,0)))
|
||||
#define __load_u32M(from) ((__libelf_u32_t) \
|
||||
(lu(from,0,24) | lu(from,1,16) | lu(from,2,8) | lu(from,3,0)))
|
||||
#define __load_i32L(from) ((__libelf_i32_t) \
|
||||
(li(from,3,24) | lu(from,2,16) | lu(from,1,8) | lu(from,0,0)))
|
||||
#define __load_i32M(from) ((__libelf_i32_t) \
|
||||
(li(from,0,24) | lu(from,1,16) | lu(from,2,8) | lu(from,3,0)))
|
||||
|
||||
#define su(to,i,v,s) (((char*)(to))[i]=((__libelf_u32_t)(v)>>(s)))
|
||||
#define si(to,i,v,s) (((char*)(to))[i]=((__libelf_i32_t)(v)>>(s)))
|
||||
|
||||
#define __store_u16L(to,v) \
|
||||
(su(to,1,v,8), su(to,0,v,0))
|
||||
#define __store_u16M(to,v) \
|
||||
(su(to,0,v,8), su(to,1,v,0))
|
||||
#define __store_i16L(to,v) \
|
||||
(si(to,1,v,8), si(to,0,v,0))
|
||||
#define __store_i16M(to,v) \
|
||||
(si(to,0,v,8), si(to,1,v,0))
|
||||
|
||||
#define __store_u32L(to,v) \
|
||||
(su(to,3,v,24), su(to,2,v,16), su(to,1,v,8), su(to,0,v,0))
|
||||
#define __store_u32M(to,v) \
|
||||
(su(to,0,v,24), su(to,1,v,16), su(to,2,v,8), su(to,3,v,0))
|
||||
#define __store_i32L(to,v) \
|
||||
(si(to,3,v,24), si(to,2,v,16), si(to,1,v,8), si(to,0,v,0))
|
||||
#define __store_i32M(to,v) \
|
||||
(si(to,0,v,24), si(to,1,v,16), si(to,2,v,8), si(to,3,v,0))
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
/*
|
||||
* conversion functions from swap64.c
|
||||
*/
|
||||
extern __libelf_u64_t _elf_load_u64L(const unsigned char *from);
|
||||
extern __libelf_u64_t _elf_load_u64M(const unsigned char *from);
|
||||
extern __libelf_i64_t _elf_load_i64L(const unsigned char *from);
|
||||
extern __libelf_i64_t _elf_load_i64M(const unsigned char *from);
|
||||
extern void _elf_store_u64L(unsigned char *to, __libelf_u64_t v);
|
||||
extern void _elf_store_u64M(unsigned char *to, __libelf_u64_t v);
|
||||
extern void _elf_store_i64L(unsigned char *to, __libelf_u64_t v);
|
||||
extern void _elf_store_i64M(unsigned char *to, __libelf_u64_t v);
|
||||
|
||||
/*
|
||||
* aliases for existing conversion code
|
||||
*/
|
||||
#define __load_u64L _elf_load_u64L
|
||||
#define __load_u64M _elf_load_u64M
|
||||
#define __load_i64L _elf_load_i64L
|
||||
#define __load_i64M _elf_load_i64M
|
||||
#define __store_u64L _elf_store_u64L
|
||||
#define __store_u64M _elf_store_u64M
|
||||
#define __store_i64L _elf_store_i64L
|
||||
#define __store_i64M _elf_store_i64M
|
||||
|
||||
#endif /* __LIBELF64 */
|
||||
|
||||
#endif /* _BYTESWAP_H */
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
checksum.c - implementation of the elf{32,64}_checksum(3) functions.
|
||||
Copyright (C) 1995 - 2001 Michael Riepe
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: checksum.c,v 1.7 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
/*
|
||||
* Compatibility note:
|
||||
*
|
||||
* The algorithm used in {elf32,elf64,gelf}_checksum() does not seem to
|
||||
* be documented. I hope I got it right. My implementation does the
|
||||
* following:
|
||||
*
|
||||
* - skip sections that do not have the SHF_ALLOC flag set
|
||||
* - skip sections of type SHT_NULL, SHT_NOBITS, SHT_DYNSYM and
|
||||
* SHT_DYNAMIC
|
||||
* - add all data bytes from the remaining sections, modulo 2**32
|
||||
* - add upper and lower half of the result
|
||||
* - subtract 0xffff if the result is > 0xffff
|
||||
* - if any error occurs, return 0L
|
||||
*/
|
||||
|
||||
static int
|
||||
skip_section(Elf_Scn *scn, unsigned cls) {
|
||||
if (cls == ELFCLASS32) {
|
||||
Elf32_Shdr *shdr = &scn->s_shdr32;
|
||||
|
||||
if (!(shdr->sh_flags & SHF_ALLOC)) {
|
||||
return 1;
|
||||
}
|
||||
switch (shdr->sh_type) {
|
||||
case SHT_NULL:
|
||||
case SHT_NOBITS:
|
||||
/* Solaris seems to ignore these, too */
|
||||
case SHT_DYNSYM:
|
||||
case SHT_DYNAMIC:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#if __LIBELF64
|
||||
else if (cls == ELFCLASS64) {
|
||||
Elf64_Shdr *shdr = &scn->s_shdr64;
|
||||
|
||||
if (!(shdr->sh_flags & SHF_ALLOC)) {
|
||||
return 1;
|
||||
}
|
||||
switch (shdr->sh_type) {
|
||||
case SHT_NULL:
|
||||
case SHT_NOBITS:
|
||||
/* Solaris seems to ignore these, too */
|
||||
case SHT_DYNSYM:
|
||||
case SHT_DYNAMIC:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif /* __LIBELF64 */
|
||||
else {
|
||||
seterr(ERROR_UNIMPLEMENTED);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long
|
||||
add_bytes(unsigned char *ptr, size_t len) {
|
||||
long csum = 0;
|
||||
|
||||
while (len--) {
|
||||
csum += *ptr++;
|
||||
}
|
||||
return csum;
|
||||
}
|
||||
|
||||
static long
|
||||
_elf_csum(Elf *elf) {
|
||||
long csum = 0;
|
||||
Elf_Data *data;
|
||||
Elf_Scn *scn;
|
||||
|
||||
if (!elf->e_ehdr && !_elf_cook(elf)) {
|
||||
/* propagate errors from _elf_cook */
|
||||
return 0L;
|
||||
}
|
||||
seterr(0);
|
||||
for (scn = elf->e_scn_1; scn; scn = scn->s_link) {
|
||||
if (scn->s_index == SHN_UNDEF || skip_section(scn, elf->e_class)) {
|
||||
continue;
|
||||
}
|
||||
data = NULL;
|
||||
while ((data = elf_getdata(scn, data))) {
|
||||
if (data->d_size) {
|
||||
if (data->d_buf == NULL) {
|
||||
seterr(ERROR_NULLBUF);
|
||||
return 0L;
|
||||
}
|
||||
csum += add_bytes(data->d_buf, data->d_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_elf_errno) {
|
||||
return 0L;
|
||||
}
|
||||
csum = (csum & 0xffff) + ((csum >> 16) & 0xffff);
|
||||
if (csum > 0xffff) {
|
||||
csum -= 0xffff;
|
||||
}
|
||||
return csum;
|
||||
}
|
||||
|
||||
long
|
||||
elf32_checksum(Elf *elf) {
|
||||
if (elf) {
|
||||
if (elf->e_kind != ELF_K_ELF) {
|
||||
seterr(ERROR_NOTELF);
|
||||
}
|
||||
else if (elf->e_class != ELFCLASS32) {
|
||||
seterr(ERROR_CLASSMISMATCH);
|
||||
}
|
||||
else {
|
||||
return _elf_csum(elf);
|
||||
}
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
#if __LIBELF64
|
||||
|
||||
long
|
||||
elf64_checksum(Elf *elf) {
|
||||
if (elf) {
|
||||
if (elf->e_kind != ELF_K_ELF) {
|
||||
seterr(ERROR_NOTELF);
|
||||
}
|
||||
else if (elf->e_class != ELFCLASS64) {
|
||||
seterr(ERROR_CLASSMISMATCH);
|
||||
}
|
||||
else {
|
||||
return _elf_csum(elf);
|
||||
}
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
long
|
||||
gelf_checksum(Elf *elf) {
|
||||
if (elf) {
|
||||
if (elf->e_kind != ELF_K_ELF) {
|
||||
seterr(ERROR_NOTELF);
|
||||
}
|
||||
else if (!valid_class(elf->e_class)) {
|
||||
seterr(ERROR_UNKNOWN_CLASS);
|
||||
}
|
||||
else {
|
||||
return _elf_csum(elf);
|
||||
}
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
#endif /* __LIBELF64 */
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
cntl.c - implementation of the elf_cntl(3) function.
|
||||
Copyright (C) 1995 - 1998 Michael Riepe
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: cntl.c,v 1.7 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
int
|
||||
elf_cntl(Elf *elf, Elf_Cmd cmd) {
|
||||
Elf_Scn *scn;
|
||||
Elf *child;
|
||||
|
||||
if (!elf) {
|
||||
return -1;
|
||||
}
|
||||
elf_assert(elf->e_magic == ELF_MAGIC);
|
||||
if (cmd == ELF_C_FDREAD) {
|
||||
if (!elf->e_readable) {
|
||||
seterr(ERROR_WRONLY);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (cmd != ELF_C_FDDONE) {
|
||||
seterr(ERROR_INVALID_CMD);
|
||||
return -1;
|
||||
}
|
||||
if (elf->e_disabled) {
|
||||
return 0;
|
||||
}
|
||||
if (elf->e_kind == ELF_K_AR) {
|
||||
for (child = elf->e_members; child; child = child->e_link) {
|
||||
elf_assert(elf == child->e_parent);
|
||||
if (elf_cntl(child, cmd)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (elf->e_kind == ELF_K_ELF && cmd == ELF_C_FDREAD) {
|
||||
if (!elf->e_ehdr && !_elf_cook(elf)) {
|
||||
return -1;
|
||||
}
|
||||
for (scn = elf->e_scn_1; scn; scn = scn->s_link) {
|
||||
if (scn->s_index == SHN_UNDEF || scn->s_type == SHT_NULL) {
|
||||
continue;
|
||||
}
|
||||
else if (!elf_getdata(scn, NULL)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
elf->e_disabled = 1;
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,164 @@
|
|||
/*
|
||||
* lib/config.h.w32 - configuration file for W32 port
|
||||
* Copyright (C) 2004 - 2006 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* @(#) $Id: config.h.w32,v 1.2 2006/09/07 15:55:42 michael Exp $
|
||||
*/
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if you want to include extra debugging code */
|
||||
#define ENABLE_DEBUG 1
|
||||
|
||||
/* Define if memmove() does not copy overlapping arrays correctly */
|
||||
#undef HAVE_BROKEN_MEMMOVE
|
||||
|
||||
/* Define if you have the catgets function. */
|
||||
#undef HAVE_CATGETS
|
||||
|
||||
/* Define if you have the dgettext function. */
|
||||
#undef HAVE_DGETTEXT
|
||||
|
||||
/* Define if you have the memset function. */
|
||||
#define HAVE_MEMSET 1
|
||||
|
||||
/* Define if struct nlist is declared in <elf.h> or <sys/elf.h> */
|
||||
#undef HAVE_STRUCT_NLIST_DECLARATION
|
||||
|
||||
/* Define if Elf32_Dyn is declared in <link.h> */
|
||||
#undef __LIBELF_NEED_LINK_H
|
||||
|
||||
/* Define if Elf32_Dyn is declared in <sys/link.h> */
|
||||
#undef __LIBELF_NEED_SYS_LINK_H
|
||||
|
||||
/* Define to `<elf.h>' or `<sys/elf.h>' if one of them is present */
|
||||
#undef __LIBELF_HEADER_ELF_H
|
||||
|
||||
/* Define if you want 64-bit support (and your system supports it) */
|
||||
#define __LIBELF64 1
|
||||
|
||||
/* Define if you want 64-bit support, and are running IRIX */
|
||||
#undef __LIBELF64_IRIX
|
||||
|
||||
/* Define if you want 64-bit support, and are running Linux */
|
||||
#undef __LIBELF64_LINUX
|
||||
|
||||
/* Define if you want symbol versioning (and your system supports it) */
|
||||
#define __LIBELF_SYMBOL_VERSIONS 1
|
||||
|
||||
/* Define if symbol versioning uses Sun section type (SHT_SUNW_*) */
|
||||
#define __LIBELF_SUN_SYMBOL_VERSIONS 1
|
||||
|
||||
/* Define if symbol versioning uses GNU section types (SHT_GNU_*) */
|
||||
#undef __LIBELF_GNU_SYMBOL_VERSIONS
|
||||
|
||||
/* Define to a 64-bit signed integer type if one exists */
|
||||
#define __libelf_i64_t __int64
|
||||
|
||||
/* Define to a 64-bit unsigned integer type if one exists */
|
||||
#define __libelf_u64_t unsigned __int64
|
||||
|
||||
/* Define to a 32-bit signed integer type if one exists */
|
||||
#define __libelf_i32_t int
|
||||
|
||||
/* Define to a 32-bit unsigned integer type if one exists */
|
||||
#define __libelf_u32_t unsigned int
|
||||
|
||||
/* Define to a 16-bit signed integer type if one exists */
|
||||
#define __libelf_i16_t short int
|
||||
|
||||
/* Define to a 16-bit unsigned integer type if one exists */
|
||||
#define __libelf_u16_t unsigned short int
|
||||
|
||||
/* The number of bytes in a __int64. */
|
||||
#define SIZEOF___INT64 8
|
||||
|
||||
/* The number of bytes in a int. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The number of bytes in a long. */
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* The number of bytes in a long long. */
|
||||
#define SIZEOF_LONG_LONG 0
|
||||
|
||||
/* The number of bytes in a short. */
|
||||
#define SIZEOF_SHORT 2
|
||||
|
||||
/* Define if you have the ftruncate function. */
|
||||
#undef HAVE_FTRUNCATE
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define if you have the memcmp function. */
|
||||
#define HAVE_MEMCMP 1
|
||||
|
||||
/* Define if you have the memcpy function. */
|
||||
#define HAVE_MEMCPY 1
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
/* Define if you have the memset function. */
|
||||
#define HAVE_MEMSET 1
|
||||
|
||||
/* Define if you have the <ar.h> header file. */
|
||||
#undef HAVE_AR_H
|
||||
|
||||
/* Define if you have the <elf.h> header file. */
|
||||
#undef HAVE_ELF_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <gelf.h> header file. */
|
||||
#undef HAVE_GELF_H
|
||||
|
||||
/* Define if you have the <libelf.h> header file. */
|
||||
#undef HAVE_LIBELF_H
|
||||
|
||||
/* Define if you have the <link.h> header file. */
|
||||
#undef HAVE_LINK_H
|
||||
|
||||
/* Define if you have the <nlist.h> header file. */
|
||||
#undef HAVE_NLIST_H
|
||||
|
||||
/* Define if you have the <sys/elf.h> header file. */
|
||||
#undef HAVE_SYS_ELF_H
|
||||
|
||||
/* Define if you have the <sys/link.h> header file. */
|
||||
#undef HAVE_SYS_LINK_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
|
@ -0,0 +1,501 @@
|
|||
/*
|
||||
* cook.c - read and translate ELF files.
|
||||
* Copyright (C) 1995 - 2006 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: cook.c,v 1.29 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
const Elf_Scn _elf_scn_init = INIT_SCN;
|
||||
const Scn_Data _elf_data_init = INIT_DATA;
|
||||
|
||||
Elf_Type
|
||||
_elf_scn_type(unsigned t) {
|
||||
switch (t) {
|
||||
case SHT_DYNAMIC: return ELF_T_DYN;
|
||||
case SHT_DYNSYM: return ELF_T_SYM;
|
||||
case SHT_HASH: return ELF_T_WORD;
|
||||
case SHT_REL: return ELF_T_REL;
|
||||
case SHT_RELA: return ELF_T_RELA;
|
||||
case SHT_SYMTAB: return ELF_T_SYM;
|
||||
case SHT_SYMTAB_SHNDX: return ELF_T_WORD; /* XXX: really? */
|
||||
#if __LIBELF_SYMBOL_VERSIONS
|
||||
#if __LIBELF_SUN_SYMBOL_VERSIONS
|
||||
case SHT_SUNW_verdef: return ELF_T_VDEF;
|
||||
case SHT_SUNW_verneed: return ELF_T_VNEED;
|
||||
case SHT_SUNW_versym: return ELF_T_HALF;
|
||||
#else /* __LIBELF_SUN_SYMBOL_VERSIONS */
|
||||
case SHT_GNU_verdef: return ELF_T_VDEF;
|
||||
case SHT_GNU_verneed: return ELF_T_VNEED;
|
||||
case SHT_GNU_versym: return ELF_T_HALF;
|
||||
#endif /* __LIBELF_SUN_SYMBOL_VERSIONS */
|
||||
#endif /* __LIBELF_SYMBOL_VERSIONS */
|
||||
}
|
||||
return ELF_T_BYTE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for overflow on 32-bit systems
|
||||
*/
|
||||
#define overflow(a,b,t) (sizeof(a) < sizeof(t) && (t)(a) != (b))
|
||||
|
||||
#define truncerr(t) ((t)==ELF_T_EHDR?ERROR_TRUNC_EHDR: \
|
||||
((t)==ELF_T_PHDR?ERROR_TRUNC_PHDR: \
|
||||
ERROR_INTERNAL))
|
||||
#define memerr(t) ((t)==ELF_T_EHDR?ERROR_MEM_EHDR: \
|
||||
((t)==ELF_T_PHDR?ERROR_MEM_PHDR: \
|
||||
ERROR_INTERNAL))
|
||||
|
||||
Elf_Data*
|
||||
_elf_xlatetom(const Elf *elf, Elf_Data *dst, const Elf_Data *src) {
|
||||
if (elf->e_class == ELFCLASS32) {
|
||||
return elf32_xlatetom(dst, src, elf->e_encoding);
|
||||
}
|
||||
#if __LIBELF64
|
||||
else if (elf->e_class == ELFCLASS64) {
|
||||
return elf64_xlatetom(dst, src, elf->e_encoding);
|
||||
}
|
||||
#endif /* __LIBELF64 */
|
||||
seterr(ERROR_UNIMPLEMENTED);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char*
|
||||
_elf_item(void *buf, Elf *elf, Elf_Type type, size_t off) {
|
||||
Elf_Data src, dst;
|
||||
|
||||
elf_assert(valid_type(type));
|
||||
if (off < 0 || off > elf->e_size) {
|
||||
seterr(ERROR_OUTSIDE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
src.d_type = type;
|
||||
src.d_version = elf->e_version;
|
||||
src.d_size = _fsize(elf->e_class, src.d_version, type);
|
||||
elf_assert(src.d_size);
|
||||
if ((elf->e_size - off) < src.d_size) {
|
||||
seterr(truncerr(type));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dst.d_version = _elf_version;
|
||||
dst.d_size = _msize(elf->e_class, dst.d_version, type);
|
||||
elf_assert(dst.d_size);
|
||||
|
||||
if (!(dst.d_buf = buf) && !(dst.d_buf = malloc(dst.d_size))) {
|
||||
seterr(memerr(type));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
elf_assert(elf->e_data);
|
||||
if (elf->e_rawdata) {
|
||||
src.d_buf = elf->e_rawdata + off;
|
||||
}
|
||||
else {
|
||||
src.d_buf = elf->e_data + off;
|
||||
}
|
||||
|
||||
if (_elf_xlatetom(elf, &dst, &src)) {
|
||||
return (char*)dst.d_buf;
|
||||
}
|
||||
if (dst.d_buf != buf) {
|
||||
free(dst.d_buf);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
_elf_cook_phdr(Elf *elf) {
|
||||
size_t num, off, entsz;
|
||||
|
||||
if (elf->e_class == ELFCLASS32) {
|
||||
num = ((Elf32_Ehdr*)elf->e_ehdr)->e_phnum;
|
||||
off = ((Elf32_Ehdr*)elf->e_ehdr)->e_phoff;
|
||||
entsz = ((Elf32_Ehdr*)elf->e_ehdr)->e_phentsize;
|
||||
}
|
||||
#if __LIBELF64
|
||||
else if (elf->e_class == ELFCLASS64) {
|
||||
num = ((Elf64_Ehdr*)elf->e_ehdr)->e_phnum;
|
||||
off = ((Elf64_Ehdr*)elf->e_ehdr)->e_phoff;
|
||||
entsz = ((Elf64_Ehdr*)elf->e_ehdr)->e_phentsize;
|
||||
/*
|
||||
* Check for overflow on 32-bit systems
|
||||
*/
|
||||
if (overflow(off, ((Elf64_Ehdr*)elf->e_ehdr)->e_phoff, Elf64_Off)) {
|
||||
seterr(ERROR_OUTSIDE);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif /* __LIBELF64 */
|
||||
else {
|
||||
seterr(ERROR_UNIMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
if (off) {
|
||||
Elf_Scn *scn;
|
||||
size_t size;
|
||||
unsigned i;
|
||||
char *p;
|
||||
|
||||
if (num == PN_XNUM) {
|
||||
/*
|
||||
* Overflow in ehdr->e_phnum.
|
||||
* Get real value from first SHDR.
|
||||
*/
|
||||
if (!(scn = elf->e_scn_1)) {
|
||||
seterr(ERROR_NOSUCHSCN);
|
||||
return 0;
|
||||
}
|
||||
if (elf->e_class == ELFCLASS32) {
|
||||
num = scn->s_shdr32.sh_info;
|
||||
}
|
||||
#if __LIBELF64
|
||||
else if (elf->e_class == ELFCLASS64) {
|
||||
num = scn->s_shdr64.sh_info;
|
||||
}
|
||||
#endif /* __LIBELF64 */
|
||||
/* we already had this
|
||||
else {
|
||||
seterr(ERROR_UNIMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
size = _fsize(elf->e_class, elf->e_version, ELF_T_PHDR);
|
||||
elf_assert(size);
|
||||
#if ENABLE_EXTENDED_FORMAT
|
||||
if (entsz < size) {
|
||||
#else /* ENABLE_EXTENDED_FORMAT */
|
||||
if (entsz != size) {
|
||||
#endif /* ENABLE_EXTENDED_FORMAT */
|
||||
seterr(ERROR_EHDR_PHENTSIZE);
|
||||
return 0;
|
||||
}
|
||||
size = _msize(elf->e_class, _elf_version, ELF_T_PHDR);
|
||||
elf_assert(size);
|
||||
if (!(p = malloc(num * size))) {
|
||||
seterr(memerr(ELF_T_PHDR));
|
||||
return 0;
|
||||
}
|
||||
for (i = 0; i < num; i++) {
|
||||
if (!_elf_item(p + i * size, elf, ELF_T_PHDR, off + i * entsz)) {
|
||||
free(p);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
elf->e_phdr = p;
|
||||
elf->e_phnum = num;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_elf_cook_shdr(Elf *elf) {
|
||||
size_t num, off, entsz;
|
||||
|
||||
if (elf->e_class == ELFCLASS32) {
|
||||
num = ((Elf32_Ehdr*)elf->e_ehdr)->e_shnum;
|
||||
off = ((Elf32_Ehdr*)elf->e_ehdr)->e_shoff;
|
||||
entsz = ((Elf32_Ehdr*)elf->e_ehdr)->e_shentsize;
|
||||
}
|
||||
#if __LIBELF64
|
||||
else if (elf->e_class == ELFCLASS64) {
|
||||
num = ((Elf64_Ehdr*)elf->e_ehdr)->e_shnum;
|
||||
off = ((Elf64_Ehdr*)elf->e_ehdr)->e_shoff;
|
||||
entsz = ((Elf64_Ehdr*)elf->e_ehdr)->e_shentsize;
|
||||
/*
|
||||
* Check for overflow on 32-bit systems
|
||||
*/
|
||||
if (overflow(off, ((Elf64_Ehdr*)elf->e_ehdr)->e_shoff, Elf64_Off)) {
|
||||
seterr(ERROR_OUTSIDE);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif /* __LIBELF64 */
|
||||
else {
|
||||
seterr(ERROR_UNIMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
if (off) {
|
||||
struct tmp {
|
||||
Elf_Scn scn;
|
||||
Scn_Data data;
|
||||
} *head;
|
||||
Elf_Data src, dst;
|
||||
Elf_Scn *scn;
|
||||
Scn_Data *sd;
|
||||
unsigned i;
|
||||
|
||||
if (off < 0 || off > elf->e_size) {
|
||||
seterr(ERROR_OUTSIDE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
src.d_type = ELF_T_SHDR;
|
||||
src.d_version = elf->e_version;
|
||||
src.d_size = _fsize(elf->e_class, src.d_version, ELF_T_SHDR);
|
||||
elf_assert(src.d_size);
|
||||
#if ENABLE_EXTENDED_FORMAT
|
||||
if (entsz < src.d_size) {
|
||||
#else /* ENABLE_EXTENDED_FORMAT */
|
||||
if (entsz != src.d_size) {
|
||||
#endif /* ENABLE_EXTENDED_FORMAT */
|
||||
seterr(ERROR_EHDR_SHENTSIZE);
|
||||
return 0;
|
||||
}
|
||||
dst.d_version = EV_CURRENT;
|
||||
|
||||
if (num == 0) {
|
||||
union {
|
||||
Elf32_Shdr sh32;
|
||||
#if __LIBELF64
|
||||
Elf64_Shdr sh64;
|
||||
#endif /* __LIBELF64 */
|
||||
} u;
|
||||
|
||||
/*
|
||||
* Overflow in ehdr->e_shnum.
|
||||
* Get real value from first SHDR.
|
||||
*/
|
||||
if (elf->e_size - off < entsz) {
|
||||
seterr(ERROR_TRUNC_SHDR);
|
||||
return 0;
|
||||
}
|
||||
if (elf->e_rawdata) {
|
||||
src.d_buf = elf->e_rawdata + off;
|
||||
}
|
||||
else {
|
||||
src.d_buf = elf->e_data + off;
|
||||
}
|
||||
dst.d_buf = &u;
|
||||
dst.d_size = sizeof(u);
|
||||
if (!_elf_xlatetom(elf, &dst, &src)) {
|
||||
return 0;
|
||||
}
|
||||
elf_assert(dst.d_size == _msize(elf->e_class, EV_CURRENT, ELF_T_SHDR));
|
||||
elf_assert(dst.d_type == ELF_T_SHDR);
|
||||
if (elf->e_class == ELFCLASS32) {
|
||||
num = u.sh32.sh_size;
|
||||
}
|
||||
#if __LIBELF64
|
||||
else if (elf->e_class == ELFCLASS64) {
|
||||
num = u.sh64.sh_size;
|
||||
/*
|
||||
* Check for overflow on 32-bit systems
|
||||
*/
|
||||
if (overflow(num, u.sh64.sh_size, Elf64_Xword)) {
|
||||
seterr(ERROR_OUTSIDE);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif /* __LIBELF64 */
|
||||
}
|
||||
|
||||
if ((elf->e_size - off) / entsz < num) {
|
||||
seterr(ERROR_TRUNC_SHDR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(head = (struct tmp*)malloc(num * sizeof(struct tmp)))) {
|
||||
seterr(ERROR_MEM_SCN);
|
||||
return 0;
|
||||
}
|
||||
for (scn = NULL, i = num; i-- > 0; ) {
|
||||
head[i].scn = _elf_scn_init;
|
||||
head[i].data = _elf_data_init;
|
||||
head[i].scn.s_link = scn;
|
||||
if (!scn) {
|
||||
elf->e_scn_n = &head[i].scn;
|
||||
}
|
||||
scn = &head[i].scn;
|
||||
sd = &head[i].data;
|
||||
|
||||
if (elf->e_rawdata) {
|
||||
src.d_buf = elf->e_rawdata + off + i * entsz;
|
||||
}
|
||||
else {
|
||||
src.d_buf = elf->e_data + off + i * entsz;
|
||||
}
|
||||
dst.d_buf = &scn->s_uhdr;
|
||||
dst.d_size = sizeof(scn->s_uhdr);
|
||||
if (!_elf_xlatetom(elf, &dst, &src)) {
|
||||
elf->e_scn_n = NULL;
|
||||
free(head);
|
||||
return 0;
|
||||
}
|
||||
elf_assert(dst.d_size == _msize(elf->e_class, EV_CURRENT, ELF_T_SHDR));
|
||||
elf_assert(dst.d_type == ELF_T_SHDR);
|
||||
|
||||
scn->s_elf = elf;
|
||||
scn->s_index = i;
|
||||
scn->s_data_1 = sd;
|
||||
scn->s_data_n = sd;
|
||||
|
||||
sd->sd_scn = scn;
|
||||
|
||||
if (elf->e_class == ELFCLASS32) {
|
||||
Elf32_Shdr *shdr = &scn->s_shdr32;
|
||||
|
||||
scn->s_type = shdr->sh_type;
|
||||
scn->s_size = shdr->sh_size;
|
||||
scn->s_offset = shdr->sh_offset;
|
||||
sd->sd_data.d_align = shdr->sh_addralign;
|
||||
sd->sd_data.d_type = _elf_scn_type(scn->s_type);
|
||||
}
|
||||
#if __LIBELF64
|
||||
else if (elf->e_class == ELFCLASS64) {
|
||||
Elf64_Shdr *shdr = &scn->s_shdr64;
|
||||
|
||||
scn->s_type = shdr->sh_type;
|
||||
scn->s_size = shdr->sh_size;
|
||||
scn->s_offset = shdr->sh_offset;
|
||||
sd->sd_data.d_align = shdr->sh_addralign;
|
||||
/*
|
||||
* Check for overflow on 32-bit systems
|
||||
*/
|
||||
if (overflow(scn->s_size, shdr->sh_size, Elf64_Xword)
|
||||
|| overflow(scn->s_offset, shdr->sh_offset, Elf64_Off)
|
||||
|| overflow(sd->sd_data.d_align, shdr->sh_addralign, Elf64_Xword)) {
|
||||
seterr(ERROR_OUTSIDE);
|
||||
return 0;
|
||||
}
|
||||
sd->sd_data.d_type = _elf_scn_type(scn->s_type);
|
||||
/*
|
||||
* QUIRKS MODE:
|
||||
*
|
||||
* Some 64-bit architectures use 64-bit entries in the
|
||||
* .hash section. This violates the ELF standard, and
|
||||
* should be fixed. It's mostly harmless as long as the
|
||||
* binary and the machine running your program have the
|
||||
* same byte order, but you're in trouble if they don't,
|
||||
* and if the entry size is wrong.
|
||||
*
|
||||
* As a workaround, I let libelf guess the right size
|
||||
* for the binary. This relies pretty much on the fact
|
||||
* that the binary provides correct data in the section
|
||||
* headers. If it doesn't, it's probably broken anyway.
|
||||
* Therefore, libelf uses a standard conforming value
|
||||
* when it's not absolutely sure.
|
||||
*/
|
||||
if (scn->s_type == SHT_HASH) {
|
||||
int override = 0;
|
||||
|
||||
/*
|
||||
* sh_entsize must reflect the entry size
|
||||
*/
|
||||
if (shdr->sh_entsize == ELF64_FSZ_ADDR) {
|
||||
override++;
|
||||
}
|
||||
/*
|
||||
* sh_size must be a multiple of sh_entsize
|
||||
*/
|
||||
if (shdr->sh_size % ELF64_FSZ_ADDR == 0) {
|
||||
override++;
|
||||
}
|
||||
/*
|
||||
* There must be room for at least 2 entries
|
||||
*/
|
||||
if (shdr->sh_size >= 2 * ELF64_FSZ_ADDR) {
|
||||
override++;
|
||||
}
|
||||
/*
|
||||
* sh_addralign must be correctly set
|
||||
*/
|
||||
if (shdr->sh_addralign == ELF64_FSZ_ADDR) {
|
||||
override++;
|
||||
}
|
||||
/*
|
||||
* The section must be properly aligned
|
||||
*/
|
||||
if (shdr->sh_offset % ELF64_FSZ_ADDR == 0) {
|
||||
override++;
|
||||
}
|
||||
/* XXX: also look at the data? */
|
||||
/*
|
||||
* Make a conservative decision...
|
||||
*/
|
||||
if (override >= 5) {
|
||||
sd->sd_data.d_type = ELF_T_ADDR;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* END QUIRKS MODE.
|
||||
*/
|
||||
}
|
||||
#endif /* __LIBELF64 */
|
||||
/* we already had this
|
||||
else {
|
||||
seterr(ERROR_UNIMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
sd->sd_data.d_size = scn->s_size;
|
||||
sd->sd_data.d_version = _elf_version;
|
||||
}
|
||||
elf_assert(scn == &head[0].scn);
|
||||
elf->e_scn_1 = &head[0].scn;
|
||||
head[0].scn.s_freeme = 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_elf_cook_file(Elf *elf) {
|
||||
elf->e_ehdr = _elf_item(NULL, elf, ELF_T_EHDR, 0);
|
||||
if (!elf->e_ehdr) {
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* Note: _elf_cook_phdr may require the first section header!
|
||||
*/
|
||||
if (!_elf_cook_shdr(elf)) {
|
||||
return 0;
|
||||
}
|
||||
if (!_elf_cook_phdr(elf)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
_elf_cook(Elf *elf) {
|
||||
elf_assert(_elf_scn_init.s_magic == SCN_MAGIC);
|
||||
elf_assert(_elf_data_init.sd_magic == DATA_MAGIC);
|
||||
elf_assert(elf);
|
||||
elf_assert(elf->e_magic == ELF_MAGIC);
|
||||
elf_assert(elf->e_kind == ELF_K_ELF);
|
||||
elf_assert(!elf->e_ehdr);
|
||||
if (!valid_version(elf->e_version)) {
|
||||
seterr(ERROR_UNKNOWN_VERSION);
|
||||
}
|
||||
else if (!valid_encoding(elf->e_encoding)) {
|
||||
seterr(ERROR_UNKNOWN_ENCODING);
|
||||
}
|
||||
else if (valid_class(elf->e_class)) {
|
||||
return _elf_cook_file(elf);
|
||||
}
|
||||
else {
|
||||
seterr(ERROR_UNKNOWN_CLASS);
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* data.c - libelf internal variables.
|
||||
* Copyright (C) 1995 - 1998, 2007 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: data.c,v 1.8 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
unsigned _elf_version = EV_NONE;
|
||||
int _elf_errno = 0;
|
||||
int _elf_fill = 0;
|
||||
|
||||
#if ENABLE_SANITY_CHECKS
|
||||
#define SANITY_CHECKS -1
|
||||
#else
|
||||
#define SANITY_CHECKS 0
|
||||
#endif
|
||||
|
||||
int _elf_sanity_checks = SANITY_CHECKS;
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* end.c - implementation of the elf_end(3) function.
|
||||
* Copyright (C) 1995 - 2004 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: end.c,v 1.12 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
#if HAVE_MMAP
|
||||
#include <sys/mman.h>
|
||||
#endif /* HAVE_MMAP */
|
||||
|
||||
static void
|
||||
_elf_free(void *ptr) {
|
||||
if (ptr) {
|
||||
free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_elf_free_scns(Elf *elf, Elf_Scn *scn) {
|
||||
Scn_Data *sd, *tmp;
|
||||
Elf_Scn *freescn;
|
||||
|
||||
for (freescn = NULL; scn; scn = scn->s_link) {
|
||||
elf_assert(scn->s_magic == SCN_MAGIC);
|
||||
elf_assert(scn->s_elf == elf);
|
||||
for (sd = scn->s_data_1; sd; sd = tmp) {
|
||||
elf_assert(sd->sd_magic == DATA_MAGIC);
|
||||
elf_assert(sd->sd_scn == scn);
|
||||
tmp = sd->sd_link;
|
||||
if (sd->sd_free_data) {
|
||||
_elf_free(sd->sd_memdata);
|
||||
}
|
||||
if (sd->sd_freeme) {
|
||||
free(sd);
|
||||
}
|
||||
}
|
||||
if ((sd = scn->s_rawdata)) {
|
||||
elf_assert(sd->sd_magic == DATA_MAGIC);
|
||||
elf_assert(sd->sd_scn == scn);
|
||||
if (sd->sd_free_data) {
|
||||
_elf_free(sd->sd_memdata);
|
||||
}
|
||||
if (sd->sd_freeme) {
|
||||
free(sd);
|
||||
}
|
||||
}
|
||||
if (scn->s_freeme) {
|
||||
_elf_free(freescn);
|
||||
freescn = scn;
|
||||
}
|
||||
}
|
||||
_elf_free(freescn);
|
||||
}
|
||||
|
||||
int
|
||||
elf_end(Elf *elf) {
|
||||
Elf **siblings;
|
||||
|
||||
if (!elf) {
|
||||
return 0;
|
||||
}
|
||||
elf_assert(elf->e_magic == ELF_MAGIC);
|
||||
if (--elf->e_count) {
|
||||
return elf->e_count;
|
||||
}
|
||||
if (elf->e_parent) {
|
||||
elf_assert(elf->e_parent->e_magic == ELF_MAGIC);
|
||||
elf_assert(elf->e_parent->e_kind == ELF_K_AR);
|
||||
siblings = &elf->e_parent->e_members;
|
||||
while (*siblings) {
|
||||
if (*siblings == elf) {
|
||||
*siblings = elf->e_link;
|
||||
break;
|
||||
}
|
||||
siblings = &(*siblings)->e_link;
|
||||
}
|
||||
elf_end(elf->e_parent);
|
||||
_elf_free(elf->e_arhdr);
|
||||
}
|
||||
#if HAVE_MMAP
|
||||
else if (elf->e_unmap_data) {
|
||||
munmap(elf->e_data, elf->e_size);
|
||||
}
|
||||
#endif /* HAVE_MMAP */
|
||||
else if (!elf->e_memory) {
|
||||
_elf_free(elf->e_data);
|
||||
}
|
||||
_elf_free_scns(elf, elf->e_scn_1);
|
||||
if (elf->e_rawdata != elf->e_data) {
|
||||
_elf_free(elf->e_rawdata);
|
||||
}
|
||||
if (elf->e_free_syms) {
|
||||
_elf_free(elf->e_symtab);
|
||||
}
|
||||
_elf_free(elf->e_ehdr);
|
||||
_elf_free(elf->e_phdr);
|
||||
free(elf);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* errmsg.c - implementation of the elf_errmsg(3) function.
|
||||
* Copyright (C) 1995 - 1999, 2004 Michael Riepe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: errmsg.c,v 1.11 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
#if HAVE_DGETTEXT
|
||||
# undef HAVE_CATGETS
|
||||
# include <libintl.h>
|
||||
#else /* HAVE_DGETTEXT */
|
||||
# define dgettext(dom, str) str
|
||||
#endif /* HAVE_DGETTEXT */
|
||||
|
||||
#if HAVE_CATGETS
|
||||
# include <nl_types.h>
|
||||
static nl_catd _libelf_cat = (nl_catd)0;
|
||||
#endif /* HAVE_CATGETS */
|
||||
|
||||
#if HAVE_DGETTEXT || HAVE_CATGETS
|
||||
static const char domain[] = "libelf";
|
||||
#endif /* HAVE_DGETTEXT || HAVE_CATGETS */
|
||||
|
||||
#if PIC
|
||||
static const char *_messages[] = {
|
||||
#else /* PIC */
|
||||
static const char *const _messages[] = {
|
||||
#endif /* PIC */
|
||||
#define __err__(a,b) b,
|
||||
#include <errors.h> /* include string tables from errors.h */
|
||||
#undef __err__
|
||||
};
|
||||
|
||||
const char*
|
||||
elf_errmsg(int err) {
|
||||
if (err == 0) {
|
||||
err = _elf_errno;
|
||||
if (err == 0) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else if (err == -1) {
|
||||
err = _elf_errno;
|
||||
}
|
||||
|
||||
if (err < 0 || err >= ERROR_NUM || _messages[err] == NULL) {
|
||||
err = ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
#if HAVE_CATGETS
|
||||
if (_libelf_cat == (nl_catd)0) {
|
||||
_libelf_cat = catopen(domain, 0);
|
||||
}
|
||||
if (_libelf_cat != (nl_catd)-1) {
|
||||
return catgets(_libelf_cat, 1, err + 1, _messages[err]);
|
||||
}
|
||||
#endif /* HAVE_CATGETS */
|
||||
return dgettext(domain, _messages[err]);
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
errno.c - implementation of the elf_errno(3) function.
|
||||
Copyright (C) 1995 - 1998 Michael Riepe
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <private.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "@(#) $Id: errno.c,v 1.7 2008/05/23 08:15:34 michael Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
int
|
||||
elf_errno(void) {
|
||||
int tmp = _elf_errno;
|
||||
|
||||
_elf_errno = 0;
|
||||
return tmp;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue