Code Monkey home page Code Monkey logo

userapps's Introduction

English | 中文 | Español | Deutsch

GitHubStars GiteeStars GitHub GitHub release Gitter GitHub pull-requests PRs Welcome

RT-Thread

RT-Thread was born in 2006, it is an open source, neutral, and community-based real-time operating system (RTOS).

RT-Thread is mainly written in C language, easy to understand and easy to port(can be quickly port to a wide range of mainstream MCUs and module chips). It applies object-oriented programming methods to real-time system design, making the code elegant, structured, modular, and very tailorable.

RT-Thread has Standard version and Nano version. For resource-constrained microcontroller (MCU) systems, the Nano version that requires only 3KB Flash and 1.2KB RAM memory resources can be tailored with easy-to-use tools. For resource-rich IoT devices, RT-Thread can use the on-line software package management tool, together with system configuration tools, to achieve intuitive and rapid modular cutting, seamlessly import rich software packages; thus, achieving complex functions like Android's graphical interface and touch sliding effects, smart voice interaction effects, and so on.

RT-Thread Architecture

RT-Thread has not only a real-time kernel, but also rich components. Its architecture is as follows:

architecture

It includes:

  • Kernel layer: RT-Thread kernel, the core part of RT-Thread, includes the implementation of objects in the kernel system, such as multi-threading and its scheduling, semaphore, mailbox, message queue, memory management, timer, etc.; libcpu/BSP (Chip Migration Related Files/Board Support Package) is closely related to hardware and consists of peripheral drivers and CPU porting.

  • Components and Service Layer: Components are based on upper-level software on top of the RT-Thread kernel, such as virtual file systems, FinSH command-line interfaces, network frameworks, device frameworks, and more. Its modular design allows for high internal cohesion inside the components and low coupling between components.

  • RT-Thread software package: A general-purpose software component running on the RT-Thread IoT operating system platform for different application areas, consisting of description information, source code or library files. RT-Thread provides an open package platform with officially available or developer-supplied packages that provide developers with a choice of reusable packages that are an important part of the RT-Thread ecosystem. The package ecosystem is critical to the choice of an operating system because these packages are highly reusable and modular, making it easy for application developers to build the system they want in the shortest amount of time. RT-Thread supports 450+ software packages.

RT-Thread Features

  • Designed for resource-constrained devices, the minimum kernel requires only 1.2KB of RAM and 3 KB of Flash.
  • A variety of standard interfaces, such as POSIX, CMSIS, C++ application environment.
  • Has rich components and a prosperous and fast growing package ecosystem.
  • Elegant code style, easy to use, read and master.
  • High Scalability. RT-Thread has high-quality scalable software architecture, loose coupling, modularity, is easy to tailor and expand.
  • Supports high-performance applications.
  • Supports all mainstream compiling tools such as GCC, Keil and IAR.
  • Supports a wide range of architectures and chips.

Code Catalogue

RT-Thread source code catalog is shown as follow:

Name Description
bsp Board Support Package based on the porting of various development boards
components Components, such as finsh shell, file system, protocol stack etc.
documentation Related documents, like coding style, doxygen etc.
examples Related sample code
include Head files of RT-Thread kernel
libcpu CPU porting code such as ARM/MIPS/RISC-V etc.
src The source files for the RT-Thread kernel.
tools The script files for the RT-Thread command build tool.

RT-Thread has now been ported for nearly 200 development boards, most BSPs support MDK, IAR development environment and GCC compiler, and have provided default MDK and IAR project, which allows users to add their own application code directly based on the project. Each BSP has a similar directory structure, and most BSPs provide a README.md file, which is a markdown-format file that contains the basic introduction of BSP, and introduces how to simply start using BSP.

Resources

Supported Architectures

RT-Thread supports many architectures, and has covered the major architectures in current applications. Architecture and chip manufacturer involved:

  • ARM Cortex-M0/M0+:manufacturers like ST
  • ARM Cortex-M3:manufacturers like ST、Winner Micro、MindMotion, ect.
  • ARM Cortex-M4:manufacturers like ST、Infineon、Nuvoton、NXP、Nordic、GigaDevice、Realtek、Ambiq Micro, ect.
  • ARM Cortex-M7:manufacturers like ST、NXP
  • ARM Cortex-M23:manufacturers like GigaDevice
  • ARM Cortex-M33:manufacturers like ST
  • ARM Cortex-R4
  • ARM Cortex-A8/A9:manufacturers like NXP
  • ARM7:manufacturers like Samsung
  • ARM9:manufacturers like Allwinner、Xilinx 、GOKE
  • ARM11:manufacturers like Fullhan
  • MIPS32:manufacturers like loongson、Ingenic
  • RISC-V RV32E/RV32I[F]/RV64[D]:manufacturers like sifive、Canaan Kendrytebouffalo_labNucleiT-HeadHPMicro
  • ARC:manufacturers like SYNOPSYS
  • DSP:manufacturers like TI
  • C-Sky
  • x86

Supported IDE and Compiler

The main IDE/compilers supported by RT-Thread are:

  • RT-Thread Studio IDE
  • MDK KEIL
  • IAR
  • GCC

RT-Thread Studio IDE

User Manual | Tutorial Videos

RT-Thread Studio IDE (a.k.a. RT-Studio) is a one-stop intergrated development environment built by RT-Thread team. It has a easy-to-use graphical configuration system and a wealth of software packages and components resources. RT-Studio has the features of project creation, configuration and management,as well as code editing, SDK management, build configuration, debugging configuration, program download and debug. We're looking to make the use of RT-Studio as intuitive as possible, reducing the duplication of work and improving the development efficiency.

studio

Env Tool

User Manual | Tutorial Videos

In the early stage, RT-Thread team also created an auxiliary tool called Env. It is an auxiliary tool with a TUI (Text-based user interface). Developers can use Env tool to configure and generate the GCC, Keil MDK, and IAR projects.

env

Getting Started

RT-Thread Programming Guide | RT-Thread Studio IDE | Kernel Sample | RT-Thread Beginners Guide

Based on STM32F103 BluePill | Raspberry Pi Pico

Simulator

RT-Thread BSP can be compiled directly and downloaded to the corresponding development board for use. In addition, RT-Thread also provides qemu-vexpress-a9 BSP, which can be used without hardware platform. See the getting started guide below for details. Getting Started of QEMU with Env: Windows | Linux Ubuntu | Mac OS

License

RT-Thread follows the Apache License 2.0 free software license. It's completely open-source, can be used in commercial applications for free, does not require the disclosure of code, and has no potential commercial risk. License information and copyright information can generally be seen at the beginning of the code:

/* Copyright (c) 2006-2018, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 * ...
 */

Community

RT-Thread is very grateful for the support from all community developers, and if you have any ideas, suggestions or questions in the process of using RT-Thread, RT-Thread can be reached by the following means, and we are also updating RT-Thread in real time on these channels. At the same time, any questions can be asked in the issue section of RT-Thread repository or RT-Thread forum, and community members will answer them.

Website | Github | Twitter | LinkedIn | Youtube | Facebook | Medium

Contribution

If you are interested in RT-Thread and want to join in the development of RT-Thread and become a code contributor,please refer to the Code Contribution Guide.

Thanks for the following contributors!

userapps's People

Stargazers

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

userapps's Issues

关于移植到loongarch64的问题

我看到文件里使用musl的交叉工具链编译源码,比如riscv64-linux-musleabi-...
我希望把RT-Thread内核以及用户程序移植到loongarch架构上,但目前loongarch架构的musl交叉工具链似乎还没有。
但是有loongarch64-linux-gnu-gcc等工具链,请问能否用这种工具链替代呢?

methods to create the prebuilt kernel

Hi,

May I ask how to built the prebuilt kernel such as prebuilt/qemu-virt64-riscv/rtthread.bin?

I download the v5.0.1 release of RT-Thread and built a bsp/qemu-virt64-riscv/rtthread.bin successfuly, but when I replaced the prebuilt kernel with mine and runs the demo, it complains that: [E/DBG] virtio-blk0 mount failed.

I guess the ext4 file system driver is absent from my kernel, so I turned on CONFIG_PKG_USING_LWEXT4 and rebuild, but got the following error:

CC build/packages/lwext4-latest/src/ext4.o
In file included from /opt/rv64/10.1/riscv64-unknown-linux-musl/include/signal.h:48,
                 from /home/yf/Projects/rt-thread/components/libc/compilers/common/include/sys/signal.h:23,
                 from /home/yf/Projects/rt-thread/components/libc/compilers/common/include/sys/time.h:180,
                 from /home/yf/Projects/rt-thread/components/libc/compilers/common/include/sys/select.h:17,
                 from /opt/rv64/10.1/riscv64-unknown-linux-musl/include/sys/types.h:71,
                 from /home/yf/Projects/rt-thread/components/libc/compilers/common/include/sys/unistd.h:16,
                 from /home/yf/Projects/rt-thread/components/libc/compilers/common/include/unistd.h:14,
                 from packages/lwext4-latest/include/ext4_oflags.h:91,
                 from packages/lwext4-latest/src/ext4.c:41:
/opt/rv64/10.1/riscv64-unknown-linux-musl/include/bits/signal.h:63:15: error: expected identifier or '(' before '[' token
   63 |  char __unused[1024 / 8 - sizeof(sigset_t)];
      |               ^
scons: *** [build/packages/lwext4-latest/src/ext4.o] Error 1
scons: building terminated because of errors.

My toolchain is from https://download.rt-thread.org/rt-smart/riscv64/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu_180881.tar.bz2:

yf@a4:$ /opt/rv64/10.1/bin/riscv64-unknown-linux-musl-gcc -v
Using built-in specs.
COLLECT_GCC=/opt/rv64/10.1/bin/riscv64-unknown-linux-musl-gcc
COLLECT_LTO_WRAPPER=/opt/rv64/10.1/bin/../libexec/gcc/riscv64-unknown-linux-musl/10.1.0/lto-wrapper
Target: riscv64-unknown-linux-musl
Configured with: /builds/alliance/risc-v-toolchain/riscv-gcc/configure --target=riscv64-unknown-linux-musl --prefix=/builds/alliance/risc-v-toolchain/install-native/ --with-sysroot=/builds/alliance/risc-v-toolchain/install-native//riscv64-unknown-linux-musl --with-system-zlib --enable-shared --enable-tls --enable-languages=c,c++ --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootstrap --src=/builds/alliance/risc-v-toolchain/riscv-gcc --disable-multilib --with-abi=lp64 --with-arch=rv64imafdc --with-tune=rocket 'CFLAGS_FOR_TARGET=-O2   -mcmodel=medany -march=rv64imafdc -mabi=lp64' 'CXXFLAGS_FOR_TARGET=-O2   -mcmodel=medany -march=rv64imafdc -mabi=lp64'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.1.0 (GCC) 
build date: Jun 21 2023 16:23:45
build sha: 1e9cc6e05c1d3f67abf532747071137fa58a549d
build job: 491872

Regards,
yf

关于工具链统一路径的问题

get_toolchain.py 下载的工具链的路径默认在此项目的相对路径下,这样就造成我这样的社区开发者开发用户app时,每次都要切换工具链路径,代码交给别人编译时也要改工具路径,这十分的麻烦。如果统一了工具链路径,至少开发者拿到一份新的代码可以做到开箱即用了

env.sh路径错误

目前遇到这个问题,先到apps目录,再source ../env.sh,再xmake,报错

$ cd apps 

mmc at hp in ~/dev/rtt/userapps/apps (main●) (dev_env) 
$ source ../env.sh 

mmc at hp in ~/dev/rtt/userapps/apps (main●) (dev_env) 
$ xmake -j8
error: unknown rule(rt.cpp) in target(cpp)!

mmc at hp in ~/dev/rtt/userapps/apps (main●) (dev_env) 
$ xmake smart-rootfs
xmake v2.8.2+20230822, A cross-platform build utility based on Lua
Copyright (C) 2015-present Ruki Wang, tboox.org, xmake.io
                         _
    __  ___ __  __  __ _| | ______
    \ \/ / |  \/  |/ _  | |/ / __ \
     >  <  | \__/ | /_| |   <  ___/
    /_/\_\_|_|  |_|\__ \|_|\_\____|
                         by ruki, xmake.io
    
    👉  Manual: https://xmake.io/#/getting_started
    🙏  Donate: https://xmake.io/#/sponsor
    

Usage: $xmake [task] [options] [target]

Build targets if no given tasks.

Actions:
       service      Start service for remote or distributed compilation and etc.
    u, uninstall    Uninstall the project binary files.
       update       Update and uninstall the xmake program.
    c, clean        Remove all binary and temporary files.
    r, run          Run the project target.
    i, install      Package and install the target binary files.
    q, require      Install and update required packages.
    f, config       Configure the project.
    b, build        Build targets if no given tasks.
    p, package      Package target.
       create       Create a new project.
    g, global       Configure the global options for xmake.

Plugins:
       show         Show the given project information.
       check        Check the project sourcecode and configuration.
       repo         Manage package repositories.
       format       Format the current project.
       doxygen      Generate the doxygen document.
    l, lua          Run the lua script.
    m, macro        Run the given macro.
       plugin       Manage plugins of xmake.
       project      Generate the project file.
       watch        Watch the project directories and run command.

Common options:
    -q, --quiet                      Quiet operation.
    -y, --yes                        Input yes by default if need user confirm.
        --confirm=CONFIRM            Input the given result if need user confirm.
                                         - yes
                                         - no
                                         - def
    -v, --verbose                    Print lots of verbose information for users.
        --root                       Allow to run xmake as root.
    -D, --diagnosis                  Print lots of diagnosis information (backtrace,
                                     check info ..) only for developers.
                                     And we can append -v to get more whole
                                     information.
                                         e.g. $ xmake -vD
        --version                    Print the version number and exit.
    -h, --help                       Print this help message and exit.

    -F FILE, --file=FILE             Read a given xmake.lua file.
    -P PROJECT, --project=PROJECT    Change to the given project directory.
                                     Search priority:
                                         1. The Given Command Argument
                                         2. The Envirnoment Variable:
                                     XMAKE_PROJECT_DIR
                                         3. The Current Directory

Command options (build):
    -b, --build                      Build target. This is default building mode and
                                     optional.
    -r, --rebuild                    Rebuild the target.
    -a, --all                        Build all targets.
    -g GROUP, --group=GROUP          Build all targets of the given group. It support
                                     path pattern matching.
                                     e.g.
                                         xmake -g test
                                         xmake -g test_*
                                         xmake --group=benchmark/*
        --dry-run                    Dry run to build target.

    -j JOBS, --jobs=JOBS             Set the number of parallel compilation jobs.
                                     (default: 8)
        --linkjobs=LINKJOBS          Set the number of parallel link jobs.
    -w, --warning                    Enable the warnings output.
        --files=FILES                Build the given source files.
                                     e.g. 
                                         - xmake --files=src/main.c
                                         - xmake --files='src/*.c' [target]
                                         - xmake --files='src/**c|excluded_file.c'
                                         - xmake --files='src/main.c:src/test.c'

          target                     The target name. It will build all default
                                     targets if this parameter is not specified.
error: invalid task: smart-rootfs

后来发现是env.sh里面路径的问题

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

应当改成,测试正常工作

script_dir=$(cd `dirname $0`; pwd)

riscv64的示例有问题,arm的Linux快速上手部分没有提供Linux运行脚本

你好,我按照快速上手的linux版介绍,尝试构建riscv64版本的用户程序,执行如下命令:

python get_toolchain.py riscv64
source smart-env.sh riscv64

图片
但是出现如下错误:
图片
通过echo $PATH命令,可以看到我的路径是正常的:
图片
不清楚为什么会这样报错?

如果不加sudo前缀,只使用scons,会产生如下错误:
图片
好像是riscv工具链有点问题?

另外,快速上手中还包含了arm的示例,这部分可以正常构建出用户态应用程序。
但是userapps\prebuilt\qemu-vexpress-a9目录下没有Linux平台的运行脚本。尽管我可以参考.bat文件自己写一个脚本,但还是希望能看到官方的示例和源码一致 :)

谢谢

sdl2_image依赖安装失败

系统:debian 12
xmake版本:v2.8.3+20231018,
执行命令xmake f -a aarch64时,显示

  => install aarch64-smart-musleabi 188177 .. ok
  => download https://github.com/libsdl-org/SDL_image/archive/refs/tags/release-2.0.5.tar.gz .. ok
  => install sdl2_image 2.0.5 .. failed

具体报错情况如下:

...
mv -f .deps/IMG_WIC.Tpo .deps/IMG_WIC.Plo
mv -f .deps/showimage.Tpo .deps/showimage.Po
IMG_webp.c:42:10: fatal error: webp/decode.h: No such file or directory
   42 | #include <webp/decode.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:619: IMG_webp.lo] Error 1
make: *** Waiting for unfinished jobs....
mv -f .deps/IMG_tif.Tpo .deps/IMG_tif.Plo
mv -f .deps/IMG_pcx.Tpo .deps/IMG_pcx.Plo
mv -f .deps/IMG_xv.Tpo .deps/IMG_xv.Plo
mv -f .deps/IMG_pnm.Tpo .deps/IMG_pnm.Plo
mv -f .deps/IMG.Tpo .deps/IMG.Plo
mv -f .deps/IMG_tga.Tpo .deps/IMG_tga.Plo
mv -f .deps/IMG_jpg.Tpo .deps/IMG_jpg.Plo
mv -f .deps/IMG_xpm.Tpo .deps/IMG_xpm.Plo
mv -f .deps/IMG_lbm.Tpo .deps/IMG_lbm.Plo
mv -f .deps/IMG_gif.Tpo .deps/IMG_gif.Plo
mv -f .deps/IMG_bmp.Tpo .deps/IMG_bmp.Plo
mv -f .deps/IMG_xcf.Tpo .deps/IMG_xcf.Plo
mv -f .deps/IMG_png.Tpo .deps/IMG_png.Plo
mv -f .deps/IMG_svg.Tpo .deps/IMG_svg.Plo

smart-env.sh配置工具链路径错误

ubuntu系统,在userapps\tools目录下运行get_toolchain.py的脚本

:~/userapps/tools$ python3 get_toolchain.py riscv64

之后

:~/userapps/tools$ cd ..
:~/userapps$ ./smart-env.sh riscv64
Arch      => riscv64
CC        => gcc
PREFIX    => riscv64-unknown-linux-musl-
EXEC_PATH => /home/auser/userapps/tools/gnu_gcc/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/bin

这里就不对吧?
之后
使用set命令检查RTT_EXEC_PATH是否设置成功 用什么具体命令呢?

再编译,总是如下错误

:~/userapps$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
CC apps/webclient/packages/webclient-v2.1.2/src/webclient.o
sh: 1: riscv64-unknown-linux-musl-gcc: not found
scons: *** [apps/webclient/packages/webclient-v2.1.2/src/webclient.o] Error 127
scons: building terminated because of errors.

请问该如何处理?

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.