Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
bootloader:openocd [2021/01/30 17:32] admin [OpenOCD with the Raspberry Pi] |
bootloader:openocd [2021/01/30 17:58] (current) admin [Acknowledge & Links] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== OpenOCD | + | ====== OpenOCD |
{{: | {{: | ||
- | On a Raspberry Pi following the openOCD | + | To install the [[http:// |
Install: | Install: | ||
$ sudo apt-get install git autoconf libtool make pkg-config libusb-1.0-0 libusb-1.0-0-dev htop | $ sudo apt-get install git autoconf libtool make pkg-config libusb-1.0-0 libusb-1.0-0-dev htop | ||
Line 9: | Line 10: | ||
$ git clone http:// | $ git clone http:// | ||
$ cd openocd/ | $ cd openocd/ | ||
- | Configure & install: | + | Configure & Install: |
$ ./ | $ ./ | ||
$ ./configure --enable-sysfsgpio --enable-bcm2835gpio | $ ./configure --enable-sysfsgpio --enable-bcm2835gpio | ||
$ make | $ make | ||
$ sudo make install | $ sudo make install | ||
- | Check | + | Check |
$ cd / | $ cd / | ||
$ ls | $ ls | ||
- | Make a folder: | + | New Folder: |
$ cd ~ | $ cd ~ | ||
$ mkdir bootloader | $ mkdir bootloader | ||
$ cd bootloader | $ cd bootloader | ||
- | Download the bootloader: | + | Download the Bootloader: |
$ wget https:// | $ wget https:// | ||
$ wget https:// | $ wget https:// | ||
- | $ wget " | + | $ wget " |
- | Make your config file: | + | Make your Config File: |
$ nano openocd.cfg | $ nano openocd.cfg | ||
Add: | Add: | ||
+ | source [find interface/ | ||
+ | transport select swd | ||
+ | |||
+ | set CHIPNAME at91samd21g18 | ||
+ | source [find target/ | ||
+ | |||
+ | # did not yet manage to make a working setup using srst | ||
+ | # | ||
+ | reset_config srst_nogate | ||
+ | |||
+ | adapter srst delay 100 | ||
+ | adapter srst pulse_width 100 | ||
+ | |||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | init | ||
+ | targets | ||
+ | reset halt | ||
+ | |||
+ | #at91samd chip-erase | ||
+ | #at91samd restore | ||
+ | at91samd bootloader 0 | ||
+ | program samd21_sam_ba.bin verify | ||
+ | #program bootloader-XIAO_m0-v3.7.0-33-g90ff611-dirty.bin verify | ||
+ | #flash write_image unlock bootloader-XIAO_m0-v3.7.0-33-g90ff611-dirty.bin | ||
+ | at91samd bootloader 8192 | ||
+ | |||
+ | reset | ||
+ | shutdown | ||
+ | ... and run it | ||
$ sudo openocd -f openocd.cfg | $ sudo openocd -f openocd.cfg | ||
If needed change the Raspberry Pi interface file: | If needed change the Raspberry Pi interface file: | ||
$ sudo nano / | $ sudo nano / | ||
$ sudo nano / | $ sudo nano / | ||
+ | Change: | ||
+ | # Each of the SWD lines need a gpio number set: swclk swdio | ||
+ | # Header pin numbers: 23 22 | ||
+ | bcm2835gpio_swd_nums 25 24 | ||
+ | |||
+ | # If you define trst or srst, use appropriate reset_config | ||
+ | # Header pin numbers: TRST - 26, SRST - 18 | ||
+ | bcm2835gpio_trst_num 7 | ||
+ | bcm2835gpio_srst_num 18 | ||
---- | ---- | ||
- | ==== HEX files ===== | + | ==== Bootloader |
- [[https:// | - [[https:// | ||
Line 43: | Line 84: | ||
---- | ---- | ||
==== Pinout ==== | ==== Pinout ==== | ||
+ | |||
+ | SWD | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
**Arduino MKR ZERO**\\ | **Arduino MKR ZERO**\\ | ||
Line 68: | Line 115: | ||
==== Acknowledge & Links ==== | ==== Acknowledge & Links ==== | ||
+ | [[http:// | ||
+ | [[http:// | ||
[[https:// | [[https:// | ||
+ | [[https:// | ||
---- | ---- |