Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show progress bar when flashing Tachyon #785

Merged
merged 6 commits into from
Jan 16, 2025

Conversation

keeramis
Copy link
Contributor

@keeramis keeramis commented Jan 16, 2025

Description

  1. Adds progress bar to flash --tachyon
  2. Throws an error if an EDL device is not found
  3. Throws an error for other errors from qdl

How to Test

Same flashing steps using particle.js flash --tachyon

$ particle.js flash --tachyon /my/local/path/to/tachyon-ubuntu-20.04-base-bb3-1.0.17.zip

Ensure that only one device is connected to the computer before proceeding.

Starting download. This may take several minutes...

Logs are being written to: /Users/keerthyamisagadda/code/tachyon-qdl/tachyon_flash_1737052496425.log

[██████████████░░░░░░░░░░░] 55% | Flashing module: system_a (2317568/4194304 sectors)

Related Issues / Discussions

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA
  • Problem and solution clearly stated
  • Tests have been provided
  • Docs have been updated
  • CI is passing

- Show progress bar while flashing
- Show location of output log file at the start of the flashing process.
- Throw error is device is not in EDL mode or no device is detected.
- Propagate any errors
Copy link
Member

@monkbroc monkbroc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

src/lib/qdl.js Outdated
const qdlArgs = [
'--storage',
TACHYON_STORAGE_TYPE,
async function run({ files, includeDir, updateFolder, zip, ui, outputLogFile }) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main feedback is to break this function into smaller functions to make sense of it.

src/lib/qdl.js Outdated
fs.appendFileSync(outputLogFile, `${line}\n`);

if (line.includes('Waiting for EDL device')) {
handleError(process, `Device is not in EDL mode${os.EOL}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
handleError(process, `Device is not in EDL mode${os.EOL}`);
handleError(process, `Ensure your device is connected and in EDL mode${os.EOL}`);

@keeramis keeramis changed the title Feature/show progress bar flash tachyon Show progress bar when flashing Tachyon Jan 16, 2025
@keeramis keeramis merged commit 07ac1e4 into master Jan 16, 2025
5 checks passed
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.

2 participants