Git Product home page Git Product logo

toit's Introduction

Toit programming language

This repository contains the Toit language implementation. It consists of the compiler, virtual machine, and standard libraries that together enable Toit programs to run on an ESP32.

Jaguar: Live reloading for the ESP32

You can use Toit to develop, update, and restart your ESP32 applications in less than two seconds through Jaguar. Jaguar is a small Toit program that runs on your ESP32. It uses the capabilities of the Toit virtual machine to let you update and restart your ESP32 applications written in Toit over WiFi whenever your source files change. Once set up, it is as easy as:

jag watch examples/hello.toit

It is also straightforward to install extra drivers and services that can extend the core functionality of your device. Add automatic NTP-based time synchronization without having to write a single line of code:

jag container install ntp examples/ntp/ntp.toit

You can watch a short video that shows how you can experience Jaguar on your ESP32 in less two minutes:

Jaguar demonstration

Community

Use this invite to join our Discord server, and follow the development and get help. We're eager to hear of your experience building with Toit. The Discord chat is publicly accessible through our Linen.

We also use GitHub Discussions to discuss and learn.

We follow a code of conduct in all our community interactions.

References

The Toit language is the foundation for the Toit platform that brings robust serviceability to your ESP32-based devices. You can read more about the language and the standard libraries in the platform documentation:

Contributing

We welcome and value your open source contributions to the language implementation and the broader ecosystem. Building or porting drivers to the Toit language is a great place to start. Read about how to get started building I2C-based drivers and get ready to publish your new driver to the package registry.

If you're interested in pitching in, we could use your help with these drivers and more!

Licenses

The Toit compiler, the virtual machine, and all the supporting infrastructure is licensed under the LGPL-2.1 license. The standard libraries contained in the lib/ directory are licensed under the MIT license. The examples contained in the examples/ directory are licensed under the 0BSD license.

Certain subdirectories are under their own open source licenses, detailed in those directories and the files they contain. These subdirectories are:

  • The subdirectory lib/font/matthew_welch/
  • Every subdirectory under packages/
  • Every subdirectory under lib/font/x11_100dpi/
  • Every subdirectory under src/compiler/third_party/
  • Every subdirectory under src/third_party/
  • Every subdirectory under third_party/

Installation

The instructions in this section don't cover the IDE integration. Follow the instructions below to set up Toit support for your editor.

Arch Linux

For Arch Linux (or variants such as Manjaro) use your favorite AUR helper to install the toit or toit-git package.

For example:

yay -S toit

Other platforms

We're actively working on simple installation steps for other platforms. For now, please use the build instructions below or download the .tar.gz files from the release page.

Building

Dependencies

Build system

Linux and Mac

To build Toit and its dependencies the build host requires:

If you are using a Linux distribution with apt capabilities, you can issue the following command to install these:

sudo apt install build-essential cmake ninja-build golang

You can then build Toit by running the following commands in a checkout of this repository:

git submodule update --init --recursive
make

For builds targeting ESP32 hardware additional requirements might be in effect depending on the build host's architecture, see paragraph ESP32 tools.

For builds targeting RISC-V, ARM32, or ARM64 hardware, see the Other platforms README.

Windows

If you are using Windows you can use Chocolatey to install the required dependencies.

After installing Chocolatey, you can install the required dependencies by running the following command in an elevated shell (usually the same you just used to install Chocolatey):

choco install git ninja mingw make golang ccache
choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=System"'

After that you can use the bash that comes with Git ('git-bash') and compile Toit in a checkout of this repository by running the following commands:

git submodule update --init --recursive
make

ESP-IDF

The Toit VM has a requirement for the Espressif IoT Development Framework, both for Linux and ESP32 builds (for Linux it's for the Mbed TLS implementation).

We recommend you use Toitware's ESP-IDF fork that comes with a few changes:

  • Custom malloc implementation
  • Allocation-fixes for UART, etc.
  • LWIP fixes

The fork's repository has been added as a submodule reference to this repository, so doing a recursive submodule init & update will establish everything nedded:

git submodule update --init --recursive

If the submodule update step fails with:

Submodule path 'esp-idf/components/coap/libcoap': checked out '98954eb30a2e728e172a6cd29430ae5bc999b585'
fatal: remote error: want 7f8c86e501e690301630029fa9bae22424adf618 not valid
Fetched in submodule path 'esp-idf/components/coap/libcoap/ext/tinydtls', but it did not contain 7f8c86e501e690301630029fa9bae22424adf618. Direct fetching of that commit failed.

try following the steps outlined here. It is an issue in the upstream ESP-IDF repository caused by the tinydtls component having changed its remote URL.

To use the offical ESP-IDF, or any other variation, you need to add the Toit specific patches first.

Then make sure it is available in your file system and point IDF_PATH to its path instead before building.

export IDF_PATH=<A_DIFFERENT_ESP_IDF>

ESP32 tools

If you want to build an image for the ESP32, install the ESP32 tools.

On Linux:

$IDF_PATH/install.sh

The default location of $IDF_PATH is under ./third_party/esp-idf

For other platforms, see Espressif's documentation.

Remember to update your environment variables:

source $IDF_PATH/export.sh

Build for host machine

Make sure the required build tools are installed as described in dependency sections ESP-IDF and Build system above.

Then run the following commands at the root of your checkout.

make all

NOTE

These instructions have been tested on Linux and macOS.

Windows support is still preliminary, and the build instructions may differ for Windows. Let us know on the discussions forum how we can improve this README.


This builds the Toit VM, the compiler, the language server and the package manager.

You should then be able to execute a toit file:

build/host/sdk/bin/toit.run examples/hello.toit

The package manager is found at build/host/sdk/bin/toit.pkg:

build/host/sdk/bin/toit.pkg init --project-root=<some-directory>
build/host/sdk/bin/toit.pkg install --project-root=<some-directory> <package-id>

Debugging

See https://github.com/toitlang/toit/wiki/Debugging.

IDE integration

Toit has a VS Code extension. You can either use the published extension or build it yourself from the sources.

In the VS Code extension (version 1.3.7+) set the toitLanguageServer.command setting to ["PATH_TO_SDK/bin/toit.lsp", "--toitc=PATH_TO_SDK/bin/toit.compile"], where PATH_TO_SDK is the path to your build/host/sdk/ folder in the Toit repository.

This makes the extension use the language server that was compiled in the build step.

Other IDEs

The Toit language server is independent of VSCode and can be used with other IDEs. It can be started with:

build/host/sdk/bin/toit.lsp --toitc=build/host/sdk/bin/toit.compile

See the instructions of your IDE on how to integrate the language server.

There are syntax highlighters for VIM and CodeMirror in the ide-tools repository.

Build for ESP32

Make sure the environment variables for the ESP32 tools are set, as described in the dependencies section. Typically this consists of running the following command:

# On Linux and Mac OS X:
third_party/esp-idf/install.sh
# On Windows:
third_party\esp-idf\install.bat

Build firmware that can be flashed onto your ESP32 device. The firmware is generated in build/esp32/firmware.envelope:

make esp32

If you want to flash the generated firmware on your device, you can use the firmware too. Internally, the firmware tool calls out to esptool.py so you need to build that first using make esptool. Assuming your device is connected through /dev/ttyUSB0 you can achieve all of this through:

make esptool
build/host/sdk/tools/firmware -e build/esp32/firmware.envelope \
    flash --port /dev/ttyUSB0 --baud 921600

By default, the image boots up but does not run any application code. You can use your own entry point by installing it into the firmware envelope before extracting the firmware.bin file:

build/host/sdk/bin/toit.compile -w hello.snapshot examples/hello.toit
build/host/sdk/tools/firmware -e build/esp32/firmware.envelope \
    container install hello hello.snapshot
build/host/sdk/tools/firmware -e build/esp32/firmware.envelope \
    extract --format=binary -o firmware.bin

Alternatively, you can also specify the entry point through the ESP32_ENTRY make variable and let the Makefile handle the flashing:

make flash ESP32_ENTRY=examples/hello.toit ESP32_PORT=/dev/ttyUSB0

Adding multiple containers

You can add more containers before you extract firmware.bin, so you firmware envelope can have any number of containers.

build/host/sdk/bin/toit.compile -w hello.snapshot examples/hello.toit
build/host/sdk/bin/toit.compile -w ntp.snapshot examples/ntp/ntp.toit

build/host/sdk/tools/firmware -e build/esp32/firmware.envelope \
    container install hello hello.snapshot
build/host/sdk/tools/firmware -e build/esp32/firmware.envelope \
    container install ntp ntp.snapshot

You can list the containers in a given firmware envelope:

build/host/sdk/tools/firmware -e build/esp32/firmware.envelope \
    container list

The listing produces JSON output that can be processed by other tools:

{ "hello": {
    "kind" : "snapshot",
    "id"   : "f0b7e859-9188-52d9-8be3-856bd0e75919"
  },
  "ntp": {
    "kind" : "snapshot",
    "id"   : "6efefb4b-aa91-5600-ba7d-f76a8dc0ac01"
  }
}

Adding container assets

Containers have associated assets that they can access at runtime. Add the following code to a file named assets.toit:

import system.assets

main:
  print assets.decode

If you run this on an ESP32, you'll get an empty map printed becase you haven't associated any assets with the container that holds the code.

To associate assets with the container, we first construct an encoded assets file and add this README.md file to it.

build/host/sdk/tools/assets -e encoded.assets create
build/host/sdk/tools/assets -e encoded.assets add readme README.md

Now we can add the encoded.assets to the assets container at install time:

build/host/sdk/bin/toit.compile -w assets.snapshot assets.toit
build/host/sdk/tools/firmware -e build/esp32/firmware.envelope \
    container install --assets=encoded.assets assets assets.snapshot

If you update the source code in assets.toit slightly, the printed information will be more digestible:

import system.assets

main:
  readme := assets.decode["readme"]
  // Guard against splitting a unicode character by
  // making this non-throwing.
  print readme[0..80].to_string_non_throwing

You'll need to reinstall the container after this by recompiling the assets.toit file to assets.snapshot and re-running:

build/host/sdk/tools/firmware -e build/esp32/firmware.envelope \
    container install --assets=encoded.assets assets assets.snapshot

NOTE

To access the device /dev/ttyUSB0 on Linux you probably need to be a member of some group, normally either uucp or dialout. To see which groups you are a member of and which group owns the device, plug in an ESP32 to the USB port and try:

groups
ls -g /dev/ttyUSB0

If you lack a group membership, you can add it with

sudo usermod -aG dialout $USER

You will have to log out and log back in for this to take effect.


Configuring WiFi for the ESP32

You can easily configure the ESP32's builtin WiFi passing it as configuration when you extract the firmware.bin file:

echo '{ "wifi.ssid": "myssid", "wifi.password": "mypassword" }' > config.json
build/host/sdk/tools/firmware -e build/esp32/firmware.envelope \
    extract --format=binary -o firmware.bin --config config.json

The Makefile also has the ESP32_WIFI_SSID and ESP32_WIFI_PASSWORD make variables to support this, if you prefer flashing through make:

make flash ESP32_ENTRY=examples/http/http.toit ESP32_WIFI_SSID=myssid ESP32_WIFI_PASSWORD=mypassword

This allows the WiFi to automatically start up when a network interface is opened.

toit's People

Contributors

floitsch avatar kasperl avatar erikcorry avatar lask avatar mikkeldamsgaard avatar andersjohnsen avatar dsobotta avatar mikini avatar enyo avatar donghengqaz avatar serjan-nasredin avatar jstroem avatar cakemaster9001 avatar miltkall avatar justind000 avatar un01s avatar

Stargazers

 avatar Nir Adler avatar  avatar Cuda Chen avatar Wei Wu avatar Robert Smith avatar

Watchers

James Cloos avatar Wei Wu avatar

toit's Issues

BUILD ERROR -- is_directory: Invalid argument

ubuntu@ubuntu:~/git/toit-riscv$ make all
(cd build/host && cmake ../.. -G Ninja -DCMAKE_BUILD_TYPE=Release)
--Configuring done
--Generating done
--Build files have been written to: /home/ubuntu/git/toit-riscv/build/host
(cd build/host && ninja build_toitvm)
[1/1] Generating ../bin/toitvm_boot.snapshot
FAILED: bin/toitvm_boot.snapshot 
cd /home/ubuntu/git/toit-riscv/build/host/src && /usr/bin/cmake -E env ASAN_OPTIONS=detect_leaks=false ASAN_OPTIONS=detect_leaks=false /home/ubuntu/git/toit-riscv/build/host/bin/toitc --dependency-file /home/ubuntu/git/toit-riscv/build/host/src/boot.dep --dependency-format ninja -w /home/ubuntu/git/toit-riscv/build/host/bin/toitvm_boot.snapshot /home/ubuntu/git/toit-riscv/tools/toitvm_boot.toit
is_directory: Invalid argument
File not found: '/home/ubuntu/git/toit-riscv/tools/toitvm_boot.toit'
ninja: build stopped: subcommand failed.
make: *** [Makefile:41: build/host/bin/toitvm] Error 1
ubuntu@ubuntu:~/git/toit-riscv$ 

riscv64 host --. ./export.sh fails after 'successful' install.sh build

debian@debian:/home/debian/git/esp-idf-riscv$ ./install.sh
Detecting the Python interpreter
Checking "python" ...
Checking "python3" ...
Python 3.9.9
"python3" has been detected
Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf, xtensa-esp32s2-elf, xtensa-esp32s3-elf, riscv32-esp-elf, esp32ulp-elf, esp32s2ulp-elf, openocd-esp32
WARNING: directory for tool xtensa-esp32-elf version esp-2021r1-8.4.0 is present, but tool was not found
Installing [email protected]
file xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /home/debian/.espressif/dist/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz to /home/debian/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0
WARNING: directory for tool xtensa-esp32s2-elf version esp-2021r1-8.4.0 is present, but tool was not found
Installing [email protected]
file xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /home/debian/.espressif/dist/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz to /home/debian/.espressif/tools/xtensa-esp32s2-elf/esp-2021r1-8.4.0
WARNING: directory for tool xtensa-esp32s3-elf version esp-2021r1-8.4.0 is present, but tool was not found
Installing [email protected]
file xtensa-esp32s3-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /home/debian/.espressif/dist/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz to /home/debian/.espressif/tools/xtensa-esp32s3-elf/esp-2021r1-8.4.0
WARNING: directory for tool riscv32-esp-elf version esp-2021r1-8.4.0 is present, but tool was not found
Installing [email protected]
file riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /home/debian/.espressif/dist/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz to /home/debian/.espressif/tools/riscv32-esp-elf/esp-2021r1-8.4.0
WARNING: directory for tool esp32ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
Installing [email protected]
file binutils-esp32ulp-linux-amd64-2.28.51-esp-20191205.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /home/debian/.espressif/dist/binutils-esp32ulp-linux-amd64-2.28.51-esp-20191205.tar.gz to /home/debian/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205
WARNING: directory for tool esp32s2ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
Installing [email protected]
file binutils-esp32s2ulp-linux-amd64-2.28.51-esp-20191205.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /home/debian/.espressif/dist/binutils-esp32s2ulp-linux-amd64-2.28.51-esp-20191205.tar.gz to /home/debian/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205
WARNING: directory for tool openocd-esp32 version v0.10.0-esp32-20210401 is present, but tool was not found
Installing [email protected]
file openocd-esp32-linux64-0.10.0-esp32-20210401.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /home/debian/.espressif/dist/openocd-esp32-linux64-0.10.0-esp32-20210401.tar.gz to /home/debian/.espressif/tools/openocd-esp32/v0.10.0-esp32-20210401
Installing Python environment and packages
Python 3.9.9
pip 21.3.1 from /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages/pip (python 3.9)
Installing Python packages from /home/debian/git/esp-idf-riscv/requirements.txt
Looking in indexes: https://pypi.org/simple, https://dl.espressif.com/pypi
Ignoring None: markers 'sys_platform == "win32"' don't match your environment
Requirement already satisfied: setuptools>=21 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/requireme
nts.txt (line 4)) (58.3.0)
Requirement already satisfied: click>=7.0 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/requirements.
txt (line 8)) (8.0.3)
Requirement already satisfied: pyserial>=3.0 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/requiremen
ts.txt (line 9)) (3.5)
Requirement already satisfied: future>=0.15.2 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/requireme
nts.txt (line 10)) (0.18.2)
Requirement already satisfied: cryptography>=2.1.4 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/requ
irements.txt (line 11)) (36.0.0)
Requirement already satisfied: pyparsing<2.4.0,>=2.0.3 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/
requirements.txt (line 12)) (2.3.1)
Requirement already satisfied: pyelftools>=0.22 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/require
ments.txt (line 13)) (0.27)
Requirement already satisfied: gdbgui==0.13.2.0 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/require
ments.txt (line 15)) (0.13.2.0)
Requirement already satisfied: pygdbmi<=0.9.0.2 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/require
ments.txt (line 18)) (0.9.0.2)
Requirement already satisfied: python-socketio<5 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/requir
ements.txt (line 21)) (4.6.1)
Requirement already satisfied: kconfiglib==13.7.1 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/requi
rements.txt (line 23)) (13.7.1)
Requirement already satisfied: reedsolo<=1.5.4,>=1.5.3 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/
requirements.txt (line 26)) (1.5.4)
Requirement already satisfied: bitstring>=3.1.6 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/require
ments.txt (line 27)) (3.1.9)
Requirement already satisfied: ecdsa>=0.16.0 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/requiremen
ts.txt (line 28)) (0.17.0)
Requirement already satisfied: construct==2.10.54 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from -r /home/debian/git/esp-idf-riscv/requi
rements.txt (line 32)) (2.10.54)
Requirement already satisfied: Flask<1.0,>=0.12.2 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /home/debian/git/e
sp-idf-riscv/requirements.txt (line 15)) (0.12.5)
Requirement already satisfied: gevent<2.0,>=1.2.2 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /home/debian/git/e
sp-idf-riscv/requirements.txt (line 15)) (1.5.0)
Requirement already satisfied: Pygments<3.0,>=2.2.0 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /home/debian/git
/esp-idf-riscv/requirements.txt (line 15)) (2.10.0)
Requirement already satisfied: Flask-SocketIO<3.0,>=2.9 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /home/debian
/git/esp-idf-riscv/requirements.txt (line 15)) (2.9.6)
Requirement already satisfied: Flask-Compress<2.0,>=1.4.0 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /home/debi
an/git/esp-idf-riscv/requirements.txt (line 15)) (1.10.1)
Requirement already satisfied: cffi>=1.12 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from cryptography>=2.1.4->-r /home/debian/git/esp-id
f-riscv/requirements.txt (line 11)) (1.15.0)
Requirement already satisfied: python-engineio<4,>=3.13.0 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from python-socketio<5->-r /home/deb
ian/git/esp-idf-riscv/requirements.txt (line 21)) (3.14.2)
Requirement already satisfied: six>=1.9.0 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from python-socketio<5->-r /home/debian/git/esp-idf-
riscv/requirements.txt (line 21)) (1.16.0)
Requirement already satisfied: pycparser in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from cffi>=1.12->cryptography>=2.1.4->-r /home/debian
/git/esp-idf-riscv/requirements.txt (line 11)) (2.21)
Requirement already satisfied: itsdangerous>=0.21 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from Flask<1.0,>=0.12.2->gdbgui==0.13.2.0->-
r /home/debian/git/esp-idf-riscv/requirements.txt (line 15)) (2.0.1)
Requirement already satisfied: Jinja2>=2.4 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from Flask<1.0,>=0.12.2->gdbgui==0.13.2.0->-r /home
/debian/git/esp-idf-riscv/requirements.txt (line 15)) (3.0.3)
Requirement already satisfied: Werkzeug<1.0,>=0.7 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from Flask<1.0,>=0.12.2->gdbgui==0.13.2.0->-
r /home/debian/git/esp-idf-riscv/requirements.txt (line 15)) (0.16.1)
Requirement already satisfied: brotli in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from Flask-Compress<2.0,>=1.4.0->gdbgui==0.13.2.0->-r /h
ome/debian/git/esp-idf-riscv/requirements.txt (line 15)) (1.0.9)
Requirement already satisfied: greenlet>=0.4.14 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from gevent<2.0,>=1.2.2->gdbgui==0.13.2.0->-r
/home/debian/git/esp-idf-riscv/requirements.txt (line 15)) (1.1.2)
Requirement already satisfied: MarkupSafe>=2.0 in /home/debian/.espressif/python_env/idf3.2_py3.9_env/lib/python3.9/site-packages (from Jinja2>=2.4->Flask<1.0,>=0.12.2->gdbgui==0
.13.2.0->-r /home/debian/git/esp-idf-riscv/requirements.txt (line 15)) (2.0.1)
All done! You can now run:

. ./export.sh

debian@debian:/home/debian/git/esp-idf-riscv$ . ./export.sh
Detecting the Python interpreter
Checking "python" ..
Checking "python3" ..
Python 3.9.9
"python3" has been detected
Adding ESP-IDF tools to PATH...
WARNING: directory for tool xtensa-esp32-elf version esp-2021r1-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32-elf has no installed versions. Please run '/home/debian/git/esp-idf-riscv/install.sh' to install it.
WARNING: directory for tool xtensa-esp32s2-elf version esp-2021r1-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32s2-elf has no installed versions. Please run '/home/debian/git/esp-idf-riscv/install.sh' to install it.
WARNING: directory for tool xtensa-esp32s3-elf version esp-2021r1-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32s3-elf has no installed versions. Please run '/home/debian/git/esp-idf-riscv/install.sh' to install it.
WARNING: directory for tool riscv32-esp-elf version esp-2021r1-8.4.0 is present, but tool was not found
ERROR: tool riscv32-esp-elf has no installed versions. Please run '/home/debian/git/esp-idf-riscv/install.sh' to install it.
WARNING: directory for tool esp32ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
ERROR: tool esp32ulp-elf has no installed versions. Please run '/home/debian/git/esp-idf-riscv/install.sh' to install it.
WARNING: directory for tool esp32s2ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
ERROR: tool esp32s2ulp-elf has no installed versions. Please run '/home/debian/git/esp-idf-riscv/install.sh' to install it.
WARNING: directory for tool openocd-esp32 version v0.10.0-esp32-20210401 is present, but tool was not found
ERROR: tool openocd-esp32 has no installed versions. Please run '/home/debian/git/esp-idf-riscv/install.sh' to install it.
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named click
env: ‘idf.py’: No such file or directory
debian@debian:~/git/esp-idf-riscv$

validate seccomp filters for riscv64 in sandbox.cc

(cd build/host && ninja build_toitvm)
[160/322] Building CXX object src/CMakeFiles/toit_vm.dir/sandbox.cc.o
FAILED: src/CMakeFiles/toit_vm.dir/sandbox.cc.o
/usr/bin/c++ -I/home/ubuntu/git/esp-idf-riscv/components/mbedtls/mbedtls/include '-fdebug-prefix-map=/home/ubuntu/git/toit-riscv=.' -Wall -Werror -ffunction-sections -fdata-sections -Wno-unused-command-line-argument -fno-exceptions -DMBEDTLS_SSL_IN_CONTENT_LEN=4608 -DMBEDTLS_SSL_OUT_CONTENT_LEN=3700 -DMBEDTLS_PLATFORM_MEMORY=1 -O3 -DNDEBUG -fno-rtti -DDEPLOY -std=gnu++11 -MD -MT src/CMakeFiles/toit_vm.dir/sandbox.cc.o -MF src/CMakeFiles/toit_vm.dir/sandbox.cc.o.d -o src/CMakeFiles/toit_vm.dir/sandbox.cc.o -c ../../src/sandbox.cc
../../src/sandbox.cc:54:3: error: ‘SYS_time’ was not declared in this scope; did you mean ‘SYS_times’?
54 | SYS_time,
| ^~~~~~~~
| SYS_times
../../src/sandbox.cc:55:3: error: ‘SYS_pipe’ was not declared in this scope; did you mean ‘SYS_pipe2’?
55 | SYS_pipe,
| ^~~~~~~~
| SYS_pipe2
../../src/sandbox.cc:64:3: error: ‘SYS_epoll_wait’ was not declared in this scope; did you mean ‘SYS_epoll_pwait’?
64 | SYS_epoll_wait,
| ^~~~~~~~~~~~~~
| SYS_epoll_pwait
../../src/sandbox.cc:75:3: error: ‘SYS_poll’ was not declared in this scope; did you mean ‘SYS_ppoll’?
75 | SYS_poll,
| ^~~~~~~~
| SYS_ppoll
../../src/sandbox.cc:80:3: error: ‘SYS_open’ was not declared in this scope; did you mean ‘SYS_fsopen’?
80 | SYS_open,
| ^~~~~~~~
| SYS_fsopen
../../src/sandbox.cc:82:3: error: ‘SYS_readlink’ was not declared in this scope; did you mean ‘SYS_readlinkat’?
82 | SYS_readlink,
| ^~~~~~~~~~~~
| SYS_readlinkat
../../src/sandbox.cc:101:3: error: ‘SYS_lstat’ was not declared in this scope; did you mean ‘SYS_fstat’?
101 | SYS_lstat,
| ^~~~~~~~~
| SYS_fstat
../../src/sandbox.cc:102:3: error: ‘SYS_stat’ was not declared in this scope; did you mean ‘SYS_fstat’?
102 | SYS_stat,
| ^~~~~~~~
| SYS_fstat
../../src/sandbox.cc:115:3: error: ‘SYS_mkdir’ was not declared in this scope; did you mean ‘SYS_chdir’?
115 | SYS_mkdir,
| ^~~~~~~~~
| SYS_chdir
../../src/sandbox.cc:119:3: error: ‘SYS_dup2’ was not declared in this scope; did you mean ‘SYS_dup’?
119 | SYS_dup2,
| ^~~~~~~~
| SYS_dup
../../src/sandbox.cc:120:3: error: ‘SYS_arch_prctl’ was not declared in this scope; did you mean ‘SYS_prctl’?
120 | SYS_arch_prctl,
| ^~~~~~~~~~~~~~
| SYS_prctl
../../src/sandbox.cc:124:3: error: ‘SYS_access’ was not declared in this scope; did you mean ‘SYS_accept’?
124 | SYS_access,
| ^~~~~~~~~~
| SYS_accept
../../src/sandbox.cc:126:3: error: ‘SYS_getdents’ was not declared in this scope; did you mean ‘SYS_getdents64’?
126 | SYS_getdents,
| ^~~~~~~~~~~~
| SYS_getdents64
../../src/sandbox.cc:155:3: error: ‘SYS_time’ was not declared in this scope; did you mean ‘SYS_times’?
155 | SYS_time,
| ^~~~~~~~
| SYS_times
../../src/sandbox.cc:156:3: error: ‘SYS_pipe’ was not declared in this scope; did you mean ‘SYS_pipe2’?
156 | SYS_pipe,
| ^~~~~~~~
| SYS_pipe2
../../src/sandbox.cc:164:3: error: ‘SYS_epoll_wait’ was not declared in this scope; did you mean ‘SYS_epoll_pwait’?
164 | SYS_epoll_wait,
| ^~~~~~~~~~~~~~
| SYS_epoll_pwait
../../src/sandbox.cc:176:3: error: ‘SYS_poll’ was not declared in this scope; did you mean ‘SYS_ppoll’?
176 | SYS_poll,
| ^~~~~~~~
| SYS_ppoll
cc1plus: note: unrecognized command-line option ‘-Wno-unused-command-line-argument’ may have been intended to silence earlier diagnostics
[165/322] Building CXX object src/CMakeFiles/toit_vm.dir/primitive_core.cc.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:41: build/host/bin/toitvm] Error 1

riscv64 cross-compile fails to link on Arch

[1/3] Linking CXX executable bin/toitc
FAILED: bin/toitc
: && /usr/bin/riscv64-linux-gnu-g++ '-fdebug-prefix-map=/home/dusten/git/toit-riscv=.' -Wall -Werror -ffunction-sections -fdata-sections -Wno-unused-command-line-argument -fno-exceptions -DMBEDTLS_SSL_IN_CONTENT_LEN=4608 -DMBEDTLS_SSL_OUT_CONTENT_LEN=3700 -DMBEDTLS_PLATFORM_MEMORY=1 -Os -fno-rtti -DDEPLOY src/compiler/CMakeFiles/toitc.dir/toitc.cc.o -o bin/toitc -static-libstdc++ lib/libtoit_core.a lib/libtoit_compiler.a lib/libmbedtls.a -lpthread -ldl lib/libyaml.a lib/libsemver.a lib/libmbedx509.a lib/libmbedcrypto.a && :
/usr/lib/gcc/riscv64-linux-gnu/11.1.0/../../../../riscv64-linux-gnu/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
[2/3] Linking CXX executable bin/toitvm
FAILED: bin/toitvm
: && /usr/bin/riscv64-linux-gnu-g++ '-fdebug-prefix-map=/home/dusten/git/toit-riscv=.' -Wall -Werror -ffunction-sections -fdata-sections -Wno-unused-command-line-argument -fno-exceptions -DMBEDTLS_SSL_IN_CONTENT_LEN=4608 -DMBEDTLS_SSL_OUT_CONTENT_LEN=3700 -DMBEDTLS_PLATFORM_MEMORY=1 -Os -fno-rtti -DDEPLOY src/CMakeFiles/toitvm.dir/toit.cc.o src/CMakeFiles/toitvm.dir/checksum.cc.o -o bin/toitvm -static-libstdc++ -Wl,--gc-sections -Wl,--whole-archive lib/libtoit_vm.a lib/libmbedtls.a -Wl,--no-whole-archive lib/libtoit_compiler.a -lpthread -ldl -static-libgcc -lSegFault lib/libmbedx509.a lib/libmbedcrypto.a lib/libyaml.a lib/libsemver.a && :
/usr/lib/gcc/riscv64-linux-gnu/11.1.0/../../../../riscv64-linux-gnu/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
make: *** [Makefile:38: build/riscv64/bin/toitvm] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.