Setting up on linux

To get started under linux mint:

Preinstall some required tools:

apt-get install git cmake gcc g++ libsdl2-dev

Grab the 32blit repo:

git clone https://github.com/pimoroni/32blit-beta

Compile away:

cd 32blit-beta/examples
cd palette-cycle
mkdir build
cd build
cmake ..
make

run your example locally
./palette-cycle

7 Likes

And for building to run on the 32blit itself:

Install arm compiling tools

apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib dfu-util

Compile is only slightly different

 cd 32blit-beta/examples
 cd palette-cycle
 mkdir build.stm32
 cd build.stm32
 cmake .. -DCMAKE_TOOLCHAIN_FILE=../../../32blit.toolchain
 make

Make sure the 32blit unit is in DFU mode ( hold X and Y then press reset),
it will just show blank screen. Note this is done over USB, no need for an ST Link cable.

sudo dfu-util -a 0 -s 0x08000000 -D palette-cycle.bin

After that, press reset to run the code on the 32blit.

6 Likes

Nice and to the point, much better than having to jump around on git hub to find all the info. In fact I couldn’t find anything in the “docs” that spoke the install of dfu-util and how to flash the device so thank you for putting it all in one place.

Up and running on Ubuntu 18.04!

Excellent instructions Mike - many thanks!

I’ve set mine up on my Raspberry Pi and it all works perfectly!

The only thing I would add to these instructions is to remember to run the apt-get using sudo, but everything else works perfectly

When building on linux I am getting the following error:

rnentjes@rnentjes-MS-7B79:~/Development/32blit/32blit-beta/examples/palette-cycle/build.stm32$ make
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rnentjes/Development/32blit/32blit-beta/examples/palette-cycle/build.stm32
[ 73%] Built target BlitHalSTM32
[ 98%] Built target BlitEngine
[ 99%] Linking CXX executable palette-cycle.elf
Building palette-cycle.bin
Building palette-cycle.dfu
/usr/bin/objcopy: Unable to recognise the format of the input file `/home/rnentjes/Development/32blit/32blit-beta/examples/palette-cycle/build.stm32/palette-cycle.elf'
make[2]: *** [CMakeFiles/palette-cycle.dir/build.make:236: palette-cycle.elf] Error 1
make[2]: *** Deleting file 'palette-cycle.elf'
make[1]: *** [CMakeFiles/Makefile2:74: CMakeFiles/palette-cycle.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Anyone know what the problem is here and how it can be fixed?

Edit: found it, there is a semicolon in an assignment in 32blit-stm32/Makefile:91 which shouldn’t be there…