diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..9cb8d53 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to make participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when +an individual is representing the project or its community in public spaces. +Examples of representing a project or community include using an official +project e-mail address, posting via an official social media account, or acting +as an appointed representative at an online or offline event. Representation of +a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at . All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq \ No newline at end of file diff --git a/.github/workflows/blog.yml b/.github/workflows/blog.yml new file mode 100644 index 0000000..32d563b --- /dev/null +++ b/.github/workflows/blog.yml @@ -0,0 +1,79 @@ +# Copyright (c) 2016-2023 Makerdiary + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +name: documentation +on: + push: + branches: + - main + +env: + PYTHON_VERSION: 3.x + +permissions: + contents: write + +jobs: + documentation: + name: Build documentation + runs-on: ubuntu-latest + steps: + + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python runtime + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Set the date environmental variable + run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + + - name: Set up build cache + uses: actions/cache@v3 + id: cache + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + + - name: Install dependencies + run: sudo apt-get install pngquant + + - name: Install Python dependencies + run: | + python3 -m pip install --upgrade pip + python3 -m pip install wheel + python3 -m pip install -r requirements.txt + + - name: Build site + run: mkdocs build + + - name: Deploy documentation + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOOGLE_ANALYTICS_KEY: ${{ vars.GOOGLE_ANALYTICS_KEY }} + run: | + mkdocs gh-deploy --force + mkdocs --version diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..733196e --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# editors +*.swp +*~ + +# python +.venv +__pycache__ +*.egg-info +dist + +# mkdocs +site + +# macOS internals +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..cda9d78 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Makerdiary Blog + +[![Blog](https://github.com/makerdiary/blog/actions/workflows/blog.yml/badge.svg?branch=main)](https://blog.makerdiary.com) + +Makerdiary Blog is for you who are new to the Makerdiary's products - whether you are a senior executive, in product development, or simply a curious soul. Our goal is to inform you, know about recent updates to our projects, as well as preview upcoming features and beta releases. + +This is a place to share your applications, articles, videos and any other resources related to the Makerdiary projects. + +## License + +Copyright (c) 2016-2023 Makerdiary. See [LICENSE](./LICENSE) for further details. \ No newline at end of file diff --git a/docs/.authors.yml b/docs/.authors.yml new file mode 100644 index 0000000..419102c --- /dev/null +++ b/docs/.authors.yml @@ -0,0 +1,9 @@ +authors: + makerdiary: + name: makerdiary + description: Official + avatar: https://github.com/makerdiary.png + Zelin: + name: Zelin + description: Editor + avatar: https://github.com/caizelin.png \ No newline at end of file diff --git a/docs/.overrides/.icons/logo.svg b/docs/.overrides/.icons/logo.svg new file mode 100644 index 0000000..89498a3 --- /dev/null +++ b/docs/.overrides/.icons/logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/docs/.overrides/.icons/nordic-chip.svg b/docs/.overrides/.icons/nordic-chip.svg new file mode 100644 index 0000000..7177216 --- /dev/null +++ b/docs/.overrides/.icons/nordic-chip.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + diff --git a/docs/.overrides/.icons/uf2-icon.svg b/docs/.overrides/.icons/uf2-icon.svg new file mode 100644 index 0000000..cd5f1cd --- /dev/null +++ b/docs/.overrides/.icons/uf2-icon.svg @@ -0,0 +1,25 @@ + + + + diff --git a/docs/.overrides/.icons/usb-dongle.svg b/docs/.overrides/.icons/usb-dongle.svg new file mode 100644 index 0000000..a34a29f --- /dev/null +++ b/docs/.overrides/.icons/usb-dongle.svg @@ -0,0 +1,13 @@ + + + + diff --git a/docs/.overrides/article.html b/docs/.overrides/article.html new file mode 100644 index 0000000..823f342 --- /dev/null +++ b/docs/.overrides/article.html @@ -0,0 +1,73 @@ + + +{% extends "main.html" %} + + +{% block content %} + {{ super() }} + {% if config.extra.giscus %} + +

{{ lang.t("meta.comments") }}

+ + + + + {% endif %} +{% endblock %} diff --git a/docs/.overrides/blog.html b/docs/.overrides/blog.html new file mode 100644 index 0000000..72705bc --- /dev/null +++ b/docs/.overrides/blog.html @@ -0,0 +1,268 @@ +{% extends "main.html" %} + + +{% block tabs %} + {{ super() }} + + + + + + {% if config.theme.hero %} +
+
+
+
+

{{ config.theme.hero.title }}

+

{{ config.theme.hero.description }}

+ {% if config.theme.hero.button_primary %} + + {{ config.theme.hero.button_primary.label }} + + {% endif %} + {% if config.theme.hero.button_secondary %} + + {{ config.theme.hero.button_secondary.label }} + + {% endif %} +
+
+
+
+ {% endif %} +{% endblock %} + + +{% block container %} +
+
+ + +
+ {{ page.content }} +
+ + +
+
    + {% for post in posts %} +
  • + {% set cover = "/" ~ post.meta.cover %} + {{ post.meta.title | e }} + + {% if post.categories %} + + {% endif %} +

    {{ post.meta.title }}

    +

    {{ post.meta.description }}

    + +
  • + {% endfor %} +
+
+ + + {% if pagination %} + {% block pagination %} + {% include "partials/pagination.html" %} + {% endblock %} + {% endif %} +
+
+{% endblock %} \ No newline at end of file diff --git a/docs/.overrides/home.html b/docs/.overrides/home.html new file mode 100644 index 0000000..8e0de5f --- /dev/null +++ b/docs/.overrides/home.html @@ -0,0 +1,284 @@ + + +{% extends "main.html" %} + + +{% block tabs %} + {{ super() }} + + + + + +
+
+
+
+ +
+
+

{{ config.theme.home.hero.title }}

+

{{ config.theme.home.hero.description }}

+ + {{ config.theme.home.hero.button_primary.label }} + + + {{ config.theme.home.hero.button_secondary.label }} + +
+
+
+
+ +{% endblock %} + + +{% block content %} + + + + {% if config.theme.home.multicolumn %} + {% if config.theme.home.multicolumn.heading %} +
+

{{ config.theme.home.multicolumn.heading }}

+
+ {% endif %} + {% if config.theme.home.multicolumn.columns %} +
+ +
+ {% endif %} + {% endif %} + + {% if config.theme.blog %} +

Latest posts

+ {% if config.theme.blog.articles %} +
+ +
+ + {% endif %} + {% endif %} +{% endblock %} + + +{% block footer %} +{{ super() }} +{% endblock %} diff --git a/docs/.overrides/main.html b/docs/.overrides/main.html new file mode 100644 index 0000000..cd1fcfb --- /dev/null +++ b/docs/.overrides/main.html @@ -0,0 +1,105 @@ + + +{% extends "base.html" %} + +{% block extrahead %} +{% if config.theme.announcement %} + +{% else %} + +{% endif %} + +{% endblock %} + + +{% block announce %} + + {{ config.theme.announcement }} + +{% endblock %} diff --git a/docs/.overrides/partials/actions.html b/docs/.overrides/partials/actions.html new file mode 100644 index 0000000..3427ae7 --- /dev/null +++ b/docs/.overrides/partials/actions.html @@ -0,0 +1,41 @@ + + + +{% if page.edit_url %} + {% set edit = "https://github.com/makerdiary/blog/edit" %} + {% set view = "https://raw.githubusercontent.com/makerdiary/blog" %} + + {% include ".icons/material/file-edit-outline.svg" %} + + + {% include ".icons/material/file-eye-outline.svg" %} + +{% endif %} diff --git a/docs/.overrides/test.html b/docs/.overrides/test.html new file mode 100644 index 0000000..6c139e6 --- /dev/null +++ b/docs/.overrides/test.html @@ -0,0 +1,285 @@ + +{% extends "main.html" %} + + +{% block tabs %} + {{ super() }} + + + + + + {% if config.theme.hero %} +
+
+
+
+

{{ config.theme.hero.title }}

+

{{ config.theme.hero.description }}

+ {% if config.theme.hero.button_primary %} + + {{ config.theme.hero.button_primary.label }} + + {% endif %} + {% if config.theme.hero.button_secondary %} + + {{ config.theme.hero.button_secondary.label }} + + {% endif %} +
+
+
+
+ {% endif %} +{% endblock %} + + + +{% block content %} + + +
+ {{ page.content }} +
+ + +
+ +
+ + + {% if pagination %} + {% block pagination %} + {% include "partials/pagination.html" %} + {% endblock %} + {% endif %} + +{% endblock %} diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..a4a2326 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +blog.makerdiary.com \ No newline at end of file diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png new file mode 100644 index 0000000..8b3c217 Binary files /dev/null and b/docs/assets/favicon.png differ diff --git a/docs/assets/images/cover.png b/docs/assets/images/cover.png new file mode 100644 index 0000000..3e1b4a1 Binary files /dev/null and b/docs/assets/images/cover.png differ diff --git a/docs/assets/stylesheets/extra.css b/docs/assets/stylesheets/extra.css new file mode 100644 index 0000000..5e3036e --- /dev/null +++ b/docs/assets/stylesheets/extra.css @@ -0,0 +1,84 @@ +:root > * { + --md-primary-fg-color: #AC2E45; + --md-primary-fg-color--light: #D84B61; + --md-primary-fg-color--dark: #982942; + --md-accent-fg-color: #C13349; + --md-accent-fg-color--transparent: #F3BAC5; +} + +[data-md-color-scheme="slate"] { + --md-hue: 210; /* [0, 360] */ + --md-primary-fg-color: #AC2E45; + --md-primary-fg-color--light: #D84B61; + --md-primary-fg-color--dark: #982942; + --md-accent-fg-color: #C13349; + --md-accent-fg-color--transparent: #EB8F9F; +} + +.md-header__button.md-logo :-webkit-any(img,svg) { + height: 36px; +} + +.nordic { + color: #00a9ce; +} + +.red-wire { + color: #ef5552; +} + +.gray-wire { + color: #757575; +} + +.amber-wire { + color: #ffc105; +} + +.light-green-wire { + color: #8bc34b; +} + +.light-blue-wire { + color: #02a6f2; +} + +.buy-button { + margin: 0.5em; +} + +.md-typeset table:not([class]) td { + vertical-align: middle; +} + +/* +.md-typeset table:not([class]) { + border: unset; + border-collapse: collapse; +} + +.md-typeset table:not([class]) tr:nth-child(2n) { + background-color: rgba(0, 0, 0, 0.035); +} + +.md-typeset table:not([class]) tbody tr:hover { + background-color: var(--md-typeset-table-color); + box-shadow: unset; +} + +.md-typeset table:not([class]) th { + min-width: 5.0rem; +} + +.md-typeset table:not([class]) td, +.md-typeset table:not([class]) th { + padding: 0.625em 0.625em +} + +.md-typeset table:not([class]) td, +.md-typeset table:not([class]) th, +.md-typeset table:not([class]) tr { + border-top: unset; + border: 1px solid var(--md-typeset-table-color); +} +*/ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..fc7a49c --- /dev/null +++ b/docs/index.md @@ -0,0 +1,7 @@ +--- +template: blog.html +title: Latest posts +hide: + - navigation + - toc +--- diff --git a/docs/posts/build-a-thread-network-with-nrf52840-mdk/cover.png b/docs/posts/build-a-thread-network-with-nrf52840-mdk/cover.png new file mode 100644 index 0000000..2ebd6de Binary files /dev/null and b/docs/posts/build-a-thread-network-with-nrf52840-mdk/cover.png differ diff --git a/docs/posts/build-a-thread-network-with-nrf52840-mdk/index.md b/docs/posts/build-a-thread-network-with-nrf52840-mdk/index.md new file mode 100644 index 0000000..1b28e2b --- /dev/null +++ b/docs/posts/build-a-thread-network-with-nrf52840-mdk/index.md @@ -0,0 +1,560 @@ +--- +title: Build a Thread network with nRF52840-MDK +date: 2019-07-15 +authors: + - makerdiary +cover: build-a-thread-network-with-nrf52840-mdk/cover.png +categories: + - Learn +description: > + In this post we will show you how to build an OpenThread (open-source implementation of the Thread®) network using nRF52840-MDK. +--- + +![](cover.png) + +# Build a Thread network with nRF52840-MDK + +## Introduction + +[OpenThread](https://openthread.io/) is an open-source implementation of the [Thread®](http://threadgroup.org/) networking protocol. Nest has released OpenThread to make the networking technology used in Nest products more broadly available to developers, in order to accelerate the development of products for the connected home. + +The [Thread specification](http://threadgroup.org/ThreadSpec) defines an IPv6-based reliable, secure and low-power wireless device-to-device communication protocol for home applications. OpenThread implements all Thread networking layers (IPv6, 6LoWPAN, IEEE 802.15.4 with MAC security, Mesh Link Establishment, Mesh Routing) and device roles, as well as Border Router support. + +![](openthread_intro.jpg) + +## What'll you need + +- 3x [nRF52840-MDK](https://makerdiary.com/products/nrf52840-mdk-iot-development-kit) boards +- 3x USB-C cables +- A Linux/macOS machine with at least 3 USB ports + +## Set up your development environment + +The following section provides detailed information about the required software toolchains. Skip any step where a compatible tool already exists. + +1. Download and install the [ARM GNU Toolchain](https://developer.arm.com/downloads/-/gnu-rm). The `6-2017-q2-update` version is recommended. Then ensure the path is added to your OS PATH environment variable. + + ``` bash + # in ~/.bash_profile, add the following script + export PATH="/gcc-arm-none-eabi-6-2017-q2-update/bin:${PATH}" + ``` + + +2. Type the following in your terminal to verify if the path is set correctly: + + ``` bash + arm-none-eabi-gcc --version + ``` + +3. Install pyOCD: + + ``` bash + pip install -U pyocd + ``` + +4. Follow the [wpantund Installation Guide](https://github.com/openthread/wpantund/blob/master/INSTALL.md) to install [wpantund](https://github.com/openthread/wpantund). + +5. Clone and install OpenThread: + + ``` bash + git clone --recursive https://github.com/makerdiary/openthread.git + cd openthread + ./bootstrap + ``` + +## Set up the NCP Joiner + +### Build and flash + +Build the OpenThread nRF52840 example with Joiner functionality. A device uses the Joiner role to be securely authenticated and commissioned onto a Thread network. Always clean the repo of previous builds first by running `make clean`. + +``` bash +cd ~/openthread +make -f examples/Makefile-nrf52840 clean +make -f examples/Makefile-nrf52840 JOINER=1 +``` + +Navigate to the directory with the OpenThread FTD NCP binary, and convert it to hex format: + +``` bash +cd ~/openthread/output/nrf52840/bin +arm-none-eabi-objcopy -O ihex ot-ncp-ftd ot-ncp-ftd.hex +``` + +Connect nRF52840-MDK to your computer with a USB cable. Flash the OpenThread NCP FTD hex file onto the nRF52840-MDK and label the board __NCP__ so that later you don't confuse the board roles. + +``` bash +pyocd flash -t nrf52840 ot-ncp-ftd.hex +``` + +### Configure wpantund + +In the NCP design, use wpantund to communicate with and manage the Thread device. + +In a terminal window, start `wpantund` on the serial port with the NCP, creating the interface `utun7` and enabling info logs: + +``` bash +sudo /usr/local/sbin/wpantund -o Config:NCP:SocketPath /dev/cu.usbmodem14112 \ + -o Config:TUN:InterfaceName utun7 \ + -o Daemon:SyslogMask " -info" +``` + +Output similar to the following is generated upon success: + +``` bash +Jun 9 01:29:49 wpantund[12257] : Starting wpantund 0.08.00d (Jun 9 2018 00:31:51) . . . +Jun 9 01:29:49 wpantund[12257] : SOURCE_VERSION = 0.07.01-217-g86d29d6 +Jun 9 01:29:49 wpantund[12257] : BUILD_VERSION = 0.07.01-217-g86d29d6 +Jun 9 01:29:49 wpantund[12257] : Configuration file "/etc/wpantund.conf" read. +Jun 9 01:29:49 wpantund[12257] : Ready. Using DBUS bus ":1.2" +Jun 9 01:29:49 wpantund[12257] : Running as root without dropping privileges! +Jun 9 01:29:49 wpantund[12257] : State change: "uninitialized" -> "offline" +Jun 9 01:29:49 wpantund[12257] : NCP is running "OPENTHREAD/20170716-00584-ge4f5f240-dirty; NRF52840; Jun 8 2018 23:36:19" +Jun 9 01:29:49 wpantund[12257] : Driver is running "0.08.00d (0.07.01-217-g86d29d6; Jun 9 2018 00:31:51)" +1:29:49 wpantund[12257] : Network is not joinable +Jun 9 01:29:49 wpantund[12257] : Resetting interface(s). . . +Jun 9 01:29:49 wpantund[12257] : Finished initializing NCP +``` + +Leave this terminal window open so that logs from wpantund can be viewed. + +A user-defined interface is required to communicate with the NCP using `wpanctl`. Open a new terminal window and using `wpanctl`, connect to the interface you just set up: + +``` bash +sudo /usr/local/bin/wpanctl -I utun7 +wpanctl:utun7> +wpanctl:utun7> status +``` + +![](verify_ncp_build.png) + +## Set up the FTDs + +The other two Thread nodes used in this section are Full Thread Devices (FTDs) on the standard System-on-Chip (SoC) design. They do not use `wpantund`, and the user manually manages them with the OpenThread CLI. + +One device functions as the Commissioner, to securely authenticate and commission devices onto that network. The other device functions as a Joiner that the Commissioner can authenticate to the Thread network. + +### Build and flash + +Build the OpenThread FTD example for the nRF52840-MDK, with the Commissioner and Joiner roles enabled: + +``` bash +cd ~/openthread +make -f examples/Makefile-nrf52840 clean +make -f examples/Makefile-nrf52840 COMMISSIONER=1 JOINER=1 +``` + +Navigate to the directory with the OpenThread Full Thread Device (FTD) CLI binary, and convert it to hex format: + +``` bash +cd ~/openthread/output/nrf52840/bin +arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.hex +``` + +Connect another nRF52840-MDK to your computer with a USB cable. Flash the OpenThread CLI FTD hex file and label the board __Commissioner__: + +``` bash +pyocd flash -t nrf52840 ot-cli-ftd.hex +``` + +### Verify build + +Verify a successful build by accessing the OpenThread CLI using a terminal application. The nRF52840-MDK boards use a baud rate of `115200`. + +``` bash +# For example, using screen +screen /dev/cu.usbmodem142112 115200 +``` + +In the terminal window, press Enter on the keyboard a few times to bring up the OpenThread CLI `>` prompt. Check for IPv6 addresses: + +``` bash +> ipaddr +fd11:2233:4455:0:99ea:1fe9:acd6:d384 +fe80:0:0:0:2003:a240:810f:1598 +Done +``` + +### Set up the FTD Joiner + +Repeat the above process to flash the third nRF52840-MDK board, using the existing `ot-cli-ftd.hex` build. Then label the board __Joiner__. Check for IPv6 addresses in the terminal window: + +``` bash +> ipaddr +fe80:0:0:0:d079:7d86:6413:4f4e +fd11:2233:4455:0:e839:eb52:f7ec:74e3 +Done +``` + +## Create the Thread network + +Now that you have all your terminal windows and screens configured, let's create our Thread network. On the __Commissioner__, configure the network and bring up Thread: + +``` bash +## FTD Commissioner ## +---------------------- + +> networkname makerdiary +Done +> extpanid 1122334455667788 +Done +> panid 0x1122 +Done +> masterkey 11223344556677881122334455667788 +Done +> ifconfig up +Done +> thread start +Done +``` + +After a moment, check the device state. It should be the __Leader__. Also get the `RLOC16` for future reference. + +``` bash +## FTD Commissioner ## +---------------------- + +> state +leader +Done +> rloc16 +3400 +Done +``` + +Check the device's IPv6 addresses: + +``` bash +## FTD Commissioner ## +---------------------- + +> ipaddr +fd11:2233:4455:0:0:ff:fe00:fc00 # Leader Anycast Locator (ALOC) +fd11:2233:4455:0:0:ff:fe00:3400 # Routing Locator (RLOC) +fd11:2233:4455:0:99ea:1fe9:acd6:d384 # Mesh-Local EID (ML-EID) +fe80:0:0:0:2003:a240:810f:1598 # Link-Local Address (LLA) +Done +``` + +The `makerdiary` network is now visible when scanned from other Thread devices. + +From `wpanctl` on the __NCP Joiner__: + +``` bash +## NCP Joiner ## +---------------- + +wpanctl:utun7> scan + | Joinable | NetworkName | PAN ID | Ch | XPanID | HWAddr | RSSI +---+----------+--------------------+--------+----+------------------+------------------+------ + 1 | NO | "makerdiary" | 0x1122 | 11 | 1122334455667788 | 2203A240810F1598 | -59 + +``` + +From the OpenThread CLI on the __FTD Joiner__: + +``` bash +## FTD Joiner ## +---------------- + +> scan +| J | Network Name | Extended PAN | PAN | MAC Address | Ch | dBm | LQI | ++---+------------------+------------------+------+------------------+----+-----+-----+ +> | 0 | makerdiary | 1122334455667788 | 1122 | 2203a240810f1598 | 11 | -32 | 244 | +Done +``` + +If the `makerdiary` network doesn't appear in the list, try scanning again. + +You may note that in both scans, the network seems to be not joinable (_Joinable_ column on the __NCP Joiner__, _J_ column on the __FTD Joiner__). This only means that Thread Commissioning is not active on the network. It can still be joined out-of-band, by entering the network master key in the joiner device manually. + +## Add the NCP Joiner + +Let's add the __NCP Joiner__ to the Thread network we just created, using an out-of-band process. Scan for networks on the __NCP Joiner__: + +``` bash +## NCP Joiner ## +---------------- + +wpanctl:utun7> scan + | Joinable | NetworkName | PAN ID | Ch | XPanID | HWAddr | RSSI +---+----------+--------------------+--------+----+------------------+------------------+------ + 1 | NO | "makerdiary" | 0x1122 | 11 | 1122334455667788 | EE7A6D71FB28C60D | -68 +``` + +To join, set the network master key on the __NCP Joiner__ and join network `1` (the ID in the first column of the scan output): + +``` bash +## NCP Joiner ## +---------------- + +wpanctl:utun7> setprop Network:Key 11223344556677881122334455667788 +wpanctl:utun7> join 1 +Joining "makerdiary" 1122334455667788 as node type "end-device" +Successfully Joined! +``` + +Check the status of the __NCP Joiner__ to verify. It might take a few seconds for all IPv6 addresses to appear in the output. + +``` bash +## NCP Joiner ## +---------------- + +wpanctl:utun7> status +utun7 => [ + "NCP:State" => "associated" + "Daemon:Enabled" => true + "NCP:Version" => "OPENTHREAD/20170716-00650-g631557e8-dirty; NRF52840; Jun 9 2018 15:45:03" + "Daemon:Version" => "0.08.00d (0.07.01-217-g86d29d6; Jun 9 2018 00:31:51)" + "Config:NCP:DriverName" => "spinel" + "NCP:HardwareAddress" => [9019EC5D617D7AAB] + "NCP:Channel" => 11 + "Network:NodeType" => "end-device" + "Network:Name" => "makerdiary" + "Network:XPANID" => 0x1122334455667788 + "Network:PANID" => 0x1122 + "IPv6:LinkLocalAddress" => "fe80::60bd:ff84:2121:344d" + "IPv6:MeshLocalAddress" => "fd11:2233:4455::f:b5e:169b:b875" + "IPv6:MeshLocalPrefix" => "fd11:2233:4455::/64" + "com.nestlabs.internal:Network:AllowingJoin" => false +] +``` + +Make note of the `IPv6:MeshLocalAddress`, you'll use it later. + +Get the __NCP Joiner__'s `RLOC16`: + +``` bash +## NCP Joiner ## +---------------- + +wpanctl:utun7> getprop Thread:RLOC16 +Thread:RLOC16 = 0x3403 +``` + +Back on the __FTD Commissioner__, check the router and child tables to confirm both devices are part of the same network. Use the `RLOC16` to identify the __NCP Joiner__. + +``` bash +## FTD Commissioner ## +---------------------- + +> router table +| ID | RLOC16 | Next Hop | Path Cost | LQ In | LQ Out | Age | Extended MAC | ++----+--------+----------+-----------+-------+--------+-----+------------------+ +| 13 | 0x3400 | 63 | 0 | 0 | 0 | 0 | 2203a240810f1598 | + +Done +> child table +| ID | RLOC16 | Timeout | Age | LQ In | C_VN |R|S|D|N| Extended MAC | ++-----+--------+------------+------------+-------+------+-+-+-+-+------------------+ +| 3 | 0x3403 | 240 | 66 | 3 | 86 |1|1|1|1| 62bdff842121344d | + +Done +``` + +Ping the mesh-local address of the NCP Joiner (the `IPv6:MeshLocalAddress` attribute from the __NCP Joiner__'s `status` output) to verify connectivity: + +``` bash +## FTD Commissioner ## +---------------------- + +> ping fd11:2233:4455::f:b5e:169b:b875 +> 8 bytes from fd11:2233:4455:0:f:b5e:169b:b875: icmp_seq=2 hlim=64 time=35ms +``` + +![](ncp_ftd_topology.png) + +## Commission the FTD Joiner + +Now let's add the third Thread device to the `makerdiary` network. This time we're going to use the more secure in-band commissioning process. On the __FTD Joiner__, scan for the network: + +``` bash +## FTD Joiner ## +---------------- + +> scan +| J | Network Name | Extended PAN | PAN | MAC Address | Ch | dBm | LQI | ++---+------------------+------------------+------+------------------+----+-----+-----+ +> | 0 | makerdiary | 1122334455667788 | 1122 | 2203a240810f1598 | 11 | -32 | 244 | +Done +``` + +A `0` in the `J` column indicates that Thread Commissioning is not active on the device. + +Let's be specific when commissioning on this next device, and only allow the __FTD Joiner__ to join. Still on the __FTD Joiner__, get the `eui64`, so the __FTD Commissioner__ can identify it: + +``` bash +## FTD Joiner ## +---------------- + +> eui64 +31ae3e8e7b87cfd6 +Done +``` + +On the __FTD Commissioner__, start the commissioner and specify the eui64 of the device that can join, along with the Joiner Credential. The Joiner Credential is a device-specific passphrase. + +``` bash +## FTD Commissioner ## +---------------------- + +> commissioner start +Done +> commissioner joiner add 31ae3e8e7b87cfd6 J01NME +Done +``` + +Switch to the __FTD Joiner__, and rescan: + +``` bash +## FTD Joiner ## +---------------- + +> scan +| J | Network Name | Extended PAN | PAN | MAC Address | Ch | dBm | LQI | ++---+------------------+------------------+------+------------------+----+-----+-----+ +> | 1 | makerdiary | 1122334455667788 | 1122 | 2203a240810f1598 | 11 | -32 | 244 | +Done +``` + +As indicated by the `1` in the `J` column, Thread Commissioning is now active on the network. Start the joiner role with the Joiner Credential you just set up on the __FTD Commissioner__: + +``` bash +## FTD Joiner ## +---------------- + +> ifconfig up +Done +> joiner start J01NME +Done +``` + +Within a minute or so, you get a confirmation of a successful authentication. + +Bring up Thread so the __FTD Joiner__ joins the `makerdiary` network, and immediately check the state and `RLOC16`: + +``` bash +## FTD Joiner ## +---------------- + +> thread start +Done +> state +child +Done +> rloc16 +3404 +Done +``` + +Check the device's IPv6 addresses. Notice that there is no ALOC. That's because this device is not the Leader, nor does it hold an Anycast-specific role that requires an ALOC. + +``` bash +## FTD Joiner ## +---------------- + +> ipaddr +fd11:2233:4455:0:0:ff:fe00:3404 +fe80:0:0:0:7827:55cf:47e4:5907 +fd11:2233:4455:0:e839:eb52:f7ec:74e3 +Done +``` + +Immediately switch to the __FTD Commissioner__ and check the router and child tables to confirm that three devices exist in the `makerdiary` network: + +``` bash +## FTD Commissioner ## +---------------------- + +> router table +| ID | RLOC16 | Next Hop | Path Cost | LQ In | LQ Out | Age | Extended MAC | ++----+--------+----------+-----------+-------+--------+-----+------------------+ +| 13 | 0x3400 | 63 | 0 | 0 | 0 | 0 | 2203a240810f1598 | + +Done +> child table +| ID | RLOC16 | Timeout | Age | LQ In | C_VN |R|S|D|N| Extended MAC | ++-----+--------+------------+------------+-------+------+-+-+-+-+------------------+ +| 3 | 0x3403 | 240 | 231 | 3 | 86 |1|1|1|1| 62bdff842121344d | +| 4 | 0x3404 | 240 | 49 | 3 | 88 |1|1|1|1| 7a2755cf47e45907 | + +Done +``` + +Based on the `RLOC16`, the __FTD Joiner__ has attached to the network as an End Device (child). Here is our updated topology: + +![](thread_topology_updated.png) + +## Send messages with UDP + +One of the application services that OpenThread provides is User Datagram Protocol (UDP), a Transport Layer protocol. An application built on OpenThread could use the UDP API to pass messages between nodes in a Thread network, or to other devices in an external network (like the internet, if the Thread network features a Border Router). + +UDP sockets are exposed through the OpenThread CLI. Let's use it to pass messages between the two FTDs. + +Get the Mesh-Local EID address for the __FTD Joiner__. We're using this address because it's reachable from anywhere within the Thread network. + +``` bash +## FTD Joiner ## +---------------- + +> ipaddr +fd11:2233:4455:0:0:ff:fe00:fc00 # Leader Anycast Locator (ALOC) +fd11:2233:4455:0:0:ff:fe00:f400 # Routing Locator (RLOC) +fe80:0:0:0:7827:55cf:47e4:5907 # Link-Local Address (LLA) +fd11:2233:4455:0:e839:eb52:f7ec:74e3 # Mesh-Local EID (ML-EID) +Done +``` + +Start UDP and bind it to a socket for any IPv6 address: + +``` bash +## FTD Joiner ## +---------------- + +> udp open +Done +> udp bind :: 1212 +``` + +Switch to the __FTD Commissioner__, start UDP, and connect to the socket you set up on the __FTD Joiner__, using its ML-EID: + +``` bash +## FTD Commissioner ## +---------------------- + +> udp open +Done +> udp connect fd11:2233:4455:0:e839:eb52:f7ec:74e3 1212 +Done +``` + +The UDP connection should be live between the two nodes. Send a message from the __FTD Commissioner__: + +``` bash +## FTD Commissioner ## +---------------------- + +> udp send hello-openthread +Done +``` +On the __FTD Joiner__, the UDP message has been received! + +``` bash +## FTD Joiner ## +---------------- + +> 16 bytes from fd11:2233:4455:0:0:ff:fe00:3400 49153 hello-openthread +``` + +## Congratulations! + +You've created a physical Thread network with nRF52840-MDK! + +## Reference + +- [Build a Thread network with nRF52840 boards and OpenThread](https://codelabs.developers.google.com/codelabs/openthread-hardware/#0) - covers all the steps in this post +- [openthread.io](https://openthread.io/) +- [github.com/openthread](https://github.com/openthread/openthread/) +- [Thread Primer](https://openthread.io/guides/thread_primer/) — covers all the Thread concepts in this post +- [OpenThread CLI reference](https://github.com/openthread/openthread/blob/master/src/cli/README.md) +- [OpenThread UDP CLI reference](https://github.com/openthread/openthread/blob/master/src/cli/README_UDP.md) diff --git a/docs/posts/build-a-thread-network-with-nrf52840-mdk/ncp_ftd_topology.png b/docs/posts/build-a-thread-network-with-nrf52840-mdk/ncp_ftd_topology.png new file mode 100644 index 0000000..3cdebf8 Binary files /dev/null and b/docs/posts/build-a-thread-network-with-nrf52840-mdk/ncp_ftd_topology.png differ diff --git a/docs/posts/build-a-thread-network-with-nrf52840-mdk/openthread_intro.jpg b/docs/posts/build-a-thread-network-with-nrf52840-mdk/openthread_intro.jpg new file mode 100644 index 0000000..a54bd1f Binary files /dev/null and b/docs/posts/build-a-thread-network-with-nrf52840-mdk/openthread_intro.jpg differ diff --git a/docs/posts/build-a-thread-network-with-nrf52840-mdk/thread_topology_updated.png b/docs/posts/build-a-thread-network-with-nrf52840-mdk/thread_topology_updated.png new file mode 100644 index 0000000..ced5afb Binary files /dev/null and b/docs/posts/build-a-thread-network-with-nrf52840-mdk/thread_topology_updated.png differ diff --git a/docs/posts/build-a-thread-network-with-nrf52840-mdk/verify_ncp_build.png b/docs/posts/build-a-thread-network-with-nrf52840-mdk/verify_ncp_build.png new file mode 100644 index 0000000..d12dda5 Binary files /dev/null and b/docs/posts/build-a-thread-network-with-nrf52840-mdk/verify_ncp_build.png differ diff --git a/docs/posts/debugging-nrf52840-mdk-with-vscode/cover.png b/docs/posts/debugging-nrf52840-mdk-with-vscode/cover.png new file mode 100644 index 0000000..535bb53 Binary files /dev/null and b/docs/posts/debugging-nrf52840-mdk-with-vscode/cover.png differ diff --git a/docs/posts/debugging-nrf52840-mdk-with-vscode/index.md b/docs/posts/debugging-nrf52840-mdk-with-vscode/index.md new file mode 100644 index 0000000..72f2fd4 --- /dev/null +++ b/docs/posts/debugging-nrf52840-mdk-with-vscode/index.md @@ -0,0 +1,194 @@ +--- +title: Debugging nRF52840-MDK board with Visual Studio Code +date: 2019-07-16 +authors: + - makerdiary +cover: debugging-nrf52840-mdk-with-vscode/cover.png +categories: + - Learn +description: > + This post explains how to configure the local debug toolchain for debugging nRF52840-MDK board with Visual Studio Code. +--- + +![](cover.png) + +# Debugging nRF52840-MDK board with Visual Studio Code + +## Introduction + +[Visual Studio Code](https://code.visualstudio.com/) is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. With the addition of the C/C++ extension to Visual Studio Code, you might have what is needed in such a small, cross-platform editor. + +This post explains how to configure the local debug toolchain for debugging nRF52840-MDK board with Visual Studio Code. + +## Hardware Requirements + +- [nRF52840-MDK](https://makerdiary.com/products/nrf52840-mdk-iot-development-kit) board +- 1x USB-C cable +- A Windows/macOS/Linux PC + +## Install Visual Studio Code + +You need to install Visual Studio Code with the C/C++ extensions to begin. + +1. Install [Visual Studio Code](https://code.visualstudio.com/). +2. Open Visual Studio Code, and click on the __Extensions__ button. +3. Search for the C/C++ plugin (by Microsoft) and click __Install__. +4. When prompted, restart the IDE. + +![](install-vscode.png) + +## Install pyOCD + +The latest stable version of pyOCD may be installed via [pip](https://pip.pypa.io/en/stable/index.html) as follows. __Skip__ this step if pyOCD already exists. + +``` bash +pip install -U pyocd +``` + +## Install GNU Arm Embedded Toolchain + +Download and install the [GNU ARM Embedded Toolchain](https://developer.arm.com/downloads/-/gnu-rm). Then ensure the path is added to your OS PATH environment variable: + +``` bash +# in ~/.bash_profile, add the following script +export PATH="/gcc-arm-none-eabi-6-2017-q2-update/bin:${PATH}" +``` + +Type the following in your terminal to verify if arm-none-eabi-gcc works: + +``` bash +arm-none-eabi-gcc --version +``` + +## Configuring the debugger + +The `launch.json` file is used to configure the debugger in Visual Studio Code. To configure the debugger for your project: + +1. Open the project folder in Visual Studio Code. + +2. Open the `.vscode/launch.json` file and add the example configurations: + + ``` bash + { + "version": "0.2.0", + "configurations": [ + { + "name": "C++ Launch", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceRoot}/armgcc/_build/nrf52840_xxaa.out", + "args": [], + "stopAtEntry": true, + "cwd": "${workspaceRoot}", + "environment": [], + "externalConsole": false, + "debugServerArgs": "", + "serverLaunchTimeout": 20000, + "filterStderr": true, + "filterStdout": false, + "serverStarted": "GDB\\ server\\ started", + "preLaunchTask": "make", + "setupCommands": [ + { "text": "-target-select remote localhost:3333", "description": "connect to target", "ignoreFailures": false }, + { "text": "-file-exec-and-symbols ${workspaceRoot}/armgcc/_build/nrf52840_xxaa.out", "description": "load file", "ignoreFailures": false}, + { "text": "-interpreter-exec console \"monitor endian little\"", "ignoreFailures": false }, + { "text": "-interpreter-exec console \"monitor reset\"", "ignoreFailures": false }, + { "text": "-interpreter-exec console \"monitor halt\"", "ignoreFailures": false }, + { "text": "-interpreter-exec console \"monitor arm semihosting enable\"", "ignoreFailures": false }, + { "text": "-target-download", "description": "flash target", "ignoreFailures": false } + ], + "logging": { + "moduleLoad": true, + "trace": true, + "engineLogging": true, + "programOutput": true, + "exceptions": true + }, + "linux": { + "MIMode": "gdb", + "MIDebuggerPath": "arm-none-eabi-gdb", + "debugServerPath": "pyocd-gdbserver" + }, + "osx": { + "MIMode": "gdb", + "MIDebuggerPath": "arm-none-eabi-gdb", + "debugServerPath": "pyocd-gdbserver" + }, + "windows": { + "preLaunchTask": "make.exe", + "MIMode": "gdb", + "MIDebuggerPath": "arm-none-eabi-gdb.exe", + "debugServerPath": "pyocd-gdbserver.exe", + "setupCommands": [ + { "text": "-environment-cd ${workspaceRoot}\\armgcc\\_build" }, + { "text": "-target-select remote localhost:3333", "description": "connect to target", "ignoreFailures": false }, + { "text": "-file-exec-and-symbols nrf52840_xxaa.out", "description": "load file", "ignoreFailures": false}, + { "text": "-interpreter-exec console \"monitor endian little\"", "ignoreFailures": false }, + { "text": "-interpreter-exec console \"monitor reset\"", "ignoreFailures": false }, + { "text": "-interpreter-exec console \"monitor halt\"", "ignoreFailures": false }, + { "text": "-interpreter-exec console \"monitor arm semihosting enable\"", "ignoreFailures": false }, + { "text": "-target-download", "description": "flash target", "ignoreFailures": false } + ] + } + } + ] + } + ``` + +3. Create a make task in `.vscode/tasks.json` file: + + ``` bash + { + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "make", + "options": { + "cwd": "${workspaceRoot}/armgcc" + }, + "problemMatcher": { + "owner": "cpp", + "fileLocation": ["relative", "${workspaceRoot}"], + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + }, + "args": [], + "linux": { + "command": "make" + }, + "osx": { + "command": "make" + }, + "windows": { + "command": "make.exe" + } + } + ] + } + ``` + +## Debugging your project + +Connect the board to your PC, click __Debug__ -> __Start Debugging__ , and debugging starts. Click on the __Debug Console__ tab to see the debug output: + +![](vscode-debugging.png) + +Now you can explore the debugging capabilities for Variables, Breakpoints, and more. + +## Example Sources + +The example project files are located in GitHub: https://github.com/makerdiary/nrf52840-mdk/tree/master/examples/nrf5-sdk/blinky + +## Reference + +- [VS Code Launch Json Reference](https://code.visualstudio.com/docs/cpp/launch-json-reference) +- [VS Code Tasks Documentation](https://code.visualstudio.com/docs/editor/tasks) +- [nRF52840-MDK Documentation](https://wiki.makerdiary.com/nrf52840-mdk/) diff --git a/docs/posts/debugging-nrf52840-mdk-with-vscode/install-vscode.png b/docs/posts/debugging-nrf52840-mdk-with-vscode/install-vscode.png new file mode 100644 index 0000000..507d633 Binary files /dev/null and b/docs/posts/debugging-nrf52840-mdk-with-vscode/install-vscode.png differ diff --git a/docs/posts/debugging-nrf52840-mdk-with-vscode/vscode-debugging.png b/docs/posts/debugging-nrf52840-mdk-with-vscode/vscode-debugging.png new file mode 100644 index 0000000..bb143dd Binary files /dev/null and b/docs/posts/debugging-nrf52840-mdk-with-vscode/vscode-debugging.png differ diff --git a/docs/posts/docs-updated-nrf52840-mdk-usb-dongle/cover.png b/docs/posts/docs-updated-nrf52840-mdk-usb-dongle/cover.png new file mode 100644 index 0000000..0980ee0 Binary files /dev/null and b/docs/posts/docs-updated-nrf52840-mdk-usb-dongle/cover.png differ diff --git a/docs/posts/docs-updated-nrf52840-mdk-usb-dongle/index.md b/docs/posts/docs-updated-nrf52840-mdk-usb-dongle/index.md new file mode 100644 index 0000000..5fc1779 --- /dev/null +++ b/docs/posts/docs-updated-nrf52840-mdk-usb-dongle/index.md @@ -0,0 +1,27 @@ +--- +title: Documentation Updated - nRF52840 MDK USB Dongle +date: 2023-08-07 +authors: + - makerdiary +cover: docs-updated-nrf52840-mdk-usb-dongle/cover.png +categories: + - News +description: > + We are excited to announce that Documentation v2.0.0 is now available! There are many updates in this version that we hope you'll like. +--- + +![](cover.png) + +The first commit to the [`makerdiary/nrf52840-mdk-usb-dongle`](https://github.com/makerdiary/nrf52840-mdk-usb-dongle) repository was on Sep 27, 2018. Five years later, nRF52840 MDK USB Dongle has become one of the most popular, open-source nRF52840-based hardware today. + +We are excited to announce that Documentation v2.0.0 is now available! There are many updates in this version that we hope you'll like, some of the key highlights include: + +- [__Updated Quick Start Guide__](https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/getting-started/) - Provide a quick introduction to using nRF Connect Bluetooth Low Energy app to demonstrate Bluetooth Low Energy connectivity. +- [__Migrated to nRF Connect SDK__](https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ncs/) - nRF Connect SDK is the latest software development kit for building products based on Nordic Semiconductor's chips. We provide an extensive set of documentation and samples to help you getting started. +- [__Added nRF Sniffer for Bluetooth LE__](https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/ble-sniffer/) - This is a useful tool for debugging and learning about Bluetooth Low Energy applications. +- [__Added nRF Sniffer for 802.15.4__](https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/nrf802154-sniffer/) - This is a tool for learning about and debugging applications that are using protocols based on IEEE 802.15.4, such as Thread and Zigbee. +- [__Updated OpenSK__](https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/guides/opensk/) - There are many updates since we landed OpenSK. Now you can try the latest OpenSK firmware, even build your own's. + +What's still missing from the updates? Feel free to share your ideas in the [Discussions](https://github.com/makerdiary/nrf52840-mdk-usb-dongle/discussions). Together, we can make this project better! + +Last but certainly not least, a big __Thank You__ to the contributors of this project. diff --git a/docs/posts/getting-started-with-google-opensk/choose-webAuthn-way.png b/docs/posts/getting-started-with-google-opensk/choose-webAuthn-way.png new file mode 100644 index 0000000..322786a Binary files /dev/null and b/docs/posts/getting-started-with-google-opensk/choose-webAuthn-way.png differ diff --git a/docs/posts/getting-started-with-google-opensk/cover.png b/docs/posts/getting-started-with-google-opensk/cover.png new file mode 100644 index 0000000..6bda756 Binary files /dev/null and b/docs/posts/getting-started-with-google-opensk/cover.png differ diff --git a/docs/posts/getting-started-with-google-opensk/enter-pin-authentication.png b/docs/posts/getting-started-with-google-opensk/enter-pin-authentication.png new file mode 100644 index 0000000..f89b37e Binary files /dev/null and b/docs/posts/getting-started-with-google-opensk/enter-pin-authentication.png differ diff --git a/docs/posts/getting-started-with-google-opensk/index.md b/docs/posts/getting-started-with-google-opensk/index.md new file mode 100644 index 0000000..02f3100 --- /dev/null +++ b/docs/posts/getting-started-with-google-opensk/index.md @@ -0,0 +1,72 @@ +--- +title: Getting started with Google OpenSK +date: 2020-02-09 +authors: + - makerdiary +cover: getting-started-with-google-opensk/cover.png +categories: + - Learn +description: > + This post details how to get started with the OpenSK using the nRF52840 MDK USB Dongle without going through the complete toolchain installation. +--- + +![](cover.png) + +# Getting started with Google OpenSK + +## Introduction + +[OpenSK](https://github.com/google/OpenSK) released by Google is a fully open-source implementation for security keys written in Rust that supports both FIDO U2F and FIDO2 standards. + +OpenSK is based on the FIDO2 specifications, which combine the World Wide Web Consortium’s (W3C) [Web Authentication (WebAuthn)](https://fidoalliance.org/fido2/fido2-web-authentication-webauthn/) specification and FIDO Alliance’s corresponding [Client-to-Authenticator Protocol (CTAP)](https://fidoalliance.org/specifications/download/). + +The nRF52840 MDK USB Dongle works well with OpenSK. Taking advantage of the UF2 Bootloader, you can easily program the OpenSK by just copying the `.uf2`-format image to the flash drive. + +This guide details how to get started with the OpenSK using the nRF52840 MDK USB Dongle without going through the complete toolchain installation. + +## Requirements + +Before you start, check that you have the required hardware and software: + +- 1x [nRF52840 MDK USB Dongle](https://makerdiary.com/products/nrf52840-mdk-usb-dongle)(or [w/Case](https://makerdiary.com/products/nrf52840-mdk-usb-dongle-w-case) option) +- Latest version of Google Chrome, Mozilla Firefox, Microsoft Edge or Apple Safari + +## Programming the latest OpenSK firmware + +Download the [latest firmware](https://github.com/makerdiary/OpenSK-firmware/releases) and complete the following steps to program the firmware: + +1. Push and hold the button and plug your dongle into the USB port of your computer. Release the button after your dongle is connected. The RGB LED turns green. +2. It will mount as a Mass Storage Device called __UF2BOOT__. +3. Drag and drop `opensk-nrf52840_mdk_usb_dongle-.uf2` onto the __UF2BOOT__ volume. The RGB LED blinks red fast during flashing. +4. Re-plug the dongle and the OpenSK device will start running. + +!!! Note "About the Volume Label" + + The dongle manufactured after July 20 2023 is shipped with the latest [UF2 Bootloader 0.7.1](https://github.com/makerdiary/nrf52840-mdk-usb-dongle/tree/main/firmware/uf2_bootloader), which will mount as a Mass Storage Device called __UF2BOOT__. If you are running the older bootloader, it will mount as __MDK-DONGLE__. + +## Testing OpenSK + +After flashing the firmware to your dongle, complete the following steps to test it: + +1. Visit https://webauthn.io/ in a supported web browser, for example, Google Chrome. +2. Enter an example username and then click __Register__. You will be prompted to choose the way to create a passkey. Select __USB security key__. + ![](choose-webAuthn-way.png) + +3. Plug the dongle into the USB port of your computer. __Red LED__ and __Blue LED__ are blinking, which asks you to confirm the transaction with a button press. + +4. After the button is pressed, you will be prompted to enter a PIN for your security key. Just enter your PIN and click __Next__. + ![](webAuthn-PIN-required.png) + + +5. __Red LED__ and __Blue LED__ are blinking again and press the button again to complete the request. Then you will see the success notification. + ![](webAuthn-register-success.png) + +6. Now try to authenticate by click __Authenticate__. You will be prompted to enter the PIN you set above. Just enter your PIN and click __Next__. + ![](enter-pin-authentication.png) + +7. __Red LED__ and __Blue LED__ are blinking and you are asked to confirm the request with a button press. Press the button and you will be logged in. + ![](webAuthn-logged-in.png) + +## Explore More + +The two-factor authentication (2FA) has been successfully deployed by a growing number of websites and platforms, including Google, social networks, cloud providers, and many others. Happy trying! diff --git a/docs/posts/getting-started-with-google-opensk/webAuthn-PIN-required.png b/docs/posts/getting-started-with-google-opensk/webAuthn-PIN-required.png new file mode 100644 index 0000000..94272d6 Binary files /dev/null and b/docs/posts/getting-started-with-google-opensk/webAuthn-PIN-required.png differ diff --git a/docs/posts/getting-started-with-google-opensk/webAuthn-logged-in.png b/docs/posts/getting-started-with-google-opensk/webAuthn-logged-in.png new file mode 100644 index 0000000..75dc693 Binary files /dev/null and b/docs/posts/getting-started-with-google-opensk/webAuthn-logged-in.png differ diff --git a/docs/posts/getting-started-with-google-opensk/webAuthn-register-success.png b/docs/posts/getting-started-with-google-opensk/webAuthn-register-success.png new file mode 100644 index 0000000..d5e5970 Binary files /dev/null and b/docs/posts/getting-started-with-google-opensk/webAuthn-register-success.png differ diff --git a/docs/posts/getting-started-with-nrf52840-mdk/ble_app_blinky_demo.jpg b/docs/posts/getting-started-with-nrf52840-mdk/ble_app_blinky_demo.jpg new file mode 100644 index 0000000..17bb64d Binary files /dev/null and b/docs/posts/getting-started-with-nrf52840-mdk/ble_app_blinky_demo.jpg differ diff --git a/docs/posts/getting-started-with-nrf52840-mdk/cover.png b/docs/posts/getting-started-with-nrf52840-mdk/cover.png new file mode 100644 index 0000000..dec92e2 Binary files /dev/null and b/docs/posts/getting-started-with-nrf52840-mdk/cover.png differ diff --git a/docs/posts/getting-started-with-nrf52840-mdk/drag-n-drop_programming.png b/docs/posts/getting-started-with-nrf52840-mdk/drag-n-drop_programming.png new file mode 100644 index 0000000..0aaf4d4 Binary files /dev/null and b/docs/posts/getting-started-with-nrf52840-mdk/drag-n-drop_programming.png differ diff --git a/docs/posts/getting-started-with-nrf52840-mdk/index.md b/docs/posts/getting-started-with-nrf52840-mdk/index.md new file mode 100644 index 0000000..b2d598d --- /dev/null +++ b/docs/posts/getting-started-with-nrf52840-mdk/index.md @@ -0,0 +1,123 @@ +--- +title: Getting started with nRF52840-MDK +date: 2019-07-01 +authors: + - makerdiary +cover: getting-started-with-nrf52840-mdk/cover.png +categories: + - Learn +description: > + nRF52840-MDK is a versatile, easy-to-use IoT hardware platform for Bluetooth 5, Bluetooth Mesh, Thread, IEEE 802.15.4, ANT and 2.4GHz proprietary applications using the nRF52840. +--- + +![](cover.png) + +# Getting started with nRF52840-MDK + +## Introduction + +The [nRF52840-MDK](https://makerdiary.com/products/nrf52840-mdk-iot-development-kit) is a versatile, easy-to-use IoT hardware platform for Bluetooth 5, Bluetooth Mesh, Thread, IEEE 802.15.4, ANT and 2.4GHz proprietary applications using the nRF52840 SoC. + +It comes with a fully integrated debugger (also known as [DAPLink](https://daplink.io/)) which makes it easy to program and debug application software without extra debug probe. + +In this post I’ll show you how to connect and set up your nRF52840-MDK, and what to expect when you do so. This will take about 20 minutes. + +## Prerequisites + +In order to set up the nRF52840-MDK development kit, prepare the following: + +- The [nRF52840-MDK](https://makerdiary.com/products/nrf52840-mdk-iot-development-kit) board +- A macOS/Linux/Windows PC +- An iPhone or Android phone +- 1x USB-C cable + +![](nrf52840-mdk-with-cable.jpeg) + +## Set up the board + +Connect the board by performing the following steps: + +1. Connect the nRF52840-MDK to one of your PC’s USB host ports. This provides power to the board. Observe that two GREEN LEDs are on. One indicates that USB power is good, and another indicates that the application is advertising. +2. Open a file explorer. Confirm that the board has appeared as a removable drive named __DAPLINK__. This allows you to program the nRF52840 chip. You’ll do this under [how to program nRF52840-MDK](#how-to-program-nrf52840-mdk) below. + +![](nrf52840_mdk_ble_app_blinky.jpg) + +## Use Terminal application + +Terminal applications (for example [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/) or [screen](https://www.gnu.org/software/screen/manual/screen.html)) run on your host PC. They provide a window where the board prints log information. + +Start a terminal application. The default setup for the USB serial port is 115200 baud, 8 bits, 1 stop bit, no parity (`115200–8-N-1`). For example on macOS, type the following command: + +``` bash +screen /dev/cu.usbmodem1412 115200 +``` + +![](screen_messages_macos.png) + +## Use nRF Connect App + +You can also test the application with the nRF Connect mobile app by performing the following steps: + +- Get the nRF Connect app from App Store or Google Play. +- Connect to the device from nRF Connect (the device is advertising as __nRF52840-MDK__). +- Observe that the RGB LED stays BLUE. This indicates that the connections is established. +- bserve that the LED Button Service is shown in the connected device. It contains two characteristics: _Nordic Blinky Button_ and _Nordic Blinky LED_. +- Enable _Notify_ on the _Nordic Blinky Button_. Notifications are received when pressing or releasing the USER Button. +- Write `01` to the _Nordic Blinky LED_ and observe that RED LED is turned on. +- Write `00` to the _Nordic Blinky LED_ and observe that RED LED is turned off. + +![](ble_app_blinky_demo.jpg) + +## How to program nRF52840-MDK + +You have the following two options to program your board: + +- [Drag-n-drop Programming](#drag-n-drop-programming) +- [Using pyOCD]() + +### Drag-n-drop Programming + +Drag and drop the hex file into the __DAPLINK__ removable drive. The file contains firmware which will be automatically programmed onto the nRF52840 SoC. When programming is completed, the removable drive will be re-detected by the computer. The application will run after pressing the RESET button. + +![](drag-n-drop_programming.png) + +### Using pyOCD + +pyOCD is an open source Python package for programming and debugging Arm Cortex-M microcontrollers using multiple supported types of USB debug probes. It is fully cross-platform, with support for Linux, macOS, and Windows. + +The latest stable version of pyOCD may be installed via [pip](https://pip.pypa.io/en/stable/index.html) as follows: + +``` bash +pip install -U pyocd +``` + +For more installing options, see [pyOCD GitHub repo](https://github.com/pyocd/pyOCD#installing). + +Verify if your board is detected by pyOCD by running: + +``` bash +pyocd list +``` + +Flash the board with your new firmware by running: + +``` bash +pyocd flash -t nrf52840 +``` + +![](using-pyocd.png) + +## Next steps + +You can clone the [makerdiary/nrf52840-mdk](https://github.com/makerdiary/nrf52840-mdk) repository or download it as a zip package and put its contents to your working directory. + +``` bash +git clone https://github.com/makerdiary/nrf52840-mdk.git +``` + +This repository provides documents and example applications that you can run on your board to ensure that everything is set up correctly. + +## Resources + +- [nRF52840-MDK GitHub Repository](https://github.com/makerdiary/nrf52840-mdk) +- [nRF52840-MDK Wiki Page](https://wiki.makerdiary.com/nrf52840-mdk) diff --git a/docs/posts/getting-started-with-nrf52840-mdk/nrf52840-mdk-with-cable.jpeg b/docs/posts/getting-started-with-nrf52840-mdk/nrf52840-mdk-with-cable.jpeg new file mode 100644 index 0000000..ca1b959 Binary files /dev/null and b/docs/posts/getting-started-with-nrf52840-mdk/nrf52840-mdk-with-cable.jpeg differ diff --git a/docs/posts/getting-started-with-nrf52840-mdk/nrf52840_mdk_ble_app_blinky.jpg b/docs/posts/getting-started-with-nrf52840-mdk/nrf52840_mdk_ble_app_blinky.jpg new file mode 100644 index 0000000..b89072a Binary files /dev/null and b/docs/posts/getting-started-with-nrf52840-mdk/nrf52840_mdk_ble_app_blinky.jpg differ diff --git a/docs/posts/getting-started-with-nrf52840-mdk/screen_messages_macos.png b/docs/posts/getting-started-with-nrf52840-mdk/screen_messages_macos.png new file mode 100644 index 0000000..5374b13 Binary files /dev/null and b/docs/posts/getting-started-with-nrf52840-mdk/screen_messages_macos.png differ diff --git a/docs/posts/getting-started-with-nrf52840-mdk/using-pyocd.png b/docs/posts/getting-started-with-nrf52840-mdk/using-pyocd.png new file mode 100644 index 0000000..107148d Binary files /dev/null and b/docs/posts/getting-started-with-nrf52840-mdk/using-pyocd.png differ diff --git a/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/blinky_demo.gif b/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/blinky_demo.gif new file mode 100644 index 0000000..970bef1 Binary files /dev/null and b/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/blinky_demo.gif differ diff --git a/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/cover.png b/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/cover.png new file mode 100644 index 0000000..52af31b Binary files /dev/null and b/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/cover.png differ diff --git a/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/index.md b/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/index.md new file mode 100644 index 0000000..19d60fa --- /dev/null +++ b/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/index.md @@ -0,0 +1,167 @@ +--- +title: How to set up nRF5 SDK with ARM GCC +date: 2019-07-08 +authors: + - makerdiary +cover: how-to-set-up-nrf5-sdk-with-arm-gcc/cover.png +categories: + - Learn +description: > + In this post we will describe how to set up the nRF5 SDK development environment on your system, build and run the example applications in a few minutes. +--- + +![](cover.png) + +# How to set up nRF5 SDK with ARM GCC + +## Introduction + +The [nRF5 SDK](https://www.nordicsemi.com/Software-and-Tools/Software/nRF5-SDK/) is your first stop for building fully featured, reliable and secure applications with the nRF52 and nRF51 Series. It offers developers a wealth of varied modules and examples right across the spectrum including numerous Bluetooth Low Energy profiles, Device Firmware Upgrade (DFU), GATT serializer and driver support for all peripherals on all nRF5 Series devices. The nRF5 SDK will almost certainly have something for your needs in developing exciting yet robust wireless products. + +The SDK is delivered as a plain `.zip`-archive, which makes it easy to install as well as giving you the freedom to choose the IDE and compiler of your choice. + +Here we will describe how to set up the nRF5 SDK development environment on your system, build and run the example applications. + +## Install GNU Arm Embedded Toolchain + +The GNU Embedded Toolchain for Arm is a ready-to-use, open source suite of tools for C, C++ and Assembly programming targeting Arm Cortex-M and Cortex-R family of processors. It includes the GNU Compiler (GCC) and is available free of charge directly from Arm for embedded software development on Windows, Linux and macOS operating systems. + +Download and install the [GNU ARM Embedded Toolchain](https://developer.arm.com/downloads/-/gnu-rm). The `6-2017-q2-update` version is recommended. Then ensure the path is added to your OS PATH environment variable. + +``` bash +# in ~/.bash_profile, add the following script +export PATH="/gcc-arm-none-eabi-6-2017-q2-update/bin:${PATH}" +``` + +Type the following in your terminal to verify if the path is set correctly: + +``` bash +arm-none-eabi-gcc --version +``` + +## Install GNU make + +Now with the toolchain installed we can build object files from source code, but to build projects based on makefiles, which can be seen as a recipes for the builds, we need to have GNU make installed on the system. + +On Windows the easiest way to install the dependencies is to use the [MSYS2](http://www.msys2.org/). You can do so by performing the following steps: + +1. Download and run the installer - "x86_64" for 64-bit, "i686" for 32-bit Windows. + +2. Update the package database and core system packages with: + ``` bash + pacman -Syu + ``` + +3. If needed, close MSYS2, run it again from Start menu. Update the rest with: + ``` bash + pacman -Su + ``` + +4. Install make: + ``` bash + pacman -S make + ``` + +GNU make is bundled with Xcode tools if working on macOS. On Linux it may be different ways to obtain GNU make depending on your distro, if not installed already, e.g. on Ubuntu you can get by entering this command: + +``` bash +sudo apt-get install build-essential checkinstall +``` + +## Clone the repository + +Clone the nRF52840-MDK repository from GitHub: + +``` bash +git clone https://github.com/makerdiary/nrf52840-mdk +``` + +## Install the nRF5 SDK + +Download the SDK file [nRF5_SDK_v15.2.0_9412b96](https://www.nordicsemi.com/Software-and-Tools/Software/nRF5-SDK/Download#infotabs) from https://www.nordicsemi.com . Note that the current version is `15.2.0`. + +Extract the zip file to the `nrf52840-mdk/nrf_sdks` directory. This should give you the following folder structure: + +``` bash +./nrf52840-mdk/ +├── LICENSE +├── README.md +├── firmware +├── config +├── docs +├── examples +├── mkdocs.yml +├── nrf_sdks +│ └── nRF5_SDK_v15.2.0_9412b96 +└── tools +``` + +To build an example application you first need to set the toolchain path in `makefile.windows` or `makefile.posix` depending on platform you are using. That is, the `.posix` should be edited if your are working on either Linux or macOS. These files are located in: + +``` bash +/components/toolchain/gcc +``` + +Open the file in a text editor, and make sure that the __GNU_INSTALL_ROOT__ variable is pointing to your GNU Arm Embedded Toolchain install directory. + +``` bash +GNU_INSTALL_ROOT ?= $(HOME)/gcc-arm-none-eabi/gcc-arm-none-eabi-6-2017-q2-update/bin/ +GNU_VERSION ?= 6.3.1 +GNU_PREFIX ?= arm-none-eabi +``` + +## Build and run the blinky example + +Now you can try to build one of the examples. Will use the blinky example here to keep it simple. + +Open terminal and change directory to: + +``` bash +cd ./nrf52840-mdk/examples/nrf5-sdk/blinky/armgcc/ +``` + +Connect the nRF52840-MDK to one of your PC's USB host ports. Compile and program the example: + +``` bash +make flash +``` + +![](blinky_demo.gif) + +## Run examples with SoftDevice + +Before you can run more advanced examples that use Bluetooth or ANT, you must program the SoftDevice on the board. + +The SoftDevice binary is located in folder `components/softdevice//hex` in the SDK, where `` is the name of the SoftDevice. + +The easiest way to program the SoftDevice is using the GCC makefile of an example: + +1. Open a command prompt in the folder that contains the makefile of an example. The example must require a SoftDevice. For example, the `ble_app_blinky` example. + + ``` bash + # change to the armgcc directory of 'ble_app_blinky' example + cd ~/nrf52840-mdk/examples/nrf5-sdk/ble_app_blinky/armgcc + ``` + +2. Run the following command: + + ``` bash + # this will compile & program the application(without SoftDevice) + make flash + + # this will program SoftDevice alone + make flash_softdevice + ``` + +![](nrf52840_mdk_ble_app_blinky.jpg) + +## More examples + +Over time, more example applications will be added to the repository. You can star or watch the [nrf52840-mdk](https://github.com/makerdiary/nrf52840-mdk) repository to stay up to date. + +## Reference + +- [Nordic nRF5 SDK](https://www.nordicsemi.com/Software-and-Tools/Software/nRF5-SDK) +- [Nordic Semiconductor Infocenter](https://infocenter.nordicsemi.com/index.jsp) +- [makerdiary/nrf52840-mdk repository](https://github.com/makerdiary/nrf52840-mdk) +- [nRF52840 MDK Documentation](https://wiki.makerdiary.com/nrf52840-mdk) diff --git a/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/nrf52840_mdk_ble_app_blinky.jpg b/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/nrf52840_mdk_ble_app_blinky.jpg new file mode 100644 index 0000000..b89072a Binary files /dev/null and b/docs/posts/how-to-set-up-nrf5-sdk-with-arm-gcc/nrf52840_mdk_ble_app_blinky.jpg differ diff --git a/docs/posts/introducing-circuitpython/cover.png b/docs/posts/introducing-circuitpython/cover.png new file mode 100644 index 0000000..3e1b4a1 Binary files /dev/null and b/docs/posts/introducing-circuitpython/cover.png differ diff --git a/docs/posts/introducing-circuitpython/index.md b/docs/posts/introducing-circuitpython/index.md new file mode 100644 index 0000000..42c974b --- /dev/null +++ b/docs/posts/introducing-circuitpython/index.md @@ -0,0 +1,45 @@ +--- +title: Introducing CircuitPython +date: 2023-07-14 +authors: + - makerdiary +cover: introducing-circuitpython/cover.png +categories: + - Learn +description: > + CircuitPython is an implementation of Python for microcontrollers. Once you get your board set up, open any text editor, and start editing code. +--- + +![](cover.png) + +## What is CircuitPython? + +CircuitPython is a programming language designed to simplify experimenting and learning to program on low-cost microcontroller boards. It makes getting started easier than ever with no upfront desktop downloads needed. Once you get your board set up, open any text editor, and get started editing code. It's that simple. + +CircuitPython is an implementation of Python, which is a high-level programming language which means it's designed to be easier to read, write and maintain. It supports modules and packages which means it's easy to reuse your code for other projects. It has a built in interpreter which means there are no extra steps, like compiling, to get your code to work. And of course, it is Open Source Software which means it's free for anyone to use, modify or improve upon. + +## Why CircuitPython? + +CircuitPython is a fork of [MicroPython](https://micropython.org/), and offers unified Python core APIs and a growing list of 300+ device libraries and drivers that work with it. You can see [differences from MicroPython](https://github.com/adafruit/circuitpython#differences-from-micropython). + +Here is some reasons to use CircuitPython: + +- **You want to get up and running quickly.** Create a file, edit your code, save the file, and it runs immediately. There is no compiling, no downloading and no uploading needed. +- **You're new to programming.** CircuitPython is designed with education in mind. It's easy to start learning how to program and you get immediate feedback from the board. +- **Easily update your code.** Since your code lives on the disk drive, you can edit it whenever you like, you can also keep multiple files around for easy experimentation. +- **The serial console and REPL.** These allow for live feedback from your code and interactive programming. File storage. The internal storage for CircuitPython makes it great for data-logging, playing audio clips, and otherwise interacting with files. +- **Strong hardware support.** CircuitPython has builtin support for microcontroller hardware features like digital I/O pins, hardware buses (UART, I2C, SPI), audio I/O, and other capabilities. There are also many libraries and drivers for sensors, breakout boards and other external components. +- **It's Python!** Python is the fastest-growing programming language. It's taught in schools and universities. CircuitPython is almost-completely compatible with Python. It simply adds hardware support. + +## How to get started? + +To use CircuitPython, you need to choose a microcontroller board well supported by CircuitPython. There are [300+ boards](https://circuitpython.org/downloads) that can run CircuitPython. + +The following boards from Makerdiary are supported by CircuitPython: + +- [nRF52840 Connect Kit](https://makerdiary.com/products/nrf52840-connectkit) +- [nRF52840 MDK USB Dongle](https://makerdiary.com/products/nrf52840-mdk-usb-dongle)(we also have a [w/Case version](https://makerdiary.com/products/nrf52840-mdk-usb-dongle-w-case)) +- [nRF52840 M.2 Developer Kit](https://makerdiary.com/products/nrf52840-m2-developer-kit) +- [M60 Mechanical Keyboard](https://makerdiary.com/products/m60-mechanical-keyboard-pcba) +- [Pitaya Go](https://makerdiary.com/products/pitaya-go) +- [nRF52840 MDK](https://makerdiary.com/products/nrf52840-mdk-iot-development-kit) diff --git a/docs/posts/introducing-nrf-connect-sdk/cover.png b/docs/posts/introducing-nrf-connect-sdk/cover.png new file mode 100644 index 0000000..12b4498 Binary files /dev/null and b/docs/posts/introducing-nrf-connect-sdk/cover.png differ diff --git a/docs/posts/introducing-nrf-connect-sdk/index.md b/docs/posts/introducing-nrf-connect-sdk/index.md new file mode 100644 index 0000000..c1fc64f --- /dev/null +++ b/docs/posts/introducing-nrf-connect-sdk/index.md @@ -0,0 +1,62 @@ +--- +title: Introducing nRF Connect SDK +date: 2023-06-26 +authors: + - makerdiary +cover: introducing-nrf-connect-sdk/cover.png +categories: + - Learn +description: > + nRF Connect SDK is a scalable and unified software development kit for building products based on Nordic Semiconductor's wireless devices. +--- + +![](cover.png) + +# Introducing nRF Connect SDK + +## Overview + +nRF Connect SDK is a scalable and unified software development kit for building products based on Nordic Semiconductor's nRF52, nRF53, nRF70 and nRF91 Series wireless devices. It offers developers an extensible framework for building size-optimized software for memory-constrained devices as well as powerful and complex software for more advanced devices and applications. + +It integrates the Zephyr Real-Time Operating System (RTOS) and a wide range of complete applications, samples, and protocol stacks such as Bluetooth Low Energy, Bluetooth mesh, Matter, Thread/Zigbee and LTE-M/NB-IoT/GPS, TCP/IP. It also includes middleware such as CoAP, MQTT, LwM2M, various libraries, hardware drivers, Trusted Firmware-M for security, and a secure bootloader (MCUBoot). + +The following figure illustrates the architecture of the nRF Connect SDK, where Zephyr RTOS and third-party components (Ex: MCUBoot, Trusted Firmware-M) are shown in dark blue: + +![](ncs-arch.png) + +## About Zephyr RTOS + +Zephyr RTOS is an open-source real-time operating system for connected and resource-constrained embedded devices. It includes a scheduler that ensures predictable/deterministic execution patterns and abstracts out the timing requirements. It also comes with a rich set of fundamental libraries and middleware that simplifies development and helps reduce a product’s time to market. Zephyr RTOS is highly configurable and enables scalable configurations from very small configurations for memory-constrained devices (minimum 8 kilobytes, for example, simple LED blinking application) to powerful, feature-rich, high-processing power devices (multiple MBs of memory) with large memory configurations. + +[Zephyr RTOS](https://www.zephyrproject.org/){ .md-button .md-button--primary } + +## How nRF Connect SDK code is organized + +The nRF Connect SDK offers a single code base for all of Nordic’s devices and software components. It simplifies porting modules, libraries, and drivers from one application to another, thus reducing development time. By enabling developers to pick and choose the essential software components for their application, high memory efficiency is guaranteed. The nRF Connect SDK is publicly hosted on GitHub. + +Internally, the nRF Connect SDK code is organized into four main repositories: + +- nrf – Applications, samples, connectivity protocols (Nordic) +- nrfxlib – Common libraries and stacks (Nordic) +- Zephyr – RTOS & Board configurations (open source) +- MCUBoot – Secure Bootloader (open source) + +In addition to the four main repositories, there are also other repositories like the TrustedFirmware-M repository and the Matter repository. + +## Tools and configuration + +The figure below visualizes the toolchain in the nRF Connect SDK, which is based on the Zephyr toolchain. You can see a set of different tools, each playing a role in the creation of an application, from configuring the system to building it. + +![](ncs_build_process.png) + +Kconfig generates definitions that configure the whole system, for example which wireless protocol or which libraries to include in your application. Devicetree describes the hardware. CMake then uses the information from Kconfig and the devicetree to generate build files, which Ninja will use to build the program. The GCC compiler system is used to create the executables. + +This high decoupling of the source code (`*.c`) and the configuration system through Kconfig (`*.conf`) and the hardware description system through devicetree (`*.dts`) makes it easy to use the same application source code on different hardware and with different configurations with minimal changes. This has a huge impact on the ease of portability and maintainability. + +![](ncs_app_build_process.png) + +## Next steps + +Now that we have an understanding of the content and structure of the nRF Connect SDK, let’s move to the developer guides which will step you through the basics of nRF Connect SDK development and show you how to implement typical use cases with Nordic Semiconductor libraries and drivers on nRF52840 Connect Kit. + +[nRF Connect SDK Developer Guides](https://wiki.makerdiary.com/nrf52840-connectkit/guides/ncs/){ .md-button .md-button--primary } diff --git a/docs/posts/introducing-nrf-connect-sdk/ncs-arch.png b/docs/posts/introducing-nrf-connect-sdk/ncs-arch.png new file mode 100644 index 0000000..fd22823 Binary files /dev/null and b/docs/posts/introducing-nrf-connect-sdk/ncs-arch.png differ diff --git a/docs/posts/introducing-nrf-connect-sdk/ncs_app_build_process.png b/docs/posts/introducing-nrf-connect-sdk/ncs_app_build_process.png new file mode 100644 index 0000000..c3c69de Binary files /dev/null and b/docs/posts/introducing-nrf-connect-sdk/ncs_app_build_process.png differ diff --git a/docs/posts/introducing-nrf-connect-sdk/ncs_build_process.png b/docs/posts/introducing-nrf-connect-sdk/ncs_build_process.png new file mode 100644 index 0000000..b1f2723 Binary files /dev/null and b/docs/posts/introducing-nrf-connect-sdk/ncs_build_process.png differ diff --git a/docs/posts/meet-m60-mechanical-keyboard-from-prototype-to-production/cover.png b/docs/posts/meet-m60-mechanical-keyboard-from-prototype-to-production/cover.png new file mode 100644 index 0000000..15c07a3 Binary files /dev/null and b/docs/posts/meet-m60-mechanical-keyboard-from-prototype-to-production/cover.png differ diff --git a/docs/posts/meet-m60-mechanical-keyboard-from-prototype-to-production/index.md b/docs/posts/meet-m60-mechanical-keyboard-from-prototype-to-production/index.md new file mode 100644 index 0000000..1b28473 --- /dev/null +++ b/docs/posts/meet-m60-mechanical-keyboard-from-prototype-to-production/index.md @@ -0,0 +1,33 @@ +--- +title: Meet M60 Mechanical Keyboard - from Prototype to Production +date: 2020-07-13 +authors: + - makerdiary +cover: meet-m60-mechanical-keyboard-from-prototype-to-production/cover.png +categories: + - News + - Mechanical Keyboards +description: > + M60 is an open source, Python powered Mechanical Keyboard. This post will detail how we make it from Prototype to Production. +--- + +![](cover.png) + +# Meet M60 Mechanical Keyboard - from Prototype to Production + +A few months ago, we made a hand-wired keyboard powered by Python, which attracted a lot of attention. Lots of people love it, some question it. With putting more time into the Python keyboard, we find it more and more interesting. We think a Python keyboard can make a big difference, so we decided to design a new keyboard for everyone. It's called M60. + +Designing a new keyboard is a step by step process. Now, we has finished keyboard PCBA design. We would like to share the process and some ideas behind it with you. + +The hand-wired keyboard is a typical prototype. It is a working keyboard and can be used to do some function tests. It has got some feedback. From these feedback, we know that soldering a keyboard is a really hard for most people, so M60 is a solder-free keyboard. It has hot-swapping sockets which makes it super easy to change mechanical switches. You will be able to choose your favorite type of mechanical switches. + +![](m60-modular-design.webp) + +With modular design in mind, we designed an M2 module as the core of the keyboard. It is a practice of design for manufacturing, which also improve its repairability. + +With Python, the keyboard has very unique features. With no need to download any software or setup a development environment, we can just use a text editor to configure the keyboard or to add a new function. Meanwhile, it also has some disadvantages. Comparing to C, Python is slower, it requires more powerful hardware and has higher power consumption. + +Besides, the keyboard is powerful enough to run Python, will also be able to run C/C++, Rust, Go (TinyGo) and JavaScript (JerryScript). The hardware is also optimized for power efficiency. + +We always want to get you involved. If you're also interested in the Python keyboard, you can share your idea with us. + diff --git a/docs/posts/meet-m60-mechanical-keyboard-from-prototype-to-production/m60-modular-design.webp b/docs/posts/meet-m60-mechanical-keyboard-from-prototype-to-production/m60-modular-design.webp new file mode 100644 index 0000000..e848be5 Binary files /dev/null and b/docs/posts/meet-m60-mechanical-keyboard-from-prototype-to-production/m60-modular-design.webp differ diff --git a/docs/posts/nrf52840-connectkit-is-here/cover.png b/docs/posts/nrf52840-connectkit-is-here/cover.png new file mode 100644 index 0000000..6803624 Binary files /dev/null and b/docs/posts/nrf52840-connectkit-is-here/cover.png differ diff --git a/docs/posts/nrf52840-connectkit-is-here/index.md b/docs/posts/nrf52840-connectkit-is-here/index.md new file mode 100644 index 0000000..9bb91a5 --- /dev/null +++ b/docs/posts/nrf52840-connectkit-is-here/index.md @@ -0,0 +1,36 @@ +--- +title: nRF52840 Connect Kit is Here! +date: 2023-06-25 +authors: + - makerdiary +cover: nrf52840-connectkit-is-here/cover.png +categories: + - News +description: > + We are excited to announce the nRF52840 Connect Kit! It comes with a more mainstream form factor, USB-C, 64 Mbit QSPI flash, flexible power management and a rich set of features. +--- + +![](cover.png) + +# nRF52840 Connect Kit is Here! + +We are excited to announce that nRF52840 Connect Kit is now available! It's a new member of our nRF52840-based prototyping kit family. It comes in a more mainstream form factor with USB-C and 40 pin DIP/SMT type. A new power architecture is introduced to support various options for easily powering the unit from USB, external supplies or batteries. We will also offer Chip antenna or U.FL receptacle option for selection. + +![](nrf52840_connectkit_hero.png) + +With nRF52840 Connect Kit you can quickly and easily build your next connected project supporting Bluetooth LE, Bluetooth mesh, NFC, Thread, Zigbee, 802.15.4, ANT and 2.4 GHz proprietary stacks. Easy-to-use form factor, USB-C, 64 Mbit QSPI flash, flexible power management and a rich set of features enable designs to meet a wide range of applications. + +!!! Tip "About nRF52840" + + The nRF52840 SoC is the most advanced member of the nRF52 Series. It meets the challenges of sophisticated applications that need protocol concurrency and a rich and varied set of peripherals and features. It offers generous memory availability for both Flash and RAM, which are prerequisites for such demanding applications. + + The nRF52840 is fully multiprotocol capable with full protocol concurrency. It has protocol support for Bluetooth LE, Bluetooth mesh, Thread, Zigbee, 802.15.4, ANT and 2.4 GHz proprietary stacks. + +nRF52840 Connect Kit has support for Nordic Semi's nRF Connect SDK, which integrates the Zephyr RTOS, protocol stacks, samples, hardware drivers and much more. We also offer Python support, allowing you access hardware-specific functionality and peripherals with Python programming language. + +In addition, we offer an extensive set of documentation such as out of box experience, getting started and developer guides, which can help you save big by reducing development effort. + +Interested in our brand new nRF52840 Connect Kit? You can get it from [the official store](https://makerdiary.com/products/nrf52840-connectkit) or refer to our [wiki page](https://wiki.makerdiary.com/nrf52840-connectkit) for more technical resources. + + + diff --git a/docs/posts/nrf52840-connectkit-is-here/nrf52840_connectkit_hero.png b/docs/posts/nrf52840-connectkit-is-here/nrf52840_connectkit_hero.png new file mode 100644 index 0000000..b0e7b69 Binary files /dev/null and b/docs/posts/nrf52840-connectkit-is-here/nrf52840_connectkit_hero.png differ diff --git a/docs/posts/programming-nrf5x-with-pitaya-link/copy-hex-to-pitaya-link.webp b/docs/posts/programming-nrf5x-with-pitaya-link/copy-hex-to-pitaya-link.webp new file mode 100644 index 0000000..7476692 Binary files /dev/null and b/docs/posts/programming-nrf5x-with-pitaya-link/copy-hex-to-pitaya-link.webp differ diff --git a/docs/posts/programming-nrf5x-with-pitaya-link/cover.png b/docs/posts/programming-nrf5x-with-pitaya-link/cover.png new file mode 100644 index 0000000..7b93976 Binary files /dev/null and b/docs/posts/programming-nrf5x-with-pitaya-link/cover.png differ diff --git a/docs/posts/programming-nrf5x-with-pitaya-link/index.md b/docs/posts/programming-nrf5x-with-pitaya-link/index.md new file mode 100644 index 0000000..d892ca2 --- /dev/null +++ b/docs/posts/programming-nrf5x-with-pitaya-link/index.md @@ -0,0 +1,128 @@ +--- +title: Programming nRF5x SoCs with Pitaya-Link +date: 2020-02-26 +authors: + - makerdiary +cover: programming-nrf5x-with-pitaya-link/cover.png +categories: + - Learn +description: > + Pitaya-Link is a low-cost debug probe based on the CMSIS-DAP (aka DAPLink) protocol standard. This post details how to program the nRF5x SoCs using Pitaya-Link. +--- + +![](cover.png) + +# Programming nRF5x SoCs with Pitaya-Link + +## Introduction + +[Pitaya-Link](https://makerdiary.com/products/pitaya-link) is a low-cost debug probe based on the CMSIS-DAP (also known as [DAPLink](https://github.com/ARMmbed/DAPLink)) protocol standard. It can be used to program and debug the application software running on Arm Cortex Microcontrollers. + +The design enables developers with Drag-And-Drop programming, Virtual COM Port, CMSIS-DAP compliant debug channel, and access to Arm Cortex Microcontrollers in the browser using WebUSB. + +The probe comes with indicator LEDs, a button to reset the target or trigger the firmware update, reversible USB-C connector and easy-to-use 7-pin 2.54mm Header. + +![](pitaya-link_diagram_v1_0.png) + +## What you'll need + +- 1x [Pitaya-Link Debug Probe](https://makerdiary.com/products/pitaya-link) +- A macOS/Linux/Windows PC +- An nRF52 target board(e.g. [nRF52840 MDK USB Dongle](https://makerdiary.com/products/nrf52840-mdk-usb-dongle)) + +## Installing pyOCD + +pyOCD is an open source Python package for programming and debugging Arm Cortex-M microcontrollers using multiple supported types of USB debug probes. It is fully cross-platform, with support for Linux, macOS, and Windows. + +The latest stable version of pyOCD may be installed via pip as follows: + +``` bash +python3 -mpip install -U pyocd +``` + +Alternatively, you can install the latest prerelease version from the HEAD of the `develop` branch, you can do the following: + +``` bash +$ python3 -mpip install --pre -U git+https://github.com/pyocd/pyOCD.git@develop +``` + +Verify if pyOCD works correctly in your terminal: + +``` bash +pyocd --version +``` + +## Connecting the target + +Perform the following steps to connect your nRF5x target board: + +1. Connect the target board to Pitaya-Link using the provided 7-pin Cable. +2. Connect Pitaya-Link to the PC using the provided USB-C Cable. +3. A disk drive called __PITAYA-LINK__ will be automatically detected by the computer. + +![](cover.png) + +## Programming + +Pitaya-Link allows programming of your target MCU in the following two very simple ways: + +- Intuitive Drag-And-Drop programming +- Using the `pyocd` executable + +### Drag-and-drop programming + +Drag-And-Drop is an optional intuitive programming feature. It allows programming of your target MCU by dragging and dropping a file ( `.hex` -format) onto the __PITAYA-LINK__ drive. + +There is no need to install application software. Anyone that can drag and drop a file to a USB memory stick can now program the target board. + +![](copy-hex-to-pitaya-link.webp) + +### Using the pyocd executable + +The `pyocd` command line tool gives you total control over your device with these subcommands: + +- `gdbserver`: GDB remote server allows you to debug using gdb via either the console or [several GUI debugger options](https://pyocd.io/docs/gdb_setup). +- `load`: Program files of various formats into flash or RAM. +- `erase`: Erase part or all of an MCU's flash memory. +- `pack`: Manage [CMSIS Device Family Packs](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/index.html) that provide additional target device support. +- `commander`: Interactive REPL control and inspection of the MCU. +- `server`: Share a debug probe with a TCP/IP server. +- `reset`: Hardware or software reset of a device. +- `rtt`: Stream Segger RTT IO with any debug probe. +- `list`: Show connected devices. + +You can get additional help by adding `--help` option. + +To load/erase the nRF52840-based target, open up a terminal and run: + +=== "Load `.hex`" + + ``` bash linenums="1" + pyocd load -t nrf52840 firmware.hex + ``` + +=== "Load `.bin`" + + ``` bash linenums="1" + pyocd load -t nrf52840 --base-address 0x1000 firmware.bin + ``` + +=== "Chip Erase" + + ``` bash linenums="1" + pyocd erase -t nrf52840 --chip + ``` + + +## Explore Further + +Now that you are familiar with the Pitaya-Link, it's time to explore more tutorials available below: + +- [Using Pitaya-Link with DAP.js](https://wiki.makerdiary.com/pitaya-link/dapjs/) +- [Using Pitaya-Link with Visual Studio Code](https://wiki.makerdiary.com/pitaya-link/vscode/) +- [Using Pitaya-Link with GNU MCU Eclipse](https://wiki.makerdiary.com/pitaya-link/eclipse/) +- [Using Pitaya-Link with KEIL µVision IDE](https://wiki.makerdiary.com/pitaya-link/keil-mdk/) +- [Using Pitaya-Link with IAR Embedded Workbench](https://wiki.makerdiary.com/pitaya-link/iar-ewarm/) +- [Upgrading the DAPLink Firmware](https://wiki.makerdiary.com/pitaya-link/upgrading/) +- [Building your own DAPLink Firmware](https://wiki.makerdiary.com/pitaya-link/building/) + diff --git a/docs/posts/programming-nrf5x-with-pitaya-link/pitaya-link_diagram_v1_0.png b/docs/posts/programming-nrf5x-with-pitaya-link/pitaya-link_diagram_v1_0.png new file mode 100644 index 0000000..de690b1 Binary files /dev/null and b/docs/posts/programming-nrf5x-with-pitaya-link/pitaya-link_diagram_v1_0.png differ diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..abfb36d --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,173 @@ +# Copyright (c) 2016-2023 Makerdiary +# +# SPDX-License-Identifier: Apache-2.0 + +# Project information +site_name: Makerdiary Blog +site_url: https://blog.makerdiary.com +site_author: makerdiary +site_description: >- + This blog is for you who are new to the Makerdiary's products - whether you are a + senior executive, in product development, or simply a curious soul. Our goal is to + inform you, know about recent updates to our projects, as well as preview upcoming + features and beta releases. + +# Repository +repo_name: makerdiary +repo_url: https://github.com/makerdiary +edit_uri: "" +#edit_uri: edit/main/docs + +# Copyright +copyright: 'Copyright © 2016-2023 makerdiary' + +# Configuration +theme: + name: material + custom_dir: docs/.overrides + features: + # - announce.dismiss + - content.code.annotate + - content.code.copy + # - content.tabs.link + - content.tooltips + # - header.autohide + # - navigation.expand + - navigation.indexes + - navigation.instant + - navigation.prune + # - navigation.sections + - navigation.tabs + # - navigation.tabs.sticky + - navigation.top + - navigation.tracking + - navigation.footer + - search.highlight + - search.share + - search.suggest + - toc.follow + # - toc.integrate + palette: + - scheme: default + primary: custom + toggle: + icon: material/weather-night + name: Switch to dark mode + - scheme: slate + primary: custom + toggle: + icon: material/weather-sunny + name: Switch to light mode + font: + text: Roboto + code: Roboto Mono + favicon: assets/favicon.png + icon: + logo: logo + # Announcement bar + announcement: "" + + hero: + title: Welcome to Makerdiary Blog + description: >- + Be the first to know about recent updates to our projects, as well as preview upcoming features and beta releases. + button_primary: + label: Subscribe + link: https://makerdiary.com/newsletter + +# Plugins +plugins: + - search + - blog: + blog_dir: . + post_dir: posts + post_date_format: medium + pagination_per_page: 6 + pagination_keep_content: true + post_url_format: "{slug}" + post_readtime_words_per_minute: 128 + # - git-revision-date-localized + - minify: + minify_html: true + # TODO: Support Chinese + # - i18n: + # default_language: en + # languages: + # en: English + # zh: 简体中文 + +# Customization +extra: + generator: false + analytics: + provider: google + property: !ENV GOOGLE_ANALYTICS_KEY + social: + - icon: fontawesome/brands/shopify + link: https://makerdiary.com + - icon: fontawesome/brands/github + link: https://github.com/makerdiary + - icon: fontawesome/brands/twitter + link: https://twitter.com/makerdiary + - icon: fontawesome/brands/discourse + link: https://community.makerdiary.com + - icon: fontawesome/brands/youtube + link: https://www.youtube.com/@makerdiary + - icon: fontawesome/solid/blog + link: https://blog.makerdiary.com + - icon: fontawesome/brands/medium + link: https://medium.com/makerdiary + - icon: fontawesome/solid/envelope + link: mailto:hi@makerdiary.com + +extra_css: + - assets/stylesheets/extra.css + +# Extensions +markdown_extensions: + - abbr + - admonition + - attr_list + - def_list + - footnotes + - md_in_html + - meta + - toc: + permalink: true + - pymdownx.arithmatex: + generic: true + - pymdownx.betterem: + smart_enable: all + - pymdownx.caret + - pymdownx.details + - pymdownx.emoji: + emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_index: !!python/name:materialx.emoji.twemoji + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.keys + - pymdownx.magiclink: + repo_url_shorthand: true + user: makerdiary + repo: blog + - pymdownx.mark + - pymdownx.smartsymbols + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.tabbed: + alternate_style: true + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde + +# Page tree +nav: + - Home: index.md + - Store: https://makerdiary.com + - Wiki: https://wiki.makerdiary.com + - Community: https://github.com/orgs/makerdiary/discussions + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a8024dc --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +mkdocs-material==9.2.3 +cairosvg>=2.5 +mkdocs-git-committers-plugin-2>=1.1.1 +mkdocs-git-revision-date-localized-plugin>=1.0 +mkdocs-minify-plugin>=0.3 +mkdocs-rss-plugin>=1.2 +mkdocs-redirects>=1.0 +pillow<10