Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX6UL-AN-0005: Using DART for embedded applications

807 bytes added, 14:44, 14 October 2022
no edit summary
''You can also produce only a Dart VM runtime, no SDK, by replacing create_sdk with runtime. This process involves also building a VM that targets ia32/x64, which is used to generate a few parts of the SDK''
== Installing the SDK in the target ==
Once the SDK image has been created, it is possible to create an archive and copy it in the target (for example using ''scp'' or ''ftp'') and then extract the archive in the <code>/usr/bin</code> directory:
<pre class="workstation-terminal">
dvdk@vagrant:~/dart/dart-sdk/sdk/out/ReleaseXARM/dart-sdk$ ls -la
dvdk@vagrant:~/dart/dart-sdk/sdk/out/ReleaseXARM/dart-sdk$ sudo tar zcpf ../dart-sdk-arm.tar.gz *
dvdk@vagrant:~/dart/dart-sdk/sdk/out/ReleaseXARM/dart-sdk$
</pre>
and then extract the archive in the <code>/usr/bin</code> target directory:
<pre class="workstation-terminal">
root@desk-mx6ul-lynx:/usr/bin# mkdir dart-sdk
root@desk-mx6ul-lynx:/usr/bin# cd dart-sdk
root@desk-mx6ul-lynx:/usr/bin/dart-sdk# scp user@192.168.0.23:/tmp/dart* .
user@192.168.0.23's password:
dart-sdk-arm.tar.gz 100% 114MB 2.2MB/s 00:52
root@desk-mx6ul-lynx:/usr/bin/dart-sdk# tar zxpf dart-sdk-arm.tar.gz
root@desk-mx6ul-lynx:/usr/bin/dart-sdk#
</pre>
It runs and shows the version
<pre class="workstation-terminal">
root@desk-mx6ul-lynx:/usr/bin/dart-sdk# ./bin/dart --version
Dart SDK version: 2.19.0-edge.5501c7f9787b77897b9ac6fdd22103f273663d0d (be) (Fri Oct 14 03:13:52 2022 +0000) on "linux_arm"
root@desk-mx6ul-lynx:/usr/bin/dart-sdk#
</pre>
== Running the ''Hello world'' example ==
Before running a Hello World in Dart is to have the Dart SDK has to be installed on the local target, i.e. the previous steps have to be already accomplished.
The simpler example written in Dart can be the following one:
8,241
edits