Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
flit committed Oct 8, 2023
2 parents fba00fb + c684bdf commit cb97846
Show file tree
Hide file tree
Showing 43 changed files with 158,367 additions and 249 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,7 @@ pyocd_user.py
# Mac
.DS_Store

# kdevelop
.kdev4
*.kdev4
*.kate-swp
5 changes: 5 additions & 0 deletions docs/builtin-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,11 @@ title: Built-in targets
<td>NRF52840</td>
</tr>

<tr><td><code>nrf91</code></td>
<td>Nordic Semiconductor</td>
<td>NRF9160</td>
</tr>

<tr><td><code>rp2040</code></td>
<td>Raspberry Pi</td>
<td>RP2040Core0</td>
Expand Down
10 changes: 8 additions & 2 deletions docs/open_cmsis_pack_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,15 @@ Only top-level sequences can be disabled individually. If a debug sequence is ca
This section documents details of the debug sequence engine provided by pyOCD, supported features, and any notable differences with other debuggers (primarily Keil MDK, which provided the first implementation and against which Packs are generally most thoroughly tested by their authors).


### CPU-specific DebugPort sequences
### Core-specific sequences

Like all other debug sequences, `DebugPortSetup`, `DebugPortStart`, and `DebugPortStop` can be customised per CPU core. If a DFP has multiple CPU-specific instances of these sequences, they may behave differently in pyOCD than other debuggers. Many debuggers only "connect" to a single CPU chosen by the user when debugging or running a project. PyOCD is somewhat different in that it connects to the device as a whole, and then debugs a chosen core after the connection is established (which more closely reflects the hardware situation).
The DFP debug sequence architecture is currently based on the fact that most debuggers only "connect" to a single CPU core chosen by the user when debugging or running a project. All debug sequences can be customised per core, and there can be separate sequences for each core.

PyOCD is somewhat different in that it connects to the device as a whole, and then debugs one or more cores after the connection is established. This more closely reflects the hardware situation.

This primarily impacts the `DebugPortSetup`, `DebugPortStart`, `DebugPortStop`, and `DebugDeviceUnlock` debug sequences that affect the entire SoC. These relate to the connect procedure for the Arm ADI DP (Debug Port) used for SWD/JTAG communications. While most sequences can be run separately for each core, these are run only once per target connection. The core-specific variant that is selected can affect the rest of the debugging session. (Technically, this is also true for debuggers that are presented as debugging a single core, in cases where a second instance of that debugger can be started to debug another core. But, the way it's presented to the user is different.)

The `primary_core` session option is used to select which core-specific version of the `DebugPort*`/`DebugDeviceUnlock` sequences is run during the target connection process. For all other sequences, the core-specific version that is run depends on which core is performing the action.


### Custom default reset sequences
Expand Down
3 changes: 2 additions & 1 deletion pyocd/board/board.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pyOCD debugger
# Copyright (c) 2006-2013,2018 Arm Limited
# Copyright (c) 2021-2022 Chris Reed
# Copyright (c) 2023 Benjamin Sølberg
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -77,7 +78,7 @@ def __init__(self,
if session.options.get('warning.cortex_m_default'):
LOG.warning("Generic 'cortex_m' target type is selected by default; is this "
"intentional? You will be able to debug most devices, but not program "
" flash. To set the target type use the '--target' argument or "
"flash. To set the target type use the '--target' argument or "
"'target_override' option. Use 'pyocd list --targets' to see available "
"targets types.")

Expand Down
46 changes: 42 additions & 4 deletions pyocd/board/board_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ class BoardInfo(NamedTuple):
"0243": BoardInfo( "MIMXRT1015-EVK", "mimxrt1015", "l1_mimxrt1015-evk.bin",),
"0244": BoardInfo( "MIMXRT1170-EVK", "mimxrt1170_cm7", "l1_rt1170.bin", ),
"0245": BoardInfo( "IBMEthernetKit", "k64f", "l1_k64f.bin" ),
"0246": BoardInfo( "MIMXRT1160-EVK", "mimxrt1166xxxxx", None, ),
"0246": BoardInfo( "MIMXRT1160-EVK", "mimxrt1166dvm6a", None, ),
"0250": BoardInfo( "FRDM-KW24D512", "kw24d5", "l1_kw24d5.bin" ),
"0251": BoardInfo( "FRDM-KW36", "kw36z4", "l1_kw36z.bin", ),
"0252": BoardInfo( "FRDM-KW38", "kw38z4", None, ),
"0253": BoardInfo( "USB-KW38", "kw38z4", None, ),
"0254": BoardInfo( "KW38-ER-RD", "kw38z4", None, ),
"0255": BoardInfo( "MIMXRT1040-EVK", "mimxrt1042xjm5b", None, ),
"0260": BoardInfo( "FRDM-KL26Z", "kl26z", "l1_kl26z.bin", ),
"0261": BoardInfo( "FRDM-KL27Z", "kl27z4", "l1_kl27z.bin", ),
"0262": BoardInfo( "FRDM-KL43Z", "kl43z4", "l1_kl26z.bin", ),
Expand All @@ -95,6 +96,7 @@ class BoardInfo(NamedTuple):
"0340": BoardInfo( "TWR-K80F150M", "mk80fn256vll15", None, ),
"0341": BoardInfo( "FRDM-KV31F", "mkv31f512vll12", None, ),
"0350": BoardInfo( "XDOT_L151CC", "stm32l151cctx", None ),
"0360": BoardInfo( "HANI-IOT", "lpc55s69", None ),
"0400": BoardInfo( "MAXWSNENV", "max32600", "l1_maxwsnenv.bin", ),
"0405": BoardInfo( "MAX32600MBED", "max32600", "l1_max32600mbed.bin", ),
"0406": BoardInfo( "MAX32620MBED", "max32620", None ),
Expand All @@ -107,6 +109,7 @@ class BoardInfo(NamedTuple):
"0418": BoardInfo( "MAX32620FTHR", "max32620", "max32620fthr.bin", ),
"0420": BoardInfo( "MAX32630HSP3", "max32630", None ),
"0421": BoardInfo( "MAX32660EVSYS", "max32660", "max32660evsys.bin", ),
"0422": BoardInfo( "MAX32666FTHR", "max32666", "max32666fthr.bin", ),
"0424": BoardInfo( "MAX32670EVKIT", "max32670", "max32670evkit.bin", ),
"0451": BoardInfo( "MTB MXChip EMW3166", "stm32f412xg", "mtb_mxchip_emw3166.bin",),
"0459": BoardInfo( "MTB Advantech WISE-1530", "stm32f412xg", "mtb_wise-1530.bin", ),
Expand All @@ -120,10 +123,13 @@ class BoardInfo(NamedTuple):
"0715": BoardInfo( "NUCLEO-L053R8", "stm32l053r8tx", "NUCLEO_L053R8.bin", ),
"0720": BoardInfo( "NUCLEO-F401RE", "stm32f401retx", None, ),
"0725": BoardInfo( "NUCLEO-F030R8", "stm32f030r8tx", None, ),
"0726": BoardInfo( "32F0308DISCOVERY", "stm32f030r8tx", None, ),
"0729": BoardInfo( "NUCLEO-G071RB", "stm32g071rbtx", None, ),
"0730": BoardInfo( "NUCLEO-F072RB", "stm32f072rbtx", "NUCLEO_F072RB.bin", ),
"0731": BoardInfo( "32F072BDISCOVERY", "stm32f072rbtx", None, ),
"0735": BoardInfo( "NUCLEO-F334R8", "stm32f334r8tx", "NUCLEO_F334R8.bin", ),
"0740": BoardInfo( "NUCLEO-F411RE", "stm32f411retx", "NUCLEO_F411RE.bin", ),
"0741": BoardInfo( "32F411EDISCOVERY", "stm32f411retx", None, ),
"0742": BoardInfo( "NUCLEO-F413ZH", "stm32f413zhtx", None, ),
"0743": BoardInfo( "DISCO-F413ZH", "stm32f413zhtx", None, ),
"0744": BoardInfo( "NUCLEO-F410RB", "stm32f410rbtx", None, ),
Expand All @@ -135,6 +141,7 @@ class BoardInfo(NamedTuple):
"0760": BoardInfo( "NUCLEO-L073RZ", "stm32l073rztx", None, ),
"0764": BoardInfo( "DISCO-L475VG-IOT01A", "stm32l475xg", "stm32l475vg_iot01a.bin",),
"0765": BoardInfo( "NUCLEO-L476RG", "stm32l476rgtx", "NUCLEO_L476RG.bin", ),
"0766": BoardInfo( "Avnet Silica ST Sensor Node", "stm32f103cb", None, ),
"0770": BoardInfo( "NUCLEO-L432KC", "stm32l432kcux", "NUCLEO_L432KC.bin", ),
"0774": BoardInfo( "DISCO-L4R9I", "stm32l4r9aiix", None, ),
"0775": BoardInfo( "NUCLEO-F303K8", "stm32f303k8tx", None, ),
Expand All @@ -144,6 +151,7 @@ class BoardInfo(NamedTuple):
"0779": BoardInfo( "NUCLEO-L433RC-P", "stm32l433rctx", None, ),
"0780": BoardInfo( "NUCLEO-L011K4", "stm32l011k4tx", None, ),
"0781": BoardInfo( "NUCLEO-L4R5ZI-P", "stm32l4r5zitx", None, ),
"0782": BoardInfo( "NUCLEO-L4A6ZG", "stm32l4a6zgtx", None, ),
"0783": BoardInfo( "NUCLEO-L010RB", "stm32l010rbtx", None, ),
"0785": BoardInfo( "NUCLEO-F042K6", "stm32f042k6tx", None, ),
"0788": BoardInfo( "DISCO-F469NI", "stm32f469nihx", None, ),
Expand All @@ -154,6 +162,7 @@ class BoardInfo(NamedTuple):
"0797": BoardInfo( "NUCLEO-F439ZI", "stm32f439zitx", None, ),
"0805": BoardInfo( "DISCO-L053C8", "stm32l053c8tx", None, ),
"0810": BoardInfo( "DISCO-F334C8", "stm32f334c8tx", None, ),
"0811": BoardInfo( "32F723EDISCOVERY", "stm32f723iekx", None, ),
"0812": BoardInfo( "NUCLEO-F722ZE", "stm32f722zetx", None, ),
"0813": BoardInfo( "NUCLEO-H743ZI", "stm32h743zitx", None, ),
"0814": BoardInfo( "DISCO-H747I", "stm32h747xihx", None, ),
Expand All @@ -172,31 +181,60 @@ class BoardInfo(NamedTuple):
"0828": BoardInfo( "NUCLEO-L496ZG-P", "stm32l496zgtx", None, ),
"0829": BoardInfo( "NUCLEO-L452RE-P", "stm32l452retx", None, ),
"0830": BoardInfo( "DISCO-F407VG", "stm32f407vgtx", None, ),
"0831": BoardInfo( "STM32H573I-DK", "stm32h573iitx", None, ),
"0832": BoardInfo( "NUCLEO-H503RB", "stm32h503rbt6", None, ),
"0833": BoardInfo( "DISCO-L072CZ-LRWAN1", "stm32l072cztx", None, ),
"0835": BoardInfo( "NUCLEO-F207ZG", "stm32f207zgtx", "NUCLEO_F207ZG.bin", ),
"0836": BoardInfo( "NUCLEO-H743ZI2", "stm32h743zitx", None, ),
"0837": BoardInfo( "NUCLEO-WBA55CG", "stm32wba52cg", None, ),
"0838": BoardInfo( "NUCLEO-U545RE-Q", "stm32u545retxq", None, ),
"0839": BoardInfo( "NUCLEO-WB55RG", "stm32wb55rgvx", None, ),
"0840": BoardInfo( "B96B-F446VE", "stm32f446vetx", None, ),
"0841": BoardInfo( "NUCLEO-G474RE", "stm32g474retx", None, ),
"0842": BoardInfo( "NUCLEO-H753ZI", "stm32h753zitx", None, ),
"0843": BoardInfo( "NUCLEO-H745ZI-Q", "stm32h745zitx", None, ),
"0847": BoardInfo( "DISCO-H745I", "stm32h745xihx", None, ),
"0844": BoardInfo( "NUCLEO-H755ZI-Q", "stm32h755zitx", None, ),
"0845": BoardInfo( "NUCLEO-L412RB-P", "stm32l412rbtxp", None, ),
"0846": BoardInfo( "NUCLEO-L412KB", "stm32l412kbtx", None, ),
"0847": BoardInfo( "STM32H745I-DISCO", "stm32h745xihx", None, ),
"0848": BoardInfo( "STM32G071B-DISCO", "stm32g071rbtx", None, ),
"0849": BoardInfo( "NUCLEO-G070RB", "stm32g070rbtx", None, ),
"0850": BoardInfo( "NUCLEO-G431RB", "stm32g431rbtx", None, ),
"0851": BoardInfo( "NUCLEO-G431KB", "stm32g431kbtx", None, ),
"0852": BoardInfo( "NUCLEO-G031K8", "stm32g031K8tx", None, ),
"0853": BoardInfo( "NUCLEO-F301K8", "stm32f301k8tx", None, ),
"0854": BoardInfo( "NUCLEO-L552ZE-Q", "stm32l552zetxq", None, ),
"0855": BoardInfo( "DISCO-L562QE", "stm32l562qeixq", None, ),
"0855": BoardInfo( "STM32L562E-DK", "stm32l562qeixq", None, ),
"0856": BoardInfo( "STM32F7308-DK", "stm32f730i8kx", None, ),
"0857": BoardInfo( "STM32F7508-DK", "stm32f750n8hx", None, ),
"0858": BoardInfo( "DISCO-F750B", "stm32f750n8hx", None, ), # not on st.com
"0859": BoardInfo( "STM32H7B3I-DK", "stm32h7b3lihxq", None, ),
"0860": BoardInfo( "NUCLEO-H7A3ZI-Q", "stm32h7a3zitxq", None, ),
"0861": BoardInfo( "NUCLEO-H7A3ZI", "stm32h7a3zitx", None, ),
"0862": BoardInfo( "NUCLEO-H7B3ZI", "stm32h7b3zitx", None, ),
"0863": BoardInfo( "STM32L4P5G-DK", "stm32l4p5agix", None, ),
"0864": BoardInfo( "B-G474E-DPOW1", "stm32g474retx", None, ),
"0865": BoardInfo( "NUCLEO-L4P5ZG", "stm32l4p5zgtx", None, ),
"0866": BoardInfo( "NUCLEO-WL55JC", "stm32wl55jcix", None, ),
"0867": BoardInfo( "NUCLEO-C031C6", "stm32c031c6tx", None, ),
"0868": BoardInfo( "STM32C0116-DK", "stm32c011f6ux", None, ),
"0869": BoardInfo( "STM32C0316-DK", "stm32c031c6tx", None, ),
"0871": BoardInfo( "NUCLEO-H723ZG", "stm32h723zgtx", None, ),
"0872": BoardInfo( "NUCLEO-G0B1RE", "stm32g0b1retx", None, ),
"0875": BoardInfo( "STM32H735G-DK", "stm32h735igtx", None, ),
"0877": BoardInfo( "NUCLEO-U5A5ZJ-Q", "stm32u5a5zjtxq", None, ),
"0878": BoardInfo( "NUCLEO-H563ZI", "stm32h563zitx", None, ),
"0879": BoardInfo( "NUCLEO-F756ZG", "stm32f756zgtx", None, ),
"0880": BoardInfo( "B-L462E-CELL1", "stm32l462reyx", None, ),
"0881": BoardInfo( "STM32WL55C-DK", "stm32wl55ccux", None, ),
"0882": BoardInfo( "NUCLEO-G491RE", "stm32g491retx", None, ),
"0883": BoardInfo( "NUCLEO-WB15CC", "stm32wb15ccux", None, ),
"0884": BoardInfo( "DISCO-WB5MMG", "stm32wb5mmghx", None, ),
"0884": BoardInfo( "STM32WB5MM-DK", "stm32wb5mmghx", None, ),
"0885": BoardInfo( "B-L4S5I-IOT01A", "stm32l4s5vitx", None, ),
"0886": BoardInfo( "NUCLEO-U575ZI-Q", "stm32u575zitx", None, ),
"0887": BoardInfo( "B-U585I-IOT02A", "stm32u585aiix", None, ),
"0888": BoardInfo( "STM32U5A9J-DK", "stm32u5a9njhxq", None, ),
"0889": BoardInfo( "B-G473E-ZEST1S", "stm32g473retx", None, ), # board not on st.com
"1010": BoardInfo( "mbed NXP LPC1768", "lpc1768", "l1_lpc1768.bin", ),
"1017": BoardInfo( "mbed HRM1017", "nrf51", "l1_nrf51.bin", ),
"1018": BoardInfo( "Switch-Science-mbed-LPC824", "lpc824", "l1_lpc824.bin", ),
Expand Down
1 change: 1 addition & 0 deletions pyocd/core/memory_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ class MemoryRegion(MemoryRangeBase):
'is_readable': lambda r: 'r' in r.access,
'is_writable': lambda r: 'w' in r.access,
'is_executable': lambda r: 'x' in r.access,
'is_erasable' : True,
'is_secure': lambda r: 's' in r.access,
'is_nonsecure': lambda r: not r.is_secure,
}
Expand Down
Loading

0 comments on commit cb97846

Please sign in to comment.