Get Started with RT-Thread Smart OpenSource Microkernel Operating System!

RT-Thread Smart Architecture

Software Introduction

RT-Thread Smart Software

Prepare Toolchain

Download Toolchain:

Install Compile Environment

1 sudo apt-get update
2 sudo apt-get install vim scons git bzip2 net-tools
3 sudo apt-get install python-all python-all-dev
4 sudo apt-get install qemu-system-arm qemu-system-common qemu-utils

Compile Application

1   # Enter rt-smart category
2 cd rt-smart
3
4 # Set the corresponding environment variable, compared with RT-Thread, RT-Thread Smart has RTT_CC_PREFIX environment variable
5 source smart-env.sh
6
7 # Compile user mode application
8 cd userapps
9 scons
10
11 scons: Reading SConscript files ...
12 scons: done reading SConscript files.
13 scons: Building targets ...
14 CC build/hello/main.o
15 CC build/ping/main.o
16 CC build/pong/main.o
17 CC build/vi/optparse-v1.0.0/optparse.o
18 CC build/vi/vi.o
19 CC build/vi/vi_utils.o
20 CC build/webclient/main.o
21 LINK root/bin/hello.elf
22 LINK root/bin/ping.elf
23 LINK root/bin/pong.elf
24 LINK root/bin/vi.elf
25 LINK root/bin/webclient.elf
26 scons: done building targets.
1  cd userapps
2 python ../tools/mkromfs.py root ../kernel/bsp/qemu-vexpress-a9/applications/romfs.c

Compile RT-Smart Kernel

1  cd rt-smart/kernel/bsp/qemu-vexpress-a9
2 scons
3 ... ...
4 CC build/kernel/src/thread.o
5 CC build/kernel/src/timer.o
6 LINK rtthread.elf
7 arm-linux-musleabi-objcopy -O binary rtthread.elf rtthread.bin
8 arm-linux-musleabi-size rtthread.elf
9 text data bss dec hex filename
10 1219480 40652 122444 1382576 1518b0 rtthread.elf
11 scons: done building targets.

Simulate and Execute

1  cd rt-smart/kernel/bsp/qemu-vexpress-a9
2 ./qemu-nographic.sh
3
4 \ | /
5 - RT - Thread Smart Operating System
6 / | \ 5.0.0 build Nov 15 2020
7 2006 - 2020 Copyright by rt-thread team
8 lwIP-2.0.2 initialized!
9 try to allocate fb... | w - 640, h - 480 | done!
10 fb => 0x61100000
11 [I/sal.skt] Socket Abstraction Layer initialize success.
12 [I/SDIO] SD card capacity 65536 KB.
13 Dir /mnt mount failed!
14 hello rt-thread
15 msh />
16 msh />/bin/hello.elf
17 msh />hello world!
1    \ | /
2 - RT - Thread Smart Operating System
3 / | \ 5.0.0 build Nov 24 2020
4 2006 - 2020 Copyright by rt-thread team
5 lwIP-2.0.2 initialized!
6 try to allocate fb... | w - 640, h - 480 | done!
7 fb => 0x61100000
8 [I/sal.skt] Socket Abstraction Layer initialize success.
9 [I/SDIO] SD card capacity 65536 KB.
10 [I/SDIO] switching card to high speed failed!
11 Dir /mnt mount failed!
12 hello rt-thread
13 msh />mkfs sd0
14 msh />
15
16 # Ctrl + A, X to exit
17 QEMU: Terminated
18
19 bernard@fuchsia-NUC8i7BEH:
~/workspace/rt-smart/smart/kernel/bsp/qemu-vexpress-a9$ ./qemu-nographic.sh
20 \ | /
21 - RT - Thread Smart Operating System
22 / | \ 5.0.0 build Nov 24 2020
23 2006 - 2020 Copyright by rt-thread team
24 lwIP-2.0.2 initialized!
25 try to allocate fb... | w - 640, h - 480 | done!
26 fb => 0x61100000
27 [I/sal.skt] Socket Abstraction Layer initialize success.
28 [I/SDIO] SD card capacity 65536 KB.
29 [I/SDIO] switching card to high speed failed!
30 file system initialization done!
31 hello rt-thread
32 msh />

Compile on Windows and Execute on Raspberry Pi 4B

Prepare Compiling Environment

1  #Enter rt-smart category, set environment variable 
2 cd rt-smart
3 > smart-env.bat
1  # Check out if the return results are effective 
2 > set RTT_CC_PREFIX
3 RTT_CC_PREFIX=arm-linux-musleabi-

Compile Application

1 #Enter userapps category to edit 
2 cd rt-smart\userapps
3 scons

Compile RT-Thread Smart Kernel

1   #Enter raspberry-pi\raspi4-32 category to compile
2 cd rt-smart\kernel\bsp\raspberry-pi\raspi4-32
3 scons
4 ... ...
5 CC build/kernel/src/signal.o
6 CC build/kernel/src/thread.o
7 CC build/kernel/src/timer.o
8 LINK rtthread.elf
9 arm-linux-musleabi-objcopy -O binary rtthread.elf kernel7.img
10 arm-linux-musleabi-size rtthread.elf
11 text data bss dec hex filename
12 710780 40448 64730 815958 c7356 rtthread.elf
13 scons: done building targets.

Connect Hardware

  1. Raspberry Pi 4B
  2. SD card (32GB or less)
  3. USB-TTL switching serial line
  4. Networking cables
  5. TYPE-C (for power supply)
  6. Card Reader (for writing compiled files to SD cards)

Prepare the software on the SD card

--

--

--

An Open-Source Community-Powered Real-Time Operating System (RTOS) Project! We develop, we DIY, we create, we share, we explore this new IoT World together!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Take command of your go programs with Cobra 🐍

Telegram bot that notifies vaccine slot availability

Use Docker to run Postgres locally

How I turned a real estate idea into a chrome extension with paid users.

Keep Your Money Moving With A Free Foreign Exchange Rates API

How To Get Company Tags With Domain Data API

MVVM-1: A General Discussion

WriteUp — THM Anonymous playground

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
RT-Thread IoT OS

RT-Thread IoT OS

An Open-Source Community-Powered Real-Time Operating System (RTOS) Project! We develop, we DIY, we create, we share, we explore this new IoT World together!

More from Medium

Load Testing Cute Server With 1M WebSocket Connections

Configuring multi-threaded tests on Heroku CI for Ruby on Rails

Remote Procedures, Please.

Live’s uml sequence diagram

Listing Symbolic Links in Apache