Skip to content

New port for Infineon PSoC6 controllers #15642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .github/workflows/ports_psoc6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: psoc6 port
on:
push:
pull_request:
paths:
- '.github/workflows/*.yml'
- 'tools/**'
- 'py/**'
- 'extmod/**'
- 'shared/**'
- 'lib/**'
- 'drivers/**'
- 'ports/psoc6/**'

jobs:
server-build:
runs-on: ubuntu-latest
strategy:
matrix:
board:
- CY8CPROTO-062-4343W
- CY8CPROTO-063-BLE
- CY8CKIT-062S2-AI
outputs:
commit_sha: ${{ steps.commit_sha.outputs.sha_short }}

steps:
- uses: actions/checkout@v4
- name: Install packages
run: source tools/ci.sh && ci_psoc6_setup
- name: Build
run: source tools/ci.sh && ci_psoc6_build ${{ matrix.board }}

# Steps only relevant for Infineon fork
# with self-hosted runner available
- name: Gets commit SHA
if: success() && github.repository_owner == 'infineon'
id: commit_sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Save firmware bin
if: success() && github.repository_owner == 'infineon'
uses: actions/upload-artifact@v4
with:
name: mpy-psoc6_${{ matrix.board }}_${{ steps.commit_sha.outputs.sha_short }}
path: ports/psoc6/build/firmware.hex

# Jobs only relevant for Infineon fork
on-target-test:
if: github.repository_owner == 'infineon'
runs-on: self-hosted
needs: server-build
continue-on-error: true
strategy:
matrix:
board:
- CY8CPROTO-062-4343W
- CY8CPROTO-063-BLE
- CY8CKIT-062S2-AI
steps:
- uses: actions/checkout@v4
- name: Download binaries
uses: actions/download-artifact@v4
- name: Container setup
run: |
echo ${{ secrets.SELF_HOSTED_PASSWORD }} | sudo -S chmod 666 /var/run/docker.sock
source tools/ci.sh && ci_psoc6_setup
- name: Setup devices
run: |
cp mpy-psoc6_${{ matrix.board }}_${{ needs.server-build.outputs.commit_sha }}/firmware.hex .
source tools/ci.sh && ci_psoc6_flash_multiple_devices ${{ matrix.board }} firmware.hex tools/psoc6/${{ runner.name }}-devs.yml
- name: Run psoc6 tests
timeout-minutes: 12
run: |
./tests/ports/psoc6/run_psoc6_tests.sh --test-suite ci-tests --board ${{ matrix.board }} --hil ${{ runner.name }}
- name: Container teardown
if: failure() || success()
run: |
source tools/ci.sh && ci_psoc6_teardown

release:
runs-on: ubuntu-latest
needs: [server-build, on-target-test]
strategy:
matrix:
board:
- CY8CPROTO-062-4343W
- CY8CPROTO-063-BLE
- CY8CKIT-062S2-AI
if: startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'infineon'
steps:
- name: Download binaries
uses: actions/download-artifact@v4
- name: Prepare release assets
run: |
cd mpy-psoc6_${{ matrix.board }}_${{ needs.server-build.outputs.commit_sha }}
mv firmware.hex ../mpy-psoc6_${{ matrix.board }}.hex
- name: Build release changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
name: Micropython PSoC6 ${{ github.ref_name }}
files: mpy-psoc6_${{ matrix.board }}.hex
body: ${{steps.build_changelog.outputs.changelog}}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ In addition, the following ports are provided in this repository:
- [nrf](ports/nrf) -- Nordic Semiconductor nRF51 and nRF52.
- [pic16bit](ports/pic16bit) -- Microchip PIC 16-bit.
- [powerpc](ports/powerpc) -- IBM PowerPC (including Microwatt)
- [psoc6](ports/psoc6) -- Infineon PSoC6.
- [qemu-arm](ports/qemu-arm) -- QEMU-based Arm emulated target (for testing)
- [qemu-riscv](ports/qemu-riscv) -- QEMU-based RISC-V emulated target (for testing)
- [renesas-ra](ports/renesas-ra) -- Renesas RA family.
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ MicroPython documentation and references
esp32/quickref.rst
rp2/quickref.rst
mimxrt/quickref.rst
psoc6/quickref.rst
wipy/quickref.rst
unix/quickref.rst
zephyr/quickref.rst
Expand Down
89 changes: 89 additions & 0 deletions docs/psoc6/general.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
.. _psoc6_general:

General information about the PSoC6™ port
=========================================

The PSoC™ 6 family is built on an ultra-low-power architecture, and the MCUs feature low-power design catering to tailored application domains.
The PSoC6™ port supports boards powered by the `Infineon PSoC6 family of microcontrollers <https://www.infineon.com/cms/en/product/microcontroller/32-bit-psoc-arm-cortex-microcontroller/psoc-6-32-bit-arm-cortex-m4-mcu/>`_ and currently supports the following MCUs:

* PSoC™ 62 - Performance
* PSoC™ 63 - Bluetooth™ Low Energy

.. _Supported boards:

Supported boards
^^^^^^^^^^^^^^^^^

The following boards are supported on this port:

.. list-table::
:widths: 20 20 50
:header-rows: 1

* - Board name
- Connectivity
- Special feature
* - CY8CPROTO-062-4343W
- Wi-Fi, BT
- microSD card slot, external flash memory, thermistor, user button
* - CY8CPROTO-063-BLE
- BLE
- user button, compact form factor
* - CY8CKIT-062S2-AI
- Wi-Fi, BT
- user button, compact form factor, USB-C, MEMS microphone, radar sensor, pressure sensor, 6-axis IMU, 3-axis magnetometer

For more hardware-related details, refer to the following sections.

CY8CPROTO-062-4343W
--------------------

Pinout
******

.. image:: img/CY8CPROTO-062-4343W-pinout.png
:width: 500


Technical specifications
************************
Links for product details:

* `CY8CPROTO-062-4343W product page with relevant documents <https://www.infineon.com/cms/en/product/evaluation-boards/cy8cproto-062-4343w/#>`_
* `CY8CPROTO-062-4343W MCU Datasheet <https://www.infineon.com/dgdl/Infineon-PSOC_6_MCU_CY8C62X8_CY8C62XA-DataSheet-v18_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ee7d03a70b1>`_

CY8CPROTO-063-BLE
-----------------

Pinout
******

.. image:: img/CY8CPROTO-063-BLE-pinout.png
:width: 350


Technical specifications
************************
Links for product details:

* `CY8CPROTO-063-BLE product page with relevant documents <https://www.infineon.com/cms/en/product/evaluation-boards/cy8cproto-063-ble/#>`_
* `CY8CPROTO-063-BLE MCU Datasheet <https://www.infineon.com/dgdl/Infineon-PSoC_6_MCU_PSoC_63_with_BLE_Datasheet_Programmable_System-on-Chip_(PSoC)-DataSheet-v16_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ee4efe46c37&utm_source=cypress&utm_medium=referral&utm_campaign=202110_globe_en_all_integration-files>`_

CY8CKIT-062S2-AI
----------------

Pinout
******

.. image:: img/CY8CKIT-062S2-AI-pinout.png
:width: 500


Technical specifications
************************
Links for product details:

* `CY8CKIT-062S2-AI product page with relevant documents <https://www.infineon.com/cms/en/product/evaluation-boards/cy8ckit-062s2-ai/>`_
* `CY8CKIT-062S2-AI MCU Datasheet <https://www.infineon.com/dgdl/Infineon-PSOC_6_MCU_CY8C62X8_CY8C62XA-DataSheet-v18_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ee7d03a70b1>`_


Binary file added docs/psoc6/img/CY8CKIT-062S2-AI-pinout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/CY8CPROTO-062-4343W-pinout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/CY8CPROTO-063-BLE-pinout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/cy-programmer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/cy8cproto-062-4343w.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/cy8cproto-063-ble.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/gh-releases.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/mpy-ide-connect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/mpy-ide-prompt.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/mpy-ide-script.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/mpy-ide-vfs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/mpy-psoc6-repl.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/psoc6/img/mpy-thonny-filesystem.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 140 additions & 0 deletions docs/psoc6/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
.. _psoc6_mpy_install:

Installing MicroPython
======================

To facilitate the installation of the MicroPython PSoC6™ port, the ``mpy-psoc6.py`` Python script is provided. It is compatible with Windows,
Linux and MacOS.

You can easily download the script from the terminal with the following command:

.. code-block:: bash

$ curl -s -L https://raw.githubusercontent.com/infineon/micropython/ports-psoc6-main/tools/psoc6/mpy-psoc6.py > mpy-psoc6.py

Ensure you have a recent version of `Python3.x <https://www.python.org/downloads/>`_ installed and the `pip <https://pip.pypa.io/en/stable/installation/>`_ package installer.
Then install the following packages:

.. code-block:: bash

$ pip install requests

Find all available commands and options by running the script with the following command:

.. code-block:: bash

$ python mpy-psoc6.py --help

.. _psoc6_device_setup:

Device setup
-------------

In order to setup MicroPython in a PSoC6™ board, the ``device-setup`` command of the ``mpy-psoc6.py``
utility can be executed. Follow the instructions to select the target PSoC6™ board, and deploy the latest
MicropPython firmware version:

.. code-block:: bash

$ python mpy-psoc6.py device-setup

You can run this command whenever you want to upgrade to the latest MicroPython firmware version.
This command will take care of the following steps:

* Download and install openocd, which is the software required to deploy a firmware file on PSoC6™ controllers
* Download the latest ``.hex`` file for your selected board
* Deploy the latest version of MicroPython firmware on your board

Install a previous version
^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you want to setup the device with a previous firmware version, you can check the list of available releases in the `GitHub release section <https://github.com/infineon/MicroPython/releases>`_.

The ``device-setup`` command can also assist you with this process. In this case, the board and the desired
version needs to be passed as arguments.

.. code-block:: bash

$ python mpy-psoc6.py device-setup -b CY8CPROTO-062-4343W -v v0.1.1

.. warning::

Be sure to provide the board name as shown in the ``device-setup`` command when running in interactive mode.
Also, provide a valid tag that exists in the release section, in the format *vx.y.z*.
No fail-safe mechanisms or error verifications are (yet) implemented on the ``mpy-psoc6.py`` utility, and the script will fail to retrieve the necessary firmware file.

Updating the flasher firmware
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The evaluation PSoC6™ boards include an integrated hardware programmer tool using `KitProg <https://www.infineon.com/cms/en/design-support/tools/programming-testing/psoc-programming-solutions/#collapse-703c72c0-50f2-11ec-9758-005056945905-3>`_ firmware.
Some older boards may come pre-flashed with KitProg version 2. For the MicroPython PSoC6™ port, KitProg version 3 is required, and the setup process will fail if version 2 is used.

In case of failure during ``device-setup``, the option ``--kitprog-fw-update`` can be added to the command.
This will update the KitProg firmware to version 3 before flashing the MicroPython firmware.

.. code-block:: bash

$ python mpy-psoc6.py device-setup --kitprog-fw-update

Direct binary flashing
----------------------

Another way to program the board is by directly providing the binary file. This can be done using the ``firmware-deploy`` command.
Specify the board and the path and name of the ``.hex`` file as follows:

.. code-block:: bash

$ python mpy-psoc6.py firmware-deploy -b CY8CPROTO-062-4343W -f pathtodir/mpy-psoc6_CY8CPROTO-062-4343W.hex

Erasing the device (external) file system
-----------------------------------------

Some PSoC6™ boards include an external flash memory which is used by the MicroPython file system. This memory will not be erased when
reprogramming or erasing MicroPython firmware via ``device-setup`` or ``firmware-deploy``.
Use the ``device-erase`` command to erase the external memory of your PSoC6™ device:

.. code-block:: bash

$ python mpy-psoc6.py device-erase

.. warning::

This command flashes the PSoC6™ controller with a custom program to delete the external memory. Thus, MicroPython will be removed from the
microcontroller. Use any of the script commands described above to reinstall MicroPython.

Getting the firmware
^^^^^^^^^^^^^^^^^^^^

The binary *.hex* files are available in the `GitHub release section <https://github.com/infineon/MicroPython/releases>`_.
All PSoC6™ firmware versions for each of the supported boards can be found there.


.. image:: img/gh-releases.png
:alt: GitHub MicroPython Releases
:width: 520px


Other installation methods
--------------------------

Cypress Programmer
^^^^^^^^^^^^^^^^^^

Alternatively, you can directly flash the firmware binary file with the `Cypress Programmer
<https://softwaretools.infineon.com/tools/com.ifx.tb.tool.cypressprogrammer>`_
It allows you to program the PSoC6™ microcontroller family with just a few clicks from your Windows, Linux, or MacOS machine.
Follow the instructions at the provided link to download and install the tool.

After that, select the downloaded MicroPython firmware *.hex* file to be deployed on the PSoC6™. Then, in
the upper menu, select the connected *Probe/Kit*, click on *Connect*, and finally click on *Program*.
The log section will show the progress and notify you when the firmware deployment on the controller is completed.

.. image:: img/cy-programmer.jpg
:alt: Cypress Programmer GUI
:width: 520px

For a detailed description on how to use the Cypress Programmer tool, please consult the `Cypress
Programmer User Guide
<https://www.infineon.com/dgdl/Infineon-Infineon_Programmer_4.0_GUI_User_Guide-Software-v01_00-EN.pdf?fileId=8ac78c8c7e7124d1017ed9abca6e365c>`_.


Loading
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy