mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
- Added new Makefile.linux in bootrom directory
- Cleaned up Makefile.linux in armsrc directory - Added Linux toolchain build script in tools directory - Made LCD support optional (disabled by default) in armsrc - Small formatting changes
This commit is contained in:
parent
b1d0de0a08
commit
aa4d9d9b73
12 changed files with 686 additions and 40 deletions
39
tools/at91sam7s256-armusbocd-flash-program.cfg
Normal file
39
tools/at91sam7s256-armusbocd-flash-program.cfg
Normal file
|
@ -0,0 +1,39 @@
|
|||
#define our ports
|
||||
telnet_port 4444
|
||||
gdb_port 3333
|
||||
|
||||
#commands specific to the Olimex ARM-USB-OCD Dongle
|
||||
interface ft2232
|
||||
ft2232_device_desc "Olimex OpenOCD JTAG"
|
||||
ft2232_layout "olimex-jtag"
|
||||
ft2232_vid_pid 0x15BA 0x0003
|
||||
jtag_speed 2
|
||||
jtag_nsrst_delay 200
|
||||
jtag_ntrst_delay 200
|
||||
|
||||
#reset_config <signals> [combination] [trst_type] [srst_type]
|
||||
reset_config srst_only srst_pulls_trst
|
||||
|
||||
#jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
|
||||
jtag_device 4 0x1 0xf 0xe
|
||||
|
||||
#daemon_startup <'attach'|'reset'>
|
||||
daemon_startup reset
|
||||
|
||||
#target <type> <endianess> <reset_mode> <jtag#> [variant]
|
||||
target arm7tdmi little run_and_init 0 arm7tdmi_r4
|
||||
|
||||
#run_and_halt_time <target#> <time_in_ms>
|
||||
run_and_halt_time 0 30
|
||||
|
||||
# commands below are specific to AT91sam7 Flash Programming
|
||||
# ---------------------------------------------------------
|
||||
|
||||
#target_script specifies the flash programming script file
|
||||
target_script 0 reset script.ocd
|
||||
|
||||
#working_area <target#> <address> <size> <'backup'|'nobackup'>
|
||||
working_area 0 0x40000000 0x4000 nobackup
|
||||
|
||||
#flash bank at91sam7 0 0 0 0 <target#>
|
||||
flash bank at91sam7 0 0 0 0 0
|
29
tools/at91sam7s256-armusbocd.cfg
Normal file
29
tools/at91sam7s256-armusbocd.cfg
Normal file
|
@ -0,0 +1,29 @@
|
|||
#define our ports
|
||||
telnet_port 4444
|
||||
gdb_port 3333
|
||||
|
||||
#commands specific to the Olimex arm-usb-ocd
|
||||
interface ft2232
|
||||
# Be careful to reflect the exact description here:
|
||||
ft2232_device_desc "Olimex OpenOCD JTAG"
|
||||
ft2232_layout "olimex-jtag"
|
||||
ft2232_vid_pid 0x15BA 0x0003
|
||||
jtag_speed 2
|
||||
jtag_nsrst_delay 200
|
||||
jtag_ntrst_delay 200
|
||||
|
||||
#reset_config <signals> [combination] [trst_type] [srst_type]
|
||||
reset_config srst_only srst_pulls_trst
|
||||
|
||||
#jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
|
||||
jtag_device 4 0x1 0xf 0xe
|
||||
|
||||
#daemon_startup <'attach'|'reset'>
|
||||
daemon_startup reset
|
||||
|
||||
#target <type> <endianess> <reset_mode> <jtag#> [variant]
|
||||
target arm7tdmi little run_and_init 0 arm7tdmi_r4
|
||||
|
||||
#run_and_halt_time <target#> <time_in_ms>
|
||||
run_and_halt_time 0 30
|
||||
|
198
tools/install-gnuarm4.sh
Executable file
198
tools/install-gnuarm4.sh
Executable file
|
@ -0,0 +1,198 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Some things for you to configure
|
||||
|
||||
# Where you want to install the tools
|
||||
DESTDIR=/usr/local/gnuarm-4.3.0
|
||||
|
||||
# Where do you want to build the tools. This is where the log files
|
||||
# will be written (which you can monitor with 'tail' during compilation).
|
||||
# You can delete this directory after everything is done.
|
||||
SRCDIR="/home/lafargue/Documents/Hobbies/RFID/Toolchain/linux"
|
||||
|
||||
# Where to get each of the toolchain components
|
||||
BINUTILS=ftp://ftp.gnu.org/gnu/binutils/binutils-2.18.tar.bz2
|
||||
GCCCORE=ftp://ftp.gnu.org/gnu/gcc/gcc-4.3.0/gcc-core-4.3.0.tar.bz2
|
||||
GPP=ftp://ftp.gnu.org/gnu/gcc/gcc-4.3.0/gcc-g++-4.3.0.tar.bz2
|
||||
NEWLIB=ftp://sources.redhat.com/pub/newlib/newlib-1.16.0.tar.gz
|
||||
#INSIGHT=ftp://sourceware.org/pub/insight/releases/insight-6.8.tar.bz2
|
||||
INSIGHT=http://mirrors.kernel.org/sources.redhat.com/insight/releases/insight-6.8.tar.bz2
|
||||
#INSIGHT=http://www.mirrorservice.org/sites/sources.redhat.com/pub/insight/releases/insight-6.8.tar.bz2
|
||||
|
||||
# Common configuration options (i.e., things to pass to 'configure')
|
||||
COMMON_CFG="--enable-interwork --target=arm-elf --program-prefix=arm-elf- --prefix=${DESTDIR} --disable-werror --enable-languages=c,c++ --enable-multilib --disable-shared"
|
||||
|
||||
# Extra configuration options for each toolchain component
|
||||
BINUTILS_CFG=
|
||||
GCCCORE_CFG="--disable-libssp --disable-threads --with-newlib" # Not sure about these last 2 options...there to try to make C++ support work
|
||||
NEWLIB_CFG=
|
||||
INSIGHT_CFG=
|
||||
|
||||
# Compiler flags for compiling Newlib (-O2 is already hard-coded)
|
||||
NEWLIB_FLAGS="-march=armv4t -mcpu=arm7tdmi -g"
|
||||
|
||||
############################################################################
|
||||
# End of configuration section. You shouldn't have to modify anything below.
|
||||
############################################################################
|
||||
|
||||
if [[ `whoami` != "root" ]]; then
|
||||
echo You must be root to run this script
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p ${SRCDIR}
|
||||
cd ${SRCDIR}
|
||||
|
||||
if [[ -f `basename ${BINUTILS}` ]]; then
|
||||
echo Looks like BINUTILS has already been downloaded.
|
||||
else
|
||||
echo Now downloading BINUTILS...
|
||||
# -nv: non-verbose but not too quiet (still print errors/warnings)
|
||||
# -nc: no-clobber, do not download a file that already exists
|
||||
# -t 0: retry indefinitely
|
||||
# -a wget.log: append errors/warnings to wget.log file
|
||||
wget -nv -nc -t 0 -a wget.log ${BINUTILS}
|
||||
fi
|
||||
|
||||
if [[ -f `basename ${GCCCORE}` ]]; then
|
||||
echo Looks like GCC has already been downloaded.
|
||||
else
|
||||
echo Now downloading GCC...
|
||||
wget -nv -nc -t 0 -a wget.log ${GCCCORE}
|
||||
fi
|
||||
|
||||
if [[ -f `basename ${GPP}` ]]; then
|
||||
echo Looks like G++ has already been downloaded.
|
||||
else
|
||||
echo Now downloading G++...
|
||||
wget -nv -nc -t 0 -a wget.log ${GPP}
|
||||
fi
|
||||
|
||||
if [[ -f `basename ${NEWLIB}` ]]; then
|
||||
echo Looks like NEWLIB has already been downloaded.
|
||||
else
|
||||
echo Now downloading NEWLIB...
|
||||
wget -nv -nc -t 0 -a wget.log ${NEWLIB}
|
||||
fi
|
||||
|
||||
if [[ -f `basename ${INSIGHT}` ]]; then
|
||||
echo Looks like INSIGHT has already been downloaded.
|
||||
else
|
||||
echo Now downloading INSIGHT...
|
||||
wget -nv -nc -t 0 -a wget.log ${INSIGHT}
|
||||
fi
|
||||
|
||||
if [[ -f binutils.built ]]; then
|
||||
echo Looks like BINUTILS was already built.
|
||||
else
|
||||
echo Building BINUTILS...
|
||||
tar -xjf `basename ${BINUTILS}`
|
||||
echo ___________________ > make.log
|
||||
echo Building binutils... >> make.log
|
||||
cd `find . -maxdepth 1 -type d -name 'binutils*'`
|
||||
mkdir gnuarm
|
||||
cd gnuarm
|
||||
../configure ${COMMON_CFG} ${BINUTILS_CFG} >> ../../make.log 2>&1
|
||||
make MAKEINFO=`which makeinfo` >> ../../make.log 2>&1
|
||||
make install >> ../../make.log 2>&1
|
||||
cd ../..
|
||||
touch binutils.built
|
||||
fi
|
||||
|
||||
echo ___________________ >> make.log
|
||||
echo Adding ${DESTDIR}/bin to PATH >> make.log
|
||||
export PATH; PATH=${DESTDIR}/bin:$PATH
|
||||
echo ___________________ >> make.log
|
||||
|
||||
if [[ -f gcc.built ]]; then
|
||||
echo Looks like GCC was already built.
|
||||
else
|
||||
echo Building GCC...
|
||||
tar -xjf `basename ${GCCCORE}`
|
||||
tar -xjf `basename ${GPP}`
|
||||
echo ___________________ >> make.log
|
||||
|
||||
cat << EOF > gcc.patch
|
||||
--- gcc-4.2.2.orig/gcc/config/arm/t-arm-elf 2006-11-06 13:13:53.000000000 +0100
|
||||
+++ gcc-4.2.2.mod/gcc/config/arm/t-arm-elf 2007-10-05 12:13:00.000000000 +0200
|
||||
@@ -23,8 +23,8 @@
|
||||
# MULTILIB_DIRNAMES += fpu soft
|
||||
# MULTILIB_EXCEPTIONS += *mthumb/*mhard-float*
|
||||
#
|
||||
-# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
|
||||
-# MULTILIB_DIRNAMES += normal interwork
|
||||
+MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
|
||||
+MULTILIB_DIRNAMES += normal interwork
|
||||
#
|
||||
# MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore
|
||||
# MULTILIB_DIRNAMES += elf under
|
||||
EOF
|
||||
|
||||
echo Patching GCC >> make.log
|
||||
cd `find . -maxdepth 1 -type d -name 'gcc*'`
|
||||
patch -p1 < ../gcc.patch
|
||||
echo Building gcc... >> make.log
|
||||
mkdir gnuarm
|
||||
cd gnuarm
|
||||
../configure ${COMMON_CFG} ${GCCCORE_CFG} >> ../../make.log 2>&1
|
||||
make >> ../../make.log 2>&1
|
||||
make install >> ../../make.log 2>&1
|
||||
cd ../..
|
||||
touch gcc.built
|
||||
fi
|
||||
|
||||
if [[ -f newlib.built ]]; then
|
||||
echo Looks like NEWLIB was already built.
|
||||
else
|
||||
echo Building NEWLIB...
|
||||
tar -xzf `basename ${NEWLIB}`
|
||||
echo ___________________ >> make.log
|
||||
echo Building newlib... >> make.log
|
||||
cd `find . -maxdepth 1 -type d -name 'newlib*'`
|
||||
mkdir gnuarm
|
||||
cd gnuarm
|
||||
../configure ${COMMON_CFG} ${NEWLIB_CFG} >> ../../make.log 2>&1
|
||||
|
||||
# This line adds our NEWLIB_CFLAGS to the configure.host file in the
|
||||
# newlib subdirectory. This is the only way I could find to tell Newlib to
|
||||
# compile itself with the -mmarch=armv4t and -mcpu=arm7tdmi flags.
|
||||
sed -i "/^newlib_cflags=/s/=.*\$/=\"${NEWLIB_FLAGS}\"/" ../newlib/configure.host
|
||||
make >> ../../make.log 2>&1
|
||||
make install >> ../../make.log 2>&1
|
||||
cd ../..
|
||||
touch newlib.built
|
||||
fi
|
||||
|
||||
echo ___________________ >> make.log
|
||||
echo "Now that newlib is built, second pass for GCC..." >> make.log
|
||||
cd `find . -maxdepth 1 -type d -name 'gcc*'`
|
||||
cd gnuarm
|
||||
make >> ../../make.log 2>&1
|
||||
make install >> ../../make.log 2>&1
|
||||
cd ../..
|
||||
|
||||
|
||||
if [[ -f insight.built ]]; then
|
||||
echo Looks like INSIGHT was already built.
|
||||
else
|
||||
echo Building INSIGHT...
|
||||
tar -xjf `basename ${INSIGHT}`
|
||||
echo ___________________ >> make.log
|
||||
echo Building insight... >> make.log
|
||||
cd `find . -maxdepth 1 -type d -name 'insight*'`
|
||||
mkdir gnuarm
|
||||
cd gnuarm
|
||||
../configure ${COMMON_CFG} ${INSIGHT_CFG} >> ../../make.log 2>&1
|
||||
make >> ../../make.log 2>&1
|
||||
make install >> ../../make.log 2>&1
|
||||
cd ../..
|
||||
touch insight.built
|
||||
fi
|
||||
|
||||
echo ___________________ >> make.log
|
||||
echo Build complete. >> make.log
|
||||
|
||||
cd ${DESTDIR}
|
||||
chmod -R a+rX .
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue