ctron / rust-esp-container

Container image with pre-built rust compiler for ESP32/ESP8266
Eclipse Public License 2.0
183 stars 20 forks source link

Readme error in upload step? #17

Open bvanderveen opened 4 years ago

bvanderveen commented 4 years ago

Hi there,

In following the readme (with ctron/rust-esp-template.git) I noticed the flash step reads:

docker run -ti --device=/dev/ttyUSB0 -v $PWD:/home/project:z rust-esp32 flash-project

Should it actually read as follows?

docker run -ti --device=/dev/ttyUSB0 -v $PWD:/home/project:z quay.io/ctron/rust-esp flash-project

Once I made this change, the flash-project command ran. However I quickly encountered another error, which was that build/bootloader/bootloader.bin does not exist. I'm still very new in ESP32 so I might be being dense… how do I generate the bootloader?

This is an excellent project! I have been laboring for a clean docker toolchain for rust/esp32 and I'm glad to have found this repo!

bvanderveen commented 4 years ago

I've noticed that this issue deletes the bootloader line: https://github.com/ctron/rust-esp-container/pull/14/files#diff-b91932d2db512c784005ef53da110e33L16

jeikabu commented 4 years ago

To build bootloader.bin you'll need to run:

make bootloader

make app in the build-project script doesn't take care of this. It's probably best to just run make -j4, you only need to do it once, anyway.

Also, you can't remove the bootloader line like in PR #14. It works ok if you've written it to flash previously, but if you overwrite it or reset the ESP32 flash memory:

esptool.py --chip esp32 --port /dev/ttyS0 --baud 115200 --before default_reset --after hard_reset erase_flash

Your program will stop working until you write the bootloader again.

bvanderveen commented 4 years ago

Heck yeah I got it to work! Maybe it's worth adding make bootloader somewhere in the readme? I'd be happy to make a PR.