diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index d267fd8..2efe2f0 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -7,8 +7,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-16.04, windows-latest, macos-latest] - python-version: [2.7, 3.7] + os: [ubuntu-latest, windows-latest, macos-latest] example: - "examples/shakti-sdk_gpio-keypad" - "examples/shakti-sdk_i2c-lm75" @@ -16,18 +15,17 @@ jobs: - "examples/shakti-sdk_weatherstation" runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: "recursive" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + - name: Set up Python + uses: actions/setup-python@v3 with: - python-version: ${{ matrix.python-version }} + python-version: "3.9" - name: Install dependencies run: | - python -m pip install --upgrade pip pip install -U https://github.com/platformio/platformio/archive/develop.zip - platformio platform install file://. + pio pkg install --global --platform symlink://. - name: Build examples run: | - platformio run -d ${{ matrix.example }} + pio run -d ${{ matrix.example }} diff --git a/README.md b/README.md index 19b32f8..b4c2f89 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -# Shakti: development platform for [PlatformIO](http://platformio.org) +# Shakti: development platform for [PlatformIO](https://platformio.org) [![Build Status](https://github.com/platformio/platform-shakti/workflows/Examples/badge.svg)](https://github.com/platformio/platform-shakti/actions) Shakti is an open-source initiative by the RISE group at IIT-Madras, which is not only building open source, production grade processors, but also associated components like interconnect fabrics, verification tools, storage controllers, peripheral IPs and SOC tools. -* [Home](http://platformio.org/platforms/shakti) (home page in PlatformIO Platform Registry) -* [Documentation](http://docs.platformio.org/page/platforms/shakti.html) (advanced usage, packages, boards, frameworks, etc.) +* [Home](https://registry.platformio.org/platforms/platformio/shakti) (home page in the PlatformIO Registry) +* [Documentation](https://docs.platformio.org/page/platforms/shakti.html) (advanced usage, packages, boards, frameworks, etc.) # Usage -1. [Install PlatformIO](http://platformio.org) -2. Create PlatformIO project and configure a platform option in [platformio.ini](http://docs.platformio.org/page/projectconf.html) file: +1. [Install PlatformIO](https://platformio.org) +2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file: ## Stable version @@ -32,4 +32,4 @@ board = ... # Configuration -Please navigate to [documentation](http://docs.platformio.org/page/platforms/shakti.html). +Please navigate to [documentation](https://docs.platformio.org/page/platforms/shakti.html). diff --git a/builder/frameworks/_bare.py b/builder/frameworks/_bare.py index 74ff42a..f0a4085 100644 --- a/builder/frameworks/_bare.py +++ b/builder/frameworks/_bare.py @@ -22,23 +22,26 @@ board_config = env.BoardConfig() +machine_flags = [ + "-march=%s" % board_config.get("build.march"), + "-mabi=%s" % board_config.get("build.mabi"), + "-mcmodel=%s" % board_config.get("build.mcmodel") +] + env.Append( - CCFLAGS=[ + ASFLAGS=machine_flags, + + ASPPFLAGS=[ + "-x", "assembler-with-cpp", + ], + + CCFLAGS=machine_flags + [ "-Wall", # show warnings - "-march=%s" % board_config.get("build.march"), - "-mabi=%s" % board_config.get("build.mabi"), - "-mcmodel=%s" % board_config.get("build.mcmodel") ], - LINKFLAGS=[ + LINKFLAGS=machine_flags + [ "-nostartfiles", - "-march=%s" % board_config.get("build.march"), - "-mabi=%s" % board_config.get("build.mabi"), - "-mcmodel=%s" % board_config.get("build.mcmodel") ], LIBS=["m", "gcc"] ) - -# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode) -env.Append(ASFLAGS=env.get("CCFLAGS", [])[:]) diff --git a/builder/frameworks/shakti-sdk.py b/builder/frameworks/shakti-sdk.py index 6bd16b4..85e284a 100644 --- a/builder/frameworks/shakti-sdk.py +++ b/builder/frameworks/shakti-sdk.py @@ -41,7 +41,7 @@ def is_valid_target(target): target = env.subst("$BOARD") env.Append( - ASFLAGS=[ + ASPPFLAGS=[ ("-D__ASSEMBLY__=1"), "-fno-common" ], diff --git a/examples/shakti-sdk_gpio-keypad/.travis.yml b/examples/shakti-sdk_gpio-keypad/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/shakti-sdk_gpio-keypad/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/shakti-sdk_gpio-keypad/README.md b/examples/shakti-sdk_gpio-keypad/README.md new file mode 100644 index 0000000..a04b3b6 --- /dev/null +++ b/examples/shakti-sdk_gpio-keypad/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-shakti/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd platform-shakti/examples/shakti-sdk_gpio-keypad + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e artix7_35t + +# Upload firmware for the specific environment +$ pio run -e artix7_35t --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/shakti-sdk_gpio-keypad/README.rst b/examples/shakti-sdk_gpio-keypad/README.rst deleted file mode 100644 index 898d9e6..0000000 --- a/examples/shakti-sdk_gpio-keypad/README.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. Copyright 2014-present PlatformIO - 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. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platform-shakti/examples/shakti-sdk_gpio-keypad - - # Build project - > platformio run - - # Upload firmware - > platformio run --target upload - - # Build specific environment - > platformio run -e artix7_35t - - # Upload firmware for the specific environment - > platformio run -e artix7_35t --target upload - - # Clean build files - > platformio run --target clean diff --git a/examples/shakti-sdk_gpio-keypad/platformio.ini b/examples/shakti-sdk_gpio-keypad/platformio.ini index a8e6516..15cb40d 100644 --- a/examples/shakti-sdk_gpio-keypad/platformio.ini +++ b/examples/shakti-sdk_gpio-keypad/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [platformio] description = diff --git a/examples/shakti-sdk_i2c-lm75/.travis.yml b/examples/shakti-sdk_i2c-lm75/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/shakti-sdk_i2c-lm75/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/shakti-sdk_i2c-lm75/README.md b/examples/shakti-sdk_i2c-lm75/README.md new file mode 100644 index 0000000..7bbdb89 --- /dev/null +++ b/examples/shakti-sdk_i2c-lm75/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-shakti/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd platform-shakti/examples/shakti-sdk_i2c-lm75 + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e artix7_35t + +# Upload firmware for the specific environment +$ pio run -e artix7_35t --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/shakti-sdk_i2c-lm75/README.rst b/examples/shakti-sdk_i2c-lm75/README.rst deleted file mode 100644 index 7dd0633..0000000 --- a/examples/shakti-sdk_i2c-lm75/README.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. Copyright 2014-present PlatformIO - 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. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platform-shakti/examples/shakti-sdk_i2c-lm75 - - # Build project - > platformio run - - # Upload firmware - > platformio run --target upload - - # Build specific environment - > platformio run -e artix7_35t - - # Upload firmware for the specific environment - > platformio run -e artix7_35t --target upload - - # Clean build files - > platformio run --target clean diff --git a/examples/shakti-sdk_i2c-lm75/platformio.ini b/examples/shakti-sdk_i2c-lm75/platformio.ini index c5282c4..a4694f8 100644 --- a/examples/shakti-sdk_i2c-lm75/platformio.ini +++ b/examples/shakti-sdk_i2c-lm75/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [platformio] description = diff --git a/examples/shakti-sdk_uart-hello/.travis.yml b/examples/shakti-sdk_uart-hello/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/shakti-sdk_uart-hello/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/shakti-sdk_uart-hello/README.md b/examples/shakti-sdk_uart-hello/README.md new file mode 100644 index 0000000..bd37ee7 --- /dev/null +++ b/examples/shakti-sdk_uart-hello/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-shakti/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd platform-shakti/examples/shakti-sdk_uart-hello + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e artix7_35t + +# Upload firmware for the specific environment +$ pio run -e artix7_35t --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/shakti-sdk_uart-hello/README.rst b/examples/shakti-sdk_uart-hello/README.rst deleted file mode 100644 index 7e22528..0000000 --- a/examples/shakti-sdk_uart-hello/README.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. Copyright 2014-present PlatformIO - 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. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platform-shakti/examples/shakti-sdk_uart-hello - - # Build project - > platformio run - - # Upload firmware - > platformio run --target upload - - # Build specific environment - > platformio run -e artix7_35t - - # Upload firmware for the specific environment - > platformio run -e artix7_35t --target upload - - # Clean build files - > platformio run --target clean diff --git a/examples/shakti-sdk_uart-hello/platformio.ini b/examples/shakti-sdk_uart-hello/platformio.ini index 06d6744..ef451c2 100644 --- a/examples/shakti-sdk_uart-hello/platformio.ini +++ b/examples/shakti-sdk_uart-hello/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [platformio] description = diff --git a/examples/shakti-sdk_weatherstation/.travis.yml b/examples/shakti-sdk_weatherstation/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/shakti-sdk_weatherstation/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/shakti-sdk_weatherstation/README.md b/examples/shakti-sdk_weatherstation/README.md new file mode 100644 index 0000000..74b3bc1 --- /dev/null +++ b/examples/shakti-sdk_weatherstation/README.md @@ -0,0 +1,27 @@ +How to build PlatformIO based project +===================================== + +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-shakti/archive/develop.zip) +3. Extract ZIP archive +4. Run these commands: + +```shell +# Change directory to example +$ cd platform-shakti/examples/shakti-sdk_weatherstation + +# Build project +$ pio run + +# Upload firmware +$ pio run --target upload + +# Build specific environment +$ pio run -e artix7_35t + +# Upload firmware for the specific environment +$ pio run -e artix7_35t --target upload + +# Clean build files +$ pio run --target clean +``` diff --git a/examples/shakti-sdk_weatherstation/README.rst b/examples/shakti-sdk_weatherstation/README.rst deleted file mode 100644 index 7aff21b..0000000 --- a/examples/shakti-sdk_weatherstation/README.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. Copyright 2014-present PlatformIO - 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. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platform-shakti/examples/shakti-sdk_weatherstation - - # Build project - > platformio run - - # Upload firmware - > platformio run --target upload - - # Build specific environment - > platformio run -e artix7_35t - - # Upload firmware for the specific environment - > platformio run -e artix7_35t --target upload - - # Clean build files - > platformio run --target clean diff --git a/examples/shakti-sdk_weatherstation/platformio.ini b/examples/shakti-sdk_weatherstation/platformio.ini index 7d73f52..4a54a08 100644 --- a/examples/shakti-sdk_weatherstation/platformio.ini +++ b/examples/shakti-sdk_weatherstation/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [platformio] description = diff --git a/platform.json b/platform.json index 456e624..2fea756 100644 --- a/platform.json +++ b/platform.json @@ -10,13 +10,13 @@ "RISC-V" ], "engines": { - "platformio": "^5" + "platformio": "^6" }, "repository": { "type": "git", "url": "https://github.com/platformio/platform-shakti.git" }, - "version": "1.1.1", + "version": "1.2.0", "frameworks": { "shakti-sdk": { "package": "framework-shakti-sdk", diff --git a/platform.py b/platform.py index 59fb33f..16dd189 100644 --- a/platform.py +++ b/platform.py @@ -14,19 +14,19 @@ from os.path import join -from platformio.managers.platform import PlatformBase +from platformio.public import PlatformBase class ShaktiPlatform(PlatformBase): def get_boards(self, id_=None): - result = PlatformBase.get_boards(self, id_) + result = super().get_boards(id_) if not result: return result if id_: return self._add_dynamic_options(result) else: - for key, value in result.items(): + for key in result: result[key] = self._add_dynamic_options(result[key]) return result