Upload same b

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
MJU20
Posts: 367
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 105 times
Been thanked: 76 times

Upload same b

Post by MJU20 »

Again, maybe a naive suggestion (from a chaotic mind) :-)

When compiling a Flowcode chart to an ESP32-Wroom I need to push a button on the ESP32 DEV-board to upload the program.
- Sometimes, during compiling my attention is drawn to another thing and I forget to push the button
- Sometimes there is a serial monitor still running so the program can't get access to the COM-port.
- ..

In these cases I need to start compiling again which takes a while, and this is annoying because the compiling was done a few seconds ago and nothing changed.
The only thing is that the upload wasn't finished.

Would it be a option to have a function in FC that uploads the last generated files without compiling again?

Would look like this:
Nieuw-1.jpg
Nieuw-1.jpg (24.05 KiB) Viewed 4331 times

Steve-Matrix
Matrix Staff
Posts: 1907
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 283 times
Been thanked: 445 times

Re: Upload same b

Post by Steve-Matrix »

Thanks for the suggestion. I have added it to my list and this should be a relatively easy addition to make.

Steve-Matrix
Matrix Staff
Posts: 1907
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 283 times
Been thanked: 445 times

Re: Upload same b

Post by Steve-Matrix »

You could use the "User-defined tools" facility of Flowcode v10 (in the Build menu) to create your own button to do this. I have done this for my projects.

By clicking the "Customise" button and then selecting the "User Tools" tab in the Options screen, I created a button called "ESP32_PROG" with the following settings:

Code: Select all

Command:
   $(fcddir)\ESP\Batch\esp32_prog_st.bat

Arguments:
    $(compileresp) "$(target)" "$(srcdir)" $(comport) 115200

Initial Folder:
    $(srcdir)
The "Use ShellExecute" needs to be ticked. Here's that screen, showing the button on the toolbar under "Build":
esp32_prog command.png
esp32_prog command.png (42.32 KiB) Viewed 3214 times
I have copied the existing "esp32_prog.bat" file and made a few changes to the numbers used when the batch file is referring to its parameters, then resaved it as "esp32_prog_st.bat". You can find this file in your "%PROGRAMDATA%\MatrixTSL\FlowcodeV10\FCD\ESP\Batch" folder. Here are the edits:

Code: Select all

@SET TOOLS_DIR=%~2
@SET TARGET=%~3
@SET OUT_DIR=%~4
@SET PORT=%~5
@SET BAUD=%~6
Hopefully this works for you too.

stefan.erni
Valued Contributor
Posts: 1230
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 228 times
Been thanked: 245 times

Re: Upload same b

Post by stefan.erni »

Hi Steve

It worked with the FC10, but not with the FC11.
I suspect the ESP32s are split up to s3 c3 c6.
Do you have any ideas?

Steve-Matrix
Matrix Staff
Posts: 1907
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 283 times
Been thanked: 445 times

Re: Upload same b

Post by Steve-Matrix »

I think you need to make a copy of the existing v11 "esp32_prog.bat" batch file and make the following changes near the beginning of it:

Code: Select all

@SET BASE_DIR=%~2
@SET TARGET=%~3
@SET OUT_DIR=%~4
@SET PORT=%~5
@SET BAUD=%~6
@SET CONFIG=%~7
@SET CHIPTYPE=%~8
And the Arguments string within User Tools should be:

Code: Select all

"$(compileresp)" "$(target)" "$(srcdir)"  $(comport) 115200

stefan.erni
Valued Contributor
Posts: 1230
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 228 times
Been thanked: 245 times

Re: Upload same b

Post by stefan.erni »

Hi Steve

Thanks. That's easy to do.
I think there's still something wrong with the path. C:\FC_ESP\mtx exists but is empty.
But in C:\FC_ESP\mtxesp32_s3_sdkconfig there is a file CMakeLists.txt

SNAG-0084.PNG
SNAG-0084.PNG (133.58 KiB) Viewed 34 times

Steve-Matrix
Matrix Staff
Posts: 1907
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 283 times
Been thanked: 445 times

Re: Upload same b

Post by Steve-Matrix »

Ok, I think I can see what you need to do. You basically need to replicate the settings in the "<build> <programmer>" setting that is near the start of the FCDX file of the chip you are using.

For example, if you are using the "ESP32-S3_MINI", that entry in the FCDX file is:

Code: Select all

<programmer exe="$(fcddir)ESP\Batch\esp32_prog.bat"  params="&quot;$(compileresp)&quot; &quot;$(target)&quot; &quot;$(outdir)&quot; $(comport) 115200 esp32_s3_sdkconfig  esp32s3 " UsesComm="1" />
In that case, you would need the following in the arguments string: in the User Tools entry:

Code: Select all

"$(compileresp)" "$(target)" "$(outdir)"  $(comport) 115200 esp32_s3_sdkconfig  esp32s3

stefan.erni
Valued Contributor
Posts: 1230
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 228 times
Been thanked: 245 times

Re: Upload same b

Post by stefan.erni »

Hi Steve

Perfect!
It's working nice.

Post Reply