156 Commits
Author SHA1 Message Date
零中断延迟的RTOS 4de3c801c1 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-15 13:32:26 +00:00
零中断延迟的RTOS be3eab8b72 update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-15 09:14:14 +00:00
零中断延迟的RTOS 10609a6b87 update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-15 09:10:58 +00:00
零中断延迟的RTOS 4d0d476d1f update System/CosyOS.H.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-15 09:03:14 +00:00
零中断延迟的RTOS 5ecf3ad785 update Port/port_x32/RISC-V32/mcucfg_rv32.h.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-15 09:01:08 +00:00
零中断延迟的RTOS 102a2e281c update Port/port_x32/Cortex-M/mcucfg_cm0.h.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-15 08:58:28 +00:00
零中断延迟的RTOS 94a8a46b8a update Port/port_x32/Cortex-M/mcucfg_cm3.h.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-15 08:55:51 +00:00
零中断延迟的RTOS 3ea4acae49 update Port/port_x32/Cortex-M/mcucfg_cm3.h.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-15 08:55:20 +00:00
零中断延迟的RTOS 673089cab3 update Port/port_x32/RISC-V32/port_rv32.h.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-15 08:13:12 +00:00
零中断延迟的RTOS 76ee4725b8 update Port/port_x32/RISC-V32/port_rv32i_HWS.S.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-14 14:06:43 +00:00
零中断延迟的RTOS 9715ece53d update System/CosyOS.H.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-14 12:28:08 +00:00
零中断延迟的RTOS f975de7bef update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-14 12:26:28 +00:00
零中断延迟的RTOS 9e94f863ce update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-14 12:25:00 +00:00
零中断延迟的RTOS 62156e014a 删除文件 Port/port_x32/RISC-V32/port_rv32_HWS.S 2026-08-14 12:05:18 +00:00
零中断延迟的RTOS f2292046a4 update CosyOS-移植文件.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-14 12:04:58 +00:00
零中断延迟的RTOS 4fb7f49772 删除文件 Port/port_x32/RISC-V32/port_rv32_SWS.S 2026-08-14 12:04:02 +00:00
零中断延迟的RTOS 4e9c468ff5 删除文件 Port/port_x32/RISC-V32/port_rv32_FSL.S 2026-08-14 12:03:53 +00:00
零中断延迟的RTOS 7ee44c7713 删除文件 Port/port_x32/RISC-V32/port_rv32.h 2026-08-14 12:03:47 +00:00
零中断延迟的RTOS e2201f75ea 删除文件 Port/port_x32/RISC-V32/mcucfg_rv32.h 2026-08-14 12:03:38 +00:00
零中断延迟的RTOS 1fbf7d2602 update CosyOS-移植文件.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-14 12:01:48 +00:00
零中断延迟的RTOS 740012fa5d 删除文件 Port/port_x32/Cortex-M/port_cmx_s.c 2026-08-14 12:00:53 +00:00
零中断延迟的RTOS 7a9257ae15 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-14 11:03:42 +00:00
零中断延迟的RTOS 0a277dbc12 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-14 11:01:09 +00:00
零中断延迟的RTOS 34ec9abe6b update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-14 10:44:08 +00:00
零中断延迟的RTOS 97b507d50e update CosyOS-移植文件.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-09 15:46:39 +00:00
零中断延迟的RTOS bcbb48f906 删除文件 Port/port_x32/RISC-V32/port_rv32_HWS.S 2026-08-09 15:45:47 +00:00
零中断延迟的RTOS 8bee36aa35 update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-09 10:17:31 +00:00
零中断延迟的RTOS e6f8bb4627 update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-09 10:14:37 +00:00
零中断延迟的RTOS d751406129 update System/CosyOS.H.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-09 10:06:43 +00:00
零中断延迟的RTOS a2a3b5fb16 update CosyOS-移植文件.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-09 10:00:33 +00:00
零中断延迟的RTOS 99d71a97c6 删除文件 Port/port_x32/RISC-V32/port_rv32_HWS.S 2026-08-09 09:59:23 +00:00
零中断延迟的RTOS ad6086de2e update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-09 09:25:52 +00:00
零中断延迟的RTOS 98f38fc1b3 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-09 09:15:39 +00:00
零中断延迟的RTOS d8b0374dfe update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 23:59:39 +00:00
零中断延迟的RTOS bf98e1f2f8 update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 23:58:20 +00:00
零中断延迟的RTOS bb18d6a6b0 update System/CosyOS.H.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 23:49:36 +00:00
零中断延迟的RTOS 135984c962 update CosyOS-移植文件.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 23:44:47 +00:00
零中断延迟的RTOS 9662824b4b 删除文件 Port/port_x32/RISC-V32/port_rv32_HWS.S 2026-08-06 23:43:24 +00:00
零中断延迟的RTOS f7bb67dd47 删除文件 Port/port_x32/RISC-V32/port_rv32_SWS.S 2026-08-06 23:43:14 +00:00
零中断延迟的RTOS e2d661aeeb update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 18:00:45 +00:00
零中断延迟的RTOS 2d9a3dcd27 update System/CosyOS.H.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 17:59:19 +00:00
零中断延迟的RTOS ee552807da update System/os_handler.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 17:52:59 +00:00
零中断延迟的RTOS e61648ab08 update CosyOS-内核文件.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 17:43:43 +00:00
零中断延迟的RTOS 788a361ceb 删除文件 System/os_main.c 2026-08-06 17:42:19 +00:00
零中断延迟的RTOS 9e14cf0d29 update System/os_handler.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 16:26:09 +00:00
零中断延迟的RTOS 0e290803e4 update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 15:10:21 +00:00
零中断延迟的RTOS c97f37ba2e update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 15:08:15 +00:00
零中断延迟的RTOS f76ce9288a update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 15:02:31 +00:00
零中断延迟的RTOS a772e49b9c update System/CosyOS.H.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 15:00:19 +00:00
零中断延迟的RTOS 003a65358d update System/os_handler.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 14:56:17 +00:00
零中断延迟的RTOS f2e6cd0d84 update System/os_main.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-06 14:50:06 +00:00
零中断延迟的RTOS 8ce43f660f update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 20:22:37 +00:00
零中断延迟的RTOS 8b26e9a3b6 update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 20:18:57 +00:00
零中断延迟的RTOS 7f17a82d6b update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 20:10:47 +00:00
零中断延迟的RTOS c359724bc0 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 20:03:11 +00:00
零中断延迟的RTOS bb194d1c1a update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 19:56:54 +00:00
零中断延迟的RTOS f7d923e30c update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 19:53:35 +00:00
零中断延迟的RTOS d04ef559b4 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 19:48:35 +00:00
零中断延迟的RTOS 435cee98fe update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 19:42:53 +00:00
零中断延迟的RTOS 568c7f99a5 update Port/port_x32/RISC-V32/port_rv32_HWS.S.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 17:52:48 +00:00
零中断延迟的RTOS 2b0063f207 update Port/port_x32/RISC-V32/port_rv32_HWS.S.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 16:54:14 +00:00
零中断延迟的RTOS fd3e2460f8 update Port/port_x32/RISC-V32/port_rv32_HWS.S.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 16:39:01 +00:00
零中断延迟的RTOS 0a0eaf4cd0 update Port/port_x32/RISC-V32/port_rv32_HWS.S.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 16:27:05 +00:00
零中断延迟的RTOS 618b3e9c5a update Port/port_x32/RISC-V32/port_rv32_HWS.S.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 15:34:48 +00:00
零中断延迟的RTOS f62b89ce16 update Port/port_x32/RISC-V32/port_rv32_HWS.S.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 14:39:13 +00:00
零中断延迟的RTOS 0e8c5e3121 update System/CosyOS.H.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 14:28:45 +00:00
零中断延迟的RTOS 4d0f6298b2 update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 14:27:47 +00:00
零中断延迟的RTOS 2e2800119b update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 14:26:52 +00:00
零中断延迟的RTOS 378d882bb5 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 14:21:34 +00:00
零中断延迟的RTOS 865bcf203f update Port/port_x32/RISC-V32/port_rv32_HWS.S.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 14:12:10 +00:00
零中断延迟的RTOS 264692dafb update Port/port_x32/RISC-V32/port_rv32_HWS.S.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-04 13:56:01 +00:00
零中断延迟的RTOS 4cd506c243 update System/CosyOS.H.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 09:57:58 +00:00
零中断延迟的RTOS 2e47d970e7 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 08:31:58 +00:00
零中断延迟的RTOS cdc2f2691b update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 08:27:58 +00:00
零中断延迟的RTOS b0a946708a update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 04:28:10 +00:00
零中断延迟的RTOS 73322f5281 update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 04:27:22 +00:00
零中断延迟的RTOS 7f86763d0b update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 04:20:02 +00:00
零中断延迟的RTOS 8ea1b48bae update CosyOS-移植文件.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 04:16:54 +00:00
零中断延迟的RTOS e9fefdbdf0 删除文件 Port/port_x32/RISC-V32/port_rv32_HWS.S 2026-08-03 04:14:44 +00:00
零中断延迟的RTOS a6bd76641f update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 04:13:26 +00:00
零中断延迟的RTOS 6b394e0fc8 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 03:57:11 +00:00
零中断延迟的RTOS 12b9814f78 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 03:55:12 +00:00
零中断延迟的RTOS 115c6ae309 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 03:43:46 +00:00
零中断延迟的RTOS 3c5921822b update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-08-03 03:39:25 +00:00
零中断延迟的RTOS b97cb04ac6 update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 15:50:32 +00:00
零中断延迟的RTOS ddd2ee3a4e update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 15:48:51 +00:00
零中断延迟的RTOS ca30605162 update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 15:44:36 +00:00
零中断延迟的RTOS 9e0f8bb081 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 15:16:04 +00:00
零中断延迟的RTOS 1aec3b5bdc update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 15:00:05 +00:00
零中断延迟的RTOS 04ec41fd17 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:37:56 +00:00
零中断延迟的RTOS 1dbf7dd8be update Demo-Service/6、综合应用/comp_usart.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:06:19 +00:00
零中断延迟的RTOS 5ea3c51598 update Demo-Service/5、协作式任务/coop_yield.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:05:24 +00:00
零中断延迟的RTOS 91f6f907a4 update Demo-Service/5、协作式任务/coop_ressus_3.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:04:23 +00:00
零中断延迟的RTOS 4a29ad7ca5 update Demo-Service/5、协作式任务/coop_ressus_2.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:03:51 +00:00
零中断延迟的RTOS 1a9eae729e update Demo-Service/5、协作式任务/coop_ressus_1.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:03:22 +00:00
零中断延迟的RTOS 1bd366647d update Demo-Service/5、协作式任务/coop_binary.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:02:53 +00:00
零中断延迟的RTOS fd34bb79da update Demo-Service/4、重入访问/reent_semaph.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:02:19 +00:00
零中断延迟的RTOS a53fa58e70 update Demo-Service/2、消息同步/msg_taskmsg.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:01:20 +00:00
零中断延迟的RTOS d320bb5991 update Demo-Service/1、事件同步/event_semaph.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:00:33 +00:00
零中断延迟的RTOS 91159f0404 update Demo-Service/1、事件同步/event_ressus.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 14:00:17 +00:00
零中断延迟的RTOS 6f3523739f update Demo-Service/1、事件同步/event_group.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:59:56 +00:00
零中断延迟的RTOS a48ed16b78 update Demo-Service/1、事件同步/event_clrblk.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:59:35 +00:00
零中断延迟的RTOS e8a1d00689 update Demo-Service/1、事件同步/event_binary.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:59:13 +00:00
零中断延迟的RTOS 38296014bc update Demo-Service/3、互斥访问/mutexc_mutex.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:58:52 +00:00
零中断延迟的RTOS da601e3cc5 update Demo-Service/2、消息同步/msg_taskmsg.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:57:33 +00:00
零中断延迟的RTOS 8fc00a4a44 update Demo-Service/1、事件同步/event_semaph.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:57:07 +00:00
零中断延迟的RTOS ac7a7d8c06 update Demo-Service/1、事件同步/event_ressus.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:56:37 +00:00
零中断延迟的RTOS 58f3cc85d4 update Demo-Service/1、事件同步/event_group.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:55:53 +00:00
零中断延迟的RTOS c7b9902abe update Demo-Service/1、事件同步/event_clrblk.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:55:34 +00:00
零中断延迟的RTOS a85384709b update Demo-Service/1、事件同步/event_binary.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:54:02 +00:00
零中断延迟的RTOS facfef0317 update Demo-Build/80251/demo_debug.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:46:16 +00:00
零中断延迟的RTOS 8b568aeec7 update Demo-Build/8051/demo_debug.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:44:53 +00:00
零中断延迟的RTOS 47bdd060c7 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 13:40:20 +00:00
零中断延迟的RTOS 121a0eb633 update Demo-Build/RISC-V32/demo_debug.c.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-31 12:36:33 +00:00
零中断延迟的RTOS 0ff1a11af6 update Demo-Build/Cortex-M/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 17:14:21 +00:00
零中断延迟的RTOS 7488d6517f update Demo-Build/80251/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 17:06:01 +00:00
零中断延迟的RTOS 4100045848 update Demo-Build/8051/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 17:04:14 +00:00
零中断延迟的RTOS 30a237e4aa update Demo-Build/8051/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 17:02:04 +00:00
零中断延迟的RTOS c8c509ca10 update Demo-Build/8051/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 16:57:09 +00:00
零中断延迟的RTOS bd8200f8e9 update Demo-Build/80251/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 16:55:41 +00:00
零中断延迟的RTOS 4bf045bc01 update Demo-Build/80251/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 16:54:55 +00:00
零中断延迟的RTOS 90e3cc513d update Demo-Build/8051/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 16:49:11 +00:00
零中断延迟的RTOS 7dfa63d0ea update Demo-Build/80251/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 16:44:42 +00:00
零中断延迟的RTOS 0cc8a19fc7 update Demo-Build/8051/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 16:36:07 +00:00
零中断延迟的RTOS 01a2860547 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 16:05:10 +00:00
零中断延迟的RTOS 06b15e8488 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 16:01:05 +00:00
零中断延迟的RTOS 6e7c456d57 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 15:55:08 +00:00
零中断延迟的RTOS 1f181d8023 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 15:49:42 +00:00
零中断延迟的RTOS 709d3a18a8 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 15:47:46 +00:00
零中断延迟的RTOS efaf286203 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 15:11:10 +00:00
零中断延迟的RTOS c2d642525a update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 14:50:56 +00:00
零中断延迟的RTOS 5295187019 update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 14:43:11 +00:00
零中断延迟的RTOS 95c7dbf4eb update Demo-Build/RISC-V32/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 14:42:30 +00:00
零中断延迟的RTOS affac1faa6 update Demo-Build/80251/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 14:28:16 +00:00
零中断延迟的RTOS 21f82e3019 update Demo-Build/8051/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 14:24:45 +00:00
零中断延迟的RTOS 022a1c5991 update Demo-Build/Cortex-M/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 14:22:54 +00:00
零中断延迟的RTOS 09ec59bfb5 update Demo-Build/Cortex-M/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 14:21:44 +00:00
零中断延迟的RTOS e2045f95c1 update Demo-Build/80251/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 14:06:35 +00:00
零中断延迟的RTOS cbc51acb97 update Demo-Build/80251/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 14:04:56 +00:00
零中断延迟的RTOS ae8a6e567c update Demo-Build/8051/readme.txt.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 13:56:19 +00:00
零中断延迟的RTOS 12876fac06 update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 13:01:22 +00:00
零中断延迟的RTOS f4a05aef91 update CosyOS-移植文件.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-30 12:56:33 +00:00
零中断延迟的RTOS 1fb6170f55 删除文件 Port/port_x32/RISC-V32/mcucfg_rv32.h 2026-07-30 12:54:02 +00:00
零中断延迟的RTOS 4b181c7d21 删除文件 Port/port_x32/RISC-V32/port_rv32_FSL.S 2026-07-30 12:53:38 +00:00
零中断延迟的RTOS 72f24513e4 update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-29 18:25:06 +00:00
零中断延迟的RTOS 3d5696c87b update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-29 16:25:22 +00:00
零中断延迟的RTOS 65aafb7b20 update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-29 16:12:31 +00:00
零中断延迟的RTOS 0034c5bdf9 update System/CosyOS.H.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-29 14:19:37 +00:00
零中断延迟的RTOS 7d67c6fe8e update README.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-29 13:49:10 +00:00
零中断延迟的RTOS 61754d794b update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-29 13:48:21 +00:00
零中断延迟的RTOS 86b8af336f update CosyOS-III 版本更新记录.md.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-29 13:46:23 +00:00
零中断延迟的RTOS b5ed7ac6da 删除文件 Port/port_x32/RISC-V32/port_rv32_yyy.h 2026-07-29 13:33:08 +00:00
零中断延迟的RTOS 6e5a101e31 update CosyOS-移植文件.
Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
2026-07-29 13:32:54 +00:00
零中断延迟的RTOS df38e5b51f 删除文件 Port/port_x32/RISC-V32/mcucfg_rv32.h 2026-07-29 13:28:58 +00:00
零中断延迟的RTOS d4e5887e3d 重命名 Port/port_x32/RISC-V32/port_rv32.h 为 Port/port_x32/RISC-V32/port_rv32_yyy.h 2026-07-29 13:28:51 +00:00
零中断延迟的RTOS 951bb09350 删除文件 Port/port_x32/RISC-V32/port_rv32_s.s 2026-07-29 13:28:31 +00:00
34 changed files with 852 additions and 244 deletions
+38
View File
@@ -286,3 +286,41 @@
* 其它调整及优化。
* 更新日期:2026.07.21
### V3.0.1
* 针对 RISC-V32,推出了自研先进技术,可实现 CH32V 全程开启硬件压栈。<br>
该技术为纯软件实现,不依赖特定硬件(0x804->bit5),V103、203 等皆可完美支持。
* 优化了中断FIFO服务装载器,性能进一步提升。同时增加了新的互斥访问方案:关闭总中断(嵌套方式)。
* 更新日期:2026.07.30
### V3.0.2
* 解决了 V3.0.1 版本中,硬件压栈相关技术的不可靠因素,确保系统稳定可靠运行。
* 更新日期:2026.08.03
### V3.0.3
* V3.0.2 版本的硬件压栈技术仍存在不可靠因素,现已彻底解决。
* 同时推出了 硬件压栈技术可靠性验证方法,以方便测试和验证。
* 更新日期:2026.08.05
### V3.0.4
* 解决了 Cortex-M33 任务不能正常启动并运行的问题,可靠性进一步提升。
* 更新日期:2026.08.07
### V3.0.5
* Cortex-M33 任务不能正常启动的问题解决后,导致 RISC-V 任务不能正常启动。<br>
紧急推出新版本解决上述问题,并使 RISC-V 的任务切换更加可靠。
* 更新日期:2026.08.07
### V3.0.6
* for RISC-V32,推出了终极先进技术,可实现硬件压栈无需可靠性验证,即可确保任务切换的安全、可靠。
* 更新日期:2026.08.09
### V3.0.7
* 针对 RV32 硬件压栈,分为两个文件,port_rv32e_HWS.S、port_rv32i_HWS.S,分别针对 RV32E 和 RV32I。
* 针对 RV32E,中断FIFO服务的装载,新增了互斥访问机制。
* 优化了 arm 互斥访问机制,当中断FIFO服务并发装载时,效率会有显著提升。
* 更新日期:2026.08.14
### V3.0.8
* RISC-V32,系统滴答自动配置做出调整,计数模式调整为向上计数,以尽可能兼容青稞系列更多的型号。
* 更新日期:2026.08.15
+4 -3
View File
@@ -3,11 +3,12 @@
* @file demo_debug.c
* @brief 例程-DEBUG for STC32G
* @author 迟凯峰
* @version V1.0.2
* @date 2026.06.28
* @version V1.0.3
* @date 2026.07.31
******************************************************************************/
#if 1 /* 编译开关 */
#if 1 /* 编译开关 */ \
&& defined ( __C251__ )
#include "CosyOS.H"
#if (SYSCFG_DEBUGGING == __ENABLED__)
+22 -3
View File
@@ -4,16 +4,24 @@
CosyOS-配置 / syscfg.h -> 系统配置>>标准头文件,应首先被正确定义。
而后,在 C251、A251 标签页中,可能需要添加标准头文件的包含路径。
2、main函数(参照例程 demo_main.c)
2、MCU配置
CosyOS-配置 / mcucfg_80251.h -> 系统时钟频率,需要正确定义。
内存方案配置,需根据edata内存的大小选择合适的方案。
基本的原则是:
(1)如果edata内存很大,优先考虑方案一。
(2)如果ddata内存适中,考虑方案二三四。
(3)如果edata内存很小,优先考虑方案五。
3、main函数(参照例程 demo_main.c)
初始化 PendSV中断(必须)
配置 DEBUG(可选)
启动 CosyOS(必须)
3、系统中断(参照例程 demo_int.c)
4、系统中断(参照例程 demo_int.c)
屏蔽 定时器0中断原函数(必须)
屏蔽 PendSV中断原函数(必须)
4、DEBUG(可选,参照例程 demo_debug.c)
5、DEBUG(可选,参照例程 demo_debug.c)
不出意外的话,您的项目现在已经可以正常编译了。
@@ -34,4 +42,15 @@
其中的用户定义部分,与PendSV中断配置、用户自定义任务切换现场保护
等功能息息相关,在未来可能需要适当调整。
--------------------------------------------------------------------
其它注意事项
1、任务栈SIZE不允许大于65535。
2、CosyOS for 80251,原生仅适配 Keil C251 编译器,如果您使用其它编译器,
应注意以下事项:
(1)CosyOS 内核中需要 __C251__ 关键字做条件编译,移植汇编文件中需要
__A251__ 关键字做条件编译,如果编译器不支持该关键字可自行添加。
(2)其它可能的、未知的兼容性问题。
+4 -3
View File
@@ -3,11 +3,12 @@
* @file demo_debug.c
* @brief 例程-DEBUG for STC8H
* @author 迟凯峰
* @version V1.0.2
* @date 2026.06.28
* @version V1.0.3
* @date 2026.07.31
******************************************************************************/
#if 1 /* 编译开关 */
#if 1 /* 编译开关 */ \
&& defined ( __C51__ )
#include "CosyOS.H"
#if (SYSCFG_DEBUGGING == __ENABLED__)
+22 -3
View File
@@ -4,16 +4,19 @@
CosyOS-配置 / syscfg.h -> 系统配置>>标准头文件,应首先被正确定义。
而后,在 C51、A51 标签页中,可能需要添加标准头文件的包含路径。
2、main函数(参照例程 demo_main.c)
2、MCU配置
CosyOS-配置 / mcucfg_8051.h -> 系统时钟频率,需要正确定义。
3、main函数(参照例程 demo_main.c)
初始化 PendSV中断(必须)
配置 DEBUG(可选)
启动 CosyOS(必须)
3、系统中断(参照例程 demo_int.c)
4、系统中断(参照例程 demo_int.c)
屏蔽 定时器0中断原函数(必须)
屏蔽 PendSV中断原函数(必须)
4、DEBUG(可选,参照例程 demo_debug.c)
5、DEBUG(可选,参照例程 demo_debug.c)
不出意外的话,您的项目现在已经可以正常编译了。
@@ -64,4 +67,20 @@
覆盖地图中应逐一查看这些函数,对于使用了内存的应手动修正调用树或
移除覆盖分析。
-------------------------------------------------------------------
其它注意事项
1、默认情况下,任务栈SIZE不允许大于255。只有在启用了XBPSTACK的任务切换
现场保护时,任务栈SIZE才允许大于255,最大可为65535。
2、CosyOS for 8051,原生仅适配 Keil C51 编译器,如果您使用其它编译器,
应注意以下事项:
(1)CosyOS 内核中需要 __C51__ 关键字做条件编译,移植汇编文件中需要
__A51__ 关键字做条件编译,如果编译器不支持该关键字可自行添加。
(2)CosyOS 内核中会用到 #pragma NOAREGS 来实现相对寄存器访问,如果
编译器不支持应设法等效替换。
(3)已知某些编译器不支持 .s 汇编文件,可将移植文件中的 .s 文件更名为
.A51,如 port_8051s.s 更名为 port_8051s.A51。
(4)其它可能的、未知的兼容性问题。
+12 -12
View File
@@ -6,24 +6,24 @@
1、系统配置
CosyOS-配置 / syscfg.h -> 系统配置>>标准头文件,应首先被正确定义。
2、main函数(参照例程 demo_main.c)
2、MCU配置
CosyOS-配置 / mcucfg_cmx.h,配置 系统中断 和 互斥访问方案。
Cortex-M3/M4/M7等内核:根据系统中断配置,选择 mcucfg_cm0.h
或 mcucfg_cm3.h 进行再配置。
Cortex-M0/M0+等内核:在 mcucfg_cm0.h 中,继续配置 系统中断。
3、main函数(参照例程 demo_main.c)
初始化 SysTick替代定时器(可选)
配置 DEBUG(可选)
启动 CosyOS(必须)
3、系统中断(参照例程 demo_int.c)
4、系统中断(参照例程 demo_int.c)
屏蔽 PendSV中断原函数(必须)
调用 tCosyTick_Handler(必须)
4、DEBUG(可选,参照例程 demo_debug_fwl.c 或 demo_debug_hal.c)
5、DEBUG(可选,参照例程 demo_debug_fwl.c 或 demo_debug_hal.c)
Cortex-M3/M4/M7等内核:
不出意外的话,您的项目现在已经可以正常编译了。
Cortex-M0/M0+等内核:
CosyOS-配置 / mcucfg_cmx.h,配置 系统中断 和 互斥访问方案;
CosyOS-配置 / mcucfg_cm0.h,配置 系统中断;
至此,您的项目才能正常编译。
不出意外的话,您的项目现在已经可以正常编译了。
但在未来,仍需重点关注如下内容:
@@ -35,8 +35,8 @@ Cortex-M0/M0+等内核:
CosyOS-配置 / mcucfg_cm0.h
CosyOS-配置 / mcucfg_cm3.h
3、启动文件配置
在启动文件中需要合理的配置堆栈,STACK固定给中断使用;
3、堆栈配置
需要合理的配置堆栈,STACK固定给中断使用;
动态分配的内存和动态创建的对象,都需要用到HEAP。
+5 -3
View File
@@ -3,8 +3,8 @@
* @file demo_debug.c
* @brief 例程-DEBUG for CH32V30x use firmware library
* @author 迟凯峰
* @version v1.0.0
* @date 2026.07.21
* @version v1.0.1
* @date 2026.07.31
******************************************************************************/
#if 0 /* 编译开关 */
@@ -71,7 +71,9 @@ void debug_hook(char _XDATA_MEM_ *p, s_u16_t len)
#endif
}
void USART1_IRQHandler(void) __attribute__((interrupt));
// 根据是否启用硬件压栈及串口中断优先级,选择相匹配的声明方式:
void USART1_IRQHandler(void) __attribute__((interrupt)); // 声明为软件压栈
//void USART1_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast"))); // 声明为硬件压栈
void USART1_IRQHandler(void)
{
#if (DEBUG_MODE == 1)
+123 -21
View File
@@ -2,31 +2,90 @@ RISC-V32 之系统构建
概述
1、rv32 目前暂不支持 cube 安装,用户需手动移植。移植过程中遇到问题
可加入社区获取技术支持。
2、CosyOS for rv32,是不能启用硬件压栈功能的。
3、目前仅支持 PSP栈模式,即不存在全局唯一主栈或中断专用栈,而是当前
2、目前仅支持 PSP栈模式,即不存在全局唯一主栈或中断专用栈,而是当前
任务栈即为当前主栈。这导致所有中断都是入任务栈,所以中断嵌套深度
应尽量配置少一些,同时任务栈SIZE应尽量大一些,以防溢出。
3、CosyOS 采用了自研先进技术,可实现 CH32V 全程开启硬件压栈。
该技术为纯软件实现,不依赖特定硬件(0x804->bit5),V103、203 等
皆可完美支持。所以,如果您的处理器支持硬件压栈,建议开启。
如果开启硬件压栈,中断函数的声明原则等同裸机。
即如果最大硬件压栈深度为3级,需要将低优先级的三级中断声明为硬件压栈,
高优先级的中断声明为软件压栈。
RV32I 开启硬件压栈,注意事项:
(1)处理器需要仅工作在机器模式
可在启动文件中,通过配置 mstatus 的 MPP 为 3 来实现。
(2)x4(tp)、mscratch、0xE000E040(中断优先级阈值)等寄存器,专用
于任务切换,不允许用户使用。
移植流程(以 MRS2 为例)
1、裸机工程
准备项目的裸机工程,一个最基础的工程即可。
2、删除文件
删除 CosyOS-源代码 中无关的文件,使其不被编译。
建议必须删除的文件:
(1)Port 中,仅保留 port_x32、syscfg.h
(2)Port / port_x32 中,仅保留 RISC-V32、port_x32.c、port_x32.h
建议可选删除的文件:
(1)Demo-Service
(2)Demo-Build 中,仅保留 RISC-V32、demo_task.c
注:如果不删除不会影响正常编译
3、拷贝文件
拷贝 CosyOS-源代码 至工程中。
4、包含路径
打开工程,添加下方的包含路径。
C包含路径:
cosyos-v3.0.1/System
cosyos-v3.0.1/Port
cosyos-v3.0.1/Port/port_x32
cosyos-v3.0.1/Port/port_x32/RISC-V32
汇编包含路径:
cosyos-v3.0.1/Port
cosyos-v3.0.1/Port/port_x32/RISC-V32
构建流程
0、Include/Exclude
Port / port_x32 / RISC-V32 / port_rv32_SWS.S, 为软件压栈专用,兼容 RV32E、RV32I 指令集;
Port / port_x32 / RISC-V32 / port_rv32e_HWS.S,为硬件压栈专用,针对 RV32E 指令集(青稞 V2 系列);
Port / port_x32 / RISC-V32 / port_rv32i_HWS.S,为硬件压栈专用,针对 RV32I 指令集(青稞 V3/V4 系列);
根据是否启用硬件压栈,Include 相匹配的文件,Exclude 不匹配的文件。
如果启用硬件压栈,port_rv32e_HWS.S、port_rv32i_HWS.S 可同时包含。
1、系统配置
Port / syscfg.h -> 系统配置>>处理器架构,应定义为 4。
Port / syscfg.h -> 系统配置>>标准头文件,需要正确定义,如定义为
"ch32v30x.h"。
2、main函数
在main函数的末尾处,先配置 DEBUG(如果需要使用 CosyOS-任务管理器),
2、MCU配置
Port / port_x32 / RISC-V32 / mcucfg_rv32.h 中,配置系统滴答和
系统时钟。
3、main函数
在main函数的末尾处,先配置 DEBUG(如果使用 CosyOS-任务管理器),
最后再启动 CosyOS(必须)。
3、中断
首先,所有中断函数都不能声明为硬件压栈中断,只能是软件压栈中断。
4、系统中断
CosyOS 固定采用 SysTick_Handler 和 SW_Handler 做为系统中断。
用户需要自行在 SysTick_Handler 中调用 tCosyTick_Handler。
用户不要自行创建 SW_Handler。
5、DEBUG(可选,参照例程 demo_debug.c)
在未来,用户仍需重点关注如下内容:
1、系统配置
@@ -35,22 +94,31 @@ RISC-V32 之系统构建
2、MCU配置
Port / port_x32 / RISC-V32 / mcucfg_rv32.h
3、启动文件、ld文件配置等
3、启动文件配置
在 handle_reset 中,配置特权级(mstatus);
配置硬件压栈使能、中断嵌套使能、中断嵌套深度、硬件压栈溢出后中断使能(0x804)。
4、ld文件配置
配置硬件栈size。
通常配置一个极小的数值即可,据不完全测试,该值配置为0即可正常运行:
__stack_size = 0;
例程-main
例程
/* 例程-main */
int main(void)
{
/* USER INIT CODE BEGIN */
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
SystemCoreClockUpdate();
Delay_Init();
/* USER INIT CODE BEGIN */
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
SystemCoreClockUpdate();
Delay_Init();
////USART_Printf_Init(115200);
USART1_UART_Init (115200);
printf("SystemClk:%d\r\n",SystemCoreClock);
printf( "ChipID:%08x\r\n", DBGMCU_GetCHIPID() );
printf("This is printf example\r\n");
/* USER INIT CODE END */
USART1_UART_Init (115200);
printf("SystemClk:%d\r\n",SystemCoreClock);
printf( "ChipID:%08x\r\n", DBGMCU_GetCHIPID() );
printf("This is printf example\r\n");
/* USER INIT CODE END */
/* USER DEBUG CONFIG */// for CosyOS-Taskmgr
#if (SYSCFG_DEBUGGING == 1)
@@ -59,7 +127,7 @@ int main(void)
Debug_Config();
}// defined in demo_debug.c
#endif
/* USER 启动 CosyOS */// 在main函数的末尾处
if(1){
#if 1 // 建议前期调试时开启,如果CosyOS启动失败会返回错误码提示用户!
@@ -70,13 +138,47 @@ int main(void)
#endif
}
while(1);
while(1);
}
例程-SysTick_Handler
void SysTick_Handler(void) __attribute__((interrupt));
/* 例程-SysTick_Handler */// 根据是否启用硬件压栈,选择相匹配的声明方式:
//void SysTick_Handler(void) __attribute__((interrupt)); // 声明为软件压栈
void SysTick_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast"))); // 声明为硬件压栈
void SysTick_Handler(void)
{
SysTick->SR = 0;
tCosyTick_Handler();
}
/* 例程-启动文件 */// 使能硬件压栈并仅为机器模式
handle_reset:
/* Enable interrupt nesting and hardware stack */
// HWSTKOVEN, PMTCFG, INESTEN, HWSTKEN
li t0, (1 << 4) | (3 << 2) | (1 << 1) | 1
csrw 0x804, t0
/* Enable floating point and global interrupt, configure privileged mode */
// FS, MPP, MPIE, MIE
li t0, (3 << 13) | (3 << 11) | (1 << 7) | (1 << 3)
csrw mstatus, t0
/*
0x804
HWSTKOVEN:硬件压栈溢出后中断使能
PMTCFG: 中断嵌套深度
INESTEN: 中断嵌套使能
HWSTKEN: 硬件压栈使能
mstatus
FS: 浮点单元状态
MPP: 进中断前特权模式
MPIE:进中断前中断使能状态
MIE: 机器模式中断使能
*/
/* 例程-断点测试钩子 */// for RV32I 硬件压栈
void test_breakpoint_hook(void)
{
printf("break point test failed\r\n");
while(1);
}
+2 -2
View File
@@ -6,7 +6,7 @@
* @note 事件处理线程(task_1)中,可以实现超时处理机制。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.21
* @date 2026.07.31
******************************************************************************/
/*-------------------------------------------------------*
@@ -19,7 +19,7 @@
| pGiveBin(bin) | 中断中给予二值信号量 - FLAG服务 |
*-------------------------------------------------------*/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
+2 -2
View File
@@ -6,7 +6,7 @@
* @note 事件处理线程(task_1)中,无法实现超时处理机制。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.21
* @date 2026.07.31
******************************************************************************/
/*-------------------------------------------------*
@@ -19,7 +19,7 @@
| pClearBlock(task) | 中断中清除阻塞 - FLAG服务 |
*-------------------------------------------------*/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
+2 -2
View File
@@ -7,10 +7,10 @@
统一处理该类事件。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.22
* @date 2026.07.31
******************************************************************************/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
+2 -2
View File
@@ -6,7 +6,7 @@
* @note 事件处理线程(task_1)中,无法实现超时处理机制。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.21
* @date 2026.07.31
******************************************************************************/
/*-----------------------------------------------*
@@ -19,7 +19,7 @@
| pResumeTask(task) | 中断中恢复任务 - FLAG服务 |
*-----------------------------------------------*/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
+2 -2
View File
@@ -7,7 +7,7 @@
* @note 计数信号量,是唯一能够实现并发事件同步的手段。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.21
* @date 2026.07.31
******************************************************************************/
/*-------------------------------------------------------*
@@ -18,7 +18,7 @@
| iGiveSem(sem) | 中断中给予计数信号量 - FIFO服务 |
*-------------------------------------------------------*/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
+2 -2
View File
@@ -5,10 +5,10 @@
* @details 通过私信的应用实现任务间通信。
* @author 迟凯峰
* @version V1.0.1
* @date 2026.04.16
* @date 2026.07.31
******************************************************************************/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H" // 用户的各个c文件中应包含此文件
#include <stdio.h> // for printf
+2 -2
View File
@@ -6,10 +6,10 @@
* @note 可实现超时处理机制。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.25
* @date 2026.07.31
******************************************************************************/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
+2 -2
View File
@@ -6,10 +6,10 @@
* @note 可实现超时处理机制。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.25
* @date 2026.07.31
******************************************************************************/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
@@ -6,7 +6,7 @@
* @note 适用于多个任意优先级任务的循环协作。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.21
* @date 2026.07.31
******************************************************************************/
/*-------------------------------------------*
@@ -17,7 +17,7 @@
| uGiveBin(bin) | 任务中 给予二值信号量 |
*-------------------------------------------*/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
@@ -6,7 +6,7 @@
* @note 适用于两个不同优先级任务的循环协作。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.21
* @date 2026.07.31
******************************************************************************/
/*-------------------------------------*
@@ -17,7 +17,7 @@
| uResumeTask(task) | 任务中 恢复任务 |
*-------------------------------------*/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
@@ -6,7 +6,7 @@
* @note 适用于多个不同优先级任务的循环协作。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.21
* @date 2026.07.31
******************************************************************************/
/*----------------------------------------------------------*
@@ -15,7 +15,7 @@
| uResumeSuspend(task) | 任务中 恢复指定任务并挂起自身任务 |
*----------------------------------------------------------*/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
@@ -6,7 +6,7 @@
* @note 适用于多个相同优先级任务的循环协作。
* @author 迟凯峰
* @version V1.0.0
* @date 2025.10.21
* @date 2026.07.31
******************************************************************************/
/*----------------------------------------------------------*
@@ -15,7 +15,7 @@
| uResumeSuspend(task) | 任务中 恢复指定任务并挂起自身任务 |
*----------------------------------------------------------*/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
@@ -6,7 +6,7 @@
* @note 适用于多个相同优先级任务的循环协作。
* @author 迟凯峰
* @version V1.0.1
* @date 2026.04.16
* @date 2026.07.31
******************************************************************************/
/*--------------------------------*
@@ -22,7 +22,7 @@
3、任务的启动顺序,决定了任务的协作运行顺序。
*/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#include "CosyOS.H"
+2 -2
View File
@@ -12,10 +12,10 @@
* @note 本例程仅以 STM32-HAL库 的应用为例,其它情形请用户自行做出调整。
* @author 迟凯峰
* @version V1.0.1
* @date 2026.02.19
* @date 2026.07.31
******************************************************************************/
#if 1 /* 编译开关 */
#if 0 /* 编译开关 */
#define PENDSV_FIFO_FLAG 2 // 定时服务为中断挂起服务,选择 FIFO服务 或 FLAG服务(1:FIFO服务,2:FLAG服务)
+3 -3
View File
@@ -4,7 +4,7 @@
* @brief CMSIS Cortex-M Core Config File
* @author 迟凯峰
* @version v3.0.0
* @date 2026.07.21
* @date 2026.08.15
******************************************************************************/
#ifndef __MCUCFG_CM0_H
@@ -62,11 +62,11 @@
// 替代定时器-重装载值
// 如果该值为常量可配置为常量,否则应配置为可读的重装载值寄存器。
#define MCUCFG_SYSTICK_LOADVALUE (SYSCFG_SYSTICK_CYCLE - 1) //=(TIM14->ARR)
#define MCUCFG_SYSTICK_LOADVALUE (SYSCFG_SYSTICK_CYCLE - 1) // = (TIM14->ARR)
// 替代定时器-时钟
// 告知CosyOS您所配置的定时器时钟,单位为兆赫(MHZ)。
#define MCUCFG_SYSTICK_CLK 1 //=(系统时钟 / (TIM14->PSC + 1))
#define MCUCFG_SYSTICK_CLK 1 // = (系统时钟 / (TIM14->PSC + 1))
//////////////////////////////////* 系统定义 *//////////////////////////////////
+2 -2
View File
@@ -4,7 +4,7 @@
* @brief CMSIS Cortex-M Core Config File
* @author 迟凯峰
* @version v3.0.0
* @date 2026.07.21
* @date 2026.08.15
******************************************************************************/
#ifndef __MCUCFG_CM3_H
@@ -69,7 +69,7 @@
// 系统滴答-时钟
// 告知CosyOS您所配置的系统滴答时钟,单位为兆赫(MHZ)。
#define MCUCFG_SYSTICK_CLK (系统时钟 / ((SysTick->CTRL & 4) ? 1 : 8))
#define MCUCFG_SYSTICK_CLK 168 // = (系统时钟 / ((SysTick->CTRL & 4) ? 1 : 8))
#endif
+45 -41
View File
@@ -3,8 +3,8 @@
* @file port_cmx_s.c
* @brief CMSIS Cortex-M Core Port File for Arm / GNU / IAR Compiler
* @author 迟凯峰
* @version v3.0.0
* @date 2026.07.21
* @version v3.0.7
* @date 2026.08.14
******************************************************************************/
#include "os_var.h"
@@ -137,28 +137,27 @@ __OVERFLOW1
#if (MCUCFG_PENDSVFIFO_MUTEX == 0xFF)
ldrh r2, [r1]
ldr r3, =0x8000
cmp r2, r3
#else
ldr r2, [r1]
ldr r3, =0x80000000
cmp r2, r3
#endif
cmp r2, r3
bhi __OVER
#endif
/* FIFO计数 */
/* 关闭总中断 */
#if (MCUCFG_PENDSVFIFO_MUTEX == 0)
#if (MCUCFG_PENDSVFIFO_XXXXX == 1)
mrs r3, primask // cycles:4
mrs r3, primask // cycle:4
#endif
cpsid i // cycles:1
ldr r2, [r1] // cycles:2
adds r2, #1 // cycles:1
str r2, [r1] // cycles:2
cpsid i // cycle:1
ldr r2, [r1] // cycle:2
adds r2, #1 // cycle:1
str r2, [r1] // cycle:2
#if (MCUCFG_PENDSVFIFO_XXXXX == 1)
msr primask, r3 // cycles:4
msr primask, r3 // cycle:4
#else
cpsie i // cycles:1
cpsie i // cycle:1
#endif
/* 互斥访问指令 */
@@ -173,24 +172,27 @@ __LOOP ldrex r2, [r1]
#elif (MCUCFG_PENDSVFIFO_MUTEX == 0xFF)
IMPORT mPendSV_FIFO_X
#define rx mPendSV_FIFO_rx
mov r12, rx
ldrh r3, [r1, #2] // 查询独占访问标志
cmp r3, #0
beq __WHOLE
/* 已打断 *///不会被打断:8
ldrh r2, [r1]
adds r2, #1
strh r2, [r1]
ldr rx, =mPendSV_FIFO_X // 重设 rx
b __OVERFLOW2
/* 未打断 *///可能被打断:14
__WHOLE push {rx} // 保护 rx
movs r2, #1
ldrh r3, [r1, #2]
strh r2, [r1, #2]
dmb
strh r2, [r1, #2] // 设置独占访问标志
__LOOP mov rx, r1
ldrh r2, [rx]
adds r2, #1
strh r2, [rx]
cmp rx, r1
bne __LOOP
cmp r3, #0
beq __RESrx
ldr rx, =mPendSV_FIFO_X
b __OVERFLOW2
__RESrx strh r3, [r1, #2]
mov rx, r12
strh r3, [r1, #2] // 清除独占访问标志
pop {rx} // 恢复 rx
#undef rx
#endif
/* FIFO溢出 */
@@ -339,28 +341,27 @@ void mPendSV_FIFOLoader(void *sv)
#if (MCUCFG_PENDSVFIFO_MUTEX == 0xFF)
"ldrh r2, [r1] \n"
"ldr r3, =0x8000 \n"
"cmp r2, r3 \n"
#else
"ldr r2, [r1] \n"
"ldr r3, =0x80000000 \n"
"cmp r2, r3 \n"
#endif
"cmp r2, r3 \n"
"bhi __OVER \n"
#endif
/* FIFO计数 */
/* 关闭总中断 */
#if (MCUCFG_PENDSVFIFO_MUTEX == 0)
#if (MCUCFG_PENDSVFIFO_XXXXX == 1)
"mrs r3, primask \n" // cycles:4
"mrs r3, primask \n" // cycle:4
#endif
"cpsid i \n" // cycles:1
"ldr r2, [r1] \n" // cycles:2
"adds r2, #1 \n" // cycles:1
"str r2, [r1] \n" // cycles:2
"cpsid i \n" // cycle:1
"ldr r2, [r1] \n" // cycle:2
"adds r2, #1 \n" // cycle:1
"str r2, [r1] \n" // cycle:2
#if (MCUCFG_PENDSVFIFO_XXXXX == 1)
"msr primask, r3 \n" // cycles:4
"msr primask, r3 \n" // cycle:4
#else
"cpsie i \n" // cycles:1
"cpsie i \n" // cycle:1
#endif
/* 互斥访问指令 */
@@ -374,24 +375,27 @@ void mPendSV_FIFOLoader(void *sv)
/* 互斥访问机制 */
#elif (MCUCFG_PENDSVFIFO_MUTEX == 0xFF)
#define rx mPendSV_FIFO_rx
"mov r12, "sDefStr(rx \n)
"movs r2, #1 \n"
"ldrh r3, [r1, #2] \n"
"cmp r3, #0 \n"
"beq __WHOLE \n"
"ldrh r2, "sDefStr([r1] \n)
"adds r2, #1 \n"
"strh r2, "sDefStr([r1] \n)
"ldr "sDefStr(rx)", =mPendSV_FIFO_X \n"
"b __OVERFLOW2 \n"
"__WHOLE: push "sDefStr({rx} \n)
"movs r2, #1 \n"
"strh r2, [r1, #2] \n"
"dmb \n"
"__LOOP: mov "sDefStr(rx)", r1 \n"
"ldrh r2, "sDefStr([rx] \n)
"adds r2, #1 \n"
"strh r2, "sDefStr([rx] \n)
"cmp "sDefStr(rx)", r1 \n"
"bne __LOOP \n"
"cmp r3, #0 \n"
"beq __RESrx \n"
"ldr "sDefStr(rx)", =mPendSV_FIFO_X \n"
"b __OVERFLOW2 \n"
"__RESrx: strh r3, [r1, #2] \n"
"mov "sDefStr(rx)", r12 \n"
"strh r3, [r1, #2] \n"
"pop "sDefStr({rx} \n)
#undef rx
#endif
/* FIFO溢出 */
+27 -7
View File
@@ -3,8 +3,8 @@
* @file mcucfg_rv32.h
* @brief RISC-V32 Core Config File
* @author 迟凯峰
* @version v3.0.0
* @date 2026.07.21
* @version v3.0.7
* @date 2026.08.15
******************************************************************************/
#ifndef __MCUCFG_RV32_H
@@ -12,14 +12,34 @@
///////////////////////////////////////////////////////////////////////////////
// 中断FIFO服务装载器-互斥访问方案
// <1=> [lr][sc]指令 <2=> [amoadd]指令
// 两种方案均可实现全局不关总中断、零中断延迟。
#define MCUCFG_PENDSVFIFO_MUTEX 1
// <1=> [lr][sc]指令 <2=> [amoadd]指令 <255=> 互斥访问机制 <0=> 关闭总中断(嵌套方式)
// <i> ------------------------------------------------------------------------
// [lr][sc]指令
// 可实现全局不关总中断、零中断延迟。
// 值得留意的是,青稞 V3A/V4 系列微处理器,对该指令进行了弱化处理,仅作为 lw,sw
// 执行,不再具有独占访问能力,所以不要使用。
// <i> ------------------------------------------------------------------------
// [amoadd]指令
// 可实现全局不关总中断、零中断延迟。
// 该指令执行周期可能会稍长且不确定。
// <i> ------------------------------------------------------------------------
// 互斥访问机制
// 可实现全局不关总中断、零中断延迟。
// 适用于不支持上述原子访问指令的情况,如青稞 V2 系列。
// x4(tp)、mscratch 专用于该机制下中断FIFO服务的互斥装载,用户不要使用。
// 青稞 V3/V4 系列,如果启用硬件压栈(port_rv32i_HWS.S),也会用到这两个寄存器,
// 会与互斥访问机制相冲突。
// <i> ------------------------------------------------------------------------
// 关闭总中断(嵌套方式)
// 适用于不支持上述原子访问指令的情况,如青稞 V2 系列。
// 由于在关闭总中断之后必须使用 fence.i 指令同步隔离,所以关闭总中断时间暂不确定。
#define MCUCFG_PENDSVFIFO_MUTEX 2
///////////////////////////////////////////////////////////////////////////////
// 浮点寄存器上下文自动保存
// <0=> 不保存 <1=> 保存
// 是否启用浮点寄存器的上下文自动保存功能?
// 如果存在并且启用了硬件浮点单元,同时在多个任务和中断中都要进行浮点运算,可考虑开启该选项。
// 如果存在并且启用了硬件浮点单元,同时在多个任务中都要进行浮点运算,可考虑开启该选项。
#define MCUCFG_FPU_AUTOSTORE 0
///////////////////////////////////////////////////////////////////////////////
@@ -68,7 +88,7 @@
// 系统滴答-时钟
// 告知CosyOS您所配置的系统滴答时钟,单位为兆赫(MHZ)。
#define MCUCFG_SYSTICK_CLK (系统时钟 / (((*(volatile uint32_t *)0xE000F000) & 4) ? 1 : 8))
#define MCUCFG_SYSTICK_CLK 96 // = (系统时钟 / (((*(volatile uint32_t *)0xE000F000) & 4) ? 1 : 8))
#endif
+11 -13
View File
@@ -3,8 +3,8 @@
* @file port_rv32.h
* @brief RISC-V32 Core Port File
* @author 迟凯峰
* @version v3.0.0
* @date 2026.07.21
* @version v3.0.8
* @date 2026.08.15
******************************************************************************/
#ifndef __PORT_RV32_H
@@ -22,17 +22,16 @@
#define MCUCFG_STACK_ALIGN __ALIGNED(16)
#define MCUCFG_TASKSTACK_REALLOC __DISABLED__
#if (MCUCFG_FPU_AUTOSTORE == __ENABLED__)
#define MCUCFG_CALLEE_PUSH_FPU (32 * MCUCFG_FPUBYTES)
#define MCUCFG_PUSH_FPU (32 * MCUCFG_FPUBYTES)
#else
#define MCUCFG_CALLEE_PUSH_FPU 0
#define MCUCFG_PUSH_FPU 0
#endif
#if !defined ( __riscv_32e )
#define MCUCFG_CALLEE_PUSH_REG (32 * MCUCFG_REGBYTES)
#define MCUCFG_PUSH_REG (32 * MCUCFG_REGBYTES)
#else
#define MCUCFG_CALLEE_PUSH_REG (16 * MCUCFG_REGBYTES)
#define MCUCFG_PUSH_REG (16 * MCUCFG_REGBYTES)
#endif
#define MCUCFG_CALLEE_PUSH (MCUCFG_CALLEE_PUSH_FPU + MCUCFG_CALLEE_PUSH_REG)
#define MCUCFG_BASICSTACKSIZE (MCUCFG_CALLEE_PUSH)
#define MCUCFG_BASICSTACKSIZE (MCUCFG_PUSH_FPU + MCUCFG_PUSH_REG)
/* TaskCtrl */
@@ -45,7 +44,7 @@
*/
#if (MCUCFG_SYSTICK_AUTOCONFIG == __ENABLED__)
/* 自动配置 */
#define MCUCFG_SYSTICK_COUNTMODE 2 /*!< 计数方式,2:从重装载值向下计数至零溢出 */
#define MCUCFG_SYSTICK_COUNTMODE 1 /*!< 计数方式,1:从零向上计数至重装载值溢出 */
#define MCUCFG_SYSTICK_LIMITVALUE (1UL << 32) /*!< 极限值 */
#define MCUCFG_SYSTICK_CURRVALUE *(volatile s_u32_t *)(0xE000F008) /*!< 当前值寄存器 */
#define MCUCFG_SYSTICK_CLK MCUCFG_SYSCLK
@@ -57,7 +56,7 @@
#error 系统滴答定时器溢出。
#endif
#define mSysTick_SetLOAD() *(volatile s_u32_t *)(0xE000F010) = MCUCFG_SYSTICK_LOADVALUE
#define mSysTick_SetCTRL() *(volatile s_u32_t *)(0xE000F000) = 0x3F
#define mSysTick_SetCTRL() *(volatile s_u32_t *)(0xE000F000) = 0x2F
#define mSysTick_INIT() \
do{ \
mSysTick_SetPRI(); \
@@ -126,7 +125,6 @@ __STATIC_FORCEINLINE void __mu_enable_sysirq(void)
/* CosyOS初始化 */
#define mCosyOS_INIT() \
do{ \
__ASM("csrc 0x804, 1"); \
mPendSV_INIT(); \
mSysTick_INIT(); \
}while(false)
@@ -155,12 +153,12 @@ do{ \
do{ \
node_news->psp = node_news->psp_top; \
node_news->psp -= MCUCFG_BASICSTACKSIZE; \
*(volatile s_u32_t *)(node_news->psp + MCUCFG_CALLEE_PUSH_FPU) = (s_u32_t)node_news->entry; /* x0(mepc) */ \
*(volatile s_u32_t *)(node_news->psp + MCUCFG_PUSH_FPU) = (s_u32_t)node_news->entry; /* x0(mepc) */ \
}while(false)
/* 栈监控 */
#if (SYSCFG_DEBUGGING == __ENABLED__)
#define mTaskStack_Check0() s_task_current->psp_top - __get_SP() + MCUCFG_CALLEE_PUSH_FPU
#define mTaskStack_Check0() s_task_current->psp_top - __get_SP() + MCUCFG_PUSH_FPU
#define mTaskStack_Check() s_stack_check((s_u8_t *)(s_task_current->psp_top), s_task_current->stacksize)
#define mTaskStack_CheckInit() s_stack_check_init((s_u8_t *)(node_news->psp_top), node_news->stacksize)
+85
View File
@@ -0,0 +1,85 @@
/**************************************************************************//**
* @item CosyOS-III Port
* @file port_rv32_FSL.S
* @brief RISC-V32 Core Port File for Interrupt FIFO Service Loading
* @author 迟凯峰
* @version v3.0.7
* @date 2026.08.14
******************************************************************************/
#include "syscfg.h"
#include "mcucfg_rv32.h"
////////////////////////////////////////////////////////////////////////////////
#if (SYSCFG_PENDSVFIFO_DEPTH > 0)
/* 互斥访问机制 */
#if (MCUCFG_PENDSVFIFO_MUTEX == 0xFF)
.data
mPendSV_FIFO_X: .word 0
#endif
/* 中断FIFO服务装载器 */
.global mPendSV_FIFOLoader
.align 2
mPendSV_FIFOLoader:
/* FIFO选择 */
la a2, m_fifo_lock
lb a3, (a2)
beqz a3, 1f
la a1, mPendSV_FIFO_0
j 2f
1: la a1, mPendSV_FIFO_1
/* 计数溢出 */
2:
#if (0) // 正常情况下计数器难以溢出,默认关闭防护以提高装载效率。
lw a2, (a1)
li a3, 0x80000000
bltu a3, a2, 5f
#endif
/* FIFO计数 */
/* 关闭总中断(嵌套方式)*/
#if (MCUCFG_PENDSVFIFO_MUTEX == 0)
csrr a3, mstatus
csrc mstatus, 0x8
fence.i
lw a2, (a1)
addi a2, a2, 1
sw a2, (a1)
csrw mstatus, a3
/* [lr][sc]指令 */
#elif (MCUCFG_PENDSVFIFO_MUTEX == 1)
3: lr.w a2, (a1)
addi a2, a2, 1
sc.w a3, a2, (a1)
bnez a3, 3b
/* [amoadd]指令 */
#elif (MCUCFG_PENDSVFIFO_MUTEX == 2)
li a3, 1
amoadd.w a2, a3, (a1)
addi a2, a2, 1
/* 互斥访问机制 */
#elif (MCUCFG_PENDSVFIFO_MUTEX == 0xFF)
csrrwi a3, mscratch, 1
3: add tp, a1, zero
lw a2, (tp)
addi a2, a2, 1
sw a2, (tp)
bne tp, a1, 3b
csrw mscratch, a3
beqz a3, 4f
la tp, mPendSV_FIFO_X
#endif
/* FIFO溢出 */
4: li a3, SYSCFG_PENDSVFIFO_DEPTH
bltu a3, a2, 5f
/* FIFO装载 */
slli a2, a2, 2
add a1, a1, a2
sw a0, (a1)
5: ret
#endif
@@ -1,32 +1,37 @@
/**************************************************************************//**
* @item CosyOS-III Port
* @file port_rv32_s.s
* @brief RISC-V32 Core Port File
* @file port_rv32_SWS.S
* @brief RISC-V32 Core Port File for Software Stack
* @note 对处理器特权模式无要求。
* @note x4(tp)寄存器默认未保护,如需保护可自行开启。
* @author 迟凯峰
* @version v3.0.0
* @date 2026.07.21
* @version v3.0.7
* @date 2026.08.14
******************************************************************************/
#include "syscfg.h"
#include "mcucfg_rv32.h"
#define fstore fsw
#define store sw
#define load lw
#define fload flw
#define fstore fsw
#define store sw
#define load lw
#define fload flw
////////////////////////////////////////////////////////////////////////////////
/* PendSV 软中断 */
.global OS_PendSV_Handler
.align 2
OS_PendSV_Handler:
/* 保护REG */
/* push Caller & Callee */
#if !defined ( __riscv_32e )
addi sp, sp,-32 * MCUCFG_REGBYTES
#else
addi sp, sp,-16 * MCUCFG_REGBYTES
#endif
store x1, 1 * MCUCFG_REGBYTES(sp)
store x4, 4 * MCUCFG_REGBYTES(sp)
////store x4, 4 * MCUCFG_REGBYTES(sp) // default not store/load x4
store x5, 5 * MCUCFG_REGBYTES(sp)
store x6, 6 * MCUCFG_REGBYTES(sp)
store x7, 7 * MCUCFG_REGBYTES(sp)
@@ -56,20 +61,24 @@ OS_PendSV_Handler:
store x30, 30 * MCUCFG_REGBYTES(sp)
store x31, 31 * MCUCFG_REGBYTES(sp)
#endif
call sPendSV_Handler
beqz a0, 2f // 直接返回
la t0, s_task_current
addi a0, a0, -1
beqz a0, 1f // 恢复现场
/* 保护PC */
la s1, s_task_current
addi s0, a0, -1
beqz s0, 1f // 恢复现场
/* push mepc */
csrr a0, mepc
store a0, 0 * MCUCFG_REGBYTES(sp)
/* 任务PC监控 */
/* 任务-PC 监控 */
#if (SYSCFG_TASKPC_MONITOR == 1)
la a1, s_pc
la a1, s_pc
sw a0, (a1)
#endif
/* 保护FPU */
/* push FPU */
#if (MCUCFG_FPU_AUTOSTORE == 1)
addi sp, sp,-32 * MCUCFG_FPUBYTES
fstore f0, 0 * MCUCFG_FPUBYTES(sp)
@@ -105,15 +114,18 @@ OS_PendSV_Handler:
fstore f30, 30 * MCUCFG_FPUBYTES(sp)
fstore f31, 31 * MCUCFG_FPUBYTES(sp)
#endif
lw t2, (t0)
sw sp, (t2)
lw t0, (s1)
sw sp, (t0)
fence rw, rw
1: /* 恢复现场 */
la t1, s_task_news
lw t2, (t1)
sw t2, (t0)
lw sp, (t2)
/* 恢复FPU */
/* 恢复现场 */
1: la t1, s_task_news
lw t0, (t1)
lw sp, (t0)
sw t0, (s1)
/* pop FPU */
#if (MCUCFG_FPU_AUTOSTORE == 1)
fload f0, 0 * MCUCFG_FPUBYTES(sp)
fload f1, 1 * MCUCFG_FPUBYTES(sp)
@@ -148,12 +160,14 @@ OS_PendSV_Handler:
fload f30, 30 * MCUCFG_FPUBYTES(sp)
fload f31, 31 * MCUCFG_FPUBYTES(sp)
addi sp, sp, 32 * MCUCFG_FPUBYTES
#endif/* 恢复PC */
#endif
/* pop mepc */
load a0, 0 * MCUCFG_REGBYTES(sp)
csrw mepc, a0
2: /* 恢复REG */
load x1, 1 * MCUCFG_REGBYTES(sp)
load x4, 4 * MCUCFG_REGBYTES(sp)
/* pop Caller & Callee */
2: load x1, 1 * MCUCFG_REGBYTES(sp)
////load x4, 4 * MCUCFG_REGBYTES(sp) // default not store/load x4
load x5, 5 * MCUCFG_REGBYTES(sp)
load x6, 6 * MCUCFG_REGBYTES(sp)
load x7, 7 * MCUCFG_REGBYTES(sp)
@@ -186,54 +200,6 @@ OS_PendSV_Handler:
load x31, 31 * MCUCFG_REGBYTES(sp)
addi sp, sp, 32 * MCUCFG_REGBYTES
#endif
mret
/* 中断FIFO服务装载器 */
#if (SYSCFG_PENDSVFIFO_DEPTH > 0)
.global mPendSV_FIFOLoader
.align 2
mPendSV_FIFOLoader:
addi sp, sp, -1 * MCUCFG_REGBYTES
store ra, 0 * MCUCFG_REGBYTES(sp)
/* FIFO选择 */
la a2, m_fifo_lock
lb a3, (a2)
beqz a3, 1f
la a1, mPendSV_FIFO_0
jal 2f
1: la a1, mPendSV_FIFO_1
/* 计数溢出 */
2:
#if (0) // 正常情况下计数器难以溢出,默认关闭防护以提高装载效率。
lw a2, (a1)
li a3, 0x80000000
bltu a3, a2, 4f
#endif
/* FIFO计数 */
/* 1、[lr][sc]指令 */
#if (MCUCFG_PENDSVFIFO_MUTEX == 1)
3: lr.w a2, (a1)
addi a2, a2, 1
sc.w a3, a2, (a1)
bnez a3, 3b
/* 2、[amoadd]指令 */
#elif (MCUCFG_PENDSVFIFO_MUTEX == 2)
li a3, 1
amoadd.w a2, a3, (a1)
addi a2, a2, 1
#endif
/* FIFO溢出 */
li a3, SYSCFG_PENDSVFIFO_DEPTH
bltu a3, a2, 4f
/* FIFO装载 */
slli a2, a2, 2
add a1, a1, a2
sw a0, (a1)
4: load ra, 0 * MCUCFG_REGBYTES(sp)
addi sp, sp, 1 * MCUCFG_REGBYTES
ret
#endif
+73
View File
@@ -0,0 +1,73 @@
/**************************************************************************//**
* @item CosyOS-III Port
* @file port_rv32e_HWS.S
* @brief RV32E Core Port File for Hardware Stack
* @note 对处理器特权模式无要求。
* @note x4(tp)寄存器默认未保护,如需保护可自行开启。
* @author 迟凯峰
* @version v3.0.7
* @date 2026.08.14
******************************************************************************/
#if defined ( __riscv_32e )
#include "syscfg.h"
#include "mcucfg_rv32.h"
#define store sw
#define load lw
////////////////////////////////////////////////////////////////////////////////
/* PendSV 软中断 */
.global OS_PendSV_Handler
.align 2
OS_PendSV_Handler: // hardware push Caller
/* push Callee */
addi sp, sp, -4 * MCUCFG_REGBYTES
store x8, 1 * MCUCFG_REGBYTES(sp)
store x9, 2 * MCUCFG_REGBYTES(sp)
////store x4, 3 * MCUCFG_REGBYTES(sp) // default not store/load x4
call sPendSV_Handler
beqz a0, 2f // 直接返回
la s1, s_task_current
addi s0, a0, -1
beqz s0, 1f // 恢复现场
/* push mepc */
csrr a0, mepc
store a0, 0 * MCUCFG_REGBYTES(sp)
/* 任务-PC 监控 */
#if (SYSCFG_TASKPC_MONITOR == 1)
la a1, s_pc
sw a0, (a1)
#endif
lw t0, (s1)
sw sp, (t0)
fence rw, rw
/* 恢复现场 */
1: la t1, s_task_news
lw t0, (t1)
lw sp, (t0)
sw t0, (s1)
/* pop mepc */
load a0, 0 * MCUCFG_REGBYTES(sp)
csrw mepc, a0
/* pop Callee */
2: load x8, 1 * MCUCFG_REGBYTES(sp)
load x9, 2 * MCUCFG_REGBYTES(sp)
////load x4, 3 * MCUCFG_REGBYTES(sp) // default not store/load x4
addi sp, sp, 4 * MCUCFG_REGBYTES
mret // hardware pop Caller
////////////////////////////////////////////////////////////////////////////////
#endif
File diff suppressed because it is too large Load Diff
+10 -10
View File
@@ -2,23 +2,23 @@
![Author](https://img.shields.io/badge/Author-迟凯峰-red?style=flat-square)
![languge](https://img.shields.io/badge/languge-C、Asm-blue)
![license](https://img.shields.io/badge/license-Apache2.0-brightgreen.svg)
![version](https://img.shields.io/badge/version-3.0.0-green)
![version](https://img.shields.io/badge/version-3.0.8-green)
[![star](https://gitee.com/cosyos/cosyos/badge/star.svg?theme=dark)](https://gitee.com/cosyos/cosyos/stargazers)
[![fork](https://gitee.com/cosyos/cosyos/badge/fork.svg?theme=dark)](https://gitee.com/cosyos/cosyos/members)
* CosyOS-QQ交流群:303421780.
### 移植流程(Cube安装)
* **裸机工程**
先准备好项目的裸机工程。
* **升级安装**
参照 Setup\readme.txt 中的说明,把 裸机工程 升级为 CosyOS工程。
* **系统构建**
打开工程,参照 CosyOS-例程(系统构建)> readme.txt 中的说明,完成系统构建。<br>
### 最新消息
CosyOS-III V3.0.1 版本发布,针对 RISC-V32,推出了自研先进技术,可实现 **CH32V 全程开启硬件压栈** 。该技术为纯软件实现,不依赖特定硬件(0x804->bit5),V103、203 等皆可完美支持。
现在,您可以愉快的使用CosyOS了!
### 移植流程
**Cube安装方式:** <br>
**1、裸机工程** 先准备好项目的裸机工程。<br>
**2、升级安装** 运行 CosyOS-III Cube.exe,把 裸机工程 升级为 CosyOS工程。<br>
**3、系统构建** 打开工程,参照 CosyOS-例程(系统构建)> readme.txt 中的说明,完成系统构建。<br>
_注:RISC-V32 暂不支持 Cube安装,只能自行移植,如移植过程中遇到问题可加入社区获取工程模板和技术支持。_
**手动移植方式:** <br>
RISC-V32 暂不支持 Cube安装,只能自行手动移植,移植可参考 Demo-Build/RISC-V32/readme.txt 中的说明,如移植过程中遇到问题可加入社区获取工程模板和技术支持。
### 序言
* 近年来,随着RTOS的普及及在嵌入式设备中的广泛应用,以关闭总中断等方式来保护临界段所带来的危害性(丢失响应、处理延误)正日益凸显出来,其中以高速通讯接收丢帧、高速捕获丢失脉冲等中断丢失响应现象最为紧要和普遍。有些RTOS关闭总中断可能过于频繁,且未能提供“系统最大关闭总中断时间”等核心关键参数,实时性有待商榷。<br>
+3 -3
View File
@@ -4,14 +4,14 @@
* @brief 系统链接头文件
* @details 用户的各个c文件中应包含此文件。
* @author 迟凯峰
* @version v3.0.0
* @date 2026.07.21
* @version v3.0.8
* @date 2026.08.15
******************************************************************************/
#ifndef __COSYOS_H
#define __COSYOS_H
#define COSYOS3_VERSION "v3.0.0"
#define COSYOS3_VERSION "v3.0.8"
#include "os_var.h"
#include "os_api.h"
+14 -11
View File
@@ -3,8 +3,8 @@
* @file os_handler.c
* @brief tCosyTick_Handler and sPendSV_Handler
* @author 迟凯峰
* @version v3.0.0
* @date 2026.07.21
* @version v3.0.4
* @date 2026.08.07
******************************************************************************/
#include "os_var.h"
@@ -475,6 +475,9 @@ __IAR_WEAK s_u8_t _start_task_(void) MCUCFG_OSIT_ATTRIBUTE
sa_insert_taskque(node_news);
s_task_queue_count++;
if(s_task_starter.status == OS_STATUS_READY){
if(s_task_current == OS_NULL){
s_task_current = node_news;
}
sa_add_ready(node_news);
}
s_task_starter._ecode = OS_ECODE_NOERROR;
@@ -514,6 +517,15 @@ __IAR_WEAK s_u8_t sPendSV_Handler(void) MCUCFG_OSIT_ATTRIBUTE
pendsv_hook();
#endif
/* 任务启动 */
if(!s_sign_startup){
s_sign_startup = true;
if(s_task_starter.hload != OS_NULL){
s_u8_t r = _start_task_();
if(r < 2) return r;
}
}
/* 每监控(每PendSV假定切换任务)*/
#if (SYSCFG_DEBUGGING == __ENABLED__)
if(s_task_current != OS_NULL){
@@ -527,15 +539,6 @@ __IAR_WEAK s_u8_t sPendSV_Handler(void) MCUCFG_OSIT_ATTRIBUTE
}
#endif
/* 任务启动 */
if(!s_sign_startup){
s_sign_startup = true;
if(s_task_starter.hload != OS_NULL){
s_u8_t r = _start_task_();
if(r < 2) return r;
}
}
/* 任务调度 */
if(s_sign_schedule.total) return 0;
else{