Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Arduino C# Compiler" #1785

Merged
merged 386 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
386 commits
Select commit Hold shift + click to select a range
411bdac
Adding this class was not the right choice, I think
pgrawehr Feb 24, 2021
ece16ef
Partial revert of previous commits
pgrawehr Feb 24, 2021
93f520b
Intermediate commit: Will try a more sophisticated code analysis to e…
pgrawehr Feb 24, 2021
c14668f
Not yet a big improvement, but works again
pgrawehr Feb 24, 2021
00245d7
Start static code analysis, support suppressing interfaces
pgrawehr Feb 25, 2021
c14ad7a
DateTime formatting works in simulation
pgrawehr Feb 27, 2021
f8389f4
Constants can be copied to flash
pgrawehr Feb 28, 2021
8639b3b
String list can be copied to flash, too
pgrawehr Feb 28, 2021
cfb5266
Got the DateTime test running from flash on the real Due for the firs…
pgrawehr Feb 28, 2021
9f422e2
Support loading full program to flash
pgrawehr Mar 1, 2021
320a781
Use flash for program.
pgrawehr Mar 2, 2021
b426aa8
Fix short date display
pgrawehr Mar 2, 2021
70b6726
Initial manual merge
pgrawehr Mar 2, 2021
b9a301b
Merge branch 'IlExecutorHost' into IlExecutorHostMerged1
pgrawehr Mar 2, 2021
320cf63
Update StyleCop rules - project builds again
pgrawehr Mar 3, 2021
d23e8ae
Move MiniRuntime classes to subfolder
pgrawehr Mar 4, 2021
d93ced9
DateTime example extended a bit
pgrawehr Mar 5, 2021
9430ec0
Support auto-starting the stored program from flash
pgrawehr Mar 7, 2021
d0a5a9b
Add SpecialTypeList support
pgrawehr Mar 10, 2021
b367114
Support for SpecialTokenList
pgrawehr Mar 12, 2021
5342cf6
Test for Reflection functions
pgrawehr Mar 13, 2021
6f0318d
Implementation of Activator.CreateInstance
pgrawehr Mar 14, 2021
8c95c09
Support auto-restarting the application after a crash
pgrawehr Mar 18, 2021
2df6118
Static cctors must be marked void
pgrawehr Mar 18, 2021
390cee8
Support alignment in structures or classes
pgrawehr Mar 21, 2021
df2358b
Remove unused alignment, make Span<> a LargeValueType
pgrawehr Mar 24, 2021
3b2cb8d
Merge remote-tracking branch 'remotes/dotnet/main' into IlExecutorHos…
pgrawehr Mar 25, 2021
04de3c1
Fix build after update
pgrawehr Mar 25, 2021
0863ecd
Use modern command sequence
pgrawehr Mar 27, 2021
7141bc5
Reorganize test cases
pgrawehr Apr 1, 2021
7c1599a
Add GC support methods
pgrawehr Apr 1, 2021
21a92f6
Add support for printing method and class signatures in C# format
pgrawehr Apr 3, 2021
719945b
Extend runtime to support more complex samples
pgrawehr Apr 3, 2021
ff726aa
Intermediate commit
pgrawehr Apr 3, 2021
152a38f
Fix implementation of implicit conversion
pgrawehr Apr 4, 2021
9fa5f01
Merge branch 'GcSupport' into IlExecutorHostMerged2
pgrawehr Apr 4, 2021
bb2c0f9
Improved array support
pgrawehr Apr 8, 2021
1437290
Complex array support routine added
pgrawehr Apr 9, 2021
1521838
Use the interface map to find which method is being implemented
pgrawehr Apr 9, 2021
441bed9
EnumGetValues2 passes
pgrawehr Apr 10, 2021
d5a2f3c
Getting a step further loading UnitsNet
pgrawehr Apr 10, 2021
a337431
Compilation succeeds for the larger example
pgrawehr Apr 10, 2021
fd8a5a7
Bme680 almost works
pgrawehr Apr 13, 2021
c74fdf5
For some reason, the kernel suddenly fails to fit into flash
pgrawehr Apr 17, 2021
db57f45
Add test to reproduce crash formatting doubles
pgrawehr Apr 18, 2021
e84c42f
Double.ToString() was broken, now it seems to be better
pgrawehr Apr 19, 2021
d1c8316
Bme680 doesn't show proper values, and there's a problem with differe…
pgrawehr Apr 21, 2021
9f9fbd6
Fix crash when using list iterators
pgrawehr Apr 22, 2021
0e1499f
Additional ToString() tests, some of them failing
pgrawehr Apr 24, 2021
c71cded
Use nameof(), so "go to implementation" works
pgrawehr Apr 24, 2021
109ec9c
Add support for T[].GetIterator()
pgrawehr Apr 29, 2021
c459983
Extend examples, fix Dictionary bugs
pgrawehr May 2, 2021
43ad122
Make sure EqualityComparer..cctors are sorted first
pgrawehr May 2, 2021
5833e50
Remove function - no intrinsic required
pgrawehr May 2, 2021
332fc0c
Another comparison to improve startup sequence anticipation
pgrawehr May 2, 2021
138f337
Code cleanup
pgrawehr May 2, 2021
f94da1e
These tests are to big to be run from RAM
pgrawehr May 2, 2021
c4b05af
Extended example works
pgrawehr May 3, 2021
a27dce1
Support communication via WiFi
pgrawehr May 8, 2021
bb1e538
Disable unused gas sensor
pgrawehr May 8, 2021
046c3e0
Add humidity sensor measurement
pgrawehr May 9, 2021
3838f8d
Extend the example
pgrawehr May 10, 2021
e3b3812
Add implementation of Number.ToString() to library, for debugging pur…
pgrawehr May 10, 2021
606c5cb
Sort unsigned, so that binary search works
pgrawehr May 12, 2021
059aae5
Add dew point
pgrawehr May 15, 2021
47ba4e8
Start adding File I/O support
pgrawehr May 19, 2021
a9b8a75
Broken Weather stuff
pgrawehr May 19, 2021
bc24078
Intermediate commit
pgrawehr May 20, 2021
6a6ee60
Next intermediate commit
pgrawehr May 20, 2021
46ee69a
File system support additions
pgrawehr May 27, 2021
225d2e4
Further work on file system support
pgrawehr May 29, 2021
132d555
Partial file system support
pgrawehr May 30, 2021
ff17f55
Moves to FirmataCommandSequence
pgrawehr Jun 6, 2021
cd55b87
Revert "Moves to FirmataCommandSequence"
pgrawehr Jun 11, 2021
73174cf
File system support for ESP32 almost working
pgrawehr Jun 16, 2021
a783199
Basic support for exception handling added
pgrawehr Jun 26, 2021
38ae7ba
Use common constants
pgrawehr Jul 6, 2021
fa305f8
Write as ASCII
pgrawehr Jul 14, 2021
ffa18e8
Remove wrong warnings
pgrawehr Jul 19, 2021
79a0bcb
Convert List to Dictionary
pgrawehr Jul 19, 2021
734b79a
Support for frequency measurement using Arduino
pgrawehr May 30, 2021
2c8f054
Add infrastructure to add extended command handlers
pgrawehr Jun 5, 2021
19eaa27
Move DHT support to extension module
pgrawehr Jun 6, 2021
c4aa791
Move frequency measurement support to separate module
pgrawehr Jun 6, 2021
243c118
Message reply handling fixed
pgrawehr Jun 6, 2021
937bb0f
Ensure a disposed instance doesn't cause any harm here
pgrawehr Jun 6, 2021
c3c0a92
Fix command sequence for DisableFrequencyReporting
pgrawehr Jul 11, 2021
ee142ed
Change ID for FREQUENCY_COMMAND
pgrawehr Jul 17, 2021
491446b
Make sure the pin mode is set
pgrawehr Aug 3, 2021
ec0f141
Allow setting/getting the internal mode from clients
pgrawehr Aug 3, 2021
2a5770c
Merge remote-tracking branch 'remotes/origin/GenericCommandHandlerSup…
pgrawehr Aug 16, 2021
ff40beb
Fix unit test
pgrawehr Aug 16, 2021
259e344
Fix missing documentation
pgrawehr Aug 17, 2021
f57fad3
Review findings addressed
pgrawehr Aug 25, 2021
3fab03d
Fix a problem when connecting to an Arduino Uno
pgrawehr Aug 28, 2021
33abd06
Avoid static member and use ReaderWriterLockSlim
pgrawehr Sep 3, 2021
01ed14d
Minor review comments
pgrawehr Sep 19, 2021
7c383ed
Recursion is not required
pgrawehr Oct 10, 2021
4ab9c7b
Merge remote-tracking branch 'remotes/origin/GenericCommandHandlerSup…
pgrawehr Oct 10, 2021
b99dc25
Start moving compiler specific stuff to separate tool executable
pgrawehr Oct 10, 2021
d10a9d5
Move most code to ArduinoCsCompiler.cs project
pgrawehr Oct 10, 2021
15b4d93
Compiles again (mostly)
pgrawehr Oct 10, 2021
b818858
Tests appear to run again
pgrawehr Oct 10, 2021
867c1d4
Rename namespace of application
pgrawehr Oct 11, 2021
e45d410
Properly separated out compiler tests as well
pgrawehr Oct 11, 2021
cf91cd7
Tests run, but there's some exception throwing bug
pgrawehr Oct 13, 2021
b19cebb
Fix problem accessing message field of exception class
pgrawehr Oct 15, 2021
bb7d052
These are used, so re-add
pgrawehr Oct 15, 2021
3f6c8b0
Improve test stability
pgrawehr Oct 15, 2021
6a8449a
Add unit tests for overflow instructions
pgrawehr Oct 17, 2021
f95311b
Generate numbers for native methods automatically
pgrawehr Oct 23, 2021
0968213
Re-Add continuous numbering
pgrawehr Oct 23, 2021
59260e4
Added missing source files
pgrawehr Oct 23, 2021
4e64277
Extend exception test cases
pgrawehr Oct 24, 2021
c81d9a1
First working version of compiler frontend.
pgrawehr Oct 25, 2021
30c7488
Execution result is same as in unit test
pgrawehr Oct 25, 2021
cb5e3e4
Fix log level filtering
pgrawehr Oct 27, 2021
447d836
Fix missing method exception
pgrawehr Oct 27, 2021
55429b5
Initial debugging framework
pgrawehr Oct 30, 2021
8cdefad
First working single-step debugger
pgrawehr Oct 31, 2021
7c4fb5c
Message flow in receiver cleaned up
pgrawehr Nov 1, 2021
ec1395b
Searching for a synchronization problem
pgrawehr Nov 7, 2021
8616f3c
Replies ordered by queue to prevent missing one
pgrawehr Nov 7, 2021
f46c54b
WeatherStation sample runs again
pgrawehr Nov 9, 2021
c8095a9
Use abbreviated month names, full names may not fit
pgrawehr Nov 10, 2021
859e28d
Improve I2C bus scan speed
pgrawehr Nov 13, 2021
05b4fad
Improve stability on poor connections
pgrawehr Nov 13, 2021
a521dcb
Moved advanced bus scan support to extension class
pgrawehr Nov 13, 2021
0f16051
Add example for color-fading an RGB LED using three PWM channels
pgrawehr Nov 18, 2021
7f495a7
Send sequence at once
pgrawehr Nov 29, 2021
49ee317
Extend timeout to work around issue https://github.com/espressif/ardu…
pgrawehr Dec 4, 2021
bf08345
Fix array size increase
pgrawehr Dec 4, 2021
9a4d830
Introduce sequence number in IL commands
pgrawehr Dec 4, 2021
e3308b0
Allow sending some commands as Sequence
pgrawehr Dec 5, 2021
7fc74a2
Intermediate commit
pgrawehr Dec 8, 2021
6895f51
Add unit test
pgrawehr Dec 9, 2021
fd7a1b8
Added more ExceptionHandling tests
pgrawehr Dec 11, 2021
96c3713
Add support for handling system exceptions
pgrawehr Dec 13, 2021
210607f
Run only one test at once
pgrawehr Dec 14, 2021
c96db32
Add a test for a bug handling a LEAVE instruction
pgrawehr Dec 14, 2021
3087d29
Merge remote-tracking branch 'remotes/dotnet/main' into DebuggerSupport
pgrawehr Dec 15, 2021
71a3c7b
Fix merge issues, now builds against .NET 6.0
pgrawehr Dec 15, 2021
e764056
Improve stability of WeatherStation example
pgrawehr Dec 17, 2021
7b47781
Started to adapt runtime components to new framework
pgrawehr Dec 18, 2021
9738853
Code execution now at least begins with .NET6.0
pgrawehr Dec 18, 2021
1e0e5c9
Introduced new EquatableMethod class, to make sure method equality al…
pgrawehr Dec 19, 2021
9a49d95
The first tests run again, but they use to much memory
pgrawehr Dec 19, 2021
0c6ccab
Exception tests run again
pgrawehr Dec 20, 2021
2f3a12b
Existing unit tests work
pgrawehr Dec 25, 2021
948cb7c
Intermediate commit
pgrawehr Dec 25, 2021
470c7ef
Some api implementations and declarations
pgrawehr Dec 26, 2021
b6321d0
The WeatherStation sample compiles again
pgrawehr Dec 26, 2021
36b0aca
Prepare for optimizing duplicate generic implementations
pgrawehr Dec 27, 2021
d71a665
Can merge some generic implementations
pgrawehr Dec 28, 2021
b053694
Also need a manual implementation of FieldInfo.Equals
pgrawehr Dec 28, 2021
961b637
Move compiler specifics to Compiler
pgrawehr Dec 28, 2021
dbdc7f8
Compiles, but is still to big.
pgrawehr Dec 29, 2021
277255a
Some compatibility improvements
pgrawehr Dec 30, 2021
ea0f25b
Interop.Kernel32 is automatically replacing all instances of this class
pgrawehr Jan 7, 2022
3d4a7f7
Add a missing index test
pgrawehr Jan 7, 2022
4a6c3cb
Debugger significantly extended
pgrawehr Jan 8, 2022
a33213e
Bug fix starting the main method with arguments
pgrawehr Jan 8, 2022
95088d8
My WeatherStation stample runs in simulation
pgrawehr Jan 9, 2022
59e54e3
The debugger is able to show locals, arguments and the evaluation sta…
pgrawehr Jan 11, 2022
bfff285
Fix crash
pgrawehr Jan 14, 2022
e031347
Send static vector size, and fix some initializers using the PrivateI…
pgrawehr Jan 16, 2022
5690a0b
We can initialize the root vector for the static fields initially
pgrawehr Jan 18, 2022
b189e32
Fix a missing initializer value
pgrawehr Jan 18, 2022
72d11c5
Write out enums with correct size
pgrawehr Jan 19, 2022
6638b17
Fix regression introduced by using a common function
pgrawehr Jan 19, 2022
8cfc039
Include tests and runtime data writing in frontend
pgrawehr Jan 22, 2022
eeabbf6
Add new interactive test mode
pgrawehr Jan 22, 2022
ad16fd3
Create dotnet-desktop.yml
pgrawehr Jan 22, 2022
1925b72
Update dotnet-desktop.yml
pgrawehr Jan 22, 2022
d4ffba2
Merge pull request #82 from pgrawehr/CreateArduinoBuild
pgrawehr Jan 22, 2022
4b2784b
Update existing pipeline file instead of new one
pgrawehr Jan 27, 2022
1dc6aa2
Use a batch file instead of complex yaml
pgrawehr Jan 28, 2022
f17a0c2
Merge remote-tracking branch 'remotes/dotnet/main' into ArduinoCsPr
pgrawehr Jan 29, 2022
ff3b7fb
Fix minor build issues
pgrawehr Jan 29, 2022
7196d76
These tests should not run during normal build
pgrawehr Jan 29, 2022
42a11ac
Running on a single CPU should show the test errors
pgrawehr Jan 29, 2022
e70484e
Use newer image, maybe this has .NET 6.0 preinstalled
pgrawehr Jan 29, 2022
c942830
At least getting to the relevant step now
pgrawehr Jan 29, 2022
c84a8a3
Should get ESP32 build to run now
pgrawehr Jan 29, 2022
83779f3
A few more steps
pgrawehr Jan 29, 2022
abd97d3
In the IDE, the build passes, so we can't be that far off
pgrawehr Jan 30, 2022
043ff8b
Now gluing everything together
pgrawehr Jan 31, 2022
d6b7e42
Need to bring msbuild into the path
pgrawehr Jan 31, 2022
416e46d
Where is msbuild?
pgrawehr Jan 31, 2022
f24c700
Visual Studio Enterprise is installed, therefore change path
pgrawehr Jan 31, 2022
d340293
Restart build
pgrawehr Feb 1, 2022
1abfca3
Need the ESP32 core v2.0.2 or later
pgrawehr Feb 1, 2022
8869ea3
Add a missing library dependency
pgrawehr Jan 22, 2022
dd32e2d
Be a bit more verbose on the long running tests
pgrawehr Feb 1, 2022
59a2be0
Use of a BlockingCollection when waiting for ACKs
pgrawehr Feb 2, 2022
f9b6f77
Building with /maxCpuCount:1 on Windows and Linux
pgrawehr Feb 2, 2022
af481ed
Add ping command to measure round-trip time
pgrawehr Jan 26, 2022
71a2ab2
Extend timeout and publish results (test)
pgrawehr Feb 3, 2022
cefd829
The pipeline computers are still to slow
pgrawehr Feb 3, 2022
542bfeb
File renamed
pgrawehr Feb 4, 2022
091932f
Start with some tests for localization support
pgrawehr Feb 4, 2022
fed769b
Take timezone information from system
pgrawehr Feb 7, 2022
e10647a
Fix crash when debugger shows arguments of non-static method
pgrawehr Feb 8, 2022
16f77d9
Improve map file output
pgrawehr Feb 8, 2022
391bf1e
First attempt to calculate alignments
pgrawehr Feb 9, 2022
2c6afa1
First part of getting time zone from system
pgrawehr Feb 13, 2022
12a0225
Time zone support appears to finally work
pgrawehr Feb 13, 2022
978db81
Trim message when it ends with CR+LF
pgrawehr Feb 14, 2022
e4588cd
Try to support a second, local culture
pgrawehr Feb 14, 2022
341150e
Allow selecting a culture via command line
pgrawehr Feb 14, 2022
6475720
Support localized date/time/number formats
pgrawehr Feb 15, 2022
cd009ba
Fix a compiler warning
pgrawehr Feb 16, 2022
6c3c4e5
Add weird compiler warning issue
pgrawehr Feb 27, 2022
bb119a2
Start extending the prepare command
pgrawehr Feb 27, 2022
fd1be2b
Merge remote-tracking branch 'remotes/dotnet/main' into ExtendedPrepa…
pgrawehr Feb 27, 2022
4ce450e
Allow creating partition map, prepare improved error handling
pgrawehr Feb 27, 2022
da04ddb
Provide some native implementations, Logging improvements
pgrawehr Feb 27, 2022
09b1484
Working on completing some remaining native functions
pgrawehr Mar 1, 2022
e32171e
Almost the last warnings removed
pgrawehr Mar 2, 2022
4157bd6
GpioDrivers should not be internal
pgrawehr Mar 2, 2022
951c25b
No warnings for WeatherStation sample
pgrawehr Mar 2, 2022
c43e0aa
Improve progress display, prevent progress during CI
pgrawehr Mar 3, 2022
891d87a
Fix implementation of Array.Clear()
pgrawehr Mar 4, 2022
450beec
Fix a problem referencing the correct equality comparer
pgrawehr Mar 5, 2022
5fb3d77
Fix a problem with the size of static fields
pgrawehr Mar 5, 2022
d9be545
Fix partition size alignment to 4k
pgrawehr Mar 6, 2022
bb29286
Make sure test run terminates with error code 0 on success
pgrawehr Mar 6, 2022
24f2940
Minor documentation fix
pgrawehr Mar 11, 2022
fa38450
Merge remote-tracking branch 'remotes/dotnet/main' into ArduinoCsPr
pgrawehr Mar 11, 2022
2e70de4
Add many missing license headers
pgrawehr Mar 11, 2022
2650032
Remove classes only used for testing
pgrawehr Mar 11, 2022
c8f4a6e
Add possibility to limit scan addresses
pgrawehr Mar 17, 2022
14dc48a
Weird: Everything appears to be successful but the task fails
pgrawehr Mar 17, 2022
fcfec26
Fix wrong project name
pgrawehr Mar 19, 2022
5cdea17
First step of documentation
pgrawehr Apr 1, 2022
806343e
Move sample to subfolder
pgrawehr Mar 20, 2022
0a70ea9
Prepare simple project template example
pgrawehr Apr 3, 2022
04aa285
A "bare bone" example to start with
pgrawehr Apr 3, 2022
8a89b1e
More documentation added
pgrawehr Apr 3, 2022
7500dce
Minor review comments
pgrawehr May 13, 2022
b793cf9
Merge remote-tracking branch 'remotes/dotnet/main' into ArduinoCsPr
pgrawehr May 17, 2022
3b7b845
Fix merge conflicts
pgrawehr May 17, 2022
1c6a6bb
Merge remote-tracking branch 'remotes/dotnet/main' into ArduinoCsPr
pgrawehr May 20, 2022
9c5359c
Undo most conflicting changes
pgrawehr May 21, 2022
08fd86b
This was broken due to a conflict
pgrawehr May 21, 2022
853259a
Remove test changes
pgrawehr Jun 19, 2022
d1e2711
By default, do not run compiler tests
pgrawehr Jun 20, 2022
7c238ef
Remove some usages of "var"
pgrawehr Jun 20, 2022
15ce5b1
Check parameters first
pgrawehr Jun 20, 2022
d5a4a5b
Automatically test whether running the full test suite is necessary
pgrawehr Aug 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 29 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ stages:
- job: Windows_NT
displayName: Windows Build
pool:
vmImage: windows-latest
vmImage: windows-2022

strategy:
matrix:
Expand All @@ -47,7 +47,7 @@ stages:
displayName: 'Execute Markdownlint'
condition: eq(variables['build.reason'], 'PullRequest')

- script: build.cmd -ci
- script: build.cmd -ci /maxCpuCount:1
-configuration $(BuildConfiguration)
-prepareMachine
/p:BuildPackages=true
Expand Down Expand Up @@ -79,6 +79,10 @@ stages:
sourceFolder: $(Build.SourcesDirectory)/artifacts/packages/$(BuildConfiguration)/Shipping
targetFolder: $(Build.ArtifactStagingDirectory)/Packages

- task: PublishTestResults@2
inputs:
mergeTestResults: true

- publish: $(Build.ArtifactStagingDirectory)/Packages
displayName: Publish Build Artifacts
artifact: BuildPackages
Expand All @@ -89,6 +93,28 @@ stages:
artifact: config
condition: eq(variables['BuildConfiguration'], 'Release')

- job: Windows_ArduinoIntegration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not add this to the main build yet. We should either make a new pipeline for this that can be invoked manually for a PR (probably ideal) or have some sort of logic that detects for changes on the Arduino or compiler bindings and would only run this job if any changes are detected. This latter option is less ideal, mainly cause you can't really invoke it if you want to run it even when changes are not detected, and it is also less maintainable since could be prone to breaking if files get moved around.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't see much of a problem the way it is now. This is easily identifyable as it is a separate build, and when it breaks on a PR it can quickly be checked whether the breakage is due to a bad change in the Arduino binding or whether it is due to some problem completely unrelated to the PR. This is much like we do with the hardware tests now. The number of PRs we have is not so big that this extra check cost really a lot of time right now.

displayName: Arduino Integration Tests
timeoutInMinutes: 120
pool:
vmImage: windows-2022

strategy:
matrix:
Build_Release:
BuildConfiguration: Release
Build_Debug:
BuildConfiguration: Debug

steps:
- script: build.cmd -ci
-configuration $(BuildConfiguration)
-prepareMachine
displayName: Build Iot

- script: eng\ArduinoCsCI.cmd $(UserProfile) $(BuildConfiguration)
displayName: Build and run Arduino Integration Tests

- job: Linux
displayName: Linux Build
container: LinuxContainer
Expand All @@ -103,7 +129,7 @@ stages:
BuildConfiguration: Debug

steps:
- script: ./build.sh --ci
- script: ./build.sh --ci /maxCpuCount:1
--configuration $(BuildConfiguration)
--prepareMachine
displayName: Build
Expand Down
66 changes: 66 additions & 0 deletions eng/ArduinoCsCI.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
echo on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my previous comment, let's just remove this file for now. We can later decide to add a separate pipeline that we can conditionally invoke in some PRs that where it is relevant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the build script, not the yml file. We might adapt or change this, but deleting won't help.


REM First argument is the path to the user home directory (typically C:\Users\VssAdministrator)
REM Second argument is either "Debug" or "Release"
if %1!==! goto :usage

choco install -y --no-progress arduino-cli
arduino-cli lib install "DHT sensor library"
arduino-cli lib install "Servo"

arduino-cli config init
arduino-cli config add board_manager.additional_urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
arduino-cli core update-index

set ArduinoRootDir=%1\Documents\Arduino
set acspath=%~dp0\..\tools\ArduinoCsCompiler\Frontend\bin\%2\net6.0\acs.exe

git clone https://github.com/firmata/ConfigurableFirmata %ArduinoRootDir%\libraries\ConfigurableFirmata
git clone https://github.com/pgrawehr/ExtendedConfigurableFirmata %ArduinoRootDir%\ExtendedConfigurableFirmata
arduino-cli core install esp32:esp32

dir %ArduinoRootDir%

%acspath% --help

rem Write runtime data to ExtendedConfigurableFirmata directory, before building
%acspath% prepare

rem bring msbuild into the path
call "c:\program files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"

pushd %ArduinoRootDir%\ExtendedConfigurableFirmata

dir
REM First build the code for the ESP32 (this just verifies that the code builds, it does no run-time checks at all)
arduino-cli compile --fqbn esp32:esp32:esp32:PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none ./ExtendedConfigurableFirmata.ino --warnings default
if errorlevel 1 goto error

REM then build the simulator code as Visual Studio C++ project
msbuild /p:Configuration=%2 ExtendedConfigurableFirmataSim\ExtendedConfigurableFirmataSim.vcxproj
if errorlevel 1 goto error

REM Start the simulator asynchronously
start ExtendedConfigurableFirmataSim\%2\ExtendedConfigurableFirmataSim.exe

popd
pushd %~dp0\..\tools\ArduinoCsCompiler\

REM and finally run the Arduino tests, now including the ones skipped previously. Set verbosity to normal to see
REM information about all tests being executed (as this test run can take 30 mins or more)
dotnet test -c %2 --no-build --no-restore --filter feature=firmata -l "console;verbosity=normal" -maxcpucount:1
if errorlevel 1 goto error

popd
taskkill /im ExtendedConfigurableFirmataSim.exe /f

Echo All done!
exit /b 0

:error
echo Tests failed. Error code %errorlevel%
exit /b 1
:usage

echo Usage: ArduinoCsCI.cmd [path-to-home-directory] [Configuration]

1 change: 1 addition & 0 deletions src/devices/Arduino/Arduino.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<TargetFrameworks>$(DefaultBindingTfms)</TargetFrameworks>
<EnableDefaultItems>false</EnableDefaultItems>
<RootNamespace>Iot.Device.Arduino</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Compile Include="*.cs" />
Expand Down
6 changes: 6 additions & 0 deletions src/devices/Arduino/Arduino.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CharacterLcd", "..\Characte
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common", "..\Common\Common.csproj", "{CD593083-8E94-4B60-86BF-DF3FB7873893}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CpuTemperature", "..\CpuTemperature\CpuTemperature.csproj", "{F3950513-A564-462F-887B-E00972D20FAD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{9E5A25ED-9839-4C1A-9B27-993437D1CB31}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arduino.Monitor", "samples\Arduino.Monitor.csproj", "{23B4B60C-9594-42BB-9D25-C54983B0F809}"
Expand Down Expand Up @@ -65,6 +67,10 @@ Global
{CD593083-8E94-4B60-86BF-DF3FB7873893}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD593083-8E94-4B60-86BF-DF3FB7873893}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD593083-8E94-4B60-86BF-DF3FB7873893}.Release|Any CPU.Build.0 = Release|Any CPU
{F3950513-A564-462F-887B-E00972D20FAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3950513-A564-462F-887B-E00972D20FAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3950513-A564-462F-887B-E00972D20FAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3950513-A564-462F-887B-E00972D20FAD}.Release|Any CPU.Build.0 = Release|Any CPU
{23B4B60C-9594-42BB-9D25-C54983B0F809}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23B4B60C-9594-42BB-9D25-C54983B0F809}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23B4B60C-9594-42BB-9D25-C54983B0F809}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion src/devices/Arduino/ArduinoBoard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public IReadOnlyList<SupportedMode> KnownModes
/// This requires an arduino with an ethernet shield or an ESP32 with enabled WIFI support.
/// </summary>
/// <param name="boardAddress">The IP address of the board</param>
/// <param name="port">The network port to use</param>
/// <param name="port">The network port to use. The default port is 27016</param>
/// <param name="board">Returns the board if successful</param>
/// <returns>True on success, false otherwise</returns>
public static bool TryConnectToNetworkedBoard(IPAddress boardAddress, int port,
Expand Down
2 changes: 1 addition & 1 deletion src/devices/Arduino/FirmataDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ public byte[] SendCommandAndWait(FirmataCommandSequence sequence, TimeSpan timeo
{
foreach (var s2 in sequencesWithAck)
{
if (_pendingResponses.TryRemoveElement(x => isMatchingAck(s2.Key, x!), timeout, out response))
if (s2.Value == false && _pendingResponses.TryRemoveElement(x => isMatchingAck(s2.Key, x!), timeout, out response))
{
CommandError e = CommandError.None;
if (response == null)
Expand Down
1 change: 1 addition & 0 deletions src/devices/Arduino/samples/Arduino.Monitor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<!--Cases used when running in VS, with the solution config either Windows-Debug or Linux-Debug (or -Release) -->
<ProjectReference Include="..\..\Bmxx80\Bmxx80.csproj" />
<ProjectReference Include="..\..\Button\Button.csproj" />
<ProjectReference Include="..\..\Board\Board.csproj" />
<ProjectReference Include="..\..\CharacterLcd\CharacterLcd.csproj" />
<ProjectReference Include="..\..\HardwareMonitor\HardwareMonitor.csproj" />
<ProjectReference Include="..\..\Mcp3xxx\Mcp3xxx.csproj" />
Expand Down