ESP32 fails to build, warnings being treated as errors

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Tinker
Posts: 25
http://meble-kuchenne.info.pl
Joined: Mon Sep 19, 2022 11:19 pm

ESP32 fails to build, warnings being treated as errors

Post by Tinker »

Hi All,
this should have been a simple task. A loop scans an IR beam, and when the beam is broken, the loop is exited and the warning light out on with a timer, after which the loop is called again.

I include here the flow-file and the build error list
Too many points to cover here. Some warning are about declared processes which are unused, but the declarations must have been auto created, also loop function witch are "depreciated" ? This is a simple code for teaching, any help appreciated.
Tink
Attachments
Beam-debug.docx
(17.21 KiB) Downloaded 120 times
Security Beam.fcfx
(12.57 KiB) Downloaded 131 times

mnfisher
Valued Contributor
Posts: 1638
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 142 times
Been thanked: 761 times

Re: ESP32 fails to build, warnings being treated as errors

Post by mnfisher »

The esp32 compiler is very strict (or to be more correct - the settings used are set to be very strict) - and the compiler is complaining that a variable may be used without being initialised.

For example:

int x;
if test == true
x =123
then
y = x
...

Will cause an error - because y is set to x and unless test is true then x may be an unitialised value.

Unfortunately - errors are often hard to spot, with pages of warnings churned out (I usually load the compiler text into an editor and search for 'error')

This looks like a problem in the switch array component where in ReadState - there are several cases where the return value isn't set - so the component will need to be updated.

Martin

medelec35
Matrix Staff
Posts: 2088
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 645 times
Been thanked: 703 times

Re: ESP32 fails to build, warnings being treated as errors

Post by medelec35 »

Hello.
Thank you for letting us know and thank you, Martin.
I have fixed the issue, and the component will be pushed onto the update system as soon as possible.
If you would like to try the component before the updates are pushed.
Browse to this location using file explorer, it's hidden by default so just paste the link into your address bar.

Code: Select all

C:\ProgramData\MatrixTSL\FlowcodeV9\Components
Replace the existing file with the attached file.
If Flowcode is already open, then you will need to reload your project for the new components to work
If you run any component updates, then the components you added will be overwritten with the updated version.
Attachments
switch_array_slide.fcpx
(7.08 KiB) Downloaded 114 times
Martin

Tinker
Posts: 25
Joined: Mon Sep 19, 2022 11:19 pm

Re: ESP32 fails to build, warnings being treated as errors

Post by Tinker »

Thank you both for the information and guidance. Prior to reading your response I was beginning to think it was because I started the project by adding all the components I wanted to use, Components like a light lux level sensor, a buzzer and the dip switches to set a delay time. I then deleted some of the components when I could not get the project to build although it worked fine in simulation. My thoughts were deleting the components from the project had not removed some of the code legacy those components had created when inserted into the project. I wrote the program again without the switch and it built ok. I will grab your corrected project and try it now. Cheers Tink

Tinker
Posts: 25
Joined: Mon Sep 19, 2022 11:19 pm

Re: ESP32 fails to build, warnings being treated as errors

Post by Tinker »

Project now builds but compile to target fails:-
Usage: idf.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
Try 'idf.py --help' for help.
Error: Invalid value for '-b' / '--baud': 'flash' is not a valid integer.
Programming Failed
C:\ProgramData\MatrixTSL\FlowcodeV9\FCD\ESP\Batch\esp32_prog.bat reported error code 0x1
Autoclose turned off
FINISHED

Is this a setting that needs change? Tink

mnfisher
Valued Contributor
Posts: 1638
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 142 times
Been thanked: 761 times

Re: ESP32 fails to build, warnings being treated as errors

Post by mnfisher »

Need to set the COM port in project options

Tinker
Posts: 25
Joined: Mon Sep 19, 2022 11:19 pm

Re: ESP32 fails to build, warnings being treated as errors

Post by Tinker »

Too quick mnfisher I just found the post dealing with this error and came back to pull the post off the forum, many thanks for extending your help.
cheers
Tink

mnfisher
Valued Contributor
Posts: 1638
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 142 times
Been thanked: 761 times

Re: ESP32 fails to build, warnings being treated as errors

Post by mnfisher »

Glad you got it sorted.. I think everyone has been 'caught' by this at one time or another!

Martin

Post Reply