Sean Simmons [Sat, 8 Mar 2014 16:21:16 +0000 (11:21 -0500)]
* Improved support for STM32L152RE - flash/ram sizes, now correct, flash programming works.
* Cleaned up checking of FP_CTRL register in gdb-server.c
* Added source code for stm32lx.s flashloader - just for reference.
Jim Paris [Fri, 31 Jan 2014 21:26:35 +0000 (16:26 -0500)]
When ignoring the end of a file, make sure we don't ignore partial words.
Consider a 128-byte write to the chip. If the last 2 bytes are
considered "empty", then len is adjusted to 126, and run_flash_loader
will only copy 126 bytes to RAM. However, run_flash_loader then
proceeds to round up to 32 words (128 bytes) when flashing, which has
the effect of clobbering those last two "empty" bytes with junk data.
Jonas Norling [Wed, 22 Jan 2014 21:10:52 +0000 (22:10 +0100)]
Remove unsupported --device option to st-util
Setting the STLINK device with -d hasn't worked for some time, but
the STLINK_DEVICE environment variable works instead. Remove the
option, update documentation and help text.
Jonas Norling [Wed, 22 Jan 2014 20:48:35 +0000 (21:48 +0100)]
Correct address for STM32F2 flash size register
There was a typo in the flash size register address for STM32F2. Change
to correct address. Verified against STM32F207 reference manual
(RM0033 Rev 5 section 33.2), and an STM32F217 chip.
Onno Kortmann [Sat, 7 Dec 2013 04:30:01 +0000 (20:30 -0800)]
Properly detect and warn if multiple stlinky magic bytes are detected
Stlinky can silently fail if its magic bytes are present anywhere else
in the SRAM. This change makes st-term detect all stlinky structures,
warn about multiple occurences and will use the last one detected.
Olivier Gay [Sun, 27 Oct 2013 15:17:08 +0000 (16:17 +0100)]
Restore gdb-server cleanup handlers for MinGW
There were removed in my previous commit 5851dee due
to compilation errors. It actually appears these signals
are supported in MinGW but there was an include error for
MinGW, this commit fixes it.
Olivier Gay [Sun, 27 Oct 2013 14:19:29 +0000 (15:19 +0100)]
Fix build issues with MinGW
Remove st-term from the list of the targets for MinGW.
st-term uses termios and would require a rewrite to have
it compile on MinGW. Also remove cleanup signal handlers
in gdb-server for MinGW to compile.
Michael Pratt [Wed, 6 Mar 2013 20:24:15 +0000 (15:24 -0500)]
Add option to not reset board on connect
'-n' in st-util will cause it to skip the reset step, and thus allow you
to begin debugging at whatever point the code may currently be at.
Adding this feature required changing the stlink_open functions to
accept a reset flag that tells them whether or not to reset after
connecting. Skipping reset does not seem to have any adverse effects on
stlink usb devices. Unfortunately, I have to stlink v1 devices to test.
Burns [Fri, 21 Jun 2013 21:36:15 +0000 (17:36 -0400)]
Support for STM32L1 medium-plus chips with chip id 0x427
-Changed the STM32L1 "medium plus" (id 0x436) support to be called HIGH.
-Added the device id 0x427 and call it medium plus.
-Gave the loader more time so it stopped timing out and thinking it failed.
-Added st-term to .gitignore
Note: ST seems to call some chips with 436 medium plus and some high. It seemed
easier to name 436 high and 427 medium plus.
The chip IDs are defined up top and those macros are used throughout the
code so let's remove the magic numbers in .chip_id so that everything is
using the macros.
Jack Peel [Sat, 6 Apr 2013 00:55:19 +0000 (17:55 -0700)]
Add SIGTERM signal handler to also call cleanup
When stopping st-util under Eclipse as an external tool the st-util
receives a SIGTERM signal, and would not return the device to
usb mass storage mode. This change now calls cleanup in the SIGTERM handler too!!
Jack Peel [Fri, 5 Apr 2013 16:06:26 +0000 (09:06 -0700)]
Add support for the STM32L1 Medium density device flash size calculation
In devices before "Rev X" the flash size register is 0 so we assume 128k
Note that "Rev X" is a LATER revision than "Rev Y" and others that might
seem like they are later!
Jack Peel [Wed, 3 Apr 2013 23:43:13 +0000 (16:43 -0700)]
Add Support for STM32L1xx Medium Plus and High density Devices
Using reference RM0038 Rev 7
The flash size register moved
and the values in the registers changed their meaning
Note that Medium Plus and High density deives have the
same device ID, but only the Medium Plus definition is
used in the code (the High comes along for free)
Ian Griffiths [Thu, 21 Mar 2013 16:28:15 +0000 (16:28 +0000)]
Limited DMA clearing to STM32F4, removed fatal error for flash loading.
Commit 0ed3907 added the clearing of DMA registers that was preventing
programming (see issue #74), however it uses hardcoded addresses of the
DMA registers on the STM32F4. This seems to prevent the flashing and
verification on STM32L1, as the registers only partly cover the range
zeroed. So the DMA clearing has been limited to the STM32F4
microcontroller.
Additionally, sometimes, typically directly after erases, a 'flash
loader run error' will occur that terminates the writing. This is not
necessary, as the writing is successfully performed by page writing
(line 1581 onwards of stlink-common.c), and so has been returned to a
error message (see issue #112). There is a comment on line 1574 (added by
Uwe Bonnes in commit 0164043f) that this may happen on blank devices,
and so the fatal error message is the incorrect response.
Ian Griffiths [Wed, 20 Mar 2013 13:01:49 +0000 (13:01 +0000)]
Added lock state check to stlink_erase_flash_page.
On the STM32L152 processor, the erase fails for the first page as the
lock is already disabled (with the unlocking code causing the lock to
become re-enabled). This commit adds checking of the lock state and will
only unlock if necessary.
Michael Pratt [Wed, 6 Mar 2013 21:15:15 +0000 (16:15 -0500)]
Add SIGINT handler for stlink cleanup
SIGINT causes st-util to immediately exit, without closing the open
stlink. This leaves devices (at least the F4 Discovery) in a state
where they are unable to reset. st-util could still connect and control
them, but a power cycle was required before they could reset on their
own.
A signal handler is added for SIGINT, which performs cleanup and closing
of the open stlink device, allowing it to function normally on
disconnect.