My notes on getting setup - Linux targeting 32blit, picosystem, VGAboard, HTML and windows exe

ETA prime, did a review of the PicoSystem and threw down a challenge to play some community made games on his next video!

PicoSystem and VGA Board a very similar, so if you choose to get a VGA Board instead, I think that should be fine.

This forum has limits on links and replies… :/

1 Like

I’m not an expert, there’s a lot of noob hacks here, but to encourage others, here are my notes on setting up.

32blit is very impressive how it can target so many platforms!
Sorry I wont be mentioning Mac or chrome OS’s, I’m not familiar at all with them.

I’m mostly in the 32blit discord (Chat) - 32blit
But I can try and answer/help here to.

General noob tips:

The 32blit documentation is pretty good, but I still got caught out here and there.
Keep folders names simple, ie no spaces or none ASCI chars, including user name!

Make sure your .profile or .bash_profile etc can be run correctly in your window terminal before starting!
Sometimes they have access issues, ie a quick fix can be:
chmod 777 $HOME/.bash_profile

If you want to build faster use:
make -j4
The number is the threads to run, the more the faster

I’m a git,cmake,arm noob, it’s best to git clone each repo then to download them as zips, this is required by some, but best to do for all, IE:
git clone -b master GitHub - raspberrypi/pico-sdk

1 Like

Each target has it’s own build folder in the 32blit-sdk (or your game) folder
ie build.stm32 build.em etc.

Here is the directory structure at the end.

$HOME/

emsdk
pico-sdk
32blit-tools
pico-extras
pico-sdk
gcc-arm-none-eabi-9-2020-q2-update (not required, and probably a me thing)
.local/bin (auto generated - location of the 32blit tool)
32blit-beta (latest branch for pico devices)

32blit-sdk/

build
build.picosystem
build.vgaboard
build.win
build.em
build.stm32

My setup.

I thought I would use a new linux flavor, I went with MX (debian based) and picked XFCE (and unknowingly stable).
Here are the links:
https://distrowatch.com/?newsid=11206

MX-19.4_July_x64.iso

Eclipse, my IDE of choose for over 20years now!
https://www.eclipse.org/downloads/packages/release/2021-09/r/eclipse-ide-cc-developers

I installed this to a Virtual Box image, so it’s self contained, the USB devices are automatically forward to the VM.

-----------------------------------------------------------------
linux

Easy one, but install gdb if you plan on debugging natively!
Follow: 32blit-sdk/Linux.md at master · 32blit/32blit-sdk · GitHub

The OS app control keys are (see hardware-test app):

Dpad = arrow keys or WASD
A = Z key
B = X key
X = C key
Y = V key

Home = 1 key
Menu = 2 or ESC key

Joystick = Mouse within app screen
Joystick press = 3 key

Tilt controls, I don’t know.

-----------------------------------------------------------------
32blit tool

I found this part a bit confusing.

In your $HOME folder (not 32blit root)
git clone the GitHub - 32blit/32blit-tools: 32blit asset management and upload tool

It also requires:

I don’t know the git commands to do it, but basically I just download the zip and extract it into the 32blit-tools dir.

Next, I had issues running pip3, not in the path (of sudo possibly), again, I brought forced scripts that used pip3, replacing it with
python3 -m pip

pip3 install 32blit
or
python3 -m pip install 32blit

That will build tool and install the tool into ~/.local/bin and add the path to your env file setting, ie .profile

-----------------------------------------------------------------
stm32

AKA 32blit: https://32blit.com/

First do this, give your user access to serial device!

On my debian stable, or the MX repo the gcc-arm-none-eabi package (from 2018) couldn’t build the stm32.
I had to “brought force it”… and downloaded the tar.bz2 file and extracted it and manually fixed up the paths in .profile
PATH="$HOME/gcc-arm-none-eabi-9-2020-q2-update/bin:$PATH"

gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 from GNU Toolchain | GNU Arm Embedded Toolchain Downloads – Arm Developer
I had to specifcy -DPICO_TOOLCHAIN_PATH=$HOME/gcc-arm-none-eabi-9-2020-q2-update in stm32/pico cmake commands below.

32blit can printf to the TTY terminal, install one, ie:
sudo apt-get install putty cu minicom screen
I found screen to work the easiest (no params), ie:
screen /dev/ttyACM0

Updated the firmware:

Put the 32blit in DFU mode (hold X/Y and press reset) , winplug the USB cable in.
32blit flash firmware/firmware.bin
or
make firmware-update.flash

next install the launcher:
32blit install launcher/launcher.blit
or
make launcher.flash

intall all the other demos (see bottom of Makefile for more info):
make install DEMO-NAME.flash

You now should have a working and demo loaded 32blit!

-----------------------------------------------------------------
Emscripten

Follow:

make sure paths are correctly executed when a new shell/terminal is open, ie: source $HOME/emsdk/emsdk_env.sh

mkdir build.em
cd build.em
emcmake cmake … -D32BLIT_DIR=$HOME/32blit-sdk
make

I like to create a script file that starts the server is helpful:
#!/bin/bash
python3 -m http.server

Run in a terminal and CTRL C to stop it.

I don’t know why, but firefox doesn’t like it, chrome browser works fine.
The keyboard buttons (from hardware-test app):
http://0.0.0.0:8000/32blit-sdk/build.em/examples/hardware-test/hardware-test.html

Same as the OS controls.

-----------------------------------------------------------------
windows exe

sudo apt-get install mingw-w64

after: sudo mkdir -p /opt/local/

make it accessible:
sudo chmod -R 777 /opt/local

in 32blit-sdk root

cd to
mkdir build.win32
cd build.win32

cmake … -DCMAKE_TOOLCHAIN_FILE=…/mingw.toolchain
make -j4

-----------------------------------------------------------------
setting up PicoSystem / VGA BOARD

VGA BOARD

PicoSystem

Both being based on the RP Pico, require the same source code, nothing is built in these folders.

Also read the PDF section 2.1. Get the SDK and examples

In your $HOME folder (not 32blit root)
git clone -b master GitHub - raspberrypi/pico-sdk
cd pico-sdk
git submodule update --init

thta read just blew my ADHD all to hell ,great post ,thanks for posting , I dont code ,just use otheres and I thank you and otheres for doing that part for people like me , I have the VGABoard hanging pretty on my Pi/Pico wall ,tried a few time using others instructions ,but never got anywere and Gave Up .

sorry about that, i ask for it to get removed,
My full notes are here:
https://cdn.discordapp.com/attachments/585104736462569474/899898060044374036/pico.txt

@mgarcia Jack wasn’t complaining, not about what you posted. I’d leave it up.

Yeah,Leave it up for sure ,great post ,My brain’s the issue ;)

I put my notes on my website (somewhat formated) and linked it to archive.org, which has a downloadable Linux Virtual Box Virtual Machine, that’s what I use anyway.