Closed AndKe closed 4 years ago
@AndKe First, when you do a package ensure to zip only the sketch files not the .git/ directory, this will avoid to get an 17Mb archive :wink:
The TEST_with_D is not OK as you define explicitly the Serial2
:
HardwareSerial Serial2(PA2);
and ask thanks the build_opt.h to instantiate the Serial2
so the fail are normal.
Finally about why the TEST_no_D is failed is linked to the core.a archive. I do not know how Arduino handles this but for both sketch the same cache is used /tmp/arduino_cache_xxxxxx/core/core_xxxxxxxxxxxxxxxxxxxxxxxxxx.a
So if the first build is TEST_with_D then it's failed then the TEST_no_D will also be failed. So if the first build is TEST_no_D then it's passed then the TEST_with_D will also be passed .
build_opt.h is not detected by the Arduino IDE as a build item and I could not do anything to avoid that as it is only used in the gcc command line as I mentioned in the wiki: https://github.com/stm32duino/wiki/wiki/Customize-build-options-using-build_opt.h#warning
So if you add or modify the build_opt file then reload Arduino IDE.
Thank you. I thought I needed to -DENABLE_HWSERIAL2 -DENABLE_HWSERIAL3 just to be able to use Serial2 / Serial3 Apparently this is redundant as HardwareSerial Serial2 does the same job?
You could define hardwareSerial with the name you want or enable a default instance using -Dxxxx then it is instantiate with the first pins found in peripheral pins.c array for the usartx selected or using the predefined pin PIN_SERIAL_RX/TXx in variant.h if any
@AndKe I've updated the wiki to be more precise: https://github.com/stm32duino/wiki/wiki/API#hardwareserial
it is much better now. :+1:
TEST_.zip
Describe the bug
In an application with build_opt.h is built first it will fail, and another application, w/o that file will fail too. In an application without that file is compiled first (successfully), then both will compile.
To Reproduce Steps to reproduce the behavior: -download the attached file. -open both projects side-by-side one in each Arduino 1.8.10 (release) (I open one arduino, then select file.. and open the next project the same way, not sure whatever these two are perfectly separated instances) Compile TEST_no_D : observe that it is a success. Compile TEST_with_D : observe that it is a success. close both Arduino IDE's open Arduino, and again , open both projects. Compile TEST_with_D : observe that it fail Compile TEST_no_D : observe that it fail too..
"TEST_with_D" will not compile as first/open open project.
Expected behavior I would expect the outcome to be the same for same app, regardless of what have been compiled first.
Desktop (please complete the following information):