For 'advanced' esp32 Flowcoders out there... You must have a working esp32 (v5) setup first...
I need to be able to use different config files for esp32 projects - and also add components etc which makes the newest 'single' compilation directory inconvenient.
One option is to rollback the batch files - but I wrote this as an experiment (and never having really worked with batch files before it might be a bit rough)
So - having backed up your current file this replaces C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\ESP\Batch\esp32_build.bat
This reverts to the old style 'directory' per project. It also uses idf.py create-project rather than building the directories from scratch - but maintains compatibility with everything. I did wonder about using the project_name.c file rather than the esp_project.c - but have stayed true to the FC technique (not least to avoid breaking all my old projects)
There is a slight issue - the batch file (and arguments) used seems to be 'fixed' - so I have hard coded the com port (I have COM6 currently) - there is maybe a workaround - where the COM port can be passed as a parameter.
Then - clicking 'compile to hex' builds and uploads the program. It has a speed advantage, especially for slower machines, because it just runs export.bat once. First compilation is slow - it does ~1200 files - but thereafter it is quicker. Also it's much quicker if comms failed (PuTTY open?) - as it doesn't attempt to recompile.
I removed the 'stats' - I don't often look at them - but they could also be added if needed.
Also - it might be useful to add 'git init' - for a little version control..
Any thoughts / improvements / requests?
You'll probably need to change the COM port in the last line (and if you are lucky might get away with a faster baud rate?)
Martin
Code: Select all
REM CRC: 0796FC1E6A776AF9156B257209C35258CE7C28B3EC20AEA2C632DB392A0E4BFD5B3F53B21811978F7B21FE4085045A7E774D1D3D69D8A99EE7320EAE740A5DB69CE852FCC2E76CD08880CFFD18B90BBB3A0DDF873040DD7BD8DA408700E5719B7AED6A0109421CF3B199900461C78937B42DEF8219F63A24580137A2F6C8FDB7553324EFF791947E8AB6FFD612B81BAA97C798A8F1CFC189DE5D38517747C774AF2DD6F839BAECF83F7F994C7164CE77868F480396BDEF2F2C3050DA273BE4EE6448CEF0EFC2793410C8AE2F408667340D60716539085AD7C37F16299AE1E9D4E82474DD52B742AE
REM REVISION: 14.0
REM GUID: 955EA920-4961-4C53-BA6B-EF4AF66BB4C2
@SET BASE_DIR=%~1
@SET TARGET=%~2
@SET OUT_DIR=%~3
@SET CONFIG=%~4
@SET CHIPTYPE=%~5
@ECHO OFF
@SET DOS_BUILD_DIR=%OUT_DIR%\%TARGET%
@CALL %BASE_DIR%export.bat> nul
@REM Remove spaces from the path ...
@SET DOS_BUILD_DIR=%DOS_BUILD_DIR: =_%
@ECHO Building: %TARGET% ...
@REM Create the project tree and copy in default files ...
IF EXIST %OUT_DIR%%TARGET% GOTO CREATED
idf.py create-project %TARGET% --path %OUT_DIR%
@PUSHD %~dp0
@COPY /Y mainCMakeLists.txt "%DOS_BUILD_DIR%\main\CMakeLists.txt" > nul
@COPY /Y component.mk "%DOS_BUILD_DIR%\main" > nul
@COPY /Y %CONFIG%.txt "%DOS_BUILD_DIR%\sdkconfig" > nul
@POPD
cd %DOS_BUILD_DIR%
@COPY "%OUT_DIR%%TARGET%.c" "%DOS_BUILD_DIR%\main\esp-project.c" > NUL
idf.py set-target %CHIPTYPE%
GOTO BUILD
:CREATED
cd %DOS_BUILD_DIR%
@COPY /Y "%OUT_DIR%%TARGET%.c" "%DOS_BUILD_DIR%\main\esp-project.c" > NUL
:BUILD
idf.py -p COM6 -b 921600 flash