-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
combine C/C++ and MicroPython downloads; add README
- Loading branch information
Showing
14 changed files
with
168 additions
and
23,202 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.uf2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
export MAMBAFORGE_HOME="$HOME/mambaforge" | ||
|
||
if [ ! -d "$MAMBAFORGE_HOME" ] | ||
then | ||
echo "$MAMBAFORGE_HOME doesn't exist" | ||
echo "Installing mambaforge" | ||
|
||
export ARCH=`uname -m` | ||
echo "ARCH: $ARCH" | ||
if [ $ARCH == "armv7l" ] | ||
then | ||
echo "Sorry - no Mambaforge release exists for $ARCH" | ||
exit | ||
fi | ||
|
||
pushd /tmp | ||
|
||
echo "Downloading latest Mambaforge installer" | ||
rm -fr Mambaforge* | ||
wget -q \ | ||
https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-$ARCH.sh | ||
chmod +x Mambaforge-Linux-$ARCH.sh | ||
|
||
echo "Installing Mambaforge to '$MAMBAFORGE_HOME' ..." | ||
./Mambaforge-Linux-$ARCH.sh -b -p $MAMBAFORGE_HOME | ||
|
||
popd | ||
fi | ||
|
||
echo "Enabling 'conda' and 'mamba'" | ||
source $MAMBAFORGE_HOME/etc/profile.d/conda.sh | ||
source $MAMBAFORGE_HOME/etc/profile.d/mamba.sh | ||
|
||
echo "Activating 'base'" | ||
mamba activate base | ||
|
||
echo "Disabling auto-activation of 'base' environment" | ||
conda config --set auto_activate_base false | ||
|
||
echo "Setting default threads to number of processors" | ||
conda config --set default_threads `nproc` | ||
|
||
echo "Updating base packages" | ||
mamba update --name base --all --yes --quiet | ||
|
||
echo "Setting up bash command line" | ||
conda init bash | ||
mamba init bash | ||
echo "export MAMBAFORGE_HOME=$MAMBAFORGE_HOME" >> ~/.bash_aliases | ||
|
||
if [ -e $HOME/.zshrc ] | ||
then | ||
echo "Setting up zsh command line" | ||
conda init zsh | ||
mamba init zsh | ||
echo "export MAMBAFORGE_HOME=$MAMBAFORGE_HOME" >> ~/.zshrc | ||
fi | ||
|
||
echo "Creating fresh Mamba environment 'PicoVision' with 'mpremote'" | ||
. "$MAMBAFORGE_HOME/etc/profile.d/conda.sh" | ||
. "$MAMBAFORGE_HOME/etc/profile.d/mamba.sh" | ||
mamba create --force --yes --quiet --name PicoVision \ | ||
python \ | ||
pip | ||
mamba activate PicoVision | ||
pip install --quiet --upgrade mpremote | ||
|
||
echo "Finished!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
source set_pico_envars | ||
|
||
echo "Downloading MicroPython release $PICOVISION_VERSION" | ||
curl -sOL \ | ||
"https://github.com/pimoroni/picovision/releases/download/v$PICOVISION_VERSION/pimoroni-picovision-v$PICOVISION_VERSION-micropython.uf2" | ||
curl -sOL \ | ||
"https://github.com/pimoroni/picovision/releases/download/v$PICOVISION_VERSION/pimoroni-picovision-widescreen-v$PICOVISION_VERSION-micropython.uf2" | ||
|
||
echo "Downloading flash_nuke.uf2" | ||
curl -sOL https://datasheets.raspberrypi.com/soft/flash_nuke.uf2 | ||
|
||
echo "Finished!" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Setting up the Development Environment | ||
|
||
## Usage | ||
1. Get a PicoVision and a display. As far as I know, most HDMI displays | ||
designed to work with a Raspberry Pi will work with the PicoVision. | ||
|
||
2. Edit the environment variables. The file `set_pico_envars` defines | ||
all the environment variables needed for the rest of the scripts. | ||
The scripts all do `source set_pico_envars` to read them. | ||
|
||
3. Run the numbered scripts in order: | ||
- 0mambaforge.sh | ||
- 1pico-toolchain.sh | ||
- 2pimoroni-repos.sh | ||
- 3build-examples.log | ||
- 3build-examples.sh | ||
- 4MicroPython.sh | ||
|
||
4. Documentation: for C/C++ development, refer to | ||
<https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html>. The | ||
setup steps have already been done, so you can start at | ||
<https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html#raspberry-pi-pico-cc-sdk>. | ||
|
||
For MicroPython development, start with | ||
<https://www.raspberrypi.com/documentation/microcontrollers/micropython.html>. | ||
Then read the Pimoroni PicoVision documentation at | ||
<https://github.com/pimoroni/picovision>. I strongly recommend using | ||
Mamba virtual environments for all Python development. To get started, | ||
type `mamba activate PicoVision`. From there, you can use the | ||
`mpremote` command line utility to manage your PicoVision board. | ||
|
||
## Script details | ||
|
||
### Mambaforge | ||
My Python development process heavily depends on the Mamba package and environment | ||
manager (<ihttps://mamba.readthedocs.io/en/latest/index.html>). The script | ||
`0mambaforge.sh` checks to see if Mambaforge is installed. If it isn't, | ||
`0mambaforge.sh` installs it. Once Mambaforge is installed, the script | ||
creates a virtual environment named `PicoVision` which contains `Python`, | ||
`pip` and the MicroPython command line utility `mpremote`. See | ||
<https://docs.micropython.org/en/latest/reference/mpremote.html> for | ||
`mpremote` documentation. | ||
|
||
### The Pico toolchain | ||
`1pico-toolchain.sh` installs all the C/C++ SDK tools. | ||
|
||
### Pimroni repositories | ||
`2pimoroni-repos.sh` installs the Pimoroni repositories required for CLAMS | ||
development. | ||
|
||
### Building the examples | ||
`3build-examples.sh` builds all the Raspberry Pi and Pimoroni examples. This | ||
takes a bit of time, but it's a necessary test of the toolchain, and as a | ||
bonus supplies numerous firmware examples to experiment with! | ||
|
||
### MicroPython tools | ||
`4MicroPython.sh` downloads the firmware files for PicoVision MicroPython. | ||
If you want to remove MicroPython and load other firmware, put the PicoVision | ||
in bootloader mode and install `flash_nuke.uf2`. It will erase the flash and | ||
put the PicoVision CPU back in bootloader mode. | ||
|
||
### Listing the firmware files in the examples | ||
Once you've built all the examples, `list-uf2-files.sh` will list all of | ||
the firmware files it built! |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters