Go to file
bon@elektron.ikp.physik.tu-darmstadt.de 0c9d5d8166 Add dfu bootloader update application and use absolute delay for stlink
Hello,

appended 3 patches
- adds a dfu-bootloader appliaction
- uses absolute delays when waiting for pull-up delays on the STLINK
(hopefully fixes issue #30)

Updating the dfu-bootloader by additional application is helpfull for the
STLINK, as for flashing the bootloader by SWDb otherwise jumpers need to be
soldered or external SWD is not possible.
Use like:
- dfu-util -s 0x08002000:leave -D dfu_upgrade.bin
- dfu-util -s 0x08000000:leave -D blackmagic_dfu.bin
- Push reset buttom and reconnect to enter new dfu bootloader
- dfu-util -s 0x08002000:leave -D blackmagic.bin
--
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>From fae5022c304a8866f056ea66660ac7ce3809dcf8 Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Date: Sun, 20 Oct 2013 15:00:36 +0200
Subject: F1: Prepare to update dfu bootloader via DFU with additional
 application.
2014-01-24 04:59:09 +08:00
driver Update Windows drivers to use new USB IDs. 2012-05-26 15:33:16 +12:00
flashstub Added support for STM32F0. 2012-10-24 18:08:01 +02:00
hardware Made assembly notes titles 2013-09-04 22:07:08 +01:00
libopencm3@a909b5ca9e Update to the newest libopencm3 2014-01-04 17:29:54 +01:00
scripts Update python scripts to find user's preferred python binary through env. 2013-05-02 11:32:24 -07:00
src Add dfu bootloader update application and use absolute delay for stlink 2014-01-24 04:59:09 +08:00
upgrade Fixed upgrade tool to build against current libusb-win32. 2013-08-19 12:26:05 +12:00
.gitignore Add dfu bootloader update application and use absolute delay for stlink 2014-01-24 04:59:09 +08:00
.gitmodules Changed libopencm3 url to https. 2012-10-24 07:34:30 +13:00
COPYING Added README and COPYING 2011-02-07 11:01:10 +13:00
HACKING Add note about -mfloat-abi=hard versus -mfloat-abi=soft 2013-01-21 13:52:02 +01:00
Makefile Add toplevel Makefile to build blackmagic with libopencm3. 2012-10-22 18:50:06 +13:00
README semihosting: improve handling of console I/O 2013-05-18 15:33:58 +12:00

README

=======================================
The Black Magic Debug Project -- README
=======================================

The Black Magic Debug Probe is gadget providing an in-application
debug capability for ARM Cortex-M microcontrollers.  It interfaces
with the GDB, the GNU source level debugger over the USB bus, and
communicates with the target microcontroller over either a JTAG or
Serial Wire debug port.

Currently supported microcontrollers:

 - ST STM32 Family
 - TI/LMI Stellaris Family
 - NXP LPC11xx Family
 - Atmel SAM3X


Getting started
===============
The Black Magic Probe is available as a built-up product form Black
Sphere Technologies.  Contact <sales@blacksphere.co.nz> should
you wish to order one.  If you would like to work on the project see
the file HACKING for developer's info.

When connected via USB, the Black Magic probe will enumerate as a CDC-ACM
device which the OS should present as a tty device or serial port.  The
GDB remote debugging protocol is implemented over this virtual character
stream.  To connect your ARM GDB to the target device use the following
commands:

(gdb) target extended-remote /dev/ttyACM0
(gdb) mon jtag_scan
(gdb) attach 1

The command 'mon swdp_scan' may be used to use the Serial-Wire Debug Protocol
instead of JTAG to connect to the target.

Once attached, all the standard GDB commands may be used to start and control
the execution of the embedded application.

The peripheral registers are not included in the memory map provided to GDB.
I suggest you add the command "set mem inaccessible-by-default off' to
your '.gdbinit'.  That will allow you to access addresses outside of
the memory map.  It will treat anything outside of the memory map as
RAM.

Semihosting support
===================
Standard ARMv6-M/ARMv7-M semihosting is supported, i.e. you can build
your application in a special way to have calls to certain functions
(open(), close(), read(), write(), lseek(), rename(), unlink(),
stat(), isatty(), system()) executed on the debugging host itself. To
make use of these facilities, add --specs=rdimon.specs and -lrdimon to
the linker flags for your firmware.

If you're going to use stdin, stdout or stderr (e.g. via
printf()/scanf()) and you're not using newlib's crt0 (by specifying
-nostartfiles), you need to add this to your initialisation:

void initialise_monitor_handles(void);
initialise_monitor_handles();

Project layout
==============
driver/ - Windows drivers for the Black Magic probe hardware.
flashstub/ - Source code for flash programming stubs in target drivers.
hardware/ - Schematic (gschem) and PCB layout for the Black Magic Probe
hardware/contrib/ - User contributed hardware variants.
libopencm3/ - Submodule for the libopencm3 library needed for stm32 platforms.
scripts/ - Python scripts useful for programming devices.
src/ - Firmware source code for the Black Magic debug probe.
upgrade/ - Alternate firmware upgrade tool written in C.