You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Build HAT: status light never starts the ready animation at boot #2825
Describe the bug
When the Build HAT first powers up, the bootloader shows a steady red LED while it waits for firmware. After loading Pybricks, the LED goes off, even though lib/pbio/platform/build_hat/pbsysconfig.h enables PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS with PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS_HUE set to green (120). The HAT gives no clear indication that Pybricks was successfully loaded.
To reproduce
Build bricks/buildhat from master and load it into the HAT with pybricks-build-hat.
Watch the status LED: it turns dark, yet the REPL over the Pi UART works, so the firmware is running.
Expected behavior
The LED breathes green (the configured hue) once the firmware is ready.
Cause
The Build HAT uses lib/pbio/sys/hmi_none.c (no buttons, no display), whose pbsys_hmi_await_program_selection() requests the REPL directly. Unlike hmi_pup.c, it never calls pbio_color_light_start_breathe_animation() first, so nothing ever starts the animation. PBSYS_CONFIG_HMI_NONE is set only by the Build HAT, so other hubs are unaffected. Fix verified on hardware; PR to follow.
Note on future light states
The Build HAT currently has no idle state. With no buttons and no program storage, hmi_none.c goes straight to the REPL, so the "ready" breathe is the only state its light has. In the future, we may want three states: waiting for a host connection (through the Pi), connected with no program running, and program running. I think that is better addressed when the Build HAT port is more mature. This fix only starts the animation that is already configured.
Activity
pbio/sys: Add Build HAT HMI that starts the status light animation.