About the project:-
This project is about flashing micro python interpreter on Esp32 S3 Sense board.
Why I decided to make it:-
When I was trying to flash micro python on esp32 S3 Sense board. I was finding it very difficult to do the process. Since there was not proper solution all over internet. I wasted almost 7 days to flash the microcontroller by still no success. Until I have asked community expert for help. Where things started getting easy and the entire process completed in just 1 day. community member who knows about esp32 was of great help to me. I decided to make this project because I don't want any novice user to waste their time on flashing esp32 with micro python interpreter.
The project:-You need to have win 8.1 os x64 on your computer where you will install Python 3.7. To download Python follow the link bellow. Since esptool start supporting from Python 3.7 bellow this version esptool is not supported.
https://www.python.org/downloads/release/python-370/
After installation of Python You need to set path of Python interpreter so that it can be accessed via command prompt
Path:- PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. In general, each executing process or user session has its own PATH setting.To set path you need to copy the location where the python interpreter is located.
Steps to search for Python interpreter location
Step 1:- Locate the python interpreter location as shown bellow
Step 2:- right click to open a window in it click open file location. A window will appear that has location of shortcut to python interpreter as shown bellow.
Step 3:-
Choose python 3.7 and then right click to open properties. As shown bellow.
Step 4:-
A window will appear in which you can find location of python interpreter as shown bellow.
Step 5:-
copy the link given in target past it in notepad and remove Python.exe at the suffix of the link as shown bellow.
Steps to set path of python interpreter
Step 1:-
Open control panel. As shown bellow.
Step 2:-
On it click System and security. A window will appear as shown bellow.
Step 3:-
On it click system. A window will appear as shown bellow.
Step 4:-
On it click Advance system setting on right A window will appear as shown bellow.
Step 5:-
Select Advance table and click on Environment Variable button. A window of Environment variable will appear as shown bellow.
Step 6:-
On System variable window select path and click edit button. A window of Edit System Variable will appear as shown bellow.
Step 7:-
On the variable value text box enter semicolon ';' at the end of text and than copy and past the text that was edited in notepad. It is the location of Python command. click ok to save all the variable and close all the window.
Steps for testing if Path variable is set or not
Step 1:-
Open command prompt as show bellow
Step 2:-
Type python in command prompt and a python prompt will appear as shown bellow. If it doesn't you have to properly set the path variable for python command.
We will use esptool in python to flash esp32 s3 sense microcontroller with micro python interpreter. for that we will have to check where the pyhon has pip command in it or not and update that pip command to latest version.
pip:The pip command looks for the package in PyPI, resolves its dependencies, and installs everything in your current Python environment to ensure that requests will work . The pip install <package> command always looks for the latest version of the package and installs it.Steps for testing and updating pip command in python:-
Step 1:-
type "python -m pip" in command prompt and you will get the output as bellow.
Step 2:-
type "python -m pip install --upgrade pip" in command prompt and it will update the pip command of python.
We are going to use esptool for flashing micro python interpreter on esp32 s3 microcontroller.
esptool: A Python-based, open-source, platform-independent utility to communicate with the ROM bootloader in Espressif chips.Steps to install esptool in python:-
Step 1:-
Type the following command in command prompt to install esptool. "python -m pip install esptool". As show bellow it will start installing esptool.
After installing esptool you need to flash the esp32 s3 microcontroller with micro python interpreter. For that you have to download compatible binary file. bellow is the link that is compatible with esp32 s3 sense controller board. you should download binary that is stable and have .bin extension.
https://micropython.org/download/ESP32_GENERIC_S3/
Steps for erasing the microcontroller and flashing it with micro python interpreter:-
Step 1:-
Before you cane erase the flash of microcontroller. you have to set the microcontroller in boot mode to do so press and hold the boot button on the microcontroller and connect it to the computer USB as shown bellow.
After connecting it to the USB red light will start glowing as long as the red light is glowing the controller is in boot mode. When the red light stops glowing the microcontroller is out of boot mode.
Step 2:-
write "python -m esptool erase_flash" to erase flash as shown bellow. If you see any error while erasing the flash it means the microcontroller is pout of boot mode. bellow is the demo of it is getting flashed.
Step 3:-
In order to flash the micro python interpreter go to the directory when you have downloaded the micro python interpreter .bin file using command prompt. after that type the following command "python -m esptool --port COM4 write_flash -fm dio 0x00000 ESP32_GENERIC_S3-20220117-v1.18.bin" as shown bellow.
You are done flashing the microcontroller with micro python.


Comments