Skip to content

[Bug] Build HAT: status light never starts the ready animation at boot #2825

Description

@davelongdev

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

  1. Build bricks/buildhat from master and load it into the HAT with pybricks-build-hat.
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    hub: buildhatIssues related to the Raspberry Pi Build HAT

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions