Git Product home page Git Product logo

teensy40's Introduction

Rust Baremetal on Teensy 4.0

This project provides Rust abstractions for the NXP i.MX RT1062 processor used in the Teensy 4.0. It is intended to be usable as a library, although currently only works for executables defined in its own examples directory.

It is very early in development, and as such as more limitations than feature.

Limitations

  • Code runs only off of flash (as does .rodata)
  • No .data section, since we cannot copy the initialization data in yet
  • Cannot be used as a dependency crate

Capabilities

Currently, this crate can bring up the microcontroller sufficiently to send messages over a UART.

Dependencies

In order to build and use this project, you'll need the following:

  • A recent Nightly build of Rust, installed using rustup
  • An Arduino environment with Teensyduino installed on top of it
  • GNU Make (BSD Make variants may work, but are untested)

Running Examples

To run the examples, set an ARDUINO environment variable that points to your teensyduino installation, then run make <examplename>. This will build the requested example and open the Teensy loader to flash it. You can then simply hit the reset button on your Teensy, just as you would in the Arduino environment.

$ export ARDUINO=$HOME/Downloads/arduino-1.8.9 # Or wherever your Arduino lives
$ make bootup

Next Steps

In no particular order, the following hardware bits need abstractions built for them. These will likely be similar to what I did for Teensy 3.2, where it makes sense.

  • GPIO
  • CCM
  • SPI
  • USB (especially USB serial for debugging)
  • DMA

There are also some remaining memory management bits that need doing:

  • ITCM and DTCM setup
  • Copying code/data into correct memories
  • A heap

Lastly, a Cargo build.rs script needs to be written so that we force the appropriate linker script when this crate is consumed. This will allow its use as a library.

teensy40's People

Contributors

branan avatar

Stargazers

David Dias avatar Luo Jia / Zhouqi Jiang avatar  avatar  avatar David Barton avatar Rafael Bachmann avatar Julien Tregoat avatar Xaymar avatar Michał Datberg avatar Dean Gjedde avatar

Watchers

 avatar James Cloos avatar Jonas Michel avatar

Forkers

choclatier

teensy40's Issues

_BOOT_DATA is different from C BootData

In the Teensyduino library, the start entry of .bootdata is set to 0x6000_0000, but in your version of .bootdata it is set to 0x0. While I think both adresses alias the same memory, is accessing the flash through the ITCM On-Chip RAM faster than reading from the "FlexSPI ciphertext" Flash memory?

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.