Redo boards menu, separate out upload method, add picotool upload (#1112)
Instead of listing each board three times (normal upload, picoprobe, and pico-debug uploads), list each board once and use a menu to select the actual upload method. Also add in picotool as an upload method for those folks who have trouble with automounting. Fix #1111
This commit is contained in:
parent
ff9f5d3809
commit
ae386d4308
8 changed files with 1540 additions and 18792 deletions
20033
boards.txt
20033
boards.txt
File diff suppressed because it is too large
Load diff
|
|
@ -33,6 +33,10 @@
|
|||
#include "hardware/irq.h"
|
||||
#include "pico/mutex.h"
|
||||
#include "pico/unique_id.h"
|
||||
#include "pico/usb_reset_interface.h"
|
||||
#include "hardware/watchdog.h"
|
||||
#include "pico/bootrom.h"
|
||||
#include <device/usbd_pvt.h>
|
||||
|
||||
// Big, global USB mutex, shared with all USB devices to make sure we don't
|
||||
// have multiple cores updating the TUSB state in parallel
|
||||
|
|
@ -67,6 +71,7 @@ static int __usb_task_irq;
|
|||
#define USBD_STR_PRODUCT (0x02)
|
||||
#define USBD_STR_SERIAL (0x03)
|
||||
#define USBD_STR_CDC (0x04)
|
||||
#define USBD_STR_RPI_RESET (0x05)
|
||||
|
||||
#define EPNUM_HID 0x83
|
||||
|
||||
|
|
@ -74,6 +79,11 @@ static int __usb_task_irq;
|
|||
#define USBD_MSC_EPIN 0x84
|
||||
#define USBD_MSC_EPSIZE 64
|
||||
|
||||
#define TUD_RPI_RESET_DESCRIPTOR(_itfnum, _stridx) \
|
||||
/* Interface */\
|
||||
9, TUSB_DESC_INTERFACE, _itfnum, 0, 0, TUSB_CLASS_VENDOR_SPECIFIC, RESET_INTERFACE_SUBCLASS, RESET_INTERFACE_PROTOCOL, _stridx,
|
||||
|
||||
|
||||
const uint8_t *tud_descriptor_device_cb(void) {
|
||||
static tusb_desc_device_t usbd_desc_device = {
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
|
|
@ -250,6 +260,14 @@ void __SetupUSBDescriptor() {
|
|||
|
||||
int usbd_desc_len = TUD_CONFIG_DESC_LEN + (__USBInstallSerial ? sizeof(cdc_desc) : 0) + (hasHID ? sizeof(hid_desc) : 0) + (__USBInstallMassStorage ? sizeof(msd_desc) : 0);
|
||||
|
||||
#ifdef ENABLE_PICOTOOL_USB
|
||||
uint8_t picotool_itf = interface_count++;
|
||||
uint8_t picotool_desc[] = {
|
||||
TUD_RPI_RESET_DESCRIPTOR(picotool_itf, USBD_STR_RPI_RESET)
|
||||
};
|
||||
usbd_desc_len += sizeof(picotool_desc);
|
||||
#endif
|
||||
|
||||
uint8_t tud_cfg_desc[TUD_CONFIG_DESC_LEN] = {
|
||||
// Config number, interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, interface_count, USBD_STR_0, usbd_desc_len, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, USBD_MAX_POWER_MA)
|
||||
|
|
@ -274,6 +292,10 @@ void __SetupUSBDescriptor() {
|
|||
memcpy(ptr, msd_desc, sizeof(msd_desc));
|
||||
ptr += sizeof(msd_desc);
|
||||
}
|
||||
#ifdef ENABLE_PICOTOOL_USB
|
||||
memcpy(ptr, picotool_desc, sizeof(picotool_desc));
|
||||
ptr += sizeof(picotool_desc);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -291,6 +313,9 @@ const uint16_t *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
|||
[USBD_STR_PRODUCT] = "PicoArduino",
|
||||
[USBD_STR_SERIAL] = idString,
|
||||
[USBD_STR_CDC] = "Board CDC",
|
||||
#ifdef ENABLE_PICOTOOL_USB
|
||||
[USBD_STR_RPI_RESET] = "Reset",
|
||||
#endif
|
||||
};
|
||||
|
||||
if (!idString[0]) {
|
||||
|
|
@ -432,4 +457,84 @@ extern "C" void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t pr
|
|||
}
|
||||
|
||||
|
||||
|
||||
#ifdef ENABLE_PICOTOOL_USB
|
||||
|
||||
static uint8_t _picotool_itf_num;
|
||||
|
||||
static void resetd_init() {
|
||||
}
|
||||
|
||||
static void resetd_reset(uint8_t rhport) {
|
||||
(void) rhport;
|
||||
_picotool_itf_num = 0;
|
||||
}
|
||||
|
||||
static uint16_t resetd_open(uint8_t rhport,
|
||||
tusb_desc_interface_t const *itf_desc, uint16_t max_len) {
|
||||
(void) rhport;
|
||||
TU_VERIFY(TUSB_CLASS_VENDOR_SPECIFIC == itf_desc->bInterfaceClass &&
|
||||
RESET_INTERFACE_SUBCLASS == itf_desc->bInterfaceSubClass &&
|
||||
RESET_INTERFACE_PROTOCOL == itf_desc->bInterfaceProtocol, 0);
|
||||
|
||||
uint16_t const drv_len = sizeof(tusb_desc_interface_t);
|
||||
TU_VERIFY(max_len >= drv_len, 0);
|
||||
|
||||
_picotool_itf_num = itf_desc->bInterfaceNumber;
|
||||
return drv_len;
|
||||
}
|
||||
|
||||
// Support for parameterized reset via vendor interface control request
|
||||
static bool resetd_control_xfer_cb(uint8_t rhport, uint8_t stage,
|
||||
tusb_control_request_t const *request) {
|
||||
(void) rhport;
|
||||
// nothing to do with DATA & ACK stage
|
||||
if (stage != CONTROL_STAGE_SETUP) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (request->wIndex == _picotool_itf_num) {
|
||||
if (request->bRequest == RESET_REQUEST_BOOTSEL) {
|
||||
reset_usb_boot(0, (request->wValue & 0x7f));
|
||||
// does not return, otherwise we'd return true
|
||||
}
|
||||
|
||||
if (request->bRequest == RESET_REQUEST_FLASH) {
|
||||
watchdog_reboot(0, 0, 100);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool resetd_xfer_cb(uint8_t rhport, uint8_t ep_addr,
|
||||
xfer_result_t result, uint32_t xferred_bytes) {
|
||||
(void) rhport;
|
||||
(void) ep_addr;
|
||||
(void) result;
|
||||
(void) xferred_bytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
static usbd_class_driver_t const _resetd_driver = {
|
||||
#if CFG_TUSB_DEBUG >= 2
|
||||
.name = "RESET",
|
||||
#endif
|
||||
.init = resetd_init,
|
||||
.reset = resetd_reset,
|
||||
.open = resetd_open,
|
||||
.control_xfer_cb = resetd_control_xfer_cb,
|
||||
.xfer_cb = resetd_xfer_cb,
|
||||
.sof = NULL
|
||||
};
|
||||
|
||||
// Implement callback to add our custom driver
|
||||
usbd_class_driver_t const *usbd_app_driver_get_cb(uint8_t *driver_count) {
|
||||
*driver_count = 1;
|
||||
return &_resetd_driver;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -135,6 +135,22 @@ For detailed usage information, please check the repo documentation available at
|
|||
|
||||
* https://arduino-pico.readthedocs.io/en/latest/fs.html
|
||||
|
||||
Uploading Sketches with Picotool
|
||||
--------------------------------
|
||||
Because the Picotool uses a custom device driver in the Pico to handle upload, when using the ``Upload Method->Picotool`` mode custom code needs to be run on the Pico which is not included by default for compatibility and code savings.
|
||||
|
||||
So for the first sketch you will need to rebuild (with the ``Upload Method->Picotool`` selected in them menus) and then manually hold down BOOTSEL and insert the Pico USB cable to enter the ROM bootloader.
|
||||
|
||||
After the initial upload, as long as the running binary was built using the ``Picotool`` upload method, then the normal upload process should work.
|
||||
|
||||
Note that for Ubuntu and other Linux operating systems you may need to add the following lines to a new `udev` config file(``99-picotool.rules``) to allow normal users to access the special USB device the Pico exports:
|
||||
|
||||
.. code::
|
||||
|
||||
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0003", MODE="660", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/98-Picotool.rules
|
||||
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="000a", MODE="660", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/98-Picotool.rules
|
||||
sudo udevadm control --reload
|
||||
|
||||
Uploading Sketches with Picoprobe
|
||||
---------------------------------
|
||||
If you have built a Raspberry Pi Picoprobe, you can use OpenOCD to handle your sketch uploads and for debugging with GDB.
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
-iwithprefixbefore/pico-sdk/src/common/pico_stdlib/include
|
||||
-iwithprefixbefore/pico-sdk/src/common/pico_sync/include
|
||||
-iwithprefixbefore/pico-sdk/src/common/pico_time/include
|
||||
-iwithprefixbefore/pico-sdk/src/common/pico_usb_reset_interface/include
|
||||
-iwithprefixbefore/pico-sdk/src/common/pico_util/include
|
||||
-iwithprefixbefore/pico-sdk/src/rp2040/hardware_regs/include
|
||||
-iwithprefixbefore/pico-sdk/src/rp2040/hardware_structs/include
|
||||
|
|
|
|||
|
|
@ -111,6 +111,8 @@ sed 's/^tools.uf2conv.network_cmd=.*//g' | \
|
|||
sed 's/^#tools.uf2conv.network_cmd=/tools.uf2conv.network_cmd=/g' | \
|
||||
sed 's/^tools.picoprobe.cmd=.*//g' | \
|
||||
sed 's/^#tools.picoprobe.cmd=/tools.picoprobe.cmd=/g' | \
|
||||
sed 's/^tools.picotool.cmd=.*//g' | \
|
||||
sed 's/^#tools.picotool.cmd=/tools.picotool.cmd=/g' | \
|
||||
sed 's/^tools.picodebug.cmd=.*//g' | \
|
||||
sed 's/^#tools.picodebug.cmd=/tools.picodebug.cmd=/g' | \
|
||||
sed 's/^discovery.rp2040.pattern=.*//g' | \
|
||||
|
|
|
|||
|
|
@ -192,6 +192,11 @@
|
|||
"packager": "rp2040",
|
||||
"version": "1.5.0-a-5007782",
|
||||
"name": "pqt-openocd"
|
||||
},
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "1.5.0-a-03f2812",
|
||||
"name": "pqt-picotool"
|
||||
}
|
||||
],
|
||||
"help": {
|
||||
|
|
@ -200,6 +205,61 @@
|
|||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"version": "1.5.0-a-03f2812",
|
||||
"name": "pqt-picotool",
|
||||
"systems": [
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-a/aarch64-linux-gnu.picotool-03f2812.230113.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.picotool-03f2812.230113.tar.gz",
|
||||
"checksum": "SHA-256:3816240a6aef8da61895227df3b1b5d7a7f95456a9e7737e25252886f649d2f3",
|
||||
"size": "171807"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-a/arm-linux-gnueabihf.picotool-03f2812.230113.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.picotool-03f2812.230113.tar.gz",
|
||||
"checksum": "SHA-256:454e1a0ce9a546626bca73cdff74dfb0e06bf6603b13d5a3a4a4f0c0968fd65d",
|
||||
"size": "152809"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-a/i686-linux-gnu.picotool-03f2812.230113.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.picotool-03f2812.230113.tar.gz",
|
||||
"checksum": "SHA-256:fee7f93d65bb3db42a9fcf5683e2b038ab13875b1d5bedb304facb92e6469a37",
|
||||
"size": "183571"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-a/i686-w64-mingw32.picotool-03f2812.230112.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.picotool-03f2812.230112.zip",
|
||||
"checksum": "SHA-256:8a37063d44e306b9315618962cd8dc14b815e998ba960a38099e45bb14bcda90",
|
||||
"size": "352766"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-a/x86_64-apple-darwin14.picotool-03f2812.230112.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.picotool-03f2812.230112.tar.gz",
|
||||
"checksum": "SHA-256:5b2f77ee33a7a757546ab526d3e477300bf01e787e645f64aa86daac6b19a510",
|
||||
"size": "852449"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-a/x86_64-linux-gnu.picotool-03f2812.230113.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.picotool-03f2812.230113.tar.gz",
|
||||
"checksum": "SHA-256:c6168c6948ec781ead9637ecddc357004aa0fbaca19a634a48fbfc4e48860d1a",
|
||||
"size": "131509"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-a/x86_64-w64-mingw32.picotool-03f2812.230112.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.picotool-03f2812.230112.zip",
|
||||
"checksum": "SHA-256:a5bded215b886bc8dc35520d2ae696c56e370ef6e92ca7d3a47fe82db362afa7",
|
||||
"size": "337118"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.5.0-a-5007782",
|
||||
"name": "pqt-openocd",
|
||||
|
|
|
|||
10
platform.txt
10
platform.txt
|
|
@ -28,6 +28,7 @@ runtime.tools.pqt-mklittlefs.path={runtime.platform.path}/system/mklittlefs
|
|||
runtime.tools.pqt-pioasm.path={runtime.platform.path}/system/pioasm
|
||||
runtime.tools.pqt-elf2uf2.path={runtime.platform.path}/system/elf2uf2
|
||||
runtime.tools.pqt-openocd.path={runtime.platform.path}/system/openocd
|
||||
runtime.tools.pqt-picotool.path={runtime.platform.path}/system/picotool
|
||||
compiler.path={runtime.tools.pqt-gcc.path}/bin/
|
||||
|
||||
compiler.libraries.ldflags=
|
||||
|
|
@ -44,7 +45,7 @@ compiler.warning_flags.all=-Wall -Wextra -Werror=return-type -Wno-ignored-qualif
|
|||
compiler.netdefines=-DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_LWIP=0 {build.lwipdefs} -DLWIP_IGMP=1 -DLWIP_CHECKSUM_CTRL_PER_NETIF=1
|
||||
compiler.defines={build.led} {build.usbstack_flags} -DCFG_TUSB_MCU=OPT_MCU_RP2040 -DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' {compiler.netdefines} -DARDUINO_VARIANT="{build.variant}" -DTARGET_RP2040
|
||||
compiler.includes="-iprefix{runtime.platform.path}/" "@{runtime.platform.path}/lib/platform_inc.txt" "-I{runtime.platform.path}/include"
|
||||
compiler.flags=-march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections {build.flags.exceptions} {build.flags.stackprotect} {build.flags.cmsis}
|
||||
compiler.flags=-march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections {build.flags.exceptions} {build.flags.stackprotect} {build.flags.cmsis} {build.picodebugflags}
|
||||
compiler.wrap="@{runtime.platform.path}/lib/platform_wrap.txt"
|
||||
compiler.libbearssl="{runtime.platform.path}/lib/libbearssl.a"
|
||||
|
||||
|
|
@ -97,6 +98,7 @@ build.boot2=boot2_generic_03h_4_padded_checksum
|
|||
build.lwipdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1
|
||||
build.wificc=-DWIFICC=CYW43_COUNTRY_WORLDWIDE
|
||||
build.debugscript=picoprobe.tcl
|
||||
build.picodebugflags=
|
||||
|
||||
# Allow Pico boards do be auto-discovered by the IDE
|
||||
#discovery.rp2040.pattern={runtime.tools.pqt-python3.path}/python3 -I "{runtime.platform.path}/tools/pluggable_discovery.py"
|
||||
|
|
@ -187,6 +189,12 @@ tools.uf2conv-network.upload.params.verbose=
|
|||
tools.uf2conv-network.upload.params.quiet=
|
||||
tools.uf2conv-network.upload.pattern="{cmd}" -I "{runtime.platform.path}/tools/espota.py" -i "{upload.port.address}" -p "{upload.port.properties.port}" "--auth={upload.field.password}" -f "{build.path}/{build.project_name}.bin"
|
||||
|
||||
#tools.picotool.cmd={runtime.tools.pqt-picotool.path}
|
||||
tools.picotool.cmd={runtime.platform.path}/system/picotool
|
||||
tools.picotool.upload.protocol=picotool
|
||||
tools.picotool.upload.params.verbose=
|
||||
tools.picotool.upload.params.quiet=
|
||||
tools.picotool.upload.pattern="{cmd}/picotool" load "{build.path}/{build.project_name}.uf2" -f
|
||||
|
||||
#tools.picoprobe.cmd={runtime.tools.pqt-openocd.path}
|
||||
tools.picoprobe.cmd={runtime.platform.path}/system/openocd
|
||||
|
|
|
|||
|
|
@ -79,8 +79,6 @@ def BuildUSBStack(name):
|
|||
print('%s.menu.usbstack.picosdk.build.usbstack_flags=' % (name))
|
||||
print("%s.menu.usbstack.tinyusb=Adafruit TinyUSB" % (name))
|
||||
print('%s.menu.usbstack.tinyusb.build.usbstack_flags=-DUSE_TINYUSB "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"' % (name))
|
||||
|
||||
def BuildWithoutUSBStack(name):
|
||||
print("%s.menu.usbstack.nousb=No USB" % (name))
|
||||
print('%s.menu.usbstack.nousb.build.usbstack_flags="-DNO_USB -DDISABLE_USB_SERIAL -I{runtime.platform.path}/tools/libpico"' % (name))
|
||||
|
||||
|
|
@ -103,7 +101,26 @@ def BuildIPStack(name):
|
|||
print('%s.menu.ipstack.ipv4ipv6.build.libpico=libpico-ipv6.a' % (name))
|
||||
print('%s.menu.ipstack.ipv4ipv6.build.lwipdefs=-DLWIP_IPV6=1 -DLWIP_IPV4=1' % (name))
|
||||
|
||||
def BuildHeader(name, vendor_name, product_name, vidtouse, pidtouse, vid, pid, pwr, boarddefine, variant, uploadtool, networkuploadtool, flashsize, ramsize, boot2, dbg, extra):
|
||||
def BuildUploadMethodMenu(name):
|
||||
for a, b, c, d, e, f in [ ["default", "Default (UF2)", 256, "picoprobe.tcl", "uf2conv", "uf2conv-network"],
|
||||
["picotool", "Picotool", 256, "picoprobe.tcl", "picotool", None],
|
||||
["picoprobe", "Picoprobe", 256, "picoprobe.tcl", "picoprobe", None],
|
||||
["picodebug", "Pico-Debug", 240, "picodebug.tcl", "picodebug", None] ]:
|
||||
print("%s.menu.uploadmethod.%s=%s" % (name, a, b))
|
||||
print("%s.menu.uploadmethod.%s.build.ram_length=%dk" % (name, a, c))
|
||||
print("%s.menu.uploadmethod.%s.build.debugscript=%s" % (name, a, d))
|
||||
# For pico-debug, need to disable USB unconditionally
|
||||
if a == "picodebug":
|
||||
print("%s.menu.uploadmethod.%s.build.picodebugflags=-UUSE_TINYUSB -DNO_USB -DDISABLE_USB_SERIAL -I{runtime.platform.path}/tools/libpico" % (name, a))
|
||||
elif a == "picotool":
|
||||
print("%s.menu.uploadmethod.%s.build.picodebugflags=-DENABLE_PICOTOOL_USB" % (name, a))
|
||||
print("%s.menu.uploadmethod.%s.upload.maximum_data_size=%d" % (name, a, c * 1024))
|
||||
print("%s.menu.uploadmethod.%s.upload.tool=%s" % (name, a, e))
|
||||
print("%s.menu.uploadmethod.%s.upload.tool.default=%s" % (name, a, e))
|
||||
if f != None:
|
||||
print("%s.menu.uploadmethod.%s.upload.tool.network=%s" % (name, a, f))
|
||||
|
||||
def BuildHeader(name, vendor_name, product_name, vid, pid, pwr, boarddefine, variant, flashsize, boot2, extra):
|
||||
prettyname = vendor_name + " " + product_name
|
||||
print()
|
||||
print("# -----------------------------------")
|
||||
|
|
@ -111,17 +128,17 @@ def BuildHeader(name, vendor_name, product_name, vidtouse, pidtouse, vid, pid, p
|
|||
print("# -----------------------------------")
|
||||
print("%s.name=%s" % (name, prettyname))
|
||||
usb = 0
|
||||
if type(pidtouse) == list:
|
||||
if type(pid) == list:
|
||||
for tp in pid:
|
||||
print("%s.vid.%d=%s" % (name, usb, vidtouse))
|
||||
print("%s.vid.%d=%s" % (name, usb, vid))
|
||||
print("%s.pid.%d=0x%04x" % (name, usb, int(tp, 16)))
|
||||
usb = usb + 1
|
||||
else:
|
||||
for kb in [ "0", "0x8000" ]:
|
||||
for ms in [ "0", "0x4000" ]:
|
||||
for jy in [ "0", "0x0100" ]:
|
||||
thispid = int(pidtouse, 16) | int(kb, 16) | int(ms, 16) | int(jy, 16)
|
||||
print("%s.vid.%d=%s" % (name, usb, vidtouse))
|
||||
thispid = int(pid, 16) | int(kb, 16) | int(ms, 16) | int(jy, 16)
|
||||
print("%s.vid.%d=%s" % (name, usb, vid))
|
||||
print("%s.pid.%d=0x%04x" % (name, usb, thispid))
|
||||
usb = usb + 1
|
||||
if type(pid) == list:
|
||||
|
|
@ -132,12 +149,7 @@ def BuildHeader(name, vendor_name, product_name, vidtouse, pidtouse, vid, pid, p
|
|||
print("%s.build.board=%s" % (name, boarddefine))
|
||||
print("%s.build.mcu=cortex-m0plus" % (name))
|
||||
print("%s.build.variant=%s" % (name, variant))
|
||||
print("%s.upload.tool=%s" % (name, uploadtool))
|
||||
print("%s.upload.tool.default=%s" % (name, uploadtool))
|
||||
if networkuploadtool != None:
|
||||
print("%s.upload.tool.network=%s" % (name, networkuploadtool))
|
||||
print("%s.upload.maximum_size=%d" % (name, flashsize))
|
||||
print("%s.upload.maximum_data_size=%d" % (name, ramsize))
|
||||
print("%s.upload.wait_for_upload_port=true" % (name))
|
||||
print("%s.upload.erase_cmd=" % (name))
|
||||
print("%s.serial.disableDTR=false" % (name))
|
||||
|
|
@ -146,8 +158,6 @@ def BuildHeader(name, vendor_name, product_name, vidtouse, pidtouse, vid, pid, p
|
|||
print("%s.build.led=" % (name))
|
||||
print("%s.build.core=rp2040" % (name))
|
||||
print("%s.build.ldscript=memmap_default.ld" % (name))
|
||||
print("%s.build.ram_length=%dk" % (name, ramsize / 1024))
|
||||
print("%s.build.debugscript=%s" % (name, dbg))
|
||||
print("%s.build.boot2=%s" % (name, boot2))
|
||||
print("%s.build.vid=%s" % (name, vid))
|
||||
if type(pid) == list:
|
||||
|
|
@ -182,49 +192,34 @@ def BuildGlobalMenuList():
|
|||
print("menu.wificountry=WiFi Region")
|
||||
print("menu.usbstack=USB Stack")
|
||||
print("menu.ipstack=IP Stack")
|
||||
print("menu.uploadmethod=Upload Method")
|
||||
|
||||
def MakeBoard(name, vendor_name, product_name, vid, pid, pwr, boarddefine, flashsizemb, boot2, extra = None):
|
||||
for a, b, c, d in [ ["", "", "uf2conv", "uf2conv-network"], ["picoprobe", " (Picoprobe)", "picoprobe", None], ["picodebug", " (pico-debug)", "picodebug", None]]:
|
||||
n = name + a
|
||||
p = product_name + b
|
||||
fssizelist = [ 0, 64 * 1024, 128 * 1024, 256 * 1024, 512 * 1024 ]
|
||||
for i in range(1, flashsizemb):
|
||||
fssizelist.append(i * 1024 * 1024)
|
||||
vidtouse = vid;
|
||||
ramsizekb = 256;
|
||||
dbg = "picoprobe.tcl"
|
||||
if a == "picoprobe":
|
||||
pidtouse = '0x0004'
|
||||
elif a == "picodebug":
|
||||
vidtouse = '0x1209'
|
||||
pidtouse = '0x2488'
|
||||
ramsizekb = 240;
|
||||
dbg = "picodebug.tcl"
|
||||
else:
|
||||
pidtouse = pid
|
||||
BuildHeader(n, vendor_name, p, vidtouse, pidtouse, vid, pid, pwr, boarddefine, name, c, d, flashsizemb * 1024 * 1024, ramsizekb * 1024, boot2, dbg, extra)
|
||||
if name == "generic":
|
||||
BuildFlashMenu(n, 2*1024*1024, [0, 1*1024*1024])
|
||||
BuildFlashMenu(n, 4*1024*1024, [0, 2*1024*1024])
|
||||
BuildFlashMenu(n, 8*1024*1024, [0, 4*1024*1024])
|
||||
BuildFlashMenu(n, 16*1024*1024, [0, 8*1024*1024])
|
||||
else:
|
||||
BuildFlashMenu(n, flashsizemb * 1024 * 1024, fssizelist)
|
||||
BuildFreq(n)
|
||||
BuildOptimize(n)
|
||||
BuildRTTI(n)
|
||||
BuildStackProtect(n)
|
||||
BuildExceptions(n)
|
||||
BuildDebugPort(n)
|
||||
BuildDebugLevel(n)
|
||||
if a != "picodebug":
|
||||
BuildUSBStack(n)
|
||||
BuildWithoutUSBStack(n)
|
||||
if name == "rpipicow":
|
||||
BuildCountry(n)
|
||||
BuildIPStack(n)
|
||||
if name == "generic":
|
||||
BuildBoot(n)
|
||||
fssizelist = [ 0, 64 * 1024, 128 * 1024, 256 * 1024, 512 * 1024 ]
|
||||
for i in range(1, flashsizemb):
|
||||
fssizelist.append(i * 1024 * 1024)
|
||||
BuildHeader(name, vendor_name, product_name, vid, pid, pwr, boarddefine, name, flashsizemb * 1024 * 1024, boot2, extra)
|
||||
if name == "generic":
|
||||
BuildFlashMenu(name, 2*1024*1024, [0, 1*1024*1024])
|
||||
BuildFlashMenu(name, 4*1024*1024, [0, 2*1024*1024])
|
||||
BuildFlashMenu(name, 8*1024*1024, [0, 4*1024*1024])
|
||||
BuildFlashMenu(name, 16*1024*1024, [0, 8*1024*1024])
|
||||
else:
|
||||
BuildFlashMenu(name, flashsizemb * 1024 * 1024, fssizelist)
|
||||
BuildFreq(name)
|
||||
BuildOptimize(name)
|
||||
BuildRTTI(name)
|
||||
BuildStackProtect(name)
|
||||
BuildExceptions(name)
|
||||
BuildDebugPort(name)
|
||||
BuildDebugLevel(name)
|
||||
BuildUSBStack(name)
|
||||
if name == "rpipicow":
|
||||
BuildCountry(name)
|
||||
BuildIPStack(name)
|
||||
if name == "generic":
|
||||
BuildBoot(name)
|
||||
BuildUploadMethodMenu(name)
|
||||
MakeBoardJSON(name, vendor_name, product_name, vid, pid, pwr, boarddefine, flashsizemb, boot2, extra)
|
||||
global pkgjson
|
||||
thisbrd = {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue