Merge latest upstream
This commit is contained in:
commit
a587ecab51
16
.github/workflows/examples.yml
vendored
16
.github/workflows/examples.yml
vendored
@ -7,26 +7,24 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
python-version: [3.7]
|
|
||||||
example:
|
example:
|
||||||
|
- "examples/arduino-blink"
|
||||||
- "examples/arduino-blink"
|
- "examples/arduino-blink"
|
||||||
- "examples/arduino-blink-earlephilhower"
|
- "examples/arduino-blink-earlephilhower"
|
||||||
- "examples/arduino-external-libs"
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: "3.9"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U https://github.com/platformio/platformio/archive/develop.zip
|
pip install -U https://github.com/platformio/platformio/archive/develop.zip
|
||||||
pio pkg install --global --platform symlink://.
|
pio pkg install --global --platform symlink://.
|
||||||
- name: Build examples
|
- name: Build examples
|
||||||
run: |
|
run: |
|
||||||
platformio run -d ${{ matrix.example }}
|
pio run -d ${{ matrix.example }}
|
||||||
|
@ -9,7 +9,7 @@ RP2040 is a low-cost, high-performance microcontroller device with a large on-ch
|
|||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
1. [Install PlatformIO](http://platformio.org)
|
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:
|
2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file:
|
||||||
|
|
||||||
## Stable version
|
## Stable version
|
||||||
|
@ -50,4 +50,4 @@
|
|||||||
},
|
},
|
||||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||||
"vendor": "Raspberry Pi"
|
"vendor": "Raspberry Pi"
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,12 @@ from SCons.Script import DefaultEnvironment
|
|||||||
env = DefaultEnvironment()
|
env = DefaultEnvironment()
|
||||||
|
|
||||||
env.Append(
|
env.Append(
|
||||||
ASFLAGS=["-x", "assembler-with-cpp"],
|
ASFLAGS=[
|
||||||
|
"-mthumb",
|
||||||
|
],
|
||||||
|
ASPPFLAGS=[
|
||||||
|
"-x", "assembler-with-cpp",
|
||||||
|
],
|
||||||
|
|
||||||
CCFLAGS=[
|
CCFLAGS=[
|
||||||
"-Os", # optimize for size
|
"-Os", # optimize for size
|
||||||
@ -54,6 +59,9 @@ env.Append(
|
|||||||
|
|
||||||
if "BOARD" in env:
|
if "BOARD" in env:
|
||||||
env.Append(
|
env.Append(
|
||||||
|
ASFLAGS=[
|
||||||
|
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
|
||||||
|
],
|
||||||
CCFLAGS=[
|
CCFLAGS=[
|
||||||
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
|
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
|
||||||
],
|
],
|
||||||
@ -61,6 +69,3 @@ if "BOARD" in env:
|
|||||||
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
|
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
|
|
||||||
env.Append(ASFLAGS=env.get("CCFLAGS", [])[:])
|
|
||||||
|
@ -15,12 +15,11 @@
|
|||||||
import sys
|
import sys
|
||||||
from platform import system
|
from platform import system
|
||||||
from os import makedirs
|
from os import makedirs
|
||||||
from os.path import isdir, join, isfile
|
from os.path import isdir, join
|
||||||
from shutil import copyfile
|
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from platformio.util import get_serial_ports
|
from platformio.public import list_serial_ports
|
||||||
|
|
||||||
from SCons.Script import (ARGUMENTS, COMMAND_LINE_TARGETS, AlwaysBuild,
|
from SCons.Script import (ARGUMENTS, COMMAND_LINE_TARGETS, AlwaysBuild,
|
||||||
Builder, Default, DefaultEnvironment)
|
Builder, Default, DefaultEnvironment)
|
||||||
@ -32,7 +31,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
|||||||
upload_options = env.BoardConfig().get("upload", {})
|
upload_options = env.BoardConfig().get("upload", {})
|
||||||
|
|
||||||
env.AutodetectUploadPort()
|
env.AutodetectUploadPort()
|
||||||
before_ports = get_serial_ports()
|
before_ports = list_serial_ports()
|
||||||
|
|
||||||
if upload_options.get("use_1200bps_touch", False):
|
if upload_options.get("use_1200bps_touch", False):
|
||||||
env.TouchSerialPort("$UPLOAD_PORT", 1200)
|
env.TouchSerialPort("$UPLOAD_PORT", 1200)
|
||||||
@ -239,7 +238,7 @@ def _update_max_upload_size(env):
|
|||||||
fetch_fs_size(env)
|
fetch_fs_size(env)
|
||||||
env.BoardConfig().update("upload.maximum_size", env["PICO_FLASH_LENGTH"])
|
env.BoardConfig().update("upload.maximum_size", env["PICO_FLASH_LENGTH"])
|
||||||
|
|
||||||
# update max upload size based on CSV file
|
# update max upload size based on set sketch size (or raw maximum size)
|
||||||
if env.get("PIOMAINPROG"):
|
if env.get("PIOMAINPROG"):
|
||||||
env.AddPreAction(
|
env.AddPreAction(
|
||||||
"checkprogsize",
|
"checkprogsize",
|
||||||
@ -391,9 +390,6 @@ elif upload_protocol in debug_tools:
|
|||||||
"tool-openocd-raspberrypi") or "")
|
"tool-openocd-raspberrypi") or "")
|
||||||
for f in openocd_args
|
for f in openocd_args
|
||||||
]
|
]
|
||||||
# use ELF file for upload, not bin (target_firm). otherwise needs
|
|
||||||
# offset 0x10000000
|
|
||||||
#upload_source = target_elf
|
|
||||||
env.Replace(
|
env.Replace(
|
||||||
UPLOADER="openocd",
|
UPLOADER="openocd",
|
||||||
UPLOADERFLAGS=openocd_args,
|
UPLOADERFLAGS=openocd_args,
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -12,13 +12,13 @@
|
|||||||
"RP2040"
|
"RP2040"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"platformio": "^5"
|
"platformio": "^6"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/platformio/platform-raspberrypi.git"
|
"url": "https://github.com/platformio/platform-raspberrypi.git"
|
||||||
},
|
},
|
||||||
"version": "1.6.0",
|
"version": "1.7.0",
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"arduino": {
|
"arduino": {
|
||||||
"package": "framework-arduino-mbed",
|
"package": "framework-arduino-mbed",
|
||||||
@ -41,7 +41,7 @@
|
|||||||
"type": "framework",
|
"type": "framework",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"owner": "platformio",
|
"owner": "platformio",
|
||||||
"version": "~3.0.1"
|
"version": "~3.1.1"
|
||||||
},
|
},
|
||||||
"framework-arduinopico": {
|
"framework-arduinopico": {
|
||||||
"type": "framework",
|
"type": "framework",
|
||||||
|
13
platform.py
13
platform.py
@ -12,11 +12,9 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import sys
|
|
||||||
import copy
|
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
from platformio.managers.platform import PlatformBase
|
from platformio.public import PlatformBase
|
||||||
|
|
||||||
|
|
||||||
class RaspberrypiPlatform(PlatformBase):
|
class RaspberrypiPlatform(PlatformBase):
|
||||||
@ -50,7 +48,7 @@ class RaspberrypiPlatform(PlatformBase):
|
|||||||
|
|
||||||
# if we want to build a filesystem, we need the tools.
|
# if we want to build a filesystem, we need the tools.
|
||||||
if "buildfs" in targets:
|
if "buildfs" in targets:
|
||||||
self.packages['tool-mklittlefs']['optional'] = False
|
self.packages['tool-mklittlefs-rp2040-earlephilhower']['optional'] = False
|
||||||
|
|
||||||
# configure J-LINK tool
|
# configure J-LINK tool
|
||||||
jlink_conds = [
|
jlink_conds = [
|
||||||
@ -67,16 +65,16 @@ class RaspberrypiPlatform(PlatformBase):
|
|||||||
if not any(jlink_conds) and jlink_pkgname in self.packages:
|
if not any(jlink_conds) and jlink_pkgname in self.packages:
|
||||||
del self.packages[jlink_pkgname]
|
del self.packages[jlink_pkgname]
|
||||||
|
|
||||||
return PlatformBase.configure_default_packages(self, variables, targets)
|
return super().configure_default_packages(variables, targets)
|
||||||
|
|
||||||
def get_boards(self, id_=None):
|
def get_boards(self, id_=None):
|
||||||
result = PlatformBase.get_boards(self, id_)
|
result = super().get_boards(id_)
|
||||||
if not result:
|
if not result:
|
||||||
return result
|
return result
|
||||||
if id_:
|
if id_:
|
||||||
return self._add_default_debug_tools(result)
|
return self._add_default_debug_tools(result)
|
||||||
else:
|
else:
|
||||||
for key, value in result.items():
|
for key in result:
|
||||||
result[key] = self._add_default_debug_tools(result[key])
|
result[key] = self._add_default_debug_tools(result[key])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -131,7 +129,6 @@ class RaspberrypiPlatform(PlatformBase):
|
|||||||
|
|
||||||
def configure_debug_session(self, debug_config):
|
def configure_debug_session(self, debug_config):
|
||||||
adapter_speed = debug_config.speed or "5000"
|
adapter_speed = debug_config.speed or "5000"
|
||||||
|
|
||||||
server_options = debug_config.server or {}
|
server_options = debug_config.server or {}
|
||||||
server_arguments = server_options.get("arguments", [])
|
server_arguments = server_options.get("arguments", [])
|
||||||
if "interface/cmsis-dap.cfg" in server_arguments:
|
if "interface/cmsis-dap.cfg" in server_arguments:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user