-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
Description
Port, board and/or hardware
esp32-s3 (on a ESP32-S3 (QFN56) (revision v0.2), with 4 MB flash)
MicroPython version
MicroPython v1.26.0-preview.527.g593ae04ee on 2025-08-07; Generic ESP32S3 module with ESP32S3
mpremote 1.25.0, on macOS
Reproduction
- Upload a file to the board (e.g.
mpremote cp bar.py :/bar.py) - Download the file again (
mpremote cp :/bar.py bar2.py) - Compare the file content (
diff -u bar.py bar2.py)
The files reproducibly differ for me. (Seeing syntax errors in repl as well, so the corruption doesn't seem to be caused by the second transfer back to the computer.)
Expected behaviour
No file corruption. (Content should be identical.)
Observed behaviour
File corruption, e.g.
def create_wav_header(sampleRate, bitsPerSample, num_channels, num_samples):
datasize = num_samples * num_channels * bitsPerSample // 8
o = bytes("RIFF", "ascii") # (4byte) Marks file as RIFF
o += (datasize + 36).to_bytes(
4, "little"
+ ) # (4byte) File size in bytes excluding this and Rittle"
) # (4byte) File size in bytes excluding this and RIFF marker
o += bytes("WAVE", "ascii") # (4byte) File type
o += bytes("fmt ", "ascii") # (4byte) Format Chunk Marker
o += (16).to_bytes(4, "little") # (4byte) Length of above format data
+ o += (1).to_bytes(2, "little") # (2byte) Format tyat data
o += (1).to_bytes(2, "little") # (2byte) Format type (1 - PCM)
o += (num_channels).to_bytes(2, "little") # (2byte)
o += (sampleRate).to_bytes(4, "little") # (4byte)
o += (sampleRate * num_channels * bitsPerSample // 8).to_bytes(4, "little") # (4byte)
+ o += (num_channels * bitsPerSample /, "little") # (4byte)
o += (num_channels * bitsPerSample // 8).to_bytes(2, "little") # (2byte)
o += (bitsPerSample).to_bytes(2, "little") # (2byte)
o += bytes("data", "ascii") # (4byte) Data Chunk Marker
o += (datasize).to_bytes(4, "little") # (4byte) Data size in bytes
return oAdditional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree