pfalcon / pycopy

Pycopy - a minimalist and memory-efficient Python dialect. Good for desktop, cloud, constrained systems, microcontrollers, and just everything.
http://pycopy.readthedocs.io
MIT License
806 stars 78 forks source link

Dirty flashing or upgrading from a different firmware does not work #44

Closed mordae closed 4 years ago

mordae commented 4 years ago

Hello. I have flashed Tasmota on a couple of Tuya bulbs using tuya-convert and now I would like to flash pycopy and give the LEDs to a bunch of kids I teach Python to play with. The problem is that I cannot exactly wipe the bulbs before flashing them without opening them up and that is something I would like to avoid since I don't have a ~230V license. And I am afraid that without wiping them beforehand pycopy won't boot up.

Why? I have tested the Tasmota->pycopy migration path on a Sonoff esp8285 board and after figuring out SetOption78 1 on Tasmota and flashing pycopy I get only a never-ending stream of random garbage on UART. Same thing happens when I dirty-flash pycopy using esptool.py. Everything works fine when I erase the flash beforehand.

I don't know if it helps, but when I manually flash 0x0fc000 it starts to work:

esptool -b 460800 write_flash --flash_mode=dout 0x0fc000 esp_init_data_default.bin

Please advise.

pfalcon commented 4 years ago

Pycopy is concentrating on the language development, and not supporting particular hardware devices. All hardware support, including esp8266, is inherited from MicroPython. In other words, Pycopy would behave exactly the same as MicroPython in that regard, so any issue would be MicroPython's and should be reported there.

And yes, both require erasing flash, as documented in the README: https://github.com/pfalcon/pycopy/tree/master/ports/esp8266 . It also gives esptool.py command to do that.