You are here
Home > embedded >

Setup GCC ARM Tool Chain For SAM E54 Xplained Pro

After struggling with config file for SAME54 board we are detailing out steps for setting up a free and fully functional GCC + Eclipse + OpenOCD GDBServer environments for use with the SAME54 Xplained Pro board.

Contents

Step 1. Setup GCC ARM Toolchain

There are varity of arm-tool chains like Yagarto, gcc-arm. I will go with GNU Arm® Embedded Toolchain (gcc-arm-none-eabi). The gcc-arm toolchain has hardfp support meaning one can take full advantage of the floating point unit (FPU) and can be used with all Cortex-M0,M3 and M4 parts.

Installing executable on Ubuntu *
Unpack the tarball to the install directory, like this:
$ cd $install_dir && tar xjf gcc-arm-none-eabi-*-yyyymmdd-linux.tar.bz2

In my case i have installed in usr/lib folder.
Update this installation path to ~/.profile file
$ vi ~/.profile
export PATH=”$PATH:/usr/lib/gcc-arm-none-eabi-8-2018-q4-major/bin”

$source ~/.profile
$echo $PATH

Then execute following command to check gcc version
$ arm-none-eabi-gcc -v

For some Ubuntu releases, the toolchain can also be installed via
Launchpad PPA at https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa.

Step 2 – Get SAME54 Example

Go to www.start.atmel.com and download example ‘LED Toggle’ for SAM E54 xplained pro board.

Extract this project to your local folder and navigate to “gcc” folder.
$ cd LED_switcher/gcc
Now execute make comand
$make
This will create “AtmelStart.elf” file
Finished building target: AtmelStart.elf
“arm-none-eabi-objcopy” -O binary “AtmelStart.elf” “AtmelStart.bin”
“arm-none-eabi-objcopy” -O ihex -R .eeprom -R .fuse -R .lock -R .signature \
“AtmelStart.elf” “AtmelStart.hex”
“arm-none-eabi-objcopy” -j .eeprom –set-section-flags=.eeprom=alloc,load –change-section-lma \
.eeprom=0 –no-change-warnings -O binary “AtmelStart.elf” \
“AtmelStart.eep” || exit 0
“arm-none-eabi-objdump” -h -S “AtmelStart.elf” > “AtmelStart.lss”
“arm-none-eabi-size” “AtmelStart.elf”
text data bss dec hex filename
1472 0 65584 67056 105f0 AtmelStart.elf

AtmelStart.bin and AtmelStart.hex are release based images that ought to be downloaded onto the chip when programming it. The .elf file is typically used for debugging. It is identical image as the one in the .bin/.hex files with debug information required by the debugger.

Step 3. Install OpenOCD

Install and configure the debugger software OpenOCD
$sudo openocd -f ~/openocd/tcl/board/microchip_same54_xplained_pro.cfg -c “program AtmelStart.elf verify reset exit”

Open On-Chip Debugger 0.10.0+dev-00755-ga7479fa8 (2019-03-30-16:21)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport “swd”. To override use ‘transport select ‘.
none separate
adapter speed: 2000 kHz
cortex_m reset_config sysresetreq
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: FW Version = 03.25.01B6
Info : CMSIS-DAP: Serial# = ATML2748051800002368
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x2ba01477
Info : same54.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Info : SWD DPIDR 0x2ba01477
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x000002b6 msp: 0x20010020
** Programming Started **
auto erase enabled
Info : SAM MCU: SAME54P20A (1024KB Flash, 256KB RAM)

Now hit the button on the board and LED on the board will blink! Congratulations! you just built your first program for the SAM E54 Xplained Pro Board..

Leave a Reply

Top