Releases: pyocd/pyOCD
Releases · pyocd/pyOCD
v0.19.0
New features
- Support for different flash erase sector and program page sizes (#452).
- Initial v8-M support, with known issues.
- New commander commands to run the gdbserver from within commander, to view and modify user options, to change the MEM-AP used for memory transfers, and to view and modify the current HPROT/HNONSEC for the selected AP.
Boards and targets
Note: there are still issues with most of the new v8-M targets.
- NXP LPC55S69
- Arm Musca-A1
- Arm Musca-B1
Changes
- pyOCD checks that at least one CPU was found and if not, reports a more understandable error.
- The core number is included in the log message indicating a core was discovered.
pyocd
was added to the commander Python expression evaluation namespace, so that all of pyOCD's Python API can be accessed.- Major cleanup of log messages related to libusb and debug probes.
- The warning about no libusb is only logged once per process.
- pyOCD clears all sticky DP error flags when a protocol error occurs.
- If pyOCD sees a timeout error on transfers, it will issue a DP abort to stop the erroneous transaction.
- Flash programming raises exceptions when the flash algorithm returns errors.
- Added
smart_flash
andkeep_unwritten
user options to better control the flash programming logic. - Builtin targets that used a custom
Flash
subclass to handle different erase/program sizes were updated to use the new support for that feature. - Transfer errors that occur while reading ROM table entries are trapped, and the associated AP is ignored.
- The commander uses a selectable MEM-AP for all memory transfers.
- Configuring the TPIU for SWO is delayed until the
TPIU.set_swo_clock()
method is called. This is required due to a change in the v8-M TPIU that requires the trace clock to be active before accessing certain registers.
Fixes
- The NXP LPC-LinkII debug probe is recognized properly.
- Worked around apparent libusb issue in Windows where STLink probes would intermittently not be visible (#575).
- Corrected handling of error responses from STLink probes (#581). This also fixes problems with the latest STLink firmware version (V2J33M25).
- Fixed a problem introduced recently where probes running the old "mbed CMSIS-DAP" firmware was not recognized (#588).
- Fixed CMSIS-Pack targets not working with
pyocd-gdbserver
(#570). - Fixed
--no-init
option for commander. - Fixed the default value for the gdbserver's
vector_catch
option. If the option was not set, an exception was raised. - Corrected
GDBServer.stop()
so it no longer uninits the board. - Commander
disasm
command works while the target is running. - The
--help-options
argument no longer fails for user options that have multiple allowed types, such aspack
. - Fixed
LOG_DAP
functionality inpyocd.coresight.ap
. - Updated pyyaml requirement to >= 5.1 (#582). The entire 4.1 release series that pyOCD was pinned to turned out to be buggy (though it didn't seem to affect pyOCD's usage).
- Fixed
FileProgrammer
trying to raise the undefinedArgumentError
exception for errors. It now raises the standardValueError
. - Fixed a number of issues with how
FileProgrammer
checked for file errors, including file not found (#590). - Fixed default names for memory regions.
- Fixed a problem where
FileProgrammer
used programmatically would not default to sector erase. - Access permissions are set on memory regions created for Pack targets.
- Fixed the
selected_core
property setter onCoreSightTarget
.
Python API
- Added optional
init_board
parameter toSession.open()
to control whether the board (and therefore target) are initialized. Used to implement the commander--no-init
option. - Removed
STLinkException
from the STLink probe code; now using standard pyOCD exceptions. - Added page and phrase sizes and program and erase weight attributes to flash memory regions.
- Added
smart_flash
andkeep_unwritten
parameters toFileProgrammer
andFlashLoader
. AccessPort
methods are automatically serialized via a mutex.- Changing the HPROT and HNONSEC values used for MEM-AP transfers is supported.
MEM_AP
attempts to detect the supported HPROT and HNONSEC bits in CSW.AHB_AP
detects whether the MSTRTYP bit is supported in CSW. (Only the M3/M4 AHB-AP supports this bit.)- Added context manager methods to
MEM_AP
to temporarily change HPROT or HNONSEC. The AP is locked while the context manager is live. - Moved the CoreSight components list to a separate source file.
- New
CortexM_v8M
subclass for v8-M cores.
Documentation
- Updated contributing guidelines and removed mention of the contributor license agreement that no longer needs to be signed.
- Added readme to udev folder with detailed information.
- The udev section in the main readme was simplified.
- Link to GNU Arm Embedded toolchain in a couple places.
- Updated the architecture diagram.
- Note about
gdb_test.py
requiring 32-bit Python 2.7 on Windows.
Testing
- Testing both 8- and 32-bit transfers in
speed_test.py
. speed_test.py
limits the size it will read or write during testing to 1 MB.- Rewrote the simple flash erase/program test in
basic_test.py
to support nonequal erase/program sizes.
Known issues
- The LPC-LinkII probe may not work correctly under Windows using pywinusb.
- All new v8-M targets have certain issues with flash programming or other operations.
v0.18.0
Boards and targets
- Added MAX32620 target and MAX32620FTHR board.
- Added MAX32630 target and MAX32630FTHR board.
Changes
- Sector erase is now the default mode for all flash programming since it is a safer default, especially with so many IoT projects now storing data on internal flash.
- Made the warning for an unknown board ID more helpful and less scary. It now says, ""Board ID XXXX is not recognized; you will be able to use pyOCD but not program flash."
- The SWV reader supports 16- and 32-bit ITM channel 0 events that send multiple characters.
- pyOCD only attempts to read the board ID from the probe's USB serial number if it knows the probe is running DAPLink, by comparing the USB VID and PID. This prevents unknown board ID warnings for other CMSIS-DAP compatible probes.
- pyOCD is now aware that a board ID of "0000" means the DAPLink is generic, so it won't try to look up the matching board.
- Removed websocket support.
Fixes
- Fixed a failure to start SWO transfers from the probe by sending the command to stop SWO before starting it. The failure could happen if the probe was left with SWO running when pyOCD exited, and then pyOCD was started again.
- Updated Argon RTOS support to match the latest version.
- Fixed an issue that prevented SWO from working with CMSIS-DAPv1.
- The SWV reader checks that the probe supports SWO before attempting to enable it.
- The
trace_start()
delegate and user script method will be called by the SWV reader if the target is reset. - Fixed memory cache bugs that caused duplication of cache contents. This most often appeared as extra data being sent by the gdbserver in response to a gdb read memory command, though it was not visible to users.
- Fixed the
FlashReaderContext
class' usage of a removed intervaltree API. This problem would be triggered if you passedpyocd gdbserver
an ELF file. - Any enabled watchpoints are removed on disconnect.
- The list of valid APs is saved only after the full AP scan completes, to prevent a partial list being saved.
- Rewrote gdbserver memory read command handler to use a much simpler and more efficient hex encoding method.
- Catching
NotImplementedError
exceptions raised on Windows by the CMSIS-DAPv2 interface code.
Python API
- Memory map API now allows empty memory ranges, but not empty memory regions.
- Removed
has_fpu
attribute from theTarget
class. This attribute is only supported onCortexM
now. is_float_register()
returns true for both single and double precision float registers.- Added a setter for the
CoreSightTarget.selected_core
property. Theselect_core()
method is now deprecated. - Changed the name of the
format
parameter ofFileProgrammer.program()
tofile_format
so it doesn't shadow the builtin function. - Refactored
GDBSocket
intopyocd.utility.socket.ListenerSocket
. - Renamed
pyocd.utility.py3_helpers
module topyocd.utility.compatibility
. - Removed unused
Flash_cortex_m
class. - A few remaining timeouts were changed to use the
Timeout
class. - Got rid of a pointless mutex in
GDBServer
. - Removed reading of flash related user options from
GDBServer
since these are now handled elsewhere.
Documentation
- Renamed files in the
docs/
folder to all lower case. - Started process of converting doxygen comments to doxygen-enabled doc comments.
- Added some missing user options to docs.
- Fixed some errors and typos in
user_scripts.md
and delegate method doc comments. - Converted license headers to use single-line comments, mostly so they don't show up in Doxygen output.
Testing
- Set up tox for running functional tests under Python 2.7 and 3.7. This will soon be used in our CI system to test on both Python versions.
- Moved unit tests from the pyocd Python package to the
test/
folder in the repo root. - Added tests to cover memory cache bugs mentioned above.
flash_loader_test.py
tests hex file programming.speed_test.py
tests cached memory accesses and records the ROM read speed.cortex_test.py
reports test metrics.- Removed use of
test_boards.yaml
file in favour of the now-standardpyocd.yaml
config file. - Fixed
blank_test.py
. - New
debug_context_test.py
.
v0.17.0
New features
- pyOCD now supports user scripts, written in Python, that can extend, modify, and override default behaviour at multiple key points in the connection lifetime. This feature is documented in docs/user_scripts.md.
- Providing the foundation for user scripts, the Python API supports attaching a delegate object to the session and other objects such as the target and cores. The same hook functions are used for delegates and user scripts.
- SWO and SWV are now supported for both CMSIS-DAP and STLink. See the description of #543 for details.
- CMSIS-DAPv2 support. v2 uses bulk endpoints instead of HID for improved latency. Tested with the Keil ULINKplus.
- Sessions have the concept of a project directory. This directory defaults to the working directory where pyOCD was started. It can be changed with the
-j/--dir
command line argument orproject_dir
user option. Any files used by pyOCD, such as config files, user scripts, or .FLM flash algos, will be searched for in the project directory if they are specified as a relative path.
Boards and targets
- Added STM32F429xI.
Changes
- The objects in the pyOCD object graph are now linked to form a generic object graph, in addition to the explicit references that already exist. This is intended to make it easier to find objects as the graph gets much more complex with support for SWO and other CoreSight components.
- The path to an .FLM style flash algorithm can be set on a
FlashRegion
via theflm
property. pyOCD will then load the flash algorithm for you. Very useful for user scripts. - Renamed the
flash_algo
property ofFlashRegion
to justalgo
and made it andflash_class
settable. This is all to make it easy to set or modify the flash algo in user scripts and delegates. - Renamed
SESSION_OPTIONS.md
documentation file toCONFIGURATION.md
since it covers all configuration topics and not just a list of options. - Added ULINKplus to example udev rules.
Fixes
- Fixed a typo in the code to build a flash algo from an .FLM file, which caused STM32 CMSIS-Pack targets to not be able to program flash.
- Corrected a performance issue for Python 3 on Windows and Linux. The pywinusb and pyusb backends for CMSIS-DAP were not yielding to other threads while waiting for data. (Thanks Cypress!)
- Improved detection of post-reset state for RTX5.
- Reduced warning messages related to USB device permissions issues on Linux through improved filtering for CMSIS-DAP devices.
- A few strings were not being properly formatted with '%'. (Thanks @mbolivar!)
- Added catch for unknown directory when parsing ELF symbols.
v0.16.1
Fixes
- Addressed a case where the USB device product name could be returned as bytes by hidapi instead of a string.
- Fixed
to_str_safe()
on Python 2 with non-ASCII characters. - Fixed Python 2 incompatibility in CMSIS DFP family matching.
Changes
- A little refactoring of some code in the
CmsisPack
class. - Renamed
pyocd.target.pack.pack
topyocd.target.pack.cmsis_pack
.
v0.16.0
New features
- Initial enablement of target support through CMSIS Device Family Packs. Pass the
--pack
argument to thepyocd
tool, or set thepack
session option in a config file. Any devices defined in the specified pack(s) become available as targets. - "erase" gdbserver monitor command. It accepts the same arguments as the
pyocd erase
subcommand.
Boards and targets
- Cypress PSoC6 CY8C6xx7 and CY8C6xxA targets and related boards.
- Maxim MAX32625 target and related board.
- Added STM32L031x6 target. (Thanks @michieldwitte!)
- Fixed the memory map for STM32F412xG. (Thanks @anthrax-0!)
Changes
- New
Target.ResetType
enumeration. - Much improved reset configuration.
CortexM
hasdefault_reset_type
anddefault_software_reset_type
properties. Software reset is used by default, and the default software reset depends on whether the core is the primary or a secondary core. - New emulated software reset type for v6-M and v8-M devices that don't support
VECTRESET
. - Presenting a standard VFP view to GDB.
- Nonstandard erased flash value can be set on a
FlashRegion
object with theerased_byte_value
attribute. - Builtin targets were moved to
pyocd.target.builtin
.
Fixes
- Fixed an issue with STLink communication by forcing the probe out of DFU mode on connection. (Thanks @michieldwitte!)
- Addressed a potential divide-by-zero error in
FlashLoader
if no data was written to flash. - Invalid addresses in hex files will be ignored rather than raise an exception. Some vendors put metadata in hex files as invalid addresses.
v0.12.1
v0.15.0
New features
- Added thread priority to RTX5 thread descriptions.
Changes
- Refined gdb target description register types and groups.
CortexM
uses the architecture and MVFR2 register to determine core features instead of the core type.- Updated
intervaltree
dependency to version 3.0.2, which fixes a warning reported on Python 3 about a deprecated API.
Fixes
- Corrected how the FPB revision was used to determine supported breakpoint address ranges.
- Fixed regression when accessing memory through APs with an APSEL > 0.
- Fixed renaming issue where
read_core_register_raw()
andwrite_core_register_raw()
were accidentally renamed to the non-raw version, resulting in two methods with the same name. This happened to not cause problems when using the gdbserver. - Set the encoding to UTF-8 when
setup.py
reads theREADME.md
file, which fixes issues on systems that have an incompatible default system encoding. - Pinned all dependencies that have stable APIs (version >=1.0).
- Corrected the flash algorithm call sequence to match the specification. This means calling
Init()
with the operation to be performed (erase or program), and callingUninit()
thenInit()
again prior to performing a different operation. Unfortunately, this change affects flash programming performance, slowing it down by approximately 5 kB/s. This performance degradation will be addressed soon.
Testing
- Expanded
cortex_test.py
to cover both the raw and non-raw versions of the read/write register APIs.
v0.14.3
Fixes
- Fixed serving on localhost only in the semihosting telnet server. The gdbserver would still serve localhost only by default (unless
--allow-remote
was set), but a bug was introduced in version 0.14.0 that caused the telnet server to always allow remote access.
v0.14.2
Fixes
- Pinned intervaltree version to 2.1.0. This is a work around for an issue in the newly released version 3.0.0 where it fails to install under Python 2.7. See chaimleib/intervaltree#77 for details.
v0.14.1
Fixes
- Corrected documentation and readme to reference combined
pyocd
tool. - Fixed handling of
chip_erase
andtrust_crc
parameters inFlashLoader
. This also corrects the behaviour of the--erase
and--trust-crc
command line arguments topyocd flash
. The most noticeable effect of the bug was that the sector erase option was not honoured. - Fixed Python3 regression with Intel hex files in
FileProgrammer
where they needed to be opened in text mode.