Giter VIP home page Giter VIP logo

xinu-stm32's Introduction

What is Xinu?

Xinu stands for Xinu Is Not Unix -- although it shares concepts and even names with Unix, the internal design differs completely. Xinu is a small, elegant operating system that supports dynamic process creation, dynamic memory allocation, network communication, local and remote file systems, a shell, and device-independent I/O functions. The small size makes Xinu suitable for embedded environments.

What is Xinu for STM32

Xinu for STM32 is a port of the ARM version of Xinu. The STM32 family of 32-bit microcontrollers is a popular SoC based on the Arm Cortex-M processor. Besides porting the original version, Xinu for STM32 is extended with the following specific Cortex-M* features:

  • Shadowed Stack Pointer: Two stack pointers are available. The MSP is used for the OS Kernel and interrupt handlers. The PSP is used by application tasks.
  • PendSV exception for scheduling: If Xinu decides that context switching is needed, it sets the pending status of the PendSV, and delays the context-switching request until all other IRQ handlers have completed their processing before carrying out the PendSV exception

Supported Peripherals (currently)

  • UART
  • GPIO
  • SPI

Tested boards

  1. STM32F103* - https://stm32-base.org/boards/STM32F103RCT6-STM32-Mini-V2.0
  2. Qemu for STM32 - https://github.com/beckus/qemu_stm32

How to build and run

Requirements

Xinu for STM32 uses simple Makefiles. The source code should be compiled with a cross compiler (i.e. GCC cross compiler for ARM Cortex-A/R/M processors). The following packages are required:

  • gcc-arm-none-eabi
  • flex
  • flex-dev
  • bison
  • gawk
  • make
  • libc-dev
  • picocom
  • stm32-flash) (* qemu)

For a debian-like distribution: apt-get install gcc-arm-none-eabi flex flex-dev bison gawk make libc-dev

Compiling locally

Make sure you have installed the above required packages.

cd compile
make

Compiling with docker

This creates a very light container based on Alpine Linux:

docker build -t . xinu-container
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp xinu-container sh -c 'cd compile && make'

If required you can use the container interactively: docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp xinu-container

Uploading firmware: built-in bootloader

Note: you will need a USB to UART device to set up communication between your PC and STM32 board. Any common chip will suffice. Pins are (RX1 - PA10, TX1 - PA9)

STM32Flash (https://sourceforge.net/projects/stm32flash) can be used for flashing the compiled code to the device's flash ROM.

stm32flash -w compile/xinu.bin -v /dev/ttyUSB0

Uploading firmware: JTAG, SWO (ST-Link)

Code layout is simple. You can just write directly at address 0x0.

Running

Xinu boots and shows a prompt. Output is over UART. Baudrate is at 115200. You can use a tool like picocom to communicate with your PC: picocom -b 115200 /dev/ttyUSB0

Emulation

Use make qemu to run Xinu for STM32 in Qemu. Please note that this version of qemu should be manually build (see https://github.com/beckus/qemu_stm32) Note: if you have installed qemu-system-arm, you will need to remove that package to avoid any conficts'

Screenshots

Screenshot

More general information about Xinu can be found at https://xinu.cs.purdue.edu/

xinu-stm32's People

Contributors

robinkrens avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  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.