51 Commits

Author SHA1 Message Date
Uwe Bonnes
636bcee355 stlink/swlink: Remove the DFU upgrade utility.
Hopefully no old bootloaders are around. If otherwise, revert to last
commit before this and update the DFU bootloader.
2020-11-27 22:26:48 +01:00
Uwe Bonnes
f71e18948a GPIO for SWD: Slow down edges on more platforms. 2020-11-27 22:26:48 +01:00
Uwe Bonnes
dc3fd2eb06 Classify debug messages
Firmware BMP with ENABLE_DEBUG=1 will print WARN and INFO as before.
PC-Hosted BMPwill alway print to stderr. Warn is printed unconditional,
INFO, GDB, TARGET, DONGLE and WIRE will print if their appropriate bit in
cl_debuglevel is set via the -v verbose command line argument.
INFO will go to stdout with -t or -l.
2020-06-05 14:59:30 +02:00
Alexey 'Alexxy' Shvetsov
805464db23 Fix redefinition of io function
Now it should work fine with any gcc version. Old one produces error
like in #657

Signed-off-by: Alexey 'Alexxy' Shvetsov <alexxyum@gmail.com>
2020-05-10 10:58:03 +02:00
Thiadmer Riemersma
1924aa4999 Make baudrate parameter of traceswo command mandatory for stlink/swlink, and superfluous on other platforms; change help message accordingly. 2019-11-19 20:20:13 +01:00
Uwe Bonnes
97561fc5cc stlink: Decrease delay with SWD turn around for native,stlink and swlink. 2018-06-26 19:50:14 +02:00
Uwe Bonnes
72c1498ae1 stlink: Make SWO Trace Buffer smaller.
Changes for delayed memory map setup otherwise overflow SRAM silently.
2018-04-23 10:48:05 +12:00
Uwe Bonnes
fc25a3339a traceswoasync: Implement async swo for stm32.
Use for stlink.
Uses dma with large buffer.
Pull up swo to provide idle level on unconnected swo pin.
2018-03-27 13:40:49 +02:00
Gareth McMullin
0ed66547d5 Fix libopencm3 breakage 2017-09-25 11:17:03 +13:00
Uwe Bonnes
4966168802 s[t|w]link: Implement ENABLE_DEBUG. 2017-09-23 16:40:28 +02:00
Uwe Bonnes
963df9febc stlink: Use common initialization and detect V2.1 boards.
Factor out hardware revision detection, USB detach and power settings, as
all three program (bootloader, bmp and dfu-upgrade) need it.
2017-09-21 18:43:06 +02:00
Uwe Bonnes
a7771fa23f stlink/swlink: Remove missleading comments. 2017-06-08 18:25:43 +02:00
Uwe Bonnes
b09a522f37 STM32F103: Use flash size from device for DFU string.
Complements #204.
STLinkV2-1 has F103CB on board! F103C8 on older Stlinks can use upper flash
with hopefully acceptable error rate.
For F103C8 devices, user has to give the force option to dfu-utils.
2017-05-07 13:19:37 +02:00
Param Aggarwal
51ac0fe319 Actual pin mappings and the comment differ!
I was stuck trying to debug the issue why my probe would not find any attached targets. This is because I was doing the pin mapping as per the comments, and not the actual code. There is a mismatch!

This PR updates the comment to reflect the values set in code. :)
2017-01-01 14:50:58 +05:30
Gareth McMullin
8b4342394f Overhaul of timeouts so they may be nested. 2016-06-28 14:35:43 +12:00
Gareth McMullin
cd1d72257f Cleanup of SRST handling.
- Remove connect_assert_srst global.
- Attach functions always release reset.
- Platforms provide a method to poll the reset pin.
- Reset on scan is all internal to command.c
- Reset is released on a failed scan.  Fixes #111
2016-04-19 13:12:16 -07:00
Gareth McMullin
600f0d27d9 Use sniprintf on newlib platforms. 2015-11-11 12:41:13 -08:00
Gareth McMullin
482070c91b Merge branch 'v1.6-branch'
Conflicts:
	src/Makefile
	src/platforms/stlink/platform.h
	src/platforms/swlink/platform.h
2015-04-03 21:02:01 -07:00
Gareth McMullin
97824b7f02 Use git describe for version in generated header file. 2015-04-03 20:21:33 -07:00
Gareth McMullin
68f54a3545 Remove old platform specific error handling macros. 2015-03-22 14:06:56 -07:00
Gareth McMullin
9a8dbdeff7 Fix errors when building for non-native platforms. 2015-03-22 12:26:45 -07:00
Gareth McMullin
3e466f2d23 Factor out timing routines common to all STM32 targets. 2015-03-02 21:59:04 -08:00
Gareth McMullin
b07ffffcee Factor out common cdcacm.c from stm32 and tm4c.
Cleaned up interface to enter bootloader and read serial number.
2015-03-02 10:16:33 -08:00
Gareth McMullin
4d4813de87 Clean up includes everywhere.
All source files include general.h first and before anything else.
This inlcludes platform.h and platform_support.h
No header file needs to include to include any of these, but should include
any others needed for it's own declarations.
2015-03-01 22:16:04 -08:00
Gareth McMullin
476f83b69a Move common USB stuff out of platform header files. 2015-02-28 22:48:26 -08:00
Gareth McMullin
5eff0ab5d6 Factor out common GPIO code in STM32 platforms. 2015-02-28 22:09:50 -08:00
Gareth McMullin
75001a4421 Factor Morse code functions out of platform code. 2015-02-28 22:05:10 -08:00
Gareth McMullin
a5549d630c Whitespace cleanup. 2014-10-16 13:50:56 -07:00
Gareth McMullin
72ae78a185 Updated libopencm3. Fixes broken bootloader, issue #43. 2014-05-08 11:02:35 -07:00
Frantisek Burian
12aeaad441 [locm3] Use the new clock-enabling mechanisms in locm3. 2014-02-13 18:21:16 +01:00
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
Gareth McMullin
8835df1822 Merge remote-tracking branch 'origin/usbuart_highrate' 2013-12-04 16:16:08 +13:00
BuFran
c28350f242 FIX: u{8,16,32} -> uint{8,16,32}_t to be compatible with new library
The use of u8, u16, u32 has been deprecated in libopencm3.
Update it with standard uint8_t, uint16_t, uint32_t types
2013-10-05 12:23:23 +08:00
Gareth McMullin
700833f38f Use do {...} while(0) for PLATFORM_FATAL_ERROR() macro. 2013-08-19 12:27:36 +12:00
Gareth McMullin
8c877d6dfa Fix trailing whitespace everywhere. 2013-06-17 15:53:32 +12:00
Paul Fertser
cdaed128c1 stlink: add support for SRST handling
This enables SRST signals in open drain mode for both stlinkv1 and
stlinkv2 hardware platforms.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2013-05-14 12:34:53 +12:00
Allen Ibara
43f7e7a3cf Changes to the USBUART to make it less likely to drop characters at higher baud rates.
USB UART seems to work fine at 115.2Kbps or 230.4Kbps, but starts to drop characters
as the data rate goes higher. This commit changes the usbuart ISR to fill a software
FIFO, and adds a low priority timer interrupt to run deferred processing to drain a
FIFO and send USB CDCACM packets, rather than calling the usb send within the UART
ISR.

Tested on native platform, up to 1.5MBps.
2013-04-27 12:56:58 -07:00
Gareth McMullin
55f161208d Further split-up of DFU bootloader. 2013-03-12 15:00:15 +13:00
Uwe Bonnes
dee82a0d4f Document changes between ST-Link V1 and V2 and implement needed changes 2013-02-15 17:39:27 +01:00
Uwe Bonnes
96ae3886ff stm32:cdcacm/usbdfu: Print version and build information in the product string 2013-01-25 13:01:57 +01:00
Uwe Bonnes
1fa961841d Product and DFU String now tell the hardware they run on 2013-01-21 11:02:44 +01:00
Uwe Bonnes
e373619374 stlink: LED is connected to GPIO9. Before LED was associated with the MCO Output. 2013-01-21 11:02:44 +01:00
Uwe Bonnes
8b1ec3151f usbuart, jtagtap, swdptap: Factor out GPIO setup 2013-01-21 11:02:44 +01:00
Uwe Bonnes
1eb9bfc650 platforms/stm32: Move more platform dependencies to platform.h 2013-01-21 11:02:43 +01:00
Uwe Bonnes
04415582bd cdcacm: move non-constant parts to platform.[hc] 2013-01-21 11:02:43 +01:00
Uwe Bonnes
67f8176c5b stlink: Add the UART 2013-01-21 11:02:43 +01:00
Uwe Bonnes
16b9c1e83f stlink: Update to current libopencm3 usb api. 2013-01-21 11:02:43 +01:00
Gareth McMullin
5dff263078 Add delay after reset request.
Hopefully this fixes problems observed with failing vFlashWrite.
2012-07-01 22:40:43 +12:00
Gareth McMullin
01d0390b54 Fixed build for stlink platform. 2012-06-28 20:49:32 +12:00
Gareth McMullin
a16123997b Added target.c for common target routines. 2012-06-24 19:08:49 +12:00