GithubHelp home page GithubHelp logo

jonlamb-gh / rpi4-rust-workspace Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 3.0 318 KB

Rust workspace for Raspberry Pi 4 bare metal things

Rust 99.54% Assembly 0.42% Shell 0.04%
bounded-registers bare-metal rpi4 embedded-hal rust rust-no-std raspberry-pi tcp-ip smoltcp no-std

rpi4-rust-workspace's Introduction

rpi4-rust-workspace

Rust workspace for RPi4 bare metal things

A lot of the things in here were inspired by rust-raspi3-OS-tutorials and circle.

Crates

Examples

Building

rustc 1.44.0-nightly (94d346360 2020-04-09)

cargo xbuild

Copy elf to binary:

cargo objcopy -- -O binary target/$(TARGET)/release/img /tmp/img.bin

Simulating

Comming soon?

https://gitlab.com/philmd/qemu/commits/raspi4_wip

# For output on UART1
qemu-system-aarch64 -M raspi4 -nographic -serial null -serial mon:stdio -kernel /path/to/binary

TODO - cusomer runner / cargo xrun support:

[target.'cfg(target_os = "none")']
runner = "tools/qemu-runner"

U-boot

Using 64 bit U-boot:

git clone --depth 1 https://github.com/u-boot/u-boot.git u-boot
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make rpi_4_defconfig
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make
U-Boot 2020.04-rc2-00048-gf2a73d6867 (Feb 16 2020 - 08:29:41 -0800)

aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0
GNU ld (GNU Binutils for Ubuntu) 2.32

Environment:

setenv imgname img.bin

# Normally for bare metal
#setenv loadaddr 0x80000

# Put it somewhere else, so we don't overwrite u-boot
setenv loadaddr 0x01000000

# Make sure the caches are on
setenv bootimg 'tftp ${loadaddr} ${serverip}:${imgname}; dcache flush; dcache on; go ${loadaddr}'

SD Card

Files:

/card
├── config.txt
├── fixup4.dat
├── start4.elf
├── u-boot.bin
└── uboot.env

Contents of config.txt:

enable_uart=1
arm_64bit=1
kernel=u-boot.bin

Links

rpi4-rust-workspace's People

Contributors

jonlamb-gh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rpi4-rust-workspace's Issues

Add EMMC/sd-card interface

Use it to read the u-boot environment file for key/value storage.
Update IP examples to pull in the ipaddr env variable.

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.