Skip to content
Simple utility for programming Atmel MCUs though CMSIS-DAP protocol. Works on Linux, MAC and Windows.
C Makefile
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Added .gitignore Oct 8, 2016
.travis.yml Use hidapi from OS instead of vendoring Jan 1, 2020
90-atmel-edbg.rules Added proper debuger and target identification Dec 4, 2015
Makefile Use hidapi from OS instead of vendoring Jan 1, 2020
README.md Use hidapi from OS instead of vendoring Jan 1, 2020
dap.c Moving some things around Nov 28, 2019
dap.h Moving some things around Nov 28, 2019
dbg.h Fix required headers in dbg.h Mar 3, 2018
dbg_lin.c Moving some things around Nov 28, 2019
dbg_mac.c Use message instead of printf Oct 21, 2018
dbg_win.c Moving some things around Nov 28, 2019
edbg.c Interface clock is set before it is used now Nov 28, 2019
edbg.h Initial support for GigaDevice GD32F4xx series Oct 30, 2019
target.c Initial support for GigaDevice GD32F4xx series Oct 30, 2019
target.h Major refactoring, added first STM32 target May 1, 2019
target_atmel_cm0p.c Better handling of erase procedure for L11 Nov 23, 2019
target_atmel_cm3.c Major refactoring, added first STM32 target May 1, 2019
target_atmel_cm4.c Major refactoring, added first STM32 target May 1, 2019
target_atmel_cm4v2.c Minor fix May 1, 2019
target_atmel_cm7.c New device Feb 19, 2020
target_gd_gd32f4xx.c More robust reset for GD32 Nov 5, 2019
target_mchp_cm23.c Add SAML10D16A device Apr 10, 2020
target_st_stm32g0.c A couple minor fixes Oct 29, 2019

README.md

Build Status

CMSIS-DAP programmer (Formerly Atmel EDBG programmer)

This is a simple command line utility for programming ARM-based MCUs through CMSIS-DAP SWD interface. It works on Linux, Mac OS X and Windows. It was tested with Atmel mEDBG- and EDBG-based boards, Atmel-ICE, LPC-Link2, IBDAP and Free-DAP-based debuggers.

Installation

Binary releases can be downloaded here. Binary releases are not tested, they are a result of automated build process.

If you want to build from the source code, simply run make all and you will get a small binary, called edbg.

Dependencies

The dependencies are minimal. In addition to normal development tools (GCC, make, etc) you will need:

  • Windows: none
  • Linux: libudev-dev
  • Mac OS X: libhidapi (can be installed via brew)

Usage

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)
  -u, --unlock               unlock the chip (forces chip erase in most cases)
  -r, --read                 read the whole content of the chip flash
  -f, --file <file>          binary file to be programmed or verified; also read output file name
  -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
  -c, --clock <freq>         interface clock frequency in kHz (default 16000)
  -o, --offset <offset>      offset for the operation
  -z, --size <size>          size for the operation
  -F, --fuse <options>       operations on the fuses (use '-F help' for details)
Fuse operations format: <actions><section>,<index/range>,<value>
  <actions>     - any combination of 'r' (read), 'w' (write), 'v' (verify)
  <section>     - index of the fuse section, may be omitted if device has only
                  one section; use '-h -t <target>' for more information
  <index/range> - index of the fuse, or a range of fuses (limits separated by ':')
                  specify ':' to read all fuses
                  specify '*' to read and write values from a file
  <value>       - fuses value or file name for write and verify operations
                  immediate values must be 32 bits or less

Multiple operations may be specified in the same command. They must be separated with a ';'.

Exact fuse bits locations and values are target-dependent.

Examples

>edbg -b -t samd11 -pv -f build/Demo.bin
Debugger: ATMEL EDBG CMSIS-DAP ATML2178031800000312 01.1A.00FB (S)
Clock frequency: 16.0 MHz
Target: SAM D11D14A (Rev B)
Programming............................................... done.
Verification............................................... done.

Fuse operations:

  -F w,1,1             -- set fuse bit 1
  -F w,8:7,0           -- clear fuse bits 8 and 7
  -F v,31:0,0x12345678 -- verify that fuse bits 31-0 are equal to 0x12345678
  -F wv,5,1            -- set and verify fuse bit 5
  -F r1,:,             -- read all fuses in a section 1
  -F wv,*,fuses.bin    -- write and verify all fuses from a file
  -F w0,1,1;w1,5,0     -- set fuse bit 1 in section 0 and clear fuse bit 5 in section 1
You can’t perform that action at this time.