Pcb

PCB

embedded programing week

ATSAMD11C

download blink.c blink.make bootloader blink.ino from class page

To use Atmel-ICE on Mac

EDBG:Embedded Debugger

Download edbg and $ make all

install libhidapi will be required

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
$ brew install hidapi
$ cd Desktop/edbg-master
$ make all
gcc -I/usr/local/include/hidapi -W -Wall -Wextra -O2 -std=gnu11 dap.c edbg.c target.c target_atmel_cm0p.c target_atmel_cm3.c target_atmel_cm4.c target_atmel_cm7.c target_atmel_cm4v2.c target_mchp_cm23.c target_st_stm32g0.c target_gd_gd32f4xx.c  dbg_mac.c /usr/local/lib/libhidapi.a -framework IOKit -framework CoreFoundation -o edbg

find serial number of USB connected Atmel-Ice

install lsusb

$ lsusb
-bash: lsusb: command not found
$ brew install lsusb
Updating Homebrew...
...
/usr/local/Cellar/lsusb/1.0: 4 files, 12.4KB

Find serial nunber

$ lsusb
Bus 020 Device 041: ID 03eb:2141 Atmel Corporation Atmel-ICE CMSIS-DAP  Serial: J41800032510

Write .bin to pcb
Embedded Programming calss page> JTAG (ARM)
EDBG
program: edbg -b -t target_type -pv -f binary_file

$ cd Desktop/
$ cd hello.D11C.blink/
$ ls
hello.D11C.blink.c          hello.D11C.blink.make
hello.D11C.blink.ino            sam_ba_Generic_D11C14A_SAMD11C14A.bin
$ edbg -t samd11 -bpv -f sam_ba_Generic_D11C14A_SAMD11C14A.bin -s J41800032510
-bash: edbg: command not found
$ /Users/yuichitamiya/Desktop/edbg-master/edbg -t samd11 -bpv -f sam_ba_Generic_D11C14A_SAMD11C14A.bin -s J41800032510
Debugger: ATMEL Atmel-ICE CMSIS-DAP J41800032510 01.27.0082 (SJ)
Clock frequency: 16.0 MHz
Target: SAM D11C14A (Rev B)
Programming................................................................... done.
Verification................................................................... done.

need to make PATH through
How to add PATH

$ nano ~/.bash_profile

add
export PATH=$PATH:/Users/yuichitamiya/Desktop/edbg-master/
save

$ source ~/.bash_profile

$ printenv PATH
$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/yuichitamiya/Desktop/edbg-master/

EDBG Useage ``` Usage: edbg [options] Options:

-b, –verbose print verbose messages -t, –target specify a target type (use ‘-t list’ for a list of supported target types)

-p, –program program the chip -v, –verify verify memory -f, –file binary file to be programmed or verified; also read output file name -s, –serial use a debugger with a specified serial number -F, –fuse operations on the fuses (use ‘-F help’ for details)

-h, –help print this help message and exit ```