Merge pull request #8 from maxgerhardt/patchup

Patchup
This commit is contained in:
Maximilian Gerhardt 2022-06-17 03:59:56 +02:00 committed by GitHub
commit 750f07c05f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 133 additions and 330 deletions

View File

@ -10,8 +10,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
example:
- "examples/arduino-blink"
- "examples/arduino-blink"
- "examples/arduino-blink-earlephilhower"
- "examples/arduino-external-libs"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "adafruit_feather",
"arduino": {
"earlephilhower": {
"variant": "adafruit_feather",
"boot2_source": "boot2_w25x10cl_4_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x80f1",
"usb_manufacturer": "Adafruit",
"usb_product": "Feather RP2040"
"usb_pid": "0x80f1"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "adafruit_itsybitsy",
"arduino": {
"earlephilhower": {
"variant": "adafruit_itsybitsy",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x80fd",
"usb_manufacturer": "Adafruit",
"usb_product": "ItsyBitsy RP2040"
"usb_pid": "0x80fd"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "adafruit_kb2040",
"arduino": {
"earlephilhower": {
"variant": "adafruit_kb2040",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x8105",
"usb_manufacturer": "Adafruit",
"usb_product": "KB2040"
"usb_pid": "0x8105"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "adafruit_macropad2040",
"arduino": {
"earlephilhower": {
"variant": "adafruit_macropad2040",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x8107",
"usb_manufacturer": "Adafruit",
"usb_product": "MacroPad RP2040"
"usb_pid": "0x8107"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "adafruit_qtpy",
"arduino": {
"earlephilhower": {
"variant": "adafruit_qtpy",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x80f7",
"usb_manufacturer": "Adafruit",
"usb_product": "QT Py RP2040"
"usb_pid": "0x80f7"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "adafruit_stemmafriend",
"arduino": {
"earlephilhower": {
"variant": "adafruit_stemmafriend",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x80e3",
"usb_manufacturer": "Adafruit",
"usb_product": "STEMMA Friend RP2040"
"usb_pid": "0x80e3"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "adafruit_trinkeyrp2040qt",
"arduino": {
"earlephilhower": {
"variant": "adafruit_trinkeyrp2040qt",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x8109",
"usb_manufacturer": "Adafruit",
"usb_product": "Trinkey RP2040 QT"
"usb_pid": "0x8109"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "arduino_nano_connect",
"arduino": {
"earlephilhower": {
"variant": "arduino_nano_connect",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2341",
"usb_pid": "0x0058",
"usb_manufacturer": "Arduino",
"usb_product": "Nano RP2040 Connect"
"usb_pid": "0x0058"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Arduino"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "challenger_2040_lora",
"arduino": {
"earlephilhower": {
"variant": "challenger_2040_lora",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x1023",
"usb_manufacturer": "iLabs",
"usb_product": "Challenger 2040 LoRa"
"usb_pid": "0x1023"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "iLabs"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "challenger_2040_lte",
"arduino": {
"earlephilhower": {
"variant": "challenger_2040_lte",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x100b",
"usb_manufacturer": "iLabs",
"usb_product": "Challenger 2040 LTE"
"usb_pid": "0x100b"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "iLabs"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "challenger_2040_wifi",
"arduino": {
"earlephilhower": {
"variant": "challenger_2040_wifi",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x1006",
"usb_manufacturer": "iLabs",
"usb_product": "Challenger 2040 WiFi"
"usb_pid": "0x1006"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "iLabs"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "challenger_2040_wifi_ble",
"arduino": {
"earlephilhower": {
"variant": "challenger_2040_wifi_ble",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x102C",
"usb_manufacturer": "iLabs",
"usb_product": "Challenger 2040 WiFi/BLE"
"usb_pid": "0x102C"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "iLabs"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "challenger_nb_2040_wifi",
"arduino": {
"earlephilhower": {
"variant": "challenger_nb_2040_wifi",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x100b",
"usb_manufacturer": "iLabs",
"usb_product": "Challenger NB 2040 WiFi"
"usb_pid": "0x100b"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "iLabs"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "cytron_maker_nano_rp2040",
"arduino": {
"earlephilhower": {
"variant": "cytron_maker_nano_rp2040",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x100f",
"usb_manufacturer": "Cytron",
"usb_product": "Maker Nano RP2040"
"usb_pid": "0x100f"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Cytron"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "cytron_maker_pi_rp2040",
"arduino": {
"earlephilhower": {
"variant": "cytron_maker_pi_rp2040",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x1000",
"usb_manufacturer": "Cytron",
"usb_product": "Maker Pi RP2040"
"usb_pid": "0x1000"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Cytron"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "dfrobot_beetle_rp2040",
"arduino": {
"earlephilhower": {
"variant": "dfrobot_beetle_rp2040",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x3343",
"usb_pid": "0x4253",
"usb_manufacturer": "DFRobot",
"usb_product": "Beetle RP2040"
"usb_pid": "0x4253"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "DFRobot"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "flyboard2040_core",
"arduino": {
"earlephilhower": {
"variant": "flyboard2040_core",
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x008a",
"usb_manufacturer": "DeRuiLab",
"usb_product": "FlyBoard2040Core"
"usb_pid": "0x008a"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "DeRuiLab"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "generic",
"arduino": {
"earlephilhower": {
"variant": "generic",
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0xf00a",
"usb_manufacturer": "Generic",
"usb_product": "RP2040"
"usb_pid": "0xf00a"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Generic"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "ilabs_rpico32",
"arduino": {
"earlephilhower": {
"variant": "ilabs_rpico32",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x1010",
"usb_manufacturer": "iLabs",
"usb_product": "RPICO32"
"usb_pid": "0x1010"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "iLabs"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "melopero_shake_rp2040",
"arduino": {
"earlephilhower": {
"variant": "melopero_shake_rp2040",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x1005",
"usb_manufacturer": "Melopero",
"usb_product": "Shake RP2040"
"usb_pid": "0x1005"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Melopero"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "rpipico",
"arduino": {
"earlephilhower": {
"variant": "rpipico",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x000a",
"usb_manufacturer": "Raspberry Pi",
"usb_product": "Pico"
"usb_pid": "0x000a"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Raspberry Pi"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "seeed_xiao_rp2040",
"arduino": {
"earlephilhower": {
"variant": "seeed_xiao_rp2040",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x000a",
"usb_manufacturer": "Seeed",
"usb_product": "XAIO RP2040"
"usb_pid": "0x000a"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Seeed"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "solderparty_rp2040_stamp",
"arduino": {
"earlephilhower": {
"variant": "solderparty_rp2040_stamp",
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
"usb_vid": "0x1209",
"usb_pid": "0xa182",
"usb_manufacturer": "Solder Party",
"usb_product": "RP2040 Stamp"
"usb_pid": "0xa182"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Solder Party"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "sparkfun_promicrorp2040",
"arduino": {
"earlephilhower": {
"variant": "sparkfun_promicrorp2040",
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
"usb_vid": "0x1b4f",
"usb_pid": "0x0026",
"usb_manufacturer": "SparkFun",
"usb_product": "ProMicro RP2040"
"usb_pid": "0x0026"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "SparkFun"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "sparkfun_thingplusrp2040",
"arduino": {
"earlephilhower": {
"variant": "sparkfun_thingplusrp2040",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x1b4f",
"usb_pid": "0x0026",
"usb_manufacturer": "SparkFun",
"usb_product": "Thing Plus RP2040"
"usb_pid": "0x0026"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "SparkFun"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "upesy_rp2040_devkit",
"arduino": {
"earlephilhower": {
"variant": "upesy_rp2040_devkit",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x1007",
"usb_manufacturer": "uPesy",
"usb_product": "RP2040 DevKit"
"usb_pid": "0x1007"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "uPesy"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "wiznet_5100s_evb_pico",
"arduino": {
"earlephilhower": {
"variant": "wiznet_5100s_evb_pico",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x1027",
"usb_manufacturer": "WIZnet",
"usb_product": "W5100S-EVB-Pico"
"usb_pid": "0x1027"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "WIZnet"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "wiznet_5500_evb_pico",
"arduino": {
"earlephilhower": {
"variant": "wiznet_5500_evb_pico",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x1029",
"usb_manufacturer": "WIZnet",
"usb_product": "W5500-EVB-Pico"
"usb_pid": "0x1029"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "WIZnet"
}
}

View File

@ -11,14 +11,12 @@
]
],
"mcu": "rp2040",
"variant": "wiznet_wizfi360_evb_pico",
"arduino": {
"earlephilhower": {
"variant": "wiznet_wizfi360_evb_pico",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2e8a",
"usb_pid": "0x1028",
"usb_manufacturer": "WIZnet",
"usb_product": "WizFi360-EVB-Pico"
"usb_pid": "0x1028"
}
}
},
@ -49,4 +47,4 @@
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "WIZnet"
}
}

View File

@ -149,16 +149,19 @@ def fetch_fs_size(env):
flash_size = board.get("upload.maximum_size")
filesystem_size = board.get("build.filesystem_size", "0MB")
filesystem_size_int = convert_size_expression_to_int(filesystem_size)
# last 4K are allocated for EEPROM emulation in flash.
# see https://github.com/earlephilhower/arduino-pico/blob/3414b73172d307e9dc901f7fee83b41112f73457/libraries/EEPROM/EEPROM.cpp#L43-L46
eeprom_size = 4096
maximum_sketch_size = flash_size - 4096 - filesystem_size_int
maximum_sketch_size = flash_size - eeprom_size - filesystem_size_int
print("Flash size: %.2fMB" % (flash_size / 1024.0 / 1024.0))
print("Sketch size: %.2fMB" % (maximum_sketch_size / 1024.0 / 1024.0))
print("Filesystem size: %.2fMB" % (filesystem_size_int / 1024.0 / 1024.0))
eeprom_start = 0x10000000 + flash_size - 4096
fs_start = 0x10000000 + flash_size - 4096 - filesystem_size_int
fs_end = 0x10000000 + flash_size - 4096
eeprom_start = 0x10000000 + flash_size - eeprom_size
fs_start = 0x10000000 + flash_size - eeprom_size - filesystem_size_int
fs_end = 0x10000000 + flash_size - eeprom_size
if maximum_sketch_size <= 0:
sys.stderr.write(
@ -173,7 +176,7 @@ def fetch_fs_size(env):
env["PICO_EEPROM_START"] = eeprom_start
env["FS_START"] = fs_start
env["FS_END"] = fs_end
# LittleFS configuration paramters taken from
# LittleFS configuration parameters taken from
# https://github.com/earlephilhower/arduino-pico-littlefs-plugin/blob/master/src/PicoLittleFS.java
env["FS_PAGE"] = 256
env["FS_BLOCK"] = 4096
@ -207,7 +210,7 @@ env.Append(
)
# store function to get infno about filesystems for builder scripts.
env["fetch_fs_size"] = fetch_fs_size
env["__fetch_fs_size"] = fetch_fs_size
#
# Target: Build executable and linkable firmware
@ -246,9 +249,6 @@ if env.get("PIOMAINPROG"):
env.VerboseAction(
lambda source, target, env: _update_max_upload_size(env),
"Retrieving maximum program size $SOURCE"))
# remove after PIO Core 3.6 release
elif set(["checkprogsize", "upload"]) & set(COMMAND_LINE_TARGETS):
_update_max_upload_size(env)
#
# Target: Print binary size
@ -292,12 +292,11 @@ def UploadUF2ToDisk(target, source, env):
"Firmware has been successfully uploaded.\n"
"(Some boards may require manual hard reset)"
)
env.UploadUF2ToDisk = UploadUF2ToDisk
if upload_protocol == "mbed":
upload_actions = [
env.VerboseAction(env.AutodetectUploadPort, "Looking for upload disk..."),
env.VerboseAction(env.UploadUF2ToDisk, "Uploading $SOURCE")
env.VerboseAction(UploadUF2ToDisk, "Uploading $SOURCE")
]
elif upload_protocol == "picotool":
env.Replace(
@ -313,7 +312,7 @@ elif upload_protocol == "picotool":
"load",
"--verify"
],
UPLOADCMD="$UPLOADER $UPLOADERFLAGS $SOURCES --offset ${hex(FS_START)}",
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS $SOURCES --offset ${hex(FS_START)}',
)
upload_actions = [

View File

@ -1 +0,0 @@
.pio

View File

@ -1,21 +0,0 @@
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-raspberrypi/archive/develop.zip)
3. Extract ZIP archive
4. Run these commands:
```shell
# Change directory to example
$ cd platform-raspberrypi/examples/arduino-blink-earlephilhower
# Build project
$ pio run
# Upload firmware
$ pio run --target upload
# Clean build files
$ pio run --target clean
```

View File

@ -1,39 +0,0 @@
This directory is intended for project header files.
A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.
```src/main.c
#include "header.h"
int main (void)
{
...
}
```
Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.
In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.
Read more about using header files in official GCC documentation:
* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html

View File

@ -1,46 +0,0 @@
This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into executable file.
The source code of each library should be placed in a an own separate directory
("lib/your_library_name/[here are source files]").
For example, see a structure of the following two libraries `Foo` and `Bar`:
|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- README --> THIS FILE
|
|- platformio.ini
|--src
|- main.c
and a contents of `src/main.c`:
```
#include <Foo.h>
#include <Bar.h>
int main (void)
{
...
}
```
PlatformIO Library Dependency Finder will find automatically dependent
libraries scanning project source files.
More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html

View File

@ -1,35 +0,0 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter, extra scripting
; Upload options: custom port, speed and extra flags
; Library options: dependencies, extra library storages
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env]
platform = raspberrypi
framework = arduino
[env:pico]
board = pico
; "pico" board can use both mbed and earlephilhower core, must select here
board_build.core = earlephilhower
[env:nanorp2040connect]
board = nanorp2040connect
; "nanorp2040connect" board can use both mbed and earlephilhower core, must select here
board_build.core = earlephilhower
; earlephilhower-only boards
[env:rpipico]
board = rpipico
[env:adafruit_feather]
board = adafruit_feather
[env:seeed_xiao_rp2040]
board = seeed_xiao_rp2040
[env:sparkfun_thingplusrp2040]
board = sparkfun_thingplusrp2040

View File

@ -1,15 +0,0 @@
#include <Arduino.h>
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

View File

@ -1,11 +0,0 @@
This directory is intended for PIO Unit Testing and project tests.
Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated
control data, usage procedures, and operating procedures, are tested to
determine whether they are fit for use. Unit testing finds problems early
in the development cycle.
More information about PIO Unit Testing:
- https://docs.platformio.org/page/plus/unit-testing.html

View File

@ -19,3 +19,11 @@ $ pio run --target upload
# Clean build files
$ pio run --target clean
```
## Notes
For Raspberry Pi Pico devices, two Arduino cores exist:
* https://github.com/arduino/ArduinoCore-mbed
* https://github.com/earlephilhower/arduino-pico
This examples showcases how to use both of these cores in the `platformio.ini`.

View File

@ -16,3 +16,26 @@ board = pico
[env:nanorp2040connect]
board = nanorp2040connect
[env:pico_earle]
board = pico
; "pico" board can use both mbed and earlephilhower core, must select here
board_build.core = earlephilhower
[env:nanorp2040connect_earle]
board = nanorp2040connect
; "nanorp2040connect" board can use both mbed and earlephilhower core, must select here
board_build.core = earlephilhower
; earlephilhower-only boards
[env:rpipico]
board = rpipico
[env:adafruit_feather]
board = adafruit_feather
[env:seeed_xiao_rp2040]
board = seeed_xiao_rp2040
[env:sparkfun_thingplusrp2040]
board = sparkfun_thingplusrp2040

View File

@ -47,7 +47,7 @@
"type": "framework",
"optional": true,
"owner": "earlephilhower",
"version": "https://github.com/earlephilhower/arduino-pico.git"
"version": "https://github.com/maxgerhardt/arduino-pico.git"
},
"tool-rp2040tools": {
"type": "uploader",
@ -64,7 +64,7 @@
"type": "uploader",
"optional": true,
"owner": "platformio",
"version": "~1.72000.0"
"version": "^1.72000.0"
},
"tool-mklittlefs-rp2040-earlephilhower": {
"type": "uploader",

View File

@ -49,7 +49,7 @@ class RaspberrypiPlatform(PlatformBase):
# if we want to build a filesystem, we need the tools.
if "buildfs" in targets:
self.packages['tool-mklittlefs-rp2040-earlephilhower']['optional'] = False
self.packages["tool-mklittlefs-rp2040-earlephilhower"]["optional"] = False
# configure J-LINK tool
jlink_conds = [