diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\344\275\234\344\270\232/\347\254\254\344\270\200\345\244\251\344\275\234\344\270\232.md" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\344\275\234\344\270\232/\347\254\254\344\270\200\345\244\251\344\275\234\344\270\232.md" new file mode 100644 index 0000000000000000000000000000000000000000..d0dad5236f84b9c75a954bff0e645c5b4a332165 --- /dev/null +++ "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\344\275\234\344\270\232/\347\254\254\344\270\200\345\244\251\344\275\234\344\270\232.md" @@ -0,0 +1,4 @@ +1. 完成对git fork的配置 +2. 更新git和发布博客 + +[RT-Thread-【RSOC25】Day1课程笔记:环境配置RT-Thread问答社区 - RT-Thread](https://club.rt-thread.org/ask/article/0cad960cf550a11d.html) \ No newline at end of file diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\344\275\234\344\270\232/\347\254\254\344\272\214\345\244\251\344\275\234\344\270\232.c" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\344\275\234\344\270\232/\347\254\254\344\272\214\345\244\251\344\275\234\344\270\232.c" new file mode 100644 index 0000000000000000000000000000000000000000..32f65c768acea3bb550dea738e716421863a7cdd --- /dev/null +++ "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\344\275\234\344\270\232/\347\254\254\344\272\214\345\244\251\344\275\234\344\270\232.c" @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2018-11-06 SummerGift first version + * 2018-11-19 flybreak add stm32f407-atk-explorer bsp + */ + +#include +#include +#include + + +rt_thread_t thread1; +rt_thread_t thread2; +rt_thread_t thread3; + +void thread1_task(void*parm) +{ + while(1) + { + rt_kprintf("run the thread1\r\n"); + rt_thread_delay(1000); + } +} +void thread2_task(void*parm) +{ + while(1) + { + rt_kprintf("run the thread2\r\n"); + rt_thread_delay(500); + } +} +void thread3_task(void*parm) +{ + while(1) + { + rt_kprintf("run the thread3\r\n"); + rt_thread_delay(500); + } +} + +int main(void) +{ + + thread1 = rt_thread_create("thread1", thread1_task, RT_NULL, 1024, 4, 10); + thread2 = rt_thread_create("thread2", thread2_task, RT_NULL, 1024, 5, 10); + thread3 = rt_thread_create("thread3", thread3_task, RT_NULL, 1024, 5 ,10); + + if(thread1 !=RT_NULL) + { + rt_thread_startup(thread1); + } + if(thread2 !=RT_NULL) + { + rt_thread_startup(thread2); + } + if(thread3 !=RT_NULL) + { + rt_thread_startup(thread3); + } + return RT_EOK; +} diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721210740643.png" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721210740643.png" new file mode 100644 index 0000000000000000000000000000000000000000..769408bf916649a07bcad0508e7493d52afb91a4 Binary files /dev/null and "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721210740643.png" differ diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721210756229.png" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721210756229.png" new file mode 100644 index 0000000000000000000000000000000000000000..9960d68065f5ef77f2f0262fa49608563ed47da1 Binary files /dev/null and "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721210756229.png" differ diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721210932327.png" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721210932327.png" new file mode 100644 index 0000000000000000000000000000000000000000..c29717cc3cec96504935e5cfa0e0c9f7f30a8929 Binary files /dev/null and "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721210932327.png" differ diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721211009294.png" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721211009294.png" new file mode 100644 index 0000000000000000000000000000000000000000..662375639d85e17fae9dab77b7674fd52b35a9dc Binary files /dev/null and "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250721211009294.png" differ diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250722195430124.png" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250722195430124.png" new file mode 100644 index 0000000000000000000000000000000000000000..350354ff69b699cfe75f1b6e48c4e5f93ef0d995 Binary files /dev/null and "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250722195430124.png" differ diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250722195441203.png" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250722195441203.png" new file mode 100644 index 0000000000000000000000000000000000000000..e4fa46c62921ea62cbc35de2322e52f6d30715f6 Binary files /dev/null and "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250722195441203.png" differ diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250722195844159.png" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250722195844159.png" new file mode 100644 index 0000000000000000000000000000000000000000..8569ba3931c618bb69a9855d80ec2c6a34353ee3 Binary files /dev/null and "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/pic.assets/image-20250722195844159.png" differ diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/\347\254\254\344\270\200\345\244\251\347\254\224\350\256\260.md" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/\347\254\254\344\270\200\345\244\251\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..875ee0aab6f1a6f7ce6c72aa1bd7e8126ab97288 --- /dev/null +++ "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/\347\254\254\344\270\200\345\244\251\347\254\224\350\256\260.md" @@ -0,0 +1,61 @@ + + +## env工具 + +### 环境配置 + +![image-20250721210756229](pic.assets/image-20250721210756229.png) + +放在c盘进行register,右键选择comemu here进入env + +![image-20250721210740643](pic.assets/image-20250721210740643.png) + +### 功能介绍 + +#### 内核的裁剪 + +#### env进入在rtconfig,h文件目录下 + +![image-20250721211009294](pic.assets/image-20250721211009294.png) + +![image-20250721210932327](pic.assets/image-20250721210932327.png) + +```c +menuconfig 进入配置界面 +``` + +#### 对项目进行编译和生成工程 + +```c +scons --target = xxx (xxx=mak4\mdk5\iar) +``` + +## git 工具 + +### 常用指令 + +```c +git init //创建仓库地址 +``` + +```c +git commit -m "xxx" //名称 +``` + +```c +git log // 查看历史版本 +``` + +```c +git branch -a //查看所有分支 +``` + +```c +git swtich xxx //切换分支 +``` + +### 图形化插件 + +在vscode中下载插件Git Graph + +使用参考文章[快速搞懂 Git Graph-CSDN博客](https://blog.csdn.net/weixin_43242506/article/details/123230514) \ No newline at end of file diff --git "a/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/\347\254\254\344\272\214\345\244\251\347\254\224\350\256\260.md" "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/\347\254\254\344\272\214\345\244\251\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..35f7dac3977090b59827ebd80290ca7559caecae --- /dev/null +++ "b/2025/\347\254\2543\347\273\204(PSoC62 evaluation Kit)/\345\206\257\344\275\263\345\271\263/\347\254\224\350\256\260/\347\254\254\344\272\214\345\244\251\347\254\224\350\256\260.md" @@ -0,0 +1,71 @@ +# 详细分析RT-Thread的启动流程 + +![image-20250722195430124](pic.assets/image-20250722195430124.png) + +![image-20211203093350029](file://E:/BaiduNetdiskDownload/90%E5%A4%A9learn/0--RTOS%E5%9F%B9%E8%AE%AD%E8%B5%84%E6%96%99/07_%E9%A1%B9%E7%9B%AE6_RT-Thread%E7%A7%BB%E6%A4%8D%E4%B8%8E%E5%86%85%E9%83%A8%E5%AE%9E%E7%8E%B0/07_%E9%A1%B9%E7%9B%AE6_RT-Thread%E7%A7%BB%E6%A4%8D%E4%B8%8E%E5%86%85%E9%83%A8%E5%AE%9E%E7%8E%B0/01_RT-Thread%E5%86%85%E9%83%A8%E5%AE%9E%E7%8E%B0/2_%E5%AD%A6%E4%B9%A0%E6%96%87%E6%A1%A3/pic/23_rtt_startup_code.png?lastModify=1750853466) + +##### startup.s + +![image-20250722195441203](pic.assets/image-20250722195441203.png) + +1. 初始化时钟和配置中断向量表 +2. 初始化堆栈 +3. 进行Flash上的变量初始化 ==》重定位“+RW”/清零“+ZI” +4. __main跳转到!![image-20250722195844159](pic.assets/image-20250722195844159.png) + +##### components.c(以mdk为例) + +###### Sub$main + +```c +int $Sub$$main(void) +{ + rtthread_startup(); + return 0; +} +``` + +###### rtthread_startup + +- 关中断 + +- 初始化系统相关硬件(硬件初始化gpio,uart,系统时钟等) + +- 初始化系统内核对象(定时器、调度器、信号等) + + tick设定:msh + +- 创建用户进程:rt_application_init (各模块初始化) + +- 启动调度器 + +###### rt_application_init + +```c +tid = rt_thread_create("main", main_thread_entry, RT_NULL, + RT_MAIN_THREAD_STACK_SIZE, RT_MAIN_THREAD_PRIORITY, 20); +``` + +###### main_thread_entry + +- 调用rt_components_init函数:这会初始化一系列的组件,比如创建shell线程 +- 调用$Super$$main函数:就是调用main函数 + +```c +void main_thread_entry(void *parameter) +{ + extern int main(void); + extern int $Super$$main(void); + +#ifdef RT_USING_COMPONENTS_INIT + /* RT-Thread components initialization */ + rt_components_init(); +#endif + /* invoke system main function */ +#if defined(__CC_ARM) || defined(__CLANG_ARM) + $Super$$main(); /* for ARMCC. */ +#elif defined(__ICCARM__) || defined(__GNUC__) + main(); +#endif +} +``` \ No newline at end of file