@echo off

Echo PROGRAMING TOOL CREATED BY BCS
Echo.
Echo SOURCE CODE FILES COLLETING. . . . . . 
PAUSE >nul 

for %%x in (*.ino.partitions.bin) do (
 
  set sourceCodeP=%%x
  
)


for %%x in (*.ino.bin) do (
 
  set sourceCode=%%x
)
Echo.
Echo.


set port=12

set /p port= If change COM port type new port :-(Default COM port:- %port%)?:
Echo.
Echo.

Echo setup COM port :- %port%
echo sourceCode file    :- %sourceCode%
echo sourceCode partitions :- %sourceCodeP%

Echo.
Echo.

Echo PROGRAMING TOOL Rady to upload
Echo Press Enter to Process........ 
PAUSE >nul

esptool.py --chip esp32 --port COM%port% --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 ./boot_app0.bin 0x1000 ./bootloader_qio_80m.bin 0x10000 ./%sourceCode% 0x8000 ./%sourceCodeP%

Echo PROGRAMMING END.. 
PAUSE >nul
PAUSE 