Programming Healthypi 5 with Zephyr
Healthypi 5 also supports programming using the Zephyr Real-Time Operating System (RTOS). Zephyr is designed for resource-constrained devices and offers a flexible platform for developing applications that require real-time capabilities. Zephyr's versatility allows developers to create more complex applications and take advantage of its real-time features for precise control and responsiveness.
Programming Healthypi 5 with Zephyr RTOS consists of four steps:
- Install Zephyr environment and the Zephyr SDK.
- Build the Healthypi 5 Zephyr firmware.
- Flash the firmware to the Healthypi 5.
Install Zephyr environment and the Zephyr SDK
-
Update the Update OS and Install dependencies
-
Install the Zephyr Software Development Kit SDK which contains toolchains for each of Zephyr’s supported architectures, which include a compiler, assembler, linker and other programs required to build Zephyr applications.
Build the Healthypi 5 Zephyr firmware
-
Create a workspace and get the zephyr source code inside the workspace.
-
Enter the root directory of the Healthypi 5 Zephyr workspace.
-
Update the workspace's projects based on the contents of the manifest file
-
Finally building of the fimware. The commands to build the firmware is based on the functionality.
-
To operate the healthypi with USB streaming, build the firmware app with west build.
-
To operate the healthypi with USB streaming and BLE support, build the firmware app with west build.
-
To operate the healthypi with USB streaming and Display support, build the firmware app with west build.
-
Flash the firmware to the Healthypi 5
Firmware can be flashed to your Healthypi device by either draging and dropping the firmware or by using a Raspberry Pi Debug Probe(not included with the kit, you will need to get one separately).
You may find an explanation of the drag and drop method on the main page. Update your device with the latest firmware with ease using the .uf2
file found in the Healthypi 5 Zephyr workspace in build/zephyr
.
To flash using a Raspberry Pi Debug Probe, install OpenOCD using the commands.
-
Download openocd for Windows from here: OpenOCD Windows
-
Copy
bin
andshare
dirs to C:\Program Files\OpenOCD\ -
Add C:\Program Files\OpenOCD\bin to ‘PATH’ environment variable
Connect the Raspberry Pi Debug Probe to the Healthypi in following manner and you are ready to flash your new firmware.
-
Connect the jumper wire from the UART port of Raspberry Pi Debug Probe to the RP2040 UART connector of Healthypi. The RP2040 UART connector of Healthypi is located below the Spo2 port.
-
Connect the jumper wire from the Debug port of Raspberry Pi Debug Probe to the RP2040 Debug connector of Healthypi. The RP2040 Debug connector of Healthypi is located below the RP2040 port.
-
Connect the Raspberry Pi Debug Probe and the computer using a B type cable.
-
From the command prompt continue,