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

write-bin does not flash binary #622

Open
TheOnAndOnlyZenomat opened this issue Apr 7, 2024 · 2 comments
Open

write-bin does not flash binary #622

TheOnAndOnlyZenomat opened this issue Apr 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@TheOnAndOnlyZenomat
Copy link

Hey,
I have a binary

00000000: 01a0                                     ..

which is just a jump to 0x0.

When I try to write this binary with

espflash write-bin 0 img.img

nothing gets actually written. The output looks normal

[2024-04-07T17:54:34Z INFO ] Serial port: '/dev/ttyUSB0'
[2024-04-07T17:54:34Z INFO ] Connecting...
[2024-04-07T17:54:34Z INFO ] Using flash stub
Chip type:         esp32c3 (revision v0.3)
Crystal frequency: 40 MHz
Flash size:        4MB
Features:          WiFi, BLE
MAC address:       60:55:f9:c8:a7:6c
[00:00:00] [========================================]       1/1       0x10000                                                                        
[2024-04-07T17:54:36Z INFO ] Binary successfully written to flash!

but when reading the memory back using

espflash read-flash 0 64 out.bin

it is just all 0xff.

When I try to flash the same binary with esptool.py

esptool.py write_flash 0 img.img

it works.
I can read back the memory with espflash and esptool.py and both show 01a0 at 0x0 in the flash.

Am I missing the point of the subcommand, or is this actually a bug. If the latter is the case, I'd be happy to do some debugging and testing for you.

@MabezDev
Copy link
Member

MabezDev commented Apr 7, 2024

Hmm, looks like a bug. It's ignoring your input address of 0x0 and proceeding with the default application address of 0x10000.

@MabezDev MabezDev added the bug Something isn't working label Apr 7, 2024
@jordonsc
Copy link

I don't believe it's writing to the wrong location, if I have good data in the provided address, after using espflash write-bin that data is replaced by 0xFF bytes as if it was erased.

The success of write-bin is dependent on my payload. If I change the payload slightly, it might succeed. Change again, it might fail - but it is deterministic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

3 participants