Skip to content

Conversation

@laurensvalk
Copy link
Member

@laurensvalk laurensvalk commented Dec 16, 2024

Support for basic multi-program slots has been added a while ago, but it is not enabled by default while we wait on related featured to be completed.

This enables it for those who wish to try it out early.

Try it out

  • Download the Prime Hub firmware file using the link in the post below.
  • Install that file using these instructions.
  • Code as usual using https://beta.pybricks.com/
  • On the hub, choose slot 1 to 5 using the left/right buttons.
  • A new program is downloaded to the selected slot.

Caveats

  • There is no file manager yet. To delete programs, just download an empty program to that slot.
  • Upgrading to a new firmware will erase the programs from the hub.
  • All programs are kept in memory at once. If you write 5 giant programs, it will have a bit less memory remaining to run them.

@coveralls
Copy link

coveralls commented Dec 16, 2024

Coverage Status

coverage: 57.124%. remained the same
when pulling 225ff14 on slot
into dfbcfa8 on master.

@laurensvalk
Copy link
Member Author

This no longer works.

Since updating Pybricks Code, it looks like we are now always sending 0 for the slot payload, so using the "current slot" never hits.

        case PBIO_PYBRICKS_COMMAND_START_USER_PROGRAM: {
            if (size > 2) {
                return PBIO_PYBRICKS_ERROR_VALUE_NOT_ALLOWED;
            }
            // Use payload as program ID, otherwise use active user slot.
            return pbio_pybricks_error_from_pbio_error(
                pbsys_main_program_request_start((size == 2 ? data[1] : pbsys_hmi_get_selected_program_slot()), PBSYS_MAIN_PROGRAM_START_REQUEST_TYPE_REMOTE));

I suppose it is not critical since we are not shipping this with the current firmware.

@laurensvalk
Copy link
Member Author

This no longer works. Since updating Pybricks Code, it looks like we are now always sending 0 for the slot payload, so using the "current slot" never hits.

This can be solved with pybricks/pybricks-code#2343

@laurensvalk
Copy link
Member Author

Closing since we enabled #312.

@laurensvalk laurensvalk deleted the slot branch July 11, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants