Skip to content

Conversation

@lucasssvaz
Copy link
Member

Description

This pull request refactors how Arduino build and flash information is handled and improves documentation and tests to match the new structure. The main changes involve extracting flash settings and binary information directly from build artifacts (like flash_args), simplifying the codebase, and updating the documentation and tests accordingly. It also replaces the use of multiple binaries with the use of the merged binary.

This will allow for us to have multi dut tests without conflicts.

Refactoring and Build Directory Handling:

  • The ArduinoApp class now extracts the sketch name, FQBN, flash settings, bootloader offset, and binary paths directly from the build directory and associated files (such as flash_args and build.options.json). This replaces the previous hardcoded logic for flash settings and binary offsets.
  • The build directory can now be specified as a relative or absolute path, and if not provided, defaults are determined based on the current working directory or the app path. Documentation in README.md has been updated to reflect this improved build directory handling.

Flashing Logic Update:

  • The flashing logic in serial.py has been updated to use the new flash settings and bootloader offset extracted from the build artifacts, rather than relying on hardcoded values or precomputed file lists. [1] [2]

Testing and Documentation Improvements:

  • Tests have been updated to assert against the new properties (such as binary_file) and to use the revised build directory structure. [1] [2] [3] [4]
  • The README.md has been improved to clarify how to specify the build directory and how the Arduino service locates required files. [1] [2]

Build Artifact Example:

  • An example flash_args file has been added to show the expected format for extracting flash settings and offsets.

Testing

Tested locally

@lucasssvaz
Copy link
Member Author

@P-R-O-C-H-Y @JakubAndrysek PTAL to see if I didn't break anything by accident. In my tests everything works fine.

@lucasssvaz lucasssvaz marked this pull request as ready for review November 22, 2025 00:54
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.

1 participant