{"id":19107980,"url":"https://github.com/rt-thread/rtthread-apps","last_synced_at":"2025-07-27T20:04:57.733Z","repository":{"id":23779240,"uuid":"27154482","full_name":"RT-Thread/rtthread-apps","owner":"RT-Thread","description":"The applications of RT-Thread RTOS.","archived":false,"fork":false,"pushed_at":"2020-12-15T02:47:16.000Z","size":78,"stargazers_count":93,"open_issues_count":1,"forks_count":57,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-30T18:51:32.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RT-Thread.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-26T01:34:50.000Z","updated_at":"2025-04-04T07:34:55.000Z","dependencies_parsed_at":"2022-08-22T04:50:45.602Z","dependency_job_id":null,"html_url":"https://github.com/RT-Thread/rtthread-apps","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RT-Thread/rtthread-apps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread%2Frtthread-apps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread%2Frtthread-apps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread%2Frtthread-apps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread%2Frtthread-apps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RT-Thread","download_url":"https://codeload.github.com/RT-Thread/rtthread-apps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread%2Frtthread-apps/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267417664,"owners_count":24083839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T04:14:35.298Z","updated_at":"2025-07-27T20:04:57.714Z","avatar_url":"https://github.com/RT-Thread.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Applications of RT-Thread RTOS #\n\n## Introduction ##\n\nThe user application is the application layer of RT-Thread RTOS. The developer can \ndevelop his/her application out of RT-Thread RTOS firmware environment.\n\nThere are two mode for RT-Thread Applications, \n\n* Standalone Application \n* Shared Library\n\nThe standalone application has a main() function as the program entry. It more like \na program in the PC/Linux. \n\nThe shared library is compose of functions, and provide these APIs to other programs.\n\n## Build Application ##\n\nFirst of all, these programs must base on RT-Thread RTOS environment, and run inside. \nIn the RT-Thread RTOS, the module option must be enable in rtconfig.h File:\n\n    #define RT_USING_MODULE\n\nAnd provide the flags for Application building in rtconfig.py file (since RT-Thread 2.1.x, \nthese flags will be gradually added to each BSP): \n\n* M_CFLAGS - User Application C/C++ compiler flags\n* M_LFLAGS - User Application link flags\n\nAnd Provide the ENV variable `BSP_ROOT` which points to your board support package \ndirectory. \n\nWindows:\n\n    set BSP_ROOT=your_bsp_directory\n\nLinux:\n\n    export BSP_ROOT=your_bsp_directory\n\nAnd to run the command under your BSP directory:\n\n    scons --target=ua -s\n\nTo generate the information for User Application, such as the header file search path, \nthe macro defined in the RT-Thread RTOS etc. \n\nFinally, you can build the user application in `rtthread-apps` directory, for example:\n\n    scons --app=hello\n\nTo build `hello` program. \n\n    scons --lib=libtar\n\nTo build a shared library. \n\n## A Simple Application ##\n\nThis is a simple application of `Hello World`:\n\n    #include \u003cstdio.h\u003e\n    \n    int main(int argc, char **argv)\n    {\n        printf(\"Hello World!\\n\");\n        return 0;\n    }\n\nIt's just like the `Hello World` program in the PC/Linux. Beside that, the user \napplication can use the most of APIs of RT-Thread, for example:\n\n    #include \u003crtthread.h\u003e\n    \n    void my_thread_entry(void* parameter)\n    {\n        int index;\n        \n        while (1)\n        {\n            rt_kprintf(\"index =\u003e %d\\n\", index ++);\n            rt_thread_delay(RT_TICK_PER_SECOND);\n        }\n    }\n    \n    int my_thread_init(void)\n    {\n        rt_thread_t tid;\n        \n        tid = rt_thread_create(\"tMyTask', my_thread_entry, RT_NULL, \n            2048, 20, 20);\n        if (tid != RT_NULL) rt_thread_startup(tid);\n        \n        return 0;\n    }\n\nThis example will create a sub-thread, which named as 'tMyTask'. \n\n## Build the POSIX application in the host ##\n\nIf you didn't set RTT_ROOT/BSP_ROOT, The command ```scons --app=hello``` will \nbuild the program in host environment, for example, build it as a Linux program. \n\nTherefore, only POSIX application can be built like that. \n\n## License ##\n\nAll of user application are standalone program, if there is no special explanation, \nthe license of these program is [GPLv2](LICENSE). While the license of RT-Thread RTOS is GPLv2+. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frt-thread%2Frtthread-apps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frt-thread%2Frtthread-apps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frt-thread%2Frtthread-apps/lists"}