Unverified Commit 481ee1c9 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Merge pull request #55 from earlephilhower/openocd

Add picoprobe upload support, cleanup up boards
parents 8dcad984 1290f72e
# Arduino-Pico [![Join the chat at https://gitter.im/arduino-pico/community](https://badges.gitter.im/arduino-pico/community.svg)](https://gitter.im/arduino-pico/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Raspberry Pi Pico Arduino core, for all RP2040 boards
This is a port of the RP2040 (Raspberry Pi Pico processor) to the Arduino ecosystem.
......@@ -67,18 +66,36 @@ Them hit the upload button and your sketch should upload and run.
In some cases the Pico will encounter a hard hang and its USB port will not respond to the auto-reset request. Should this happen, just
follow the initial procedure of holding the BOOTSEL button down while plugging in the Pico to enter the ROM bootloader.
# Uploading with Picoprobe
If you have built a Raspberry Pi Picoprobe, you can use OpenOCD to handle your sketch uploads and for debugging with GDB.
Under Windows a local admin user should be able to access the Picoprobe port automatically, but under Linux `udev` must be told about the device and to allow normal users access.
To set up user-level access to Picoprobes on Ubuntu (and other OSes which use `udev`):
````
echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", GROUP="users", MODE="0666"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
sudo udevadm control --reload
````
The first line creates a file with the USB vendor and ID of the Picoprobe and tells UDEV to give users full access to it. The second causes `udev` to load this new rule. Note that you will need to unplug and re-plug in your device the first time you create this file, to allow udev to make the device node properly.
Once Picoprobe permissions are set up properly, then select the board "Raspberry Pi Pico (Picoprobe)" in the Tools menu and upload as normal.
# Debugging with Picoprobe, OpenOCD, and GDB
The installed tools include a version of OpenOCD (in the pqt-openocd directory) and GDB (in the pqt-gcc directory). These may be used to run GDB in an interactive window as documented in the Pico Getting Started manuals from the Raspberry Pi Foundation.
# Status of Port
Lots of things are working now!
* digitalWrite/Read (basic sanity tested)
* shiftIn/Out (tested using Nokia5110 https://github.com/ionpan/Nokia5110)
* SPI (tested using SdFat 2.0 https://github.com/greiman/SdFat ... note that the Pico voltage regulator can't reliably supply enough power for a SD Card so use external power, and adjust the `USE_SIMPLE_LITTLE_ENDIAN` define in `src/sdfat.h` to 0)
* analogWrite/PWM (tested using Fade.ino)
* tone/noTone (using IRQ generated waveform)
Relatively stable and very functional, but bug reports and PRs always accepted.
* digitalWrite/Read
* shiftIn/Out
* SPI master (tested using SdFat 2.0 https://github.com/greiman/SdFat ... note that the Pico voltage regulator can't reliably supply enough power for a SD Card so use external power, and adjust the `USE_SIMPLE_LITTLE_ENDIAN` define in `src/sdfat.h` to 0)
* analogWrite/PWM
* tone/noTone
* Wire/I2C Master and Slave (tested using DS3231 https://github.com/rodan/ds3231)
* EEPROM (tested examples)
* EEPROM
* USB Serial(ACM) w/automatic reboot-to-UF2 upload)
* Hardware UART
* Servo (basic waveform testing, disables/re-enables without any short pulses)
* Servo
* Overclocking and underclocking from the menus
* printf (i.e. debug) output over USB serial
......@@ -95,7 +112,7 @@ Some major features I want to add are:
# Tutorials from Across the Web
Here are some links to coverage and additional tutorials for using `arduino-pico`
* Arduino Support for the Pi Pico available! And how fast is the Pico? - https://youtu.be/-XHh17cuH5E
* Pre-release Adafruit QT Pi RP2040 - https://www.youtube.com/watch?v=sfC1msqXX0I
* Pre-release Adafruit QT Py RP2040 - https://www.youtube.com/watch?v=sfC1msqXX0I
# Contributing
If you want to contribute or have bugfixes, drop me a note at <earlephilhower@yahoo.com> or open an issue/PR here.
......
This diff is collapsed.
......@@ -94,6 +94,8 @@ cat $srcdir/platform.txt | \
$SED 's/^runtime.tools.pqt-.*.path=.*//g' | \
$SED 's/^tools.uf2conv.cmd=.*//g' | \
$SED 's/^#tools.uf2conv.cmd=/tools.uf2conv.cmd=/g' | \
$SED 's/^tools.picoprobe.cmd=.*//g' | \
$SED 's/^#tools.picoprobe.cmd=/tools.picoprobe.cmd=/g' | \
$SED "s/version=.*/version=$ver/g" |\
$SED -E "s/name=([a-zA-Z0-9\ -]+).*/name=\1($ver)/g"\
> $outdir/platform.txt
......
......@@ -129,9 +129,15 @@ tools.uf2conv.path=
# "{runtime.tools.pqt-python3.path}/python3" for JSON board manager releases.
#tools.uf2conv.cmd={runtime.tools.pqt-python3.path}/python3
tools.uf2conv.cmd={runtime.platform.path}/system/python3/python3
tools.uf2conv.upload.protocol=uf2
tools.uf2conv.upload.params.verbose=
tools.uf2conv.upload.params.quiet=
tools.uf2conv.upload.pattern="{cmd}" "{runtime.platform.path}/tools/uf2conv.py" --serial "{serial.port}" --family RP2040 --deploy "{build.path}/{build.project_name}.uf2"
#tools.picoprobe.cmd={runtime.tools.pqt-openocd.path}
tools.picoprobe.cmd={runtime.platform.path}/system/openocd
tools.picoprobe.upload.protocol=picoprobe
tools.picoprobe.upload.params.verbose=
tools.picoprobe.upload.params.quiet=
tools.picoprobe.upload.pattern="{cmd}/bin/openocd" -f "interface/picoprobe.cfg" -f "target/rp2040.cfg" -s "{cmd}/share/openocd/scripts" -c "program {build.path}/{build.project_name}.elf verify reset exit"
......@@ -64,22 +64,22 @@ def BuildGlobalMenuList():
print("menu.dbgport=Debug Port")
print("menu.dbglvl=Debug Level")
BuildGlobalMenuList()
BuildHeader("rpipico", "Raspberry Pi Pico", "0x000a", "RASPBERRY_PI_PICO", "rpipico", "uf2conv", 2 * 1024*1024)
BuildFlashMenu("rpipico", 2 * 1024 * 1024, [ 0, 64 * 1024, 256 * 1024, 512 * 1024, 1024 * 1024 ])
BuildFreq("rpipico")
BuildDebugPort("rpipico")
BuildDebugLevel("rpipico")
def MakeBoard(name, prettyname, pid, boarddefine, flashsizemb):
for a, b, c in [ ["", "", "uf2conv"], ["picoprobe", " (Picoprobe)", "picoprobe"]]:
n = name + a
p = prettyname + b
fssizelist = [ 0, 64 * 1024, 128 * 1024, 256 * 1024, 512 * 1024 ]
for i in range(1, flashsizemb):
fssizelist.append(i * 1024 * 1024)
BuildHeader(n, p, pid, boarddefine, name, c, flashsizemb * 1024 * 1024)
BuildFlashMenu(n, flashsizemb * 1024 * 1024, fssizelist)
BuildFreq(n)
BuildDebugPort(n)
BuildDebugLevel(n)
BuildHeader("adafruitfeather", "Adafruit Feather RP2040", "0x000b", "ADAFRUIT_FEATHER_RP2040", "adafruitfeather", "uf2conv", 8 *1024*1024)
BuildFlashMenu("adafruitfeather", 8 * 1024 * 1024, [ 0, 64 * 1024, 256 * 1024, 512 * 1024, 1024 * 1024, 2 * 1024 * 1024, 3 * 1024 * 1024, 4 * 1024 *1024, 5 * 1024 *1024, 6 * 1024*1024, 7*1024*1024 ])
BuildFreq("adafruitfeather")
BuildDebugPort("adafruitfeather")
BuildDebugLevel("adafruitfeather")
BuildGlobalMenuList()
MakeBoard("rpipico", "Raspberry Pi Pico", "0x000a", "RASPBERRY_PI_PICO", 2)
MakeBoard("adafruitfeather", "Adafruit Feather RP2040", "0x000b", "ADAFRUIT_FEATHER_RP2040", 8)
MakeBoard("generic", "Generic RP2040", "0xf00a", "GENERIC_RP2040", 16)
BuildHeader("generic", "Generic RP2040", "0xf00a", "GENERIC_RP2040", "generif", "uf2conv", 2 * 1024*1024)
BuildFlashMenu("generic", 2 * 1024 * 1024, [ 0, 64 * 1024, 256 * 1024, 512 * 1024, 1024 * 1024 ])
BuildFreq("generic")
BuildDebugPort("generic")
BuildDebugLevel("generic")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment