100 Commits

Author SHA1 Message Date
Uwe Bonnes
1ca9f234f7 Infrastructure for setting maximum SWJ frequency.
Implement for BMP/firmware on STM32.
2020-12-12 18:33:09 +01:00
Uwe Bonnes
07c3699225 version.h: Remove from platform.h files
- Consolidate ident string generation
- Recompile only needed files
2020-12-06 15:18:08 +01:00
Uwe Bonnes
0a7bfd5923 dfu_f4: Fix sector_erase. 2020-12-06 15:18:08 +01:00
Uwe Bonnes
139e5d7e22 f4discovery: Compile time option to compile with ST bootloader
Just to keep things active. Prepare for F72 bootloader.
2020-11-27 22:26:48 +01:00
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
27ef4569ca stm32/dfucore.c: Use libopencm3 provided defines and functions. 2020-11-27 22:26:48 +01:00
Uwe Bonnes
77231e8972 serial_no: Fix error with "mon trace" #732
launchpad-icdi: Allow to set a serial number with make
2020-09-20 13:23:52 +02:00
Uwe Bonnes
05adcd9bf5 remote.c: Compile only relevant functions.
Do no compile firmware functions when compiling pc-hosted.
2020-06-05 14:59:30 +02:00
Koen De Vleeschauwer
541861e978 traceswo decoding 2020-05-16 15:04:35 +02:00
Uwe Bonnes
9ca401497c stm32/timing_stm32.c: Remove fixed constants and direct SCB access 2020-03-31 16:54:04 +02:00
Uwe Bonnes
2b76ec0ea3 dfucore: Reject erase outside the allowed range
An illegal erase request may get emitted as the DFU program may erase
first. Checking before flashing is not enough.
2020-03-22 16:38:54 +01:00
Extreme kefir
c94a03af48 STM32F1 High density devices DFU support(#587) 2020-03-05 19:58:55 +01:00
zvova7890
7a595ead25 fixup F103x8 flash size before build dfu iface string
we handle F103x8 as F103xB with 128k flash
2020-01-22 16:01:39 +01:00
Sid Price
1a1cabc90b Remove explicit include of rcc.h and allow common file to steer the right file
Clean up DFU files with MCU explicit includes
2020-01-14 00:09:20 +01: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
76f9a6ad42 stm32: Portability changes. 2019-10-20 22:20:06 +02:00
UweBonnes
00937348b3
Fixes to compile "make ENABLE_DEBUG=1 all_platforms" (#515) 2019-09-04 13:09:43 +02:00
Brennan Ashton
443ced62d4 Target latest libopencm3
Required fixes:
 * use usbd_request_return_codes -- commit 54b117c5a5767df8dc114612dfd8e8cb88b72c6b
 * drop deprecated timer_reset() -- commit 034dbf20ff8c54dcbee5238390b37a0d35180f44
 * drop 48 & 120 MHz configs -- commit a9dde2832eb8039b9e0d21a50b9b991ddbfc4e2d
 * ld scripts: drop duplication of standard sections -- commit 9a05dcb6c0aef712052d337457838f6041ffd57a
2019-08-14 00:57:15 -07:00
Uwe Bonnes
e29f2b4fb9 jtag/swd: Rename defines/make variables to allow removal of weak attribute
jtagtap.c is libopencm3 generic. Move to common.
2019-07-18 20:54:10 +02:00
Uwe Bonnes
7a7266a0f7 Speed up JTAG. 2018-06-26 19:50:14 +02: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
Adam Heinrich
f5cac4c78d platforms/stm32: Ignore noise errors on USBUART 2018-01-13 21:11:17 +01:00
Gareth McMullin
0ed66547d5 Fix libopencm3 breakage 2017-09-25 11:17:03 +13:00
Uwe Bonnes
ce1ef6e41b stm32: Move rdi handling to common stm32 code. 2017-09-23 16:39:35 +02:00
Uwe Bonnes
f5dd3006fb STM32: Generate same serial number as internal DFU bootloader. 2017-05-11 21:52:24 +02:00
Uwe Bonnes
b7235da97f dfucore.c: Announce no writable bootloader pages when device is read proteced
or bootloader is write protected.

Device read protection or write protection on first 4 bootloader pages
can only be removed by mass erase. Triggering mass erase with a program
running from flash is doomed for failure.
User can force bootloader update, at their own risk to brick the device.
2017-05-07 13:19:37 +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
Uwe Bonnes
5af76a1b74 dfu_f1/dfu_upgrade: Do not set read protection.
As the first 4 pages of the bootloader will always keep write protection
once read protection is applied, with the second update of the bootloader
only the higher pages where updated effectivly.
In most cases this resulted in an inaccessible device!
2017-04-29 14:58:41 +02:00
Uwe Bonnes
d796571438 Implement DFU_UPLOAD. 2017-04-15 14:26:03 +02:00
Uwe Bonnes
1d8ebcd75f Handle SET_ADDRESS according to DFUSE specs. 2017-04-14 15:16:59 +02:00
Gareth McMullin
394fd4894b Increase st-link flash allowance to 128K.
Although the devices are only documented to have 64K flash,
they have been obeserved to have a full 128K, although the undocumented
half may be untested and have problems.
2017-04-13 09:01:26 +12:00
Gareth McMullin
7730d3b198 Don't enable usb uart on v2 when debugging 2016-11-22 12:45:59 +13:00
Piotr Esden-Tempski
fdeb6471a8 Added missing #include guard. 2016-10-19 14:56:52 -07:00
Piotr Esden-Tempski
8a009ca6ae Corrected jtagtap_next signature.
The parameter is TDI (as in input) not TDO. The header signature and
comment are correct.
2016-10-19 13:53:04 -07:00
Gareth McMullin
966f360515 debug: Use semihosting if available or output via usbuart. 2016-09-29 21:31:13 -07:00
Gareth McMullin
45e322b9a3 Handle usart errors. 2016-08-22 09:57:52 +12:00
Gareth McMullin
5832d8a42a Clean up common SWD stuff. 2016-07-13 08:31:09 +12:00
Gareth McMullin
3c44cce935 Make generic jtagtap function weak and stop including the c file. 2016-07-13 08:31:09 +12:00
Gareth McMullin
8b4342394f Overhaul of timeouts so they may be nested. 2016-06-28 14:35:43 +12:00
Piotr Esden-Tempski
20c994eece Added black magic verbose/debug mode switch. 2016-06-22 17:28:26 -07:00
Gareth McMullin
8d9d6f692c Fix platform_delay 2016-04-19 13:23:04 -07: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
Piotr Esden-Tempski
c0c8bade6f [native] Make the native bootloader bit more flashy.
This change has also a practical reason. When flashing and testing the
hardware this change makes it easier to make sure all the LEDs work. Now
when the DFU bootloader is idle it is scanning the LEDs making it easy
to see if one of them has an issue.

In addition to that, the bootloader now indicates when there is data
being flashed using the DFU interface. In cases when one has more than
one device connected and accidently starts flashing a wrong device this
is very useful feature to have.
2016-02-14 23:47:57 -08:00
Gareth McMullin
5ab8564ff6 Clean up handling of lost targets using new exceptions mechanism. 2015-03-22 14:05:12 -07:00
Gareth McMullin
c731c6ece3 Make F4 conditionals check STM32F4, not F4DISCOVERY. 2015-03-03 21:39:29 -08: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
9d80641261 Move common platform include to a common directory. 2015-03-01 20:15:31 -08:00
Gareth McMullin
476f83b69a Move common USB stuff out of platform header files. 2015-02-28 22:48:26 -08:00