Skip to content

Releases: pyocd/pyOCD

v0.27.1

20 Jul 14:32
v0.27.1
eb050db

Choose a tag to compare

v0.27.1 on PyPI

Fixes

  • JLink: fix regression related to locking. #911

v0.27.0

01 Jul 21:06
v0.27.0
bb6302d

Choose a tag to compare

v0.27.0 on PyPI

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 core command.
  • Commander: Help text is wrapped to the terminal width.
  • Commander: Reading memory with a size misaligned to the read width is disallowed.
  • Gdbserver: Added --core argument to run the gdbserver for a subset of cores.
  • General: The warning about cortex_m target type being selected is not logged if the target type was explicitly set.
  • General: Added --probe as an alias for --uid on the command line.
  • General: The --frequency argument 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.2MHz now works as expected.
  • Commander: The set clock command accepts the same values as the --frequency argument.
  • J-Link: The device type passed to the J-Link driver can be specified with the jlink.device option. (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 GeneralMemAPTarget class 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.py functional test.
  • Tests: Improve logging in some tests. (Thanks @bartek-w.)
  • Tests: Add process timeout for gdb_test.py on 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 Python threading module.

v0.26.1

17 May 21:17
v0.26.1
9c933a5

Choose a tag to compare

Fixes

  • Fixed invalid reference to DFSR_PMU constant from CortexM.
  • Fixed read_memory_block32() size parameter in ElfReaderContext. (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

02 May 20:08
v0.26.0
860b61c

Choose a tag to compare

New features

  • Experimental SEGGER J-Link probe support.
    • Uses the J-Link driver via the pylink-square package, which will find the driver if installed in the standard location on all three supported OSes.
    • Added jlink.power user option to control the J-Link's power output. Defaults to enabled.
  • New reset subcommand.
  • pack subcommand option --find prints an "Installed" column showing whether the containing CMSIS-Pack is already installed and the target is available.
  • pack subcommand options --find and --install match the given part number pattern anywhere within the part number (contains match).
  • Commander improvements:
    • st alias for status.
    • Results from Python expressions are pretty printed.
    • show locked prints whether the target is locked (for NXP Kinetis and Nordic nRF52 devices).
    • show graph print the object model graph.
  • Added reset.hold_time and reset.post_delay user 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.loggers yaml key in the config file is ignored instead of reporting an error while attempting to configure logging.
  • Commander changes:
    • status only reports the core status now.
    • reg only shows peripheral register fields if the -f option is passed.
    • wreg -r option 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 six in coresight_target.py.
  • Fixed FileProgrammer import 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 Breakpoint repr() implementation.
  • Commander always flushes after wdp, wap, and wreg commands.
  • 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 DebugPort that 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 KeyError exception that would be raised by the RTX5 RTOS support when generating the thread description if a thread has an invalid state.

Internals

  • DebugPort init uses a call sequence.
  • Refactored DP connection into a DPConnector class.
  • Refactored SWJ sequences into an SWJSequenceSender class
  • Refactored CoreSight discovery to use a new CoreSightDiscovery class 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.
  • CortexM and CortexM_v8M classes gained an architecture property that is a CoreArchitecture.ARMv6M enum of the Arm Cortex-M architecture: ARMv6M, ARMv7M, ARMv8M_BASE, ARMv8M_MAIN. Correspondingly, the arch attribute 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.md reference to old MemoryMap.get_region_by_name() method that was replaced with get_first_matching_region().

v0.25.0

10 Mar 19:43
v0.25.0
d0df0d4

Choose a tag to compare

New features

  • User scripts are run earlier, from the Session constructor. This allows user scripts to add new target classes.
  • pyocd commander: Added compare command 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 k32l2b3 target. (Thanks @jhqian.)
  • Added NXP MIMXRT1010-EVK and MIMXRT1015-EVK boards and mimxrt1010 and mimxrt1015 targets.
    (Thanks @jhqian.)
  • Added NuMaker-IoT-M263A board and m263kiaae target. (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: erase command 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_SIZE larger 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_cores option.
  • Fixed issues with passing the path to an FLM flash algo to a FlashRegion via the flm parameter.

Testing

  • Added CMSIS-Pack parsing unit test.
  • The FileProgrammer functional test now tests ELF files.

Installation

  • Individual SVD files are now stored in the repo, and the svd_data.zip is built by setup.py.
  • setup.py can be run from directories other than the repo root. (Thanks @jsiverskog.)

v0.24.1

30 Dec 01:18
v0.24.1
83cd506

Choose a tag to compare

Fixes

  • Fixed regression where programming an ELF file failed, caused by missing import. (Thanks @DurandA!)

v0.24.0

24 Dec 23:38
v0.24.0
e3d468d

Choose a tag to compare

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 of swd, jtag, or default. (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 FileProgrammer that appeared when attempting to load ELF files. (#782 and others. Thanks @samkearney!)
  • Fixed an issue where v8-M cores would cause the commander show cores command 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, plus supports_swj_sequence property 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 link attribute of DebugPort to probe.
  • Refactored MemoryMap region search methods.
  • Renamed FlashRegion.is_erased() to is_data_erased() which better reflects that it operates on passed-in data.
  • Changed all the constants in Target to be enums.
  • Removed the root context methods on Target that were unused.
  • Added Target.get_halt_reason() method.
  • Renamed FlashReaderContext to ElfReaderContext.
  • Some new GraphNode methods.
  • MemoryCache and RegisterCache were moved from pyocd.debug.cache to their own modules in a new subpackage pyocd.cache.
  • Moved GDBServerPacketIOThread to its own module.
  • Moved FileProgrammer and FlashEraser to their own modules under pyocd.flash.

Documentation

  • Documented MemoryMap methods.
  • New security features documentation. (Thanks @nocko!)
  • Split documentation of user options out from configuration documentation.
  • Various little fixes and improvements.

v0.23.0

15 Nov 22:48
v0.23.0
eab53f6

Choose a tag to compare

New features

  • Added a connect_mode option. It can be set to one of halt, pre-reset, under-reset, attach. The default is halt, retaining previous behaviour. In particular, under-reset can 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:
    • go and halt report target state.
    • continue and c aliases for go.
    • load command to load any file, including hex or ELF. (loadmem only loads binary.)
    • fill command for filling memory with patterns.
    • find command to search for byte patterns in memory ranges.
    • watch, lswatch, and rmwatch commands 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_connect option in favour of the added connect_mode option. To get the behaviour of turning off halt_on_connect (the default was on), set connect_mode to attach.
  • 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 option in 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

04 Sep 22:35
v0.22.0
e9a0d7c

Choose a tag to compare

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

24 May 21:11
a17145c

Choose a tag to compare

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 list command 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 FlashBuilder class related to filling gaps in pages with no data to program.
  • Fixed Flash.program_phrase().
  • Fixed the CortexM.available_breakpoint_count property.

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 OptionsManager class that handles user options for a session.
  • Sorted out some issues in the architecture of the DebugContext class.
  • A Session is now automatically opened when used as a context manager. This can be disabled by setting the auto_open parameter 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().
  • Session is the sole notifier for target-related notifications.
  • Added support for notifications on changes to user options. In this case, the OptionsManager is the notifier. For instance, to subscribe: my_session.options.subscribe(my_cb, "auto_unlock").
  • Removed root_target attribute from Target.

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 OptionsManager class.