Releases: pyocd/pyOCD
Releases · pyocd/pyOCD
v0.27.1
v0.27.0
New features
- Support for Arm ADIv6. This is a new version of the Arm Debug Interface used with Cortex-M55 and in some advanced platforms. Cortex-M microcontrollers are expected to slowly transition to ADIv6, but most new MCUs will continue to use ADIv5.2 for quite some time.
- Recognizing the Arm SC000, SC300, and Cortex-M35P secure cores and Cortex-M55.
Boards and targets
- Added support for new revisions of secure Cypress PSoC64 devices. (Thanks @bohdan-tymkiv and Cypress.)
- Added Arm Musca-S1 board ID.
- Added board IDs for Arm MPS3 AN522 and AN540.
- Fixed vendor name for LPC55S69 target.
- LPC55S69 target supports the single-core configuration (technically LPC55S66).
- Added 'lpc55s28' built-in target.
- New STMicro STM32F767 target. (Thanks @bartek-w.)
- Added Samsung s5js100 target. (Thanks @vince-zeng and Samsung engineers.)
- Fixed reset and connect issues with a sleeping target for the NXP i.MX RT1052. (Thanks @jhqian.)
Changes
- CMSIS-Packs: Removed the debug log message for every target loaded from a pack, which could get annoying very quickly.
- User scripts: Improved logging of errors. (Thanks @bartek-w.)
- Commander: The selected MEM-AP changes when the selected core is changed with the
corecommand. - Commander: Help text is wrapped to the terminal width.
- Commander: Reading memory with a size misaligned to the read width is disallowed.
- Gdbserver: Added
--coreargument to run the gdbserver for a subset of cores. - General: The warning about
cortex_mtarget type being selected is not logged if the target type was explicitly set. - General: Added
--probeas an alias for--uidon the command line. - General: The
--frequencyargument accepts floating point values, and allows "Hz" (case-insensitive) to follow the value in addition to the previously supported metric scale suffixes. For example,--frequency=2.2MHznow works as expected. - Commander: The
set clockcommand accepts the same values as the--frequencyargument. - J-Link: The device type passed to the J-Link driver can be specified with the
jlink.deviceoption. (By default, "Cortex-M4" is used. This doesn't cause any problems except a warning in the J-Link log because pyOCD uses its own target discovery rather than the J-Link's.) - DAP: Code cleanup and some small improvements in MEM-AP initialization.
- DAP: A
GeneralMemAPTargetclass was added that provides a target object for MEM-APs without a connected core. This handles the case where a MEM-AP provides access to either the system memory bus or an isolated memory bus, independent of MEM-APs for the core(s). (Thanks @bohdan-tymkiv and Cypress.) - STLink: Banked DP registers can be accessed on recent STLink firmware (V2J32 or V3J2 and above).
- Tests: Added
concurrency_test.pyfunctional test. - Tests: Improve logging in some tests. (Thanks @bartek-w.)
- Tests: Add process timeout for
gdb_test.pyon Python 3. (Thanks @bartek-w.)
Fixes
- DAP: Solved some long-standing concurrency issues with targets being accessed from multiple threads. Only the DAP (DP and AP) layer and below are locked. This means that the target and other high level layers are not locked. For instance, two threads attempting to set breakpoints on the same core would be unpredictable. The underlying DAP accesses and memory transfers will not fail, but the FPB component registers may get into an invalid state.
- Documentation: Corrected instructions in readme for installing from the git repo.
- CMSIS-Packs: Fixed problems creating the memory map for certain cases of multiple sector sizes in flash regions or regions belonging to individual cores.
- General: ANSI flags are always cleared after the list of available probes is printed.
- General: Memory addresses are masked to 32-bits. The most visible result of this is that you will see only a 32-bit value reported in the error if you accidentally pass a larger-width value to a read or write command (because Python intrinsically supports arbitrary-width integers).
- udev rules: Fixed line endings and remove symlink directives in the STLink udev rules included in the pyOCD repo.
- General: Resolved a deprecation warning for the
Thread.isAlive()method from the Pythonthreadingmodule.
v0.26.1
Fixes
- Fixed invalid reference to
DFSR_PMUconstant fromCortexM. - Fixed
read_memory_block32()size parameter inElfReaderContext. (Thanks @mbrossard!) - Address Python 3 string conversion issue in semihosting. (Thanks @mbrossard!)
- Workaround for failure to init flash algo in verify mode.
- gdbserver: clear stale flash data on exception during flash programming.
- Fixed flash object creation in cases where the memory map is modified during the init sequence.
- Fixed NXP kl28z target issues. (Thanks @Hoohaha!)
v0.26.0
New features
- Experimental SEGGER J-Link probe support.
- Uses the J-Link driver via the
pylink-squarepackage, which will find the driver if installed in the standard location on all three supported OSes. - Added
jlink.poweruser option to control the J-Link's power output. Defaults to enabled.
- Uses the J-Link driver via the
- New
resetsubcommand. packsubcommand option--findprints an "Installed" column showing whether the containing CMSIS-Pack is already installed and the target is available.packsubcommand options--findand--installmatch the given part number pattern anywhere within the part number (contains match).- Commander improvements:
stalias forstatus.- Results from Python expressions are pretty printed.
show lockedprints whether the target is locked (for NXP Kinetis and Nordic nRF52 devices).show graphprint the object model graph.
- Added
reset.hold_timeandreset.post_delayuser options to fine tune hardware reset timings.
Boards and targets
- Fixed NXP i.MX RT1052 HyperFlash and QuadSPI flash programming. (Thanks @jhqian!)
- Fixed reset vector catch clearing on LPC1768. (Thanks @rafl!)
Changes
- Support for accessing banked DP registers.
- Improved DP power up and power down sequences to match the recommendations and add timeouts.
- The associated core number is printed for gdb and semihost servers when the port number is logged.
- An empty
logging.loggersyaml key in the config file is ignored instead of reporting an error while attempting to configure logging. - Commander changes:
statusonly reports the core status now.regonly shows peripheral register fields if the-foption is passed.wreg -roption to perform a post-write read-back and print of the peripheral register value. The read-back is no longer performed automatically.
Fixes
- Fixed several cases where exceptions were incorrectly created.
- Fixed a missing import of
sixincoresight_target.py. - Fixed
FileProgrammerimport issue for user scripts that appeared in certain cases. - Corrected a "null internal" error when using certain ELF files.
- Solved a name error in
CortexM._map_from_vector_catch_mask(). - Fixed name error regression in
Breakpointrepr() implementation. - Commander always flushes after
wdp,wap, andwregcommands. - The gdb server ensures the target is halted when gdb first connects, to prevent gdb from failing to read the target state (i.e., core registers that cannot be read by the core is running).
- Fixed incorrect exception handlers in
DebugPortthat caused certain faults and timeouts to not be cleared in the DP. - Corrected a number of naming and typing issues identified by pytype.
- Resolved a
KeyErrorexception that would be raised by the RTX5 RTOS support when generating the thread description if a thread has an invalid state.
Internals
DebugPortinit uses a call sequence.- Refactored DP connection into a
DPConnectorclass. - Refactored SWJ sequences into an
SWJSequenceSenderclass - Refactored CoreSight discovery to use a new
CoreSightDiscoveryclass hierarchy. This allows the init sequence to be modified by an ADI version-specific subclass. These changes are preparatory work for ADIv6 support. - Added a
CoreSightTarget.post_connect_hook()method that can be overridden by builtin targets without having to modify the init sequence. CortexMandCortexM_v8Mclasses gained anarchitectureproperty that is aCoreArchitecture.ARMv6Menum of the Arm Cortex-M architecture:ARMv6M,ARMv7M,ARMv8M_BASE,ARMv8M_MAIN. Correspondingly, thearchattribute was removed from the classes.- PMU halt reason support was moved to
CortexM_v8M.
Testing
- New ROM table parser unit test.
- Basic user script functional test.
Documentation
- Fixed
user_script.mdreference to oldMemoryMap.get_region_by_name()method that was replaced withget_first_matching_region().
v0.25.0
New features
- User scripts are run earlier, from the
Sessionconstructor. This allows user scripts to add new target classes. - pyocd commander: Added
comparecommand for comparing memory with a binary file. - JSON features and options list, accessible via
pyocd json --features. This is intended to allow IDEs to query for supported features and the set of available user options without having to make decisions based solely on the pyOCD version.
Boards and targets
- Added NXP FRDM-K32LB2 board and
k32l2b3target. (Thanks @jhqian.) - Added NXP MIMXRT1010-EVK and MIMXRT1015-EVK boards and
mimxrt1010andmimxrt1015targets.
(Thanks @jhqian.) - Added NuMaker-IoT-M263A board and
m263kiaaetarget. (Thanks @OpenNuvoton.) - Added numerous HDSC MCU targets:
hc32l110,hc32f003,hc32f005,hc32l136,hc32l130,hc32f030,hc32l196,hc32l190,hc32f196,hc32f190,hc32l072,hc32l073,hc32f072. (Thanks @hdscmcu.) - Improved support for Cypress PSoC64 device family. (Thanks @Cypress-OpenOCD.)
- Corrected the UICR region size for Nordic nRF52x devices. (Thanks @Dirbaio.)
Changes
- pyocd commander:
erasecommand will perform a mass erase if no arguments are passed. - pyocd erase: A much more helpful error is shown in no arguments are passed.
- Arguments for subcommands are grouped in the usage text.
- Adjusted pyOCD's CoreSight discovery process to only stop scanning for APs after two invalid APSEL addresses in sequence have been encountered (instead of 1).
- Relaxed the CMSIS-DAPv1 detection code for the pyusb backend to only require "CMSIS-DAP" in the HID interface name if there is more than one HID interface.
Fixes
- Much more robust detection of FreeRTOS. (Thanks @haneefdm.)
- Fixed exception raised by the Zephyr RTOS support in cases where a thread's state was garbage for one reason or another. (Thanks @FrameworkComputer.)
- Fixed bits versus bytes confusion in SWV processor. (Thanks @Dirbaio.)
- CMSIS-DAP v2: fix support for USB full speed devices with a
DAP_PACKET_SIZElarger than the bulk packet size. (Thanks @vllogic.) - Corrected some debug log messages in the
BreakpointManager. - pyocd commander: Fixed several issues when connecting to a device where no cores were discovered, when allowed by setting the
allow_no_coresoption. - Fixed issues with passing the path to an FLM flash algo to a
FlashRegionvia theflmparameter.
Testing
- Added CMSIS-Pack parsing unit test.
- The
FileProgrammerfunctional test now tests ELF files.
Installation
- Individual SVD files are now stored in the repo, and the
svd_data.zipis built bysetup.py. setup.pycan be run from directories other than the repo root. (Thanks @jsiverskog.)
v0.24.1
v0.24.0
New features
- Support for legacy AP BASE register formats seen on early Cortex-A platforms. While Cortex-A cores are not supported yet, pyOCD can at least read the ROM tables and identify the cores now.
- Support for the new SWJ sequences introduced in ADIv5.2 with SWJ-DPv2. These sequences transition between SWD and JTAG by going through a dormant mode. By default, pyOCD will first attempt the deprecated SWJ sequences, then if that fails it will attempt the new sequences.
- New user options:
dap_protocol: One ofswd,jtag, ordefault. (JTAG is still not fully supported, but is getting closer.)dap_enable_swj: Whether SWJ sequences are sent (default True).dap_use_deprecated_swj: Whether to attempt deprecated SWJ sequences (pre-ADIv5.2). Most Cortex-M MCUs do not support the new sequences.probe_all_aps: Force a scan of all 256 AP addresses instead of stopping the AP scan at the first invalid AP.xpsr_control_fields: Defines bitfields for XPSR and CONTROL registers when presented in gdb.
Boards and targets
- Added board ID for Embedded Planet Agora platform.
- Major refactoring of Cypress PSoC6 target support. (Thanks Cypress!)
- Nordic nRF52 APPROTECT security and unlock support. This works for both builtin and CMSIS-Pack targets. (Thanks @nocko!)
- Fixed NXP LPC1768 reset and halt.
- Fixed Arm Musca-B1 software reset.
- Added test binaries for a handful of STMicro Nucleo boards.
Changes
- More debug log messages when operations like stepping are performed.
Fixes
- Fixed uninitialized variable reference in
FileProgrammerthat appeared when attempting to load ELF files. (#782 and others. Thanks @samkearney!) - Fixed an issue where v8-M cores would cause the commander
show corescommand to raise an exception due to separate core type name lists for v6/7-M and v8-M. There is now a single core type name list. - Improved handling of probes with multiple USB HID interfaces when using the pyusb backends.
Python API
DebugProbe.swj_sequence()is added, plussupports_swj_sequenceproperty indicating whether the probe can send arbitrary SWJ sequences using this API. Currently only CMSIS-DAP probes are capable of this.- Fixed the JTAG sequence API in pyDAPAccess. (Not exposed at higher layers.)
- Renamed
linkattribute ofDebugPorttoprobe. - Refactored
MemoryMapregion search methods. - Renamed
FlashRegion.is_erased()tois_data_erased()which better reflects that it operates on passed-in data. - Changed all the constants in
Targetto be enums. - Removed the root context methods on
Targetthat were unused. - Added
Target.get_halt_reason()method. - Renamed
FlashReaderContexttoElfReaderContext. - Some new
GraphNodemethods. MemoryCacheandRegisterCachewere moved frompyocd.debug.cacheto their own modules in a new subpackagepyocd.cache.- Moved
GDBServerPacketIOThreadto its own module. - Moved
FileProgrammerandFlashEraserto their own modules underpyocd.flash.
Documentation
- Documented
MemoryMapmethods. - New security features documentation. (Thanks @nocko!)
- Split documentation of user options out from configuration documentation.
- Various little fixes and improvements.
v0.23.0
New features
- Added a
connect_modeoption. It can be set to one ofhalt,pre-reset,under-reset,attach. The default ishalt, retaining previous behaviour. In particular,under-resetcan often be used to connect to out of control targets. - Watchpoints in v8-M targets work now, with added support for DWT version 2.
- Several additions to the commander:
goandhaltreport target state.continueandcaliases forgo.loadcommand to load any file, including hex or ELF. (loadmemonly loads binary.)fillcommand for filling memory with patterns.findcommand to search for byte patterns in memory ranges.watch,lswatch, andrmwatchcommands for managing watchpoints.- Hex dumps now include an ASCII representation column.
Boards and targets
- New Cypress PSoC6 devices.
- Add NuMaker-M252KG board and M252KG6AE target.
- HDSC HC32F46X, HC32F120, and HC32M120 targets added.
Changes
- Removed
halt_on_connectoption in favour of the addedconnect_modeoption. To get the behaviour of turning offhalt_on_connect(the default was on), setconnect_modetoattach. - Tildes are expanded in ELF file paths.
- Description message included in exceptions raised for No ACK, SWD protocol error, or unrecognized CMSIS-DAP transfer response values.
- Explicitly denote support for Python 3.8.
Fixes
- Fixed bugs related to converting user options when set from the command line.
- Fixed
show optionin commander. - Corrected an undefined attribute error if an invalid path to an ELF file is specified.
- Addressed concurrency issues with recent memory map changes. The target memory map is now deep copied for each session.
- Fix some minor deprecation warnings reported by Python 3.8.
v0.22.0
Boards and targets
- Fixed regression with Cypress PSoC6 targets (#680) and merged in cumulative PSoC6 updates from Cypress.
- Resolved a number of issues (but not all) with NXP LPC55S69.
- Update ST NUCLEO-H743ZI.
- Correct the wrong part number for MIMXRT1064-EVK board.
- Correct part number for ST NUCLEO-WB55RG board.
- Fix location of input data for flash algorithms in STM32F412xx target.
- Address an issue with the built-in target STM32L031x6 by disabling double buffered flash programming.
- New board IDs: DISCO-H747I (stm32h747xihx), NUCLEO-H743ZI2 (stm32h743zitx), micro:bit v1.5 (nrf51), Calliope-mini, MTS_MDOT_F405RG (stm32f405rg), MTS_DRAGONFLY_F411RE (stm32f411re), MTS_DRAGONFLY_L471QG (stm32l471qg), MTS_MDOT_F411RE (stm32f411re), XDOT_L151CC (stm32l151cc), MAX32620MBED (max32620), MAX32620HSP (max32620), MAX32625NEXPAQ (max32625), MAX32630MBED (max32630), MAX32630HSP3 (max32630), EV_COG_AD3029LZ (aducm3029), EV_COG_AD4050LZ (aducm4050), NUCLEO-L073RZ (stm32l073rz), LPC4337 (lpc4337), Teensy 3.1 (mk20dx256vlh7), L-Tek FF1705 (stm32l151cc), L-Tek FF-LPC546XX (lpc54606).
Changes
- Support running pyOCD with cmsis-pack-manager not installed, in which case managed CMSIS packs are not supported. This is primarily for running on small platforms like Raspberry Pi. See installing_on_non_x86.md for more.
- Note in readme about using libusb 1.0.21 on Windows to work around a pyusb issue that only appears on that platform.
- Loading ELF files now uses the segments defined in the file rather than sections.
Fixes
- Fixed regression on quit option for terminal probe selection prompt.
- Gracefully handle cases where the "mbed.htm" file does not appear on STLink USB MSC volumes (#695).
- Fix SVD model handling of unset derived attributes (#688).
- Catching more USB related exceptions that can be caused by misbehaving devices.
v0.21.0
New features
- STLinkV3 support.
- Adding and removing of breakpoints is optimized. The breakpoint manager keep track of requested breakpoints, and only modifies the FPB/BPU immediately before a resume or step. This is useful because gdb likes to remove all breakpoints, then re-add them each time it runs the target.
- Support for configuring log output. See the new configuring logging documentation for details.
- The
pyocd listcommand gained some arguments to filter the output.
Boards and targets
- Added some additional NXP board IDs.
- Addressed some issues with Arm Musca-A1 and Musca-B1 support.
Changes
- More helpful warning if the generic "cortex_m" target type is selected.
- Logging of exception tracebacks can be controlled with the "debug.traceback" user option. Eventually this will default to false.
- Removed "soft_bkpt_as_hard" user option. This was from long ago, before pyOCD even supported soft breakpoints, and is no longer useful.
- Normalised the use of loggers, so each Python module has its own logger with the name of the module.
- The debug probe's firmware version is logged via a debug log message if known.
- A better error is reported if a CMSIS-Pack is not a valid zip file.
- More helpful error message if an unknown target type is specified.
Fixes
- Workaround for .FLM flash algorithms that have a page size larger than the sector size. In particular, this fixes the Keil flash algorithms for STM32L072 and L073.
- Fixed user option priorities and value parsing to work as one would expect. This is documented in the configuration documentation.
- Fixed built-in STM32L475 flash algorithm.
- Fixed some issues in the
FlashBuilderclass related to filling gaps in pages with no data to program. - Fixed
Flash.program_phrase(). - Fixed the
CortexM.available_breakpoint_countproperty.
Documentation
- Finished converting all Doxygen comments to Doxygen-enabled doc comments.
- Added a section about target types to the target support documentation.
- Added terminology definition documentation.
Python API
- Added some new exception classes, tied a few outstanding exception classes into the pyOCD exception hierarchy, and made sure the appropriate exceptions are being raised for errors.
- New
OptionsManagerclass that handles user options for a session. - Sorted out some issues in the architecture of the
DebugContextclass. - A
Sessionis now automatically opened when used as a context manager. This can be disabled by setting theauto_openparameter of the constructor to False. Conversely,ConnectHelper.session_with_chosen_probe()no longer opens the session for you (but if used in a with statement, the session will still be opened). - Removed deprecated parameters from
ConnectHelper.session_with_chosen_probe(). Sessionis the sole notifier for target-related notifications.- Added support for notifications on changes to user options. In this case, the
OptionsManageris the notifier. For instance, to subscribe:my_session.options.subscribe(my_cb, "auto_unlock"). - Removed
root_targetattribute fromTarget.
Testing
- Added a basic unit test for CMSIS-Pack loading. However, it is currently disabled because it fails when run under Travis-CI.
- New unit test for the notification API.
- New unit test for the
OptionsManagerclass.