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

Better user experience for setting the flashing address #67

Open
igrr opened this issue Jan 13, 2023 · 6 comments
Open

Better user experience for setting the flashing address #67

igrr opened this issue Jan 13, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@igrr
Copy link
Member

igrr commented Jan 13, 2023

The default flashing address is 0x1000 which is valid for the ESP32. Newer chips expect the binary to be flashed at 0 address. We could automatically update the address field after detecting the chip.

@igrr igrr added the enhancement New feature or request label Jan 13, 2023
@Jason2866
Copy link
Contributor

Jason2866 commented Jan 13, 2023

Imho this change is not needed. Every ESP32 needs several files flashed at different addresses. The user always have to think about where to flash which file.
For example we generate merged firmware binaries for project Tasmota.
All variants for all MCUs needes to be flashed at address 0x0.

@igrr
Copy link
Member Author

igrr commented Jan 13, 2023

Thank you for your comment @Jason2866.
Indeed, can also generate merged binaries using esptool.py merge_bin command, they need to be flashed at the address 0.

There has been a feature request for esptool.py to produce .hex files, which would be self-descriptive — a user who got such a file wouldn't need to specify the address at all. Maybe that would be better user experience than automatically setting the flashing address.

Edit: have renamed the issue to a more general one.

@igrr igrr changed the title UI: automatically set correct flashing address based on the chip Better user experience for setting the flashing address Jan 13, 2023
@Jason2866
Copy link
Contributor

Nice, generated firmware files which includes the info on which address the should be flashed would be indeed a great enhancement.

@TD-er
Copy link

TD-er commented Jan 13, 2023

As in like the (really) old (Intel?) HEX file format?
Wouldn't that increase filesize quite a bit?
On the other hand, lots of padded zeroes can be "compressed" into 0 bytes as each line starts with the "start address" of the next 16 bytes.

@igrr
Copy link
Member Author

igrr commented Jan 13, 2023

Yes, Intel hex. I did an experiment using this script to generate a .hex file from an IDF build directory. With the get-started/hello_world example:

-rw-r--r--  1 ivan  staff    26K Jan 11 18:47 build/bootloader/bootloader.bin
-rw-r--r--  1 ivan  staff   174K Jan 11 18:48 build/hello_world.bin
-rw-r--r--  1 ivan  staff   558K Jan 13 17:15 build/hello_world.hex
-rw-r--r--  1 ivan  staff   238K Jan 13 17:04 build/merged.bin
-rw-r--r--  1 ivan  staff   3.0K Jan 11 18:47 build/partition_table/partition-table.bin

558kB .hex file size is almost 3 times larger than the sum of the .bin file sizes. It's also twice as big as the "merged" binary. Is that going to be a problem? I don't think so, most people probably wouldn't notice much difference. When downloading such a file, it is likely to be gzip-encoded during transfer. So the only difference is storing 558kB vs 238kB on the PC.

@TD-er
Copy link

TD-er commented Jan 13, 2023

Yep, that's true indeed.
Most browsers will try to request a GZipped transfer and if the server accepts it, it will probably be about the same size as the bin files GZipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants