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

erase-region should check the provided length #753

Open
1 task
SergioGasquez opened this issue Feb 7, 2025 · 0 comments
Open
1 task

erase-region should check the provided length #753

SergioGasquez opened this issue Feb 7, 2025 · 0 comments
Milestone

Comments

@SergioGasquez
Copy link
Member

SergioGasquez commented Feb 7, 2025

erase-region should check that the provided length is multiple of the SPI flash erase sector size. In esptool docs:

The address and length must both be multiples of the SPI flash erase sector size. This is 0x1000 (4096) bytes for supported flash chips.

❯ esptool.py --chip esp32c6 erase_region 0x1000 0x50
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-C6 (QFN40) (revision v0.0)
Features: WiFi 6, BT 5, IEEE802.15.4
Crystal is 40MHz
MAC: 60:55:f9:00:00:f7:1b:6c
BASE MAC: 60:55:f9:f7:1b:6c
MAC_EXT: 00:00
Uploading stub...
Running stub...
Stub running...
Erasing region (may be slow depending on size)...

A fatal error occurred: Size of data to erase must be a multiple of 4096
Status Ok(ExitStatus(unix_wait_status(512)))

While in espflash:

❯ espflash erase-region 0x1000 0x5
[2025-02-07T10:48:49Z INFO ] Serial port: '/dev/ttyACM0'
[2025-02-07T10:48:49Z INFO ] Connecting...
[2025-02-07T10:48:49Z INFO ] Using flash stub
[2025-02-07T10:48:49Z WARN ] Setting baud rate higher than 115,200 can cause issues
[2025-02-07T10:48:49Z INFO ] Erasing region at 0x00001000 (5 bytes)

We dont throw any error and we delete the next multiple of 4096 of the provided length, in the case of my example, 4096 (0x1000)

  • Once this is resolved we should create a test for it on HIL
@github-project-automation github-project-automation bot moved this to Todo in esp-rs Feb 7, 2025
@SergioGasquez SergioGasquez added this to the v4 milestone Feb 7, 2025
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

1 participant