File tree Expand file tree Collapse file tree 1 file changed +42
-1
lines changed Expand file tree Collapse file tree 1 file changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,51 @@ power supply. For best results, use the `official Raspberry Pi Build HAT power s
2828
2929.. _official Raspberry Pi Build HAT power supply : http://raspberrypi.com/products/build-hat-power-supply
3030
31+ It is now possible to use custom firmware with the library. To do this you can follow the steps below.
32+
33+ .. code-block ::
34+ :caption: Using custom firmware
35+
36+ sudo apt install cmake python3 build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
37+
38+ git clone https://github.com/raspberrypi/pico-sdk.git --recursive
39+ git clone https://github.com/raspberrypi/buildhat.git --recursive
40+
41+ cd buildhat
42+ export PICO_SDK_PATH="$(pwd)/../pico-sdk/"
43+ make
44+
45+ cd ..
46+ mkdir test
47+ cd test
48+ mkdir data
49+
50+ cp ../buildhat/firmware-pico/build/main.bin data/firmware.bin
51+ cp ../buildhat/bhbl-pico/signature.bin data/signature.bin
52+ cat ../buildhat/firmware-pico/version.h | sed 's/#define FWVERSION "//g; s/ .*//g' > data/version
53+
54+ Then place your script, such as the following, within the test/ directory.
55+
56+ .. code-block ::
57+ :caption: Create test.py in test directory
58+
59+ import time
60+ from buildhat import Motor
61+
62+ m = Motor('A')
63+ m.start()
64+
65+ time.sleep(5)
66+
67+ Then use: ``python test.py `` in the test directory, to run your script with your custom firmware.
68+
69+ Note if you want python to always reload the firmware from your **data/ ** directory each time
70+ you run your script, simply write the value: -1 to **data/version **.
71+
3172.. warning ::
3273
3374 The API for the Build HAT is undergoing active development and is subject
34- to change.
75+ to change.
3576
3677.. toctree ::
3778 :maxdepth: 2
You can’t perform that action at this time.
0 commit comments