General Project Update

- Updated CHANGELOG.md
- README.md: Edited note on licensing.
- Formatting in tutorial.md

Temporarily removed travis-lin-mingw script for clean travis builds.
pull/920/head
nightwalker-87 2020-04-10 23:38:17 +02:00
rodzic bf39a19d39
commit 99a8aaab25
5 zmienionych plików z 71 dodań i 82 usunięć

2
.gitignore vendored
Wyświetl plik

@ -2,5 +2,3 @@ build
build-mingw
obj-*
*.user*
.travis-lin-mingw.sh

Wyświetl plik

@ -1,14 +0,0 @@
#!/bin/bash
DIR=$PWD
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
echo "WORK DIR:$DIR"
mkdir -p $DIR/build/linux-mingw32-release
cd $DIR/build/linux-mingw32-release
echo "cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$PWD/_install $DIR"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$PWD/_install $DIR
echo "make"
make
fi

Wyświetl plik

@ -20,6 +20,7 @@ Major changes and added features:
* Build for Windows under Debian/Ubuntu ([#802](https://github.com/texane/stlink/pull/802))
* Allow for 64 bytes serials ([#809](https://github.com/texane/stlink/pull/809))
* Added full support for STLINK CHIP ID L4RX ([#814](https://github.com/texane/stlink/pull/814), [#839](https://github.com/texane/stlink/pull/839))
* Added support for the STLink-v2.1 when flashed with no mass storage (PID 0x3752) ([#819](https://github.com/texane/stlink/pull/819), [#861](https://github.com/texane/stlink/pull/861))
* Added support for writing option bytes on STM32L0xx ([#830](https://github.com/texane/stlink/pull/830))
* Added support to read and write option bytes for STM32F2 series ([#836](https://github.com/texane/stlink/pull/836), [#837](https://github.com/texane/stlink/pull/837))
* Added support to read and write option bytes for STM32F446 ([#843](https://github.com/texane/stlink/pull/843))
@ -65,7 +66,7 @@ Major changes and added features:
* Added creation of icons for .desktop file ([#684](https://github.com/texane/stlink/pull/684), [#708](https://github.com/texane/stlink/pull/708))
* Added desktop file for linux ([#688](https://github.com/texane/stlink/pull/688))
* Added button to export STM32 flash memory to a file ([#691](https://github.com/texane/stlink/pull/691))
* Updated libusb to 1.0.22 ([#695](https://github.com/texane/stlink/pull/695))
* Updated libusb to 1.0.22 ([#695](https://github.com/texane/stlink/pull/695)) - (related Bugs: [#438](https://github.com/texane/stlink/pull/438), [#632](https://github.com/texane/stlink/pull/632))
* Added icons for STLink GUI ([#697](https://github.com/texane/stlink/pull/697))
* Added support for STM32L4R9 target ([#694](https://github.com/texane/stlink/pull/694), [#699](https://github.com/texane/stlink/pull/699))
* Added memory map for STM32F411RE target ([#709](https://github.com/texane/stlink/pull/709))
@ -132,7 +133,7 @@ Updates and fixes:
* Added --flash=n[k][m] command line option to override device model ([#305](https://github.com/texane/stlink/pull/305), [#516](https://github.com/texane/stlink/pull/516), [#576](https://github.com/texane/stlink/pull/576))
* Updated libusb to 1.0.21 for Windows ([#562](https://github.com/texane/stlink/pull/562))
* Fixed low-voltage flashing on STM32F7 devices ([#566](https://github.com/texane/stlink/pull/566), [#567](https://github.com/texane/stlink/pull/567))
* Fixed building with mingw64 ([#569](https://github.com/texane/stlink/pull/569), [#573](https://github.com/texane/stlink/pull/573), [#578](https://github.com/texane/stlink/pull/578), [#584](https://github.com/texane/stlink/pull/584), [#610](https://github.com/texane/stlink/pull/610))
* Fixed building with mingw64 ([#569](https://github.com/texane/stlink/pull/569), [#573](https://github.com/texane/stlink/pull/573), [#578](https://github.com/texane/stlink/pull/578), [#582](https://github.com/texane/stlink/pull/582), [#584](https://github.com/texane/stlink/pull/584), [#610](https://github.com/texane/stlink/pull/610), [#846](https://github.com/texane/stlink/pull/846))
* Fixed possible memory leak ([#570](https://github.com/texane/stlink/pull/570), [#571](https://github.com/texane/stlink/pull/571))
* Fixed installation path for shared objects ([#581](https://github.com/texane/stlink/pull/581))
* Fixed a few -Wformat warnings ([#582](https://github.com/texane/stlink/pull/582))
@ -246,6 +247,7 @@ Updates and fixes:
* Stm32l0x flash loader (Robin Kreis)
* Send F4 memory-map and features for STM32F429 ([#188](https://github.com/texane/stlink/pull/188), [#196](https://github.com/texane/stlink/pull/196), [#250](https://github.com/texane/stlink/pull/250), [#251](https://github.com/texane/stlink/pull/251)) (Release v1.1.0)
* Added AHB3 Peripherals definition for STM32F4 ([#218](https://github.com/texane/stlink/pull/218), [#288](https://github.com/texane/stlink/pull/288)) (Release v1.1.0)
* Corrected flash size register address for STM32F2 devices ([#278](https://github.com/texane/stlink/pull/278)) (Release v1.0.0)
Chip support added for:

Wyświetl plik

@ -1,4 +1,4 @@
Open source version of the STMicroelectronics Stlink Tools
Open source version of the STMicroelectronics STlink Tools
==========================================================
[![BSD licensed](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/hyperium/hyper/master/LICENSE)
@ -11,6 +11,13 @@ Open source version of the STMicroelectronics Stlink Tools
Recent new features and bugfixes can be found in the [Changelog](CHANGELOG.md) of this software project.
#### License
The stlink library and tools are licensed under the **[BSD-3 License](LICENSE.md)**.<br />
The source files **stm32l0x.s** and **stm32lx.s** found in the subdirectory `/flashloaders/`
are licensed under the **General Public License (GPL v2+)**.
## Introduction
This stlink toolset supports several so called stlink programmer boards (and clones thereof) which use a microcontroller chip to translate commands from USB to JTAG.
@ -89,13 +96,6 @@ When there is no executable available for your platform or you need the latest (
* Please start new forks from the develop branch if possible as pull requests will go into this branch as well.
## License
The stlink library and tools are licensed under the [BSD-3 license](LICENSE.md).
The flashloaders/stm32l0x.s and flashloaders/stm32lx.s source files are licensed under the GPLv2+.
# Current state of the project
## Known missing features

Wyświetl plik

@ -2,6 +2,7 @@ stlink Tools Tutorial
=====================
## Useful tool options
### st-flash
#### --flash=n[k][m]
@ -14,8 +15,8 @@ Obviously leaving the multiplier out is equally valid, for example: `--flash=0x2
The size may be followed by an optional "k" or "m" to multiply the given value by 1k (1024) or 1M respectively.
## Solution to common problems
### ST-Link-v1 driver: Issue with Kernel Extension (kext) (macOS 10.11 and later only)
## Solutions to common problems
### a) ST-Link-v1 driver: Issue with Kernel Extension (kext) (macOS 10.11 and later only)
#### Problem:
st-util fails to detect a ST-Link-v1 device:
@ -39,11 +40,13 @@ while SIP is fully activated (as is per default).
Action needs to be taken here by booting into the recovery mode where a terminal console window needs to be opened.
Here it is **NOT RECOMMEND to disable SIP completely as with the command** `csrutil disable`,
**because this leaves the system more vulnerable to common threats.
For macOS 10.11 - 10.13 it is not recommended to disable SIP completely as with the command `csrutil disable`,
because this leaves the system more vulnerable to common threats.
Instead there is a more adequate and reasonable option implemented by Apple.
Running** `csrutil enable --without kext`, **allows to load unsigned kernel extensions
while leaving SIP active with all other security features.**
Running `csrutil enable --without kext`, allows to load unsigned kernel extensions
while leaving SIP active with all other security features.
Unfortunately this option has been removed in macOS 10.14, which leaves the only option to disable SIP completely.
So who ever intends to run the ST-Link-v1 programmer on macOS please take this into account.
Further details can be found here: https://forums.developer.apple.com/thread/17452
@ -76,8 +79,56 @@ INFO gdb-server.c: Chip ID is 00000414, Core ID is 1ba01477.
INFO gdb-server.c: Listening at *:4242...
```
### b) Verify if udev rules are set correctly (by Dave Hylands)
To investigate, start by plugging your STLINK device into the usb port. Then run lsusb. You should see an entry something like the following:
```
Bus 005 Device 017: ID 0483:374b STMicroelectronics ST-LINK/V2.1 (Nucleo-F103RB)
```
Note the bus number (005) and the Device (017). You should then do:
`ls -l /dev/bus/usb/005/017` (replacing 005 and 017 appropriately).
On my system I see the following:
```
crw-rw-rw- 1 root root 189, 528 Jan 24 17:52 /dev/bus/usb/005/017
```
which is world writable (this is from the MODE:="0666" below). I have several files in my `/etc/udev/rules.d` directory. In this particular case, the `49-stlinkv2-1.rules` file contains the following:
```
# stm32 nucleo boards, with onboard st/linkv2-1
# ie, STM32F0, STM32F4.
# STM32VL has st/linkv1, which is quite different
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \
MODE:="0666", \
SYMLINK+="stlinkv2-1_%n"
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.
```
and the idVendor of 0483 and idProduct of 374b matches the vendor id from the lsusb output.
Make sure that you have all 3 files from here: https://github.com/texane/stlink/tree/master/etc/udev/rules.d in your `/etc/udev/rules.d` directory. After copying new files or editing excisting files in `/etc/udev/ruled.d` you should run the following:
```
sudo udevadm control --reload-rules
sudo udevadm trigger
```
to ensure that the rules actually take effect. Using the trigger command means that you shouldn't need to unplug and replug the device, but you might want to try that for good measure as well.
If the VID:PID of your device doesn't match those in any of the 3 files, then you may need to create a custom rule file to match your VID:PID.
------
( Content below is currently unrevised and may be outdated as of Apr 2020. )
Using STM32 discovery kits with open source tools
========
@ -249,56 +300,8 @@ $> [sudo] ./st-flash write fancy_blink.bin 0x08000000
Upon reset, the board LEDs should be blinking.
HOWTO
=====
## Verify if udev rules are set correctly (by Dave Hylands)
To investigate, start by plugging your STLINK device into the usb port. Then run lsusb. You should see an entry something like the following:
```
Bus 005 Device 017: ID 0483:374b STMicroelectronics ST-LINK/V2.1 (Nucleo-F103RB)
```
Note the bus number (005) and the Device (017). You should then do:
`ls -l /dev/bus/usb/005/017` (replacing 005 and 017 appropriately).
On my system I see the following:
```
crw-rw-rw- 1 root root 189, 528 Jan 24 17:52 /dev/bus/usb/005/017
```
which is world writable (this is from the MODE:="0666" below). I have several files in my `/etc/udev/rules.d` directory. In this particular case, the `49-stlinkv2-1.rules` file contains the following:
```
# stm32 nucleo boards, with onboard st/linkv2-1
# ie, STM32F0, STM32F4.
# STM32VL has st/linkv1, which is quite different
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \
MODE:="0666", \
SYMLINK+="stlinkv2-1_%n"
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.
```
and the idVendor of 0483 and idProduct of 374b matches the vendor id from the lsusb output.
Make sure that you have all 3 files from here: https://github.com/texane/stlink/tree/master/etc/udev/rules.d in your `/etc/udev/rules.d` directory. After copying new files or editing excisting files in `/etc/udev/ruled.d` you should run the following:
```
sudo udevadm control --reload-rules
sudo udevadm trigger
```
to ensure that the rules actually take effect. Using the trigger command means that you shouldn't need to unplug and replug the device, but you might want to try that for good measure as well.
If the VID:PID of your device doesn't match those in any of the 3 files, then you may need to create a custom rule file to match your VID:PID.
HOWTO (old)
===========
## Using the gdb server