Closed alessio-perugini closed 9 months ago
Hi! I just tried reproducing the issue and I was not able to:
❯ openssl s_client -showcerts -connect google.com:443 </dev/null | sed -n -e '/-.BEGIN/,/-.END/ p' > google.pem
depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1
verify return:1
depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
verify return:1
depth=0 CN = *.google.com
verify return:1
DONE
❯ openssl x509 -outform der -in google.pem -out google.crt
❯ espflash write-bin -p /dev/ttyACM0 -b 921600 0x3C0000 google.crt
[2023-12-11T15:58:32Z INFO ] Serial port: '/dev/ttyACM0'
[2023-12-11T15:58:32Z INFO ] Connecting...
[2023-12-11T15:58:32Z INFO ] Using flash stub
[2023-12-11T15:58:33Z WARN ] Setting baud rate higher than 115,200 can cause issues
Chip type: esp32s3 (revision v0.1)
Crystal frequency: 40MHz
Flash size: 8MB
Features: WiFi, BLE
MAC address: 60:55:f9:f5:20:d4
[00:00:00] [========================================] 2/2 0x3C0000
❯ stat -c %s google.crt
3701
I also tried with other sizes:
❯ dd if=/dev/zero of=google.crt bs=1 count=1 seek=3748
1+0 records in
1+0 records out
1 byte copied, 1.329e-05 s, 75.2 kB/s
❯ stat -c %s google.crt
3749
❯ espflash write-bin -p /dev/ttyACM0 -b 921600 0x3C0000 google.crt
[2023-12-11T15:57:43Z INFO ] Serial port: '/dev/ttyACM0'
[2023-12-11T15:57:43Z INFO ] Connecting...
[2023-12-11T15:57:43Z INFO ] Using flash stub
[2023-12-11T15:57:44Z WARN ] Setting baud rate higher than 115,200 can cause issues
Chip type: esp32s3 (revision v0.1)
Crystal frequency: 40MHz
Flash size: 8MB
Features: WiFi, BLE
MAC address: 60:55:f9:f5:20:d4
[00:00:00] [========================================] 2/2 0x3C0000
I am using espflash with that latest main
changes (commit 71d7a63). We did some changes in main
, could you try reproducing it with this espflash version (cargo install espflash --git https://github.com/esp-rs/espflash --force
) and see if the issue still persists for you @alessio-perugini?
@SergioGasquez Tested on 71d7a63 now it's working flawlessly! :rocket:
EDIT: I did a little bit a git bisect and found out that the first commit that fixes the problem is: 775e22275b30f952457978b0c38e64942233e734
:wave: I was trying to flash a x509 certificate bundle in a .crt format to
0x3c0000
address. Unfortunately, the tool returns the following error:Talking to other guys on the team we hypothesized that we could have some padding problems, so I added a few bytes at the end. Surprisingly making the .crt file multiple of 4 solved the problem, and the
espflash
worked perfectly!stat -c %s google.crt
Steps to reproduce the problem
Steps to fix the problem
Additional information
I'm running on Ubuntu 22.04
I was trying the flash on one the new Arduino Uno R4 WiFi (datasheet)