Three serial communication modules (SERCOM) configurable as UART/USART, SPI or I2C, two 16-bit timer/counters, 32-bit Real-Time Clock and calendar, 12 PWM channels, one 8- or 10-channel 12-bit ADC, one 10-bit DAC
Full Speed USB device
Supports 7/12 self-capacitance touch channels in low/high pincount devices
Supports 72 mutual-capacitance touch channels
1.62V to 3.63V power supply
Easy pin migration to SAMD11C devices
Supported by Atmel Studio, ASF and the SAM D11 Xplained Pro kit
Comparing to ATTiny1614, 14-pins micro controller family in AVR-1 series with 16 KB Flash / 2 KB SRAM / running at up to 20 MHz, SAMD11C14 has higher specification.
As of 26 Nov 2021: Now that I found I do not have JTAG programmer device. I need something like this?, or make substitute programmer by Raspberry Pi like this example. I decided to try raspberry Pi Zero as a JTAG programmer as I have Pi zero.
source [find interface/raspberrypi2-native.cfg]
transport select swd
set CHIPNAME at91samd11d14a
source [find target/at91samdXX.cfg]
# did not yet manage to make a working setup using srst
#reset_config srst_only
reset_config srst_nogate
adapter_nsrst_delay 100
adapter_nsrst_assert_width 100
bcm2835gpio_swd_nums 25 24
bcm2835gpio_trst_num 7
bcm2835gpio_srst_num 18
init
targets
reset halt
1 2 3 4 5 6 7 8 910111213141516171819202122
$ sudo openocd
Open On-Chip Debugger 0.11.0+dev-00502-gf66a16c4a (2021-11-27-00:00)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter srst delay' not 'adapter_nsrst_delay'
DEPRECATED! use 'adapter srst pulse_width' not 'adapter_nsrst_assert_width'
DEPRECATED! use 'bcm2835gpio swd_nums' not 'bcm2835gpio_swd_nums'
DEPRECATED! use 'bcm2835gpio trst_num' not 'bcm2835gpio_trst_num'
DEPRECATED! use 'bcm2835gpio srst_num' not 'bcm2835gpio_srst_num'
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd21g18.cpu: Cortex-M0+ r0p1 processor detected
Info : at91samd21g18.cpu: target has 4 breakpoints, 2 watchpoints
Info : at91samd21g18.cpu: external reset detected
Info : starting gdb server for at91samd21g18.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0xfffffffe msp: 0xfffffffc
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
If this works, shutdown the process by Ctrl+C. Then append below to openocd.cfg
source [find interface/raspberrypi2-native.cfg]
transport select swd
set CHIPNAME at91samd11d14a
source [find target/at91samdXX.cfg]
# did not yet manage to make a working setup using srst
# reset_config srst_only
reset_config srst_nogate
adapter srst delay 100
adapter srst pulse_width 100
bcm2835gpio_swd_nums 25 24
bcm2835gpio_trst_num 7
bcm2835gpio_srst_num 18
init
targets
reset halt
at91samd bootloader 0
program sam_ba_Generic_D11C14A_SAMD11C14A.bin verify
at91samd bootloader 4096
reset
shutdown
This will init, look for targets, reset and halt the chip, turn off bootloader protection, burn in the bootloader file and verify it, re-turn-on bootloader protection, reset and shutdown openocd
$ sudo openocd
Open On-Chip Debugger 0.11.0+dev-00502-gf66a16c4a (2021-11-27-00:00)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter srst delay' not 'adapter_nsrst_delay'
DEPRECATED! use 'adapter srst pulse_width' not 'adapter_nsrst_assert_width'
DEPRECATED! use 'bcm2835gpio swd_nums' not 'bcm2835gpio_swd_nums'
DEPRECATED! use 'bcm2835gpio trst_num' not 'bcm2835gpio_trst_num'
DEPRECATED! use 'bcm2835gpio srst_num' not 'bcm2835gpio_srst_num'
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd11d14a.cpu: Cortex-M0+ r0p1 processor detected
Info : at91samd11d14a.cpu: target has 4 breakpoints, 2 watchpoints
Info : at91samd11d14a.cpu: external reset detected
Info : starting gdb server for at91samd11d14a.cpu on 3333
Info : Listening on port 3333for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0xfffffffe msp: 0xfffffffc
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
Info : SAMD MCU: SAMD11C14A (16KB Flash, 4KB RAM)
Error: SAMD: NVM programming error
Error: Failed to erase row containing 00000100
Error: SAMD: failed to erase sector 1 at 0x00000100
Error: failed erasing sectors 0 to 15
embedded:startup.tcl:1070: Error: ** Programming Failed **
in procedure 'script'
at file "embedded:startup.tcl", line 26in procedure 'program' called at file "openocd.cfg", line 23in procedure 'program_error' called at file "embedded:startup.tcl", line 1135
at file "embedded:startup.tcl", line 1070
Info : Listening on port 6666for tcl connections
Info : Listening on port 4444for telnet connections
$ sudo openocd
Open On-Chip Debugger 0.11.0+dev-00502-gf66a16c4a (2021-11-27-00:00)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd11d14a.cpu: Cortex-M0+ r0p1 processor detected
Info : at91samd11d14a.cpu: target has 4 breakpoints, 2 watchpoints
Info : at91samd11d14a.cpu: external reset detected
Info : starting gdb server for at91samd11d14a.cpu on 3333
Info : Listening on port 3333for gdb connections
Info : SWD DPIDR 0x0bc11477
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000059c msp: 0x20000fd4
Info : SWD DPIDR 0x0bc11477
target halted due to debug-request, current mode: Thread
xPSR: 0x61000000 pc: 0x00000642 msp: 0x20000fd4
** Programming Started **
Info : SAMD MCU: SAMD11C14A (16KB Flash, 4KB RAM)
** Programming Finished **
** Verify Started **
** Verified OK **
Info : SWD DPIDR 0x0bc11477
shutdown command invoked
Info : Listening on port 6666for tcl connections
Info : Listening on port 4444for telnet connections
After plugging off SWD pins in target board of SAMD11C14 disconnecting from raspberry pi, the board is recognized as USB device from host computer (Mac)
123
$ ls /dev | grep usb
cu.usbmodem2101
tty.usbmodem2101
This soruce code and board settings worked for compiling and uploading. However, the serial bridging application seems not work - I could not confirm message received by serial connector from the target board (Attiny3216) on Serial monitor in Arduino IDE.
Though I tried to bridge resisters of 1.6KΩ to R3: 4.9KΩ in parallel for lowering the resister to 1.2KΩ based on mattermost instructors’ discussion, it did not work for my case.
i.e. Calculation for parallel ciurcuit with resisters
Total resister (1.2kΩ) = 1/((1/4.9kΩ)+1/ x Ω)
x = 1.589Ω ≒ 1.6Ω
I have 1.5KΩ and 120Ω resisters, so, I amended the circuit like this.
How ever, the outcome was the same and I could not confirm Serial communication with this as an USB-Serial bridging device.
As the serial communication does not work as above, programming over serial port and 4.7k (pyupdi style) did not work (any cases in pyupdi, pymcuprog or uploading by Ardino megaTinyCore board manager)
$ ./bootstrap
$ ./configure --enable-sysfsgpio --enable-bcm2835gpio
$ make
However, make failed by following error.
1 2 3 4 5 6 7 8 9101112131415161718192021
...
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./src -I./src -I./src/helper -DPKGDATADIR=\"/usr/local/share/openocd\" -DBINDIR=\"/usr/local/bin\" -I./jimtcl -I./jimtcl -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -g -O2 -MT src/svf/svf.lo -MD -MP -MF src/svf/.deps/svf.Tpo -c src/svf/svf.c -o src/svf/svf.o
src/svf/svf.c: In function ‘svf_read_command_from_file’:
src/svf/svf.c:663:7: error: this statement may fall through [-Werror=implicit-fallthrough=]i= -1;
~~^~~~
src/svf/svf.c:664:4: note: here
case'\r':
^~~~
src/svf/svf.c:667:8: error: this statement may fall through [-Werror=implicit-fallthrough=]if(!cmd_pos)
^
src/svf/svf.c:669:4: note: here
default:
^~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:3022: src/svf/svf.lo] Error 1
make[2]: Leaving directory '/home/pi/openocd'
make[1]: *** [Makefile:3897: all-recursive] Error 1
make[1]: Leaving directory '/home/pi/openocd'
make: *** [Makefile:1821: all] Error 2
At openocd forum, above (svf related error) is reported as a bug for openocd v.0.10.0. openocd-devel@lists.sourceforge.net. It suggested "--disable-werror" when run configure.. By doing that, make completed without error.
123
$ ./configure --enable-sysfsgpio --enable-bcm2835gpi --disable-werror
$ make
$ sudo make install
The command is completed. However, on running openocd it returns follows.
1 2 3 4 5 6 7 8 91011121314151617181920
$ cd ../bootloader
$ sudo openocd
Open On-Chip Debugger 0.10.0-dirty (2021-11-30-00:10)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Error: The specified debug interface was not found (bcm2835gpio)
The following debug interfaces are available:
1: ftdi
2: usb_blaster
3: jlink
4: vsllink
5: ulink
6: hla
7: osbdm
8: opendous
9: sysfsgpio
10: aice
Error: Debug Adapter has to be specified, see "interface"command