* Fixup #318 serial print in stlink probe with trailing zeros
* Refactor stlink-usb.h with some doxygen-style comments
* Refactor some pieces of stlink_open_usb
Add some better sanity checking when using libusb_open and cleanup accordingly.
Fixes hang (debian 8, amd64, libusb 1.0.19):
libusb: warning [add_to_flying_list] failed to arm first timerfd (errno 9)
libusb: warning [libusb_close] internal signalling write failed, closing anyway
* Fixup README to render HTML from Markdown
* Fixup CMakeLists.txt to have a lower working minimum version
* Add .travis.yml and .travis.sh for autobuild
The stm32l4 loader expects a count of 32 bits words while its granularity is
really 64 bits.
This patch fixes this to simplify count calculation in run_flash_loader().
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
All the loaders returns remaining work count in r2, except stm32l0/1.
Make these loaders behaving as the others to simplify run_flash_loader() code.
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
This patch invert source and destination registers in the stm32l0 and stm32l1
loaders, so that it follows the same ABI as other stm32 loaders.
Doing that, the run_flash_loader() function can be simplified a little.
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
This patch simplifies run_flash_loader() function in preparation for error
propagation from backends.
Doing this, we have less call sites for stlink API.
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Having a type of flash information has some advantages:
- Make the code easier to read
- Make adding family derivatives easier (only add a new entry in header file)
- Make the backends error propagation easier to implement (less places to fix)
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
As the libusb returns errors, make the backends propagates them so that
callers can decide to continue or stop task execution.
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
_stlink_usb_target_voltage already returns an error value.
If value return is positive, this is a voltage, if negative this is an error.
Check the return on callers side to inform there is an error in reading the
voltage, instead of notifying of a too low voltage.
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>