Skip to content

Commit

Permalink
Release 1.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Wisniewska committed Jul 4, 2023
1 parent b75d067 commit 5bbe75b
Show file tree
Hide file tree
Showing 357 changed files with 14,399 additions and 5,024 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.10.1
current_version = 1.11.0
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<suffix>.*))?
serialize =
{major}.{minor}.{patch}.{suffix}
Expand Down
4 changes: 2 additions & 2 deletions .pylintrc
Expand Up @@ -326,8 +326,8 @@ min-public-methods=1
[EXCEPTIONS]

# Exceptions that will emit a warning when caught.
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=builtins.BaseException,
builtins.Exception


[FORMAT]
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Expand Up @@ -2,5 +2,6 @@ include LICENSE
include SW_Content_Register_SPSDK.txt
include requirements*
include spsdk/py.typed
include SW_Content_Register_SPSDK.txt
recursive-include spsdk/data *
recursive-include spsdk *.pyi
2 changes: 1 addition & 1 deletion SW_Content_Register_SPSDK.txt
@@ -1,7 +1,7 @@
NXP Software Content Register

Package: NXP SPSDK
Version: 1.10.1
Version: 1.11.0
Outgoing License: BSD-3-Clause
License Files: LICENSE
Type of content: Source code
Expand Down
107 changes: 54 additions & 53 deletions codecheck.py
Expand Up @@ -31,9 +31,7 @@
"PYTEST",
"GITCOV",
"PYLINT",
# "PYLINT_TOOLS", # This is covered by PYLINT
"PYLINT_DOCS",
"PYLINT_ALL",
"MYPY",
"MYPY_TOOLS",
"DEPENDENCIES",
Expand Down Expand Up @@ -175,7 +173,7 @@ def check_mypy(args: List[str], output_log: str) -> TaskResult:
return TaskResult(error_count=res, output_log=output_log)


def check_pylint(args: str, output_log: str) -> TaskResult:
def check_pylint_all(args: str, output_log: str) -> TaskResult:
"""Call pylint with given configuration and output log."""
cmd = f"pylint {args} -j {CPU_CNT//2 or 1}"
with open(output_log, "w", encoding="utf-8") as f:
Expand All @@ -187,32 +185,47 @@ def check_pylint(args: str, output_log: str) -> TaskResult:
return TaskResult(error_count=len(err_cnt), output_log=output_log)


def check_pylint_errors(input_log: str, output_log: str) -> TaskResult:
def check_pylint(
args: str,
output_log: str,
disable: Optional[List[str]] = None,
enable: Optional[List[str]] = None,
) -> TaskResult:
"""Check Pylint log for errors."""
with open(input_log, "r", encoding="utf-8") as f:
errors = re.findall(r".*: [EF]\d{4}:.*", f.read())
cmd = f"pylint {args} -j {CPU_CNT//2 or 1}"
if disable:
cmd += f" --disable {','.join(disable)}"
if enable:
cmd += f" --enable {','.join(enable)}"
with open(output_log, "w", encoding="utf-8") as f:
f.write("\n".join(errors))
subprocess.call(cmd.split(), stdout=f, stderr=f)

return TaskResult(error_count=len(errors), output_log=output_log)
with open(output_log, "r", encoding="utf-8") as f:
err_cnt = re.findall(r": [IRCWEF]\d{4}:", f.read())

return TaskResult(error_count=len(err_cnt), output_log=output_log)


def check_radon(output_log: str) -> TaskResult:
def check_radon(
paths: List[str],
output_log: str,
min_rank: Optional[str] = None,
max_rank: Optional[str] = None,
) -> TaskResult:
"""Check the project against radon rules."""
cmd = "radon cc --show-complexity"
if min_rank:
cmd += f" --min {min_rank}"
if max_rank:
cmd += f" --max {max_rank}"
cmd += f" {' '.join(paths)}"
with open(output_log, "w", encoding="utf-8") as f:
res = subprocess.call("radon cc --show-complexity spsdk".split(), stdout=f, stderr=f)

return TaskResult(error_count=res, output_log=output_log)

subprocess.call(cmd.split(), stdout=f, stderr=f)

def check_radon_errors(input_log: str, radon_type: str, output_log: str) -> TaskResult:
"""Check radon log for records with given radon_type."""
with open(input_log, "r", encoding="utf-8") as f:
errors = re.findall(rf".* - {radon_type} .*", f.read())
with open(output_log, "w", encoding="utf-8") as f:
f.write("\n".join(errors))
with open(output_log, "r", encoding="utf-8") as f:
err_cnt = re.findall(r"[ABCDEF] \(\d{1,3}\)", f.read())

return TaskResult(error_count=len(errors), output_log=output_log)
return TaskResult(error_count=len(err_cnt), output_log=output_log)


def check_black(output: str = OUTPUT_FOLDER) -> TaskResult:
Expand Down Expand Up @@ -387,7 +400,7 @@ def main(
logging.basicConfig(level=logging.INFO)
output_dir = str(output) if output else OUTPUT_FOLDER
ret = 1
# the baseline PYLINT_ALL, RADON_ALL, and RADON_C checkers are always just informative
# the baseline RADON_ALL, and RADON_C checkers are always just informative
info_check = [x.upper() for x in list(info_check)]
try:
available_checks = TaskList(
Expand All @@ -403,31 +416,27 @@ def main(
info_only="GITCOV" in info_check,
),
TaskInfo(
"PYLINT_ALL",
"PYLINT",
check_pylint,
args="spsdk examples tools codecheck.py",
output_log=os.path.join(output_dir, "pylint_all.txt"),
info_only=True,
),
TaskInfo(
"PYLINT",
check_pylint_errors,
input_log=os.path.join(output_dir, "pylint_all.txt"),
output_log=os.path.join(output_dir, "pylint.txt"),
dependencies=["PYLINT_ALL"],
inherit_failure=False,
disable=[
"R",
"C",
"W0511",
"W0212",
"W0237",
"W0718",
"W0613",
"W0223",
"W1401",
],
enable=[],
info_only="PYLINT" in info_check,
),
# This is already covered by PYLINT
# TaskInfo(
# "PYLINT_TOOLS",
# check_pylint,
# args="tools codecheck.py -E",
# output_log=os.path.join(output, "pylint_tools.txt"),
# ),
TaskInfo(
"PYLINT_DOCS",
check_pylint,
check_pylint_all,
args="spsdk --rcfile pylint-doc-rules.ini",
output_log=os.path.join(output_dir, "pylint_docs.txt"),
info_only="PYLINT_DOCS" in info_check,
Expand Down Expand Up @@ -458,28 +467,20 @@ def main(
output=output_dir,
info_only="PYDOCSTYLE" in info_check,
),
TaskInfo(
"RADON_ALL",
check_radon,
output_log=os.path.join(output_dir, "radon_all.txt"),
info_only=True,
),
TaskInfo(
"RADON_C",
check_radon_errors,
radon_type="C",
input_log=os.path.join(output_dir, "radon_all.txt"),
check_radon,
paths=["spsdk"],
min_rank="C",
output_log=os.path.join(output_dir, "radon_c.txt"),
dependencies=["RADON_ALL"],
info_only=True,
),
TaskInfo(
"RADON_D",
check_radon_errors,
radon_type="D",
input_log=os.path.join(output_dir, "radon_all.txt"),
check_radon,
paths=["spsdk"],
min_rank="D",
output_log=os.path.join(output_dir, "radon_d.txt"),
dependencies=["RADON_ALL"],
info_only="RADON_D" in info_check,
),
TaskInfo(
Expand Down
10 changes: 7 additions & 3 deletions devices.txt
@@ -1,11 +1,12 @@
List of devices and chip versions tested

- MIMXRT1160-EVK A1
- MIMXRT1064-EVK REV A
- MIMXRT1160-EVK A0
- MIMXRT1064-EVK REV A0
- MIMXRT1060-EVK REV A / A2
- MIMXRT1050-EVKB REV A
- MIMXRT1020-EVK REV A / A3
- MIMXRT1010-EVK A
- MIMXRT1010-EVK A0
- MIMXRT685-EVK B1
- MIMXRT595-EVK B2X2 / sch. D / chip rev. C
- LPC55S69-EVK A1
Expand All @@ -15,4 +16,7 @@ List of devices and chip versions tested
- K32W1480-EVK A1
- KW45B41Z-EVK A1
- MIMXRT106X-EVK A1
- MIMXRT1024-EVK
- MIMXRT1180-EVK A0
- RD-RW61X B0
- MIMXRT1040-EVK A0
- MCXN9XX-EVK B0
Binary file removed docs/_static/images/elftosb/address_or_range.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/basic_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/bool_expr.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/call_arg.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/call_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/call_target.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/call_type.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/command_file.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/const_expr.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/constant_def.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/constants_block.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/else_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/enable_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/encrypt_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/erase_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/expr.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/from_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/if_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/in_from_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/int_const_expr.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/jump_sp_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/keyblob_block.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/keyblob_contents.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/load_data.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/load_ifr_stmt.png
Binary file not shown.
Binary file removed docs/_static/images/elftosb/load_stmt.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/load_target.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/message_stmt.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/message_type.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/mode_stmt.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/option_def.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/option_list.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/options_block.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/pre_section_block.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/reset_stmt.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/rr-1.63.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/section_block.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/section_contents.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/section_list.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/section_options.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/section_ref.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/source_def.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/source_value.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/sources_block.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/statement.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/symbol_ref.png
Diff not rendered.
Binary file removed docs/_static/images/elftosb/unary_expr.png
Diff not rendered.
Binary file modified docs/_static/images/spsdk-architecture-apis.png
Binary file modified docs/_static/images/spsdk-architecture-apps.png
Binary file modified docs/_static/images/spsdk-architecture.png
39 changes: 39 additions & 0 deletions docs/api/dk6.rst
@@ -0,0 +1,39 @@
DK6 API
====================================

This module contains support for programming DK6 devices.

Module with the DK6 commands
----------------------------------------------------------
.. automodule:: spsdk.dk6.commands
:members:
:undoc-members:
:show-inheritance:

Module representing DK6 device and memories
-----------------------------------------------------------
.. automodule:: spsdk.dk6.dk6device
:members:
:undoc-members:
:show-inheritance:

Module representing drivers for communication
----------------------------------------------------------
.. automodule:: spsdk.dk6.driver
:members:
:undoc-members:
:show-inheritance:

Module representing communication interface
----------------------------------------------------------
.. automodule:: spsdk.dk6.interface
:members:
:undoc-members:
:show-inheritance:

Module representing communication protocol
----------------------------------------------------------
.. automodule:: spsdk.dk6.protocol
:members:
:undoc-members:
:show-inheritance:
69 changes: 69 additions & 0 deletions docs/api/tp.rst
@@ -0,0 +1,69 @@
Trust Provisioning API
========================

Provides support for trust provisioning containers and OEM trust provisioning.

TP Data Containers
-----------------------------------

.. automodule:: spsdk.tp.data_container
:members:
:undoc-members:
:show-inheritance:

Data Container
-----------------------------------

.. automodule:: spsdk.tp.data_container.data_container
:members:
:undoc-members:
:show-inheritance:

Audit log
-----------------------------------

.. automodule:: spsdk.tp.data_container.audit_log
:members:
:undoc-members:
:show-inheritance:

Data Container Authentication
-----------------------------------

.. automodule:: spsdk.tp.data_container.data_container_auth
:members:
:undoc-members:
:show-inheritance:


TP Adapters
-----------------------------------

.. automodule:: spsdk.tp.adapters
:members:
:undoc-members:
:show-inheritance:

TP Config
-----------------------------------

.. automodule:: spsdk.tp.tpconfig
:members:
:undoc-members:
:show-inheritance:

TP Host
-----------------------------------

.. automodule:: spsdk.tp.tphost
:members:
:undoc-members:
:show-inheritance:

TP Utils
-----------------------------------

.. automodule:: spsdk.tp.utils
:members:
:undoc-members:
:show-inheritance:
30 changes: 30 additions & 0 deletions docs/apps/dk6prog.rst
@@ -0,0 +1,30 @@
====================
User Guide - dk6prog
====================

.. warning:: *dk6prog* is a prototype application and it is not tested. To be used at the user's own risk.

This user’s guide describes how to use *dk6prog* application.
DK6 Programmer Tools allows reading and programming flash memory of DK6 target devices (JN51xx, QN9090, K32W0xx).
It's a Python port of JN51xx Flash Programmer (https://www.nxp.com/docs/en/user-guide/JN-UG-3099.pdf).

Supported devices
==================
DK6 Board and all compatible modules https://www.nxp.com/products/wireless/multiprotocol-mcus/advanced-development-kit-for-k32w061-and-jn5189-88:IOTZTB-DK006

Backends
=========
*dk6prog* tools support four backends (drivers). PYFTDI backend, pure Python implementation of libFTDI. PYLIBFTDI backend, ctypes wrapper for libFTDI. FTD2XX backend, ctypes wrapper for D2XX. PYSERIAL backend for simple UART communication.


Jupyter example
================
Visit Jupyter example :ref:`DK6 Programming tool` for more information and examples of usage.

----------------------
Command line interface
----------------------

.. click:: spsdk.apps.dk6prog:main
:prog: dk6prog
:nested: full
2 changes: 2 additions & 0 deletions docs/apps/elftosb.rst
Expand Up @@ -25,3 +25,5 @@ Command line interface
.. click:: spsdk.apps.elftosb:main
:prog: elftosb
:nested: full


6 changes: 0 additions & 6 deletions docs/examples/dat.rst

This file was deleted.

3 changes: 3 additions & 0 deletions docs/examples/dk6.nblink
@@ -0,0 +1,3 @@
{
"path": "../../examples/jupyter_examples/dk6/dk6prog_intro.ipynb"
}
2 changes: 1 addition & 1 deletion docs/examples/jupyter.rst
Expand Up @@ -6,5 +6,5 @@ For those unfamiliar with the jupyter environment we recommend this tutorial fir

.. note::

You should install additional development requirements using **pip install -r requirements-develop.txt** in order to run jupyter notebooks.
You should install additional development requirements using **pip install spsdk[examples]** in order to run jupyter notebooks.
Users using Windows 32bit need to install rust and add MSVC target: **rustup target add i686-pc-windows-msvc**

0 comments on commit 5bbe75b

Please sign in to comment.