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

Add --monitor option to write-bin command #684

Open
aiotter opened this issue Sep 20, 2024 · 2 comments
Open

Add --monitor option to write-bin command #684

aiotter opened this issue Sep 20, 2024 · 2 comments

Comments

@aiotter
Copy link

aiotter commented Sep 20, 2024

I'm using espflash for Rust based and non-Rust based ESP32 project. It is great.
However when I'm debugging non-Rust based app like Erlang with AtomVM, I'm stressed a bit to execute espflash monitor just after espflash write-bin again and again.

How about adding --monitor option to write-bin just like flash command?

It looks cli::FlashArgs::{monitor,monitor_baud,log_format} is safe to be copied into WriteBinArgs, and the same logic here can be added at the end of write_bin function as well.

@MabezDev
Copy link
Member

Any reason why you can't use the normal flash subcommand to flash your non-Rust esp32 project? That's what I use.

Regardless, I think we'd accept a PR that extended the monitor flag to write-bin.

@aiotter
Copy link
Author

aiotter commented Sep 20, 2024

I don't expect that it is possible, because espflash flash is for ELF format.
I believe the binary file to be flashed into ESP32 is not in ELF format.

$ file MyProject.avm
MyProject.avm: a /usr/bin/env AtomVM script executable (binary data)

On AtomVM project, you write a program first with Erlang, Elixir or any other compatible languages, and then compiles it into BEAM format as usual.
AtomVM's packbeam utility will then packs it into AVM binary, which you can espflash write-bin into ESP32's 0x210000 address. AtomVM, flashed at bootloader partition in advance, will execute that AVM binary.

Do you think I can use flash command in my case?

Regardless, I think we'd accept a PR that extended the monitor flag to write-bin.

Thank you for mentioning this! I'll try implementing it and open a PR when I have some time, hopefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants