GithubHelp home page GithubHelp logo

hhy5277 / espruino Goto Github PK

View Code? Open in Web Editor NEW

This project forked from espruino/espruino

0.0 2.0 0.0 94.46 MB

The Espruino JavaScript interpreter - Official Repo

Home Page: http://www.espruino.com/

License: Other

GDB 0.01% Makefile 0.12% Python 0.60% JavaScript 0.35% Shell 0.03% C 96.49% CMake 0.01% Tcl 0.01% C++ 0.51% HTML 0.41% CSS 0.01% Objective-C 0.22% Ruby 0.01% Assembly 1.25%

espruino's Introduction

Espruino JavaScript for Microcontrollers

 _____                 _
|   __|___ ___ ___ _ _|_|___ ___
|   __|_ -| . |  _| | | |   | . |
|_____|___|  _|_| |___|_|_|_|___|
          |_|      

http://www.espruino.com           Join the chat at https://gitter.im/espruino/Espruino

About

Espruino is a JavaScript interpreter for microcontrollers. It is designed for devices with as little as 128kB Flash and 8kB RAM.

Please support Espruino by ordering one of our official boards or donating

Documentation

If you have an Espruino board, please read the Quick Start Guide first.

Browse the Espruino Website (try using search in the top right), and read the FAQ.

There's also a Reference for JavaScript commands as well as Tutorials. However the documentation on the Espruino website will match the version available for download but not the latest version on GitHub.

Builds for the Espruino Board and Pico Board (built automatically for each Git commit) are available from here

Other documentation of use is:

Support / Bugs

First, please try and check that your problem hasn't already been found or covered on our forum.

Submit bugs with clear steps to reproduce them: a small test case (not your whole program), and an actual and expected result. If you can't come up with these, please post on the forum first as it may just be something in your code that we can help out with.

Work on Espruino is supported by sales of our boards.

If your board isn't made by us but came pre-installed with Espruino then you should contact the manufacturers.

We try and support users of the boards we sell, but if you bought a non-official board your issue may not get addressed. In this case, please consider donating to help cover the time it takes to fix problems (even so, we can't guarantee to fix every problem).

License

Please see the LICENSE file

Building

Check out the page on building Espruino

Testing

There are a bunch of tests in the tests directory. See tests/README.md for examples on how to run them.

Current State

The officially supported boards are the Original Espruino Board and the Espruino Pico Board. The Web IDE is able to automatically download and flash the latest version of Espruino for you.

While Espruino can run on other boards, we make no money from them and so cannot afford to test, fix or support the firmware on them. We're dependent on the community.

You can download binaries from http://www.espruino.com/Download (these aren't the latest, but are more likely to work with your board).

If you are a board manufacturer interested in getting your board officially supported, please Contact Us.

  • Original Espruino Board - great support.
  • Espruino Pico Board - great support.
  • Puck.js - great support.
  • Espruino WiFi Board - great support.
  • Linux - WORKING
  • BBC micro:bit - WORKING
  • STM32VLDISCOVERY - WORKING - limited memory so some features removed
  • STM32F3DISCOVERY - USB BROKEN
  • STM32F4DISCOVERY - WORKING
  • STM32F401CDISCOVERY - appears WORKING, but very little testing done
  • STM32F429IDISCOVERY - WORKING over serial (A9/A10). No USB and no LCD support
  • NRF51822 Development Kit - WORKING
  • NRF52832 Development Kit - WORKING
  • HY STM32 2.4" - WORKING
  • HY STM32 2.8" - WORKING - limited memory so some features removed
  • HY STM32 3.2" - WORKING
  • Olimexino STM32 / Leaflabs Maple - WORKING - limited memory so some features removed
  • Carambola - WORKING - GPIO via filesystem (no I2C)
  • Raspberry Pi - WORKING - GPIO via filesystem or wiringPi (no I2C)
  • Sony SmartWatch - NOT WORKING - USB VCP support for F2 still needed
  • LC-TECH STM32F103RBT6 - WORKING, but with some issues (LED inverted logic, BTN needs pullup to work)
  • ST NUCLEO-F401RE - WORKING
  • ST NUCLEO-F411RE - WORKING
  • ESP8266 - WORKING - Reasonably stable, but expect to find issues
  • Arduino (AVR) - NOT POSSIBLE due to the Hardward architecture of AVRs, even though it would fit into an ATMEGA2560. If avr-gcc ever gains an easy way to emulate Von Neumann architecture then it might be portable, but for now it isn't.
  • Arduino (ARM) - very doable, but no work has been done on this.

Modification

Check out the documentation on the build process first - this should clear up a lot of potential questions about the Espruino architecture.

Please see CONTRIBUTING.md for some hints about code style/etc.

You can auto-build documentation for all source files - see doxygen/README.md

Any more questions? ask on the forum.

Porting to new devices

Currently there are a bunch of different files to modify. Eventually the plan is to fit everything into boards/BOARDNAME.py and to auto-generate the rest of the config files.

  • Most build options handled in Makefile
  • Extra libraries like USB/LCD/filesystem in Makefile
  • boards/*.py files describe the CPU, available pins, and connections - so the relevant linker script, headers + docs can be created
  • boards/pins/*.csv are copies of the 'pin definitions' table in the chip's datasheet. They are read in for STM32 chips by the boards/*.py files, but they are not required - see boards/MICROBIT.py for an example.
  • Processor-specific code in targets/ARCH - eg. targets/stm32, targets/linux
  • Processor-specific libs (like the SDK) in targetlibs/ARCH
  • src/jshardware.h is effectively a simple abstraction layer for SPI/I2C/etc, which should be implemented in targets/ARCH/jshardware.c

Adding libraries

  • Create jswrap_mylib.c/h in libs/
  • Create library functions (see examples in other jswrap files, also the comments in scripts/common.py)

See libs/README.md for a short tutorial on how to add your own libraries.

Using Espruino in your Projects

If you're using Espruino for your own personal projects - go ahead, we hope you have fun - and please let us know what you do with it on http://www.espruino.com/Forum!

If you're planning on selling the Espruino software on your own board, please:

  • Let us know, we might be able to help.
  • Read the terms of the MPLv2 Licence that Espruino is distributed under, and make sure you comply with it
  • MPLv2 dictates that any files that you modify must be made available in source form. New files that you create don't need to be made available (although we'd encourage it!)
  • You won't be able to call your board an 'Espruino' board unless it's agreed with us (we own the trademark)
  • You must explain clearly in your documentation that your device uses Espruino internally
  • Please don't fork Espruino - improvements get very hard to share, and in the long run everyone loses.
  • Please give something back to the project - be it code improvements, documentation or support.

We spend a lot of time supporting Espruino on the forums, but can only do so because we make money from the sales of Espruino boards. If your users request support from us then we have absolutely no obligation to help them. However, we'll be a lot more motivated if you're actively helping to improve Espruino for all its users (not just your own).

espruino's People

Contributors

alexanderbrevig avatar asez73 avatar beanjs avatar cchamilt avatar cephdon avatar daanpape avatar ddm avatar ebirger avatar ganehag avatar gfwilliams avatar gzip avatar jalawson avatar jcw avatar jumjum123 avatar mabecker avatar matthijskooijman avatar michd avatar mjdietzx avatar mrmossevig avatar muet avatar nkolban avatar owenmcateer avatar plumbum avatar raybellis avatar rwaldron avatar tve avatar urish avatar vshymanskyy avatar vvestm avatar wilberforce avatar

Watchers

 avatar  avatar

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.