Установка arm-none-eabi-gcc
Ставим по привычке в /opt:
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
sudo mv gcc-arm-none-eabi-4_9-2015q3 /opt
Настроечный файл тулчейна /opt/arm-2015q3.setup:
GCC_ARM=/opt/gcc-arm-none-eabi-4_9-2015q3
export GCC_ARM
PATH="${GCC_ARM}/bin:$PATH"
export PATH
Установка CMSIS-DAP
git clone --depth=1 https://github.com/ataradov/edbg
sudo yum install -y systemd-devel.x86_64
cd edbg
make
sudo cp 90-atmel-edbg.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo cp edbg /usr/sbin
готово:
$ ./edbg --help
CMSIS-DAP SWD programmer v0.5
Usage: ./edbg [options]
Options:
-h, --help print this help message and exit
-b, --verbose print verbose messages
-e, --erase perform a chip erase before programming
-p, --program program the chip
-v, --verify verify memory
-k, --lock lock the chip (set security bit)
-r, --read read the whole content of the chip flash
-f, --file <file> binary file to be programmed or verified
-t, --target <name> specify a target type (use '-t list' for a list of supported target types)
-l, --list list all available debuggers
-s, --serial <number> use a debugger with a specified serial number
-o, --offset <number> offset for the operation
-z, --size <number> size for the operation
смотрим какие архитектуры поддерживаются:
$ ./edbg -t list
Supported target types:
atmel_cm0p - Atmel SAM C/D/R series
atmel_cm3 - Atmel SAM3X/A series
atmel_cm4 - Atmel SAM G and SAM4 series
atmel_cm7 - Atmel SAM E7x/S7x/V7x series
втыкаем отладку и смотрим как определяется:
$ ./edbg --list
Attached debuggers:
ATML2407080200003567 - Atmel Corp. EDBG CMSIS-DAP
читаем прошивку:
$ ./edbg -t atmel_cm7 --verbose --read --file a.bin
Debugger: ATMEL EDBG CMSIS-DAP ATML2407080200003567 03.1F.01AE (S)
Target: SAM V71Q21
Reading................................
................................. done.
Установка примеров
wget http://www.atmel.com/images/asf-standalone-archive-3.32.0.48.zip
wget http://www.atmel.com/images/samv71_softpack_1.5_for_gnu_arm_2015q3.zip
unzip samv71_softpack_1.5_for_gnu_arm_2015q3.zip
Сборка примера с CAN FD
cd examples/Atmel/SAMV71_Xplained_Ultra/examples/mcan/build/gcc
. /opt/arm-2015q3.setup
make
В итоге в директории bin получаем образы для заливки во флеш или в ОЗУ:
$ ll bin/
mcan-flash.bin*
mcan-flash.elf*
mcan-flash.elf.txt
mcan-flash.map
mcan-sram.bin*
mcan-sram.elf*
mcan-sram.elf.txt
mcan-sram.map
Заливаем в SRAM:
$ ./edbg -t atmel_cm7 --verbose --program --verify --file bin/mcan-sram.bin
Debugger: ATMEL EDBG CMSIS-DAP ATML2407080200003567 03.1F.01AE (S)
Target: SAM V71Q21
Programming........................................... done.
Verification.......................................... done.