44 Commits

Author SHA1 Message Date
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
e67192348f FIX: usbd_init compatibility fix
Updated compatibility with libopencm3 commit 113e5c22e6390ba072148315e83a5faa5ff7ce86
2013-10-05 12:23:23 +08: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
8c877d6dfa Fix trailing whitespace everywhere. 2013-06-17 15:53:32 +12:00
Paul Fertser
e0fc21a2a7 adiv5_swdp: allow to connect to a sleeping target by pulling SRST
This patch introduces a new command, "connect_srst [enable|disable]"
which allows to enable special mode in which SRST would be pulled low
before the SWD scan till attaching to a target.

Since on Cortex-Mx the SRST signal doesn't gate JTAG and SWD, it's
possible to connect to a target while holding reset, ask it to stop at
reset vector and only then deassert reset, thus allowing to attach to
the kind of firmware that goes immediately to sleep or disables
debugging by other means early on start.

Tested on an STM32VLDiscovery board with STM32F100 configured to go to
STOP mode and executing WFI in the very beginning of main().

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2013-05-14 12:32:44 +12:00
Gareth McMullin
e3f3171a33 usbuart: Fix build error and clean up whitespace. 2013-04-27 13:14:22 -07: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
6659d87e9b Remove DFU bootloader self protection.
It can still be enabled by building with -DDFU_SELF_PROTECT
2013-04-16 16:54:52 -07:00
Gareth McMullin
61d464bf09 dfu: Fix warnings. 2013-04-04 20:16:13 -07:00
Gareth McMullin
87dad080e1 Fix build for f4discovery host. 2013-03-17 10:17:05 +13:00
Gareth McMullin
e880c553fb Restore trace timer interrupt handler. 2013-03-12 19:14:11 +13:00
Gareth McMullin
7c2e994381 Split out platform specific bootloader parts to separate files. 2013-03-12 19:04:10 +13:00
Gareth McMullin
55f161208d Further split-up of DFU bootloader. 2013-03-12 15:00:15 +13:00
Gareth McMullin
14e5e8b0b6 Separated clean and dirty bootloader sections. 2013-03-12 09:57:28 +13:00
Vegard Storheil Eriksen
e8f9d52d2f gdb_if: Fix USB flow control.
The introduction of the double buffering broke USB flow control, causing
loss of data when a new packet arrived with the previous still present in
the double buffer.

With this patch the endpoint is kept in NAK until the double buffer is empty.
2013-03-06 20:36:49 +01:00
Uwe Bonnes
ff8de39774 usbuart: Don't try to send until configured. Enumeration may hang else 2013-02-15 17:55:36 +01: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
327ee49a67 usps_f407: add another platform 2013-02-03 14:22:14 +01:00
Uwe Bonnes
31f39339fd stm32/usbdfu.c: Rearrange code to clarify the tasks to be done 2013-02-03 14:14:48 +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
8415fc829b stm32/cdcacm.c: remove unneeded includes 2013-01-23 17:28:34 +01:00
Uwe Bonnes
73d120577b usbdfu: Write protect the bootloader sector on F4 2013-01-22 19:04:51 +01:00
Uwe Bonnes
8033fb2529 STLINK: Allow to force bootloader by starting with the RESET button pressed 2013-01-21 11:02:44 +01:00
Uwe Bonnes
749fb318e7 gdb_if: Use a doubled buffer scheme for reading data from USB
Needed, as the OTG driver erases the data read after eventually calling the callback
2013-01-21 11:02:44 +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
04624af4e5 f4discovery: Adapt from the "native" file and add or change code where needed
- stm32_mem.py has problems with erasing the big pages, but dfu-util works
- serial GDB remote server doesn't work. It neither works for the STM32F107,
  so maybe there is a problem with the usbd_f107_driver.
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
7e91f68efa f4discovery: Create a platforms directory for the F4 on the F4 Discovery board 2013-01-21 11:02:44 +01:00
Uwe Bonnes
15d7077115 traceswo: Move (now-constant) traceswo.c to platforms/stm32 2013-01-21 11:02:44 +01:00
Uwe Bonnes
72ca77af53 stm32_can: Changes to get blackmagic to work 2013-01-21 11:02:44 +01:00
Uwe Bonnes
313a24b316 usbdfu: Allow for different, but constant flash page sizes 2013-01-21 11:02:43 +01:00
Uwe Bonnes
1eb9bfc650 platforms/stm32: Move more platform dependencies to platform.h 2013-01-21 11:02:43 +01:00
Uwe Bonnes
30d8aa1eb7 Move (now-constant) cdcacm.c to platforms/stm32 2013-01-21 11:02:43 +01:00
Uwe Bonnes
533608a2f4 Move usbuart to the stm32 directory 2013-01-21 11:02:43 +01:00
Uwe Bonnes
16ac8e0478 stlink: Add DFU capability 2013-01-21 11:02:43 +01:00
Uwe Bonnes
7188a4a8cb Move usbdfu to platforms/stm32 directory 2013-01-21 11:02:43 +01:00
Uwe Bonnes
35d6adc236 native/usbuart: Move platform dependant parts to platform.h 2013-01-21 11:02:43 +01:00
Uwe Bonnes
ebb48245aa stlink: Use a seperate linker file as stlink has only 64 kByte 2013-01-21 11:02:43 +01:00
Gareth McMullin
ad9c76e97f Update to current libopencm3 usb api. 2013-01-10 22:01:21 -08:00
Gareth McMullin
54f4467c0f Added stlink platform for Discovery boards and ST's ST-Link hardware. 2012-06-10 19:06:37 +12:00
Gareth McMullin
89bcdcc60a Moved stm32 generic platform files out of native platform dir. 2012-06-10 17:34:26 +12:00