microsoft / pxt

Microsoft MakeCode (PXT - Programming eXperience Toolkit)
https://makecode.com
MIT License
2.1k stars 586 forks source link

Support for ESP32 #9034

Open dharmik768 opened 2 years ago

dharmik768 commented 2 years ago

We are working on integration of MakeCode with our multi-sensor / physical computing device databot™ - hardware details here:

https://databot.us.com/databot-2-0-basic-training-deep-geek/

We are finding a hard time getting code run with an ESP32. We are unable to get the default ESP32 makecode project found here. No matter what kind of blocks we arrange there

To Reproduce Steps to reproduce the behavior:

  1. Go to https://maker.makecode.com/#
  2. Click on Espressif ESP32 DevKit-C. Then click new project
  3. Leave it as a default and press the download button. (most of the time it shows a compilation error)
  4. We have created an LED blink block and hit the simulation button, on the simulation, it seems LED is blinking and on pressing the download button bin file is also downloaded. But when we tried flashing that bin file in the ESP32 dev board with the ESP32 flashing tool no LED blink is seen on the actual board. It seems there is something wrong with the bin file itself.
  5. One more thing we noticed is that no matter how many blocks we add to the project on downloading the bin file the final size of the bin file is always the same 979Kb, That seems odd to us as it should vary from project to project.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots 1) LED blink example we tried.

image

2) Using the Espressif bin file uploading tool, we are using the same tool for other bin files and it works perfectly.

image

3) All bin files are of the same size but all projects were different.

image

Desktop:

Additional context We have tried pretty much everything that came to our mind. We also saw that it needs UF2 bootloader so we searched here but unfortunately we found nothing specific for ESP32.

Anyone can guide us in the right direction where we can build and run simple projects for ESP32 and also most important the flashing part is there any way we can directly flash from the USB instead of downloading the bin file?

Thank You, Dharmik Patel

NitramLegov commented 1 year ago

The following address worked for us:

image

Please note: We have flashed the ESP before with a blink project from PlatformIO. Maybe that made a difference.

Also, we had to hard-reset the ESP by using its buttons in order to make it reboot.