This commit is contained in:
qiyongshuang
2026-01-07 10:43:29 +08:00
parent 6209b6e7f9
commit d161f84c90
551 changed files with 23169 additions and 1518 deletions
+1 -1
View File
@@ -13,4 +13,4 @@ Series=CH32V203
Description=ROM(byte): 64K, SRAM(byte): 20K, CHIP PINS: 32, GPIO PORTS: 27.\nWCH CH32V2 series of mainstream MCUs covers the needs of a large variety of applications in the industrial,medical and consumer markets. High performance with first-class peripherals and low-power,low-voltage operation is paired with a high level of integration at accessible prices with a simple architecture and easy-to-use tools.
PeripheralVersion=1.0
MCU=CH32V203RBT6
MCU=CH32V203RBT
@@ -1,10 +1,10 @@
;/********************************** (C) COPYRIGHT *******************************
;* File Name : startup_ch32v20x_D6.s
;* Author : WCH
;* Version : V1.0.1
;* Date : 2024/01/31
;* Description : CH32V203F6-CH32V203F8-CH32V203G6-CH32V203G8-CH32V203K8-CH32V203C6-CH32V203C8-CH32V203G8
;* vector table for eclipse toolchain.
;* Version : V1.0.2
;* Date : 2025/10/21
;* Description : CH32V203F6-CH32V203F8-CH32V203G6-CH32V203G8-CH32V203K8-CH32V203C6-CH32V203C8-CH32V203G8
;* Startup File
;*********************************************************************************
;* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
;* Attention: This software (modified or not) and binary are used for
@@ -208,9 +208,9 @@ handle_reset:
.option norelax
la gp, __global_pointer$
.option pop
1:
la sp, _eusrstack
2:
/* Load data section from flash to RAM */
la a0, _data_lma
la a1, _data_vma
@@ -1,10 +1,10 @@
;/********************************** (C) COPYRIGHT *******************************
;* File Name : startup_ch32v20x_D8.s
;* Author : WCH
;* Version : V1.0.1
;* Date : 2024/01/31
;* Version : V1.0.2
;* Date : 2025/10/21
;* Description : CH32V203RB
;* vector table for eclipse toolchain.
;* Startup File
;*********************************************************************************
;* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
;* Attention: This software (modified or not) and binary are used for
@@ -225,9 +225,9 @@ handle_reset:
.option norelax
la gp, __global_pointer$
.option pop
1:
la sp, _eusrstack
2:
/* Load data section from flash to RAM */
la a0, _data_lma
la a1, _data_vma
@@ -1,10 +1,10 @@
;/********************************** (C) COPYRIGHT *******************************
;* File Name : startup_ch32v20x_D8W.s
;* Author : WCH
;* Version : V1.0.1
;* Date : 2023/11/20
;* Version : V1.0.2
;* Date : 2025/10/21
;* Description : CH32V208x
;* vector table for eclipse toolchain.
;* Startup File
;*********************************************************************************
;* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
;* Attention: This software (modified or not) and binary are used for
@@ -229,9 +229,9 @@ handle_reset:
.option norelax
la gp, __global_pointer$
.option pop
1:
la sp, _eusrstack
2:
/* Load data section from flash to RAM */
la a0, _data_lma
la a1, _data_vma
@@ -33,7 +33,7 @@
#define TOS_CFG_SEM_EN 1u
#define TOS_CFG_CPU_SYSTICK_PRIO 0xF0 //V307ÓÅÏȼ¶¸ßËÄλÓÐЧ
#define TOS_CFG_CPU_SYSTICK_PRIO 0xF0
#if (TOS_CFG_QUEUE_EN > 0u)
#define TOS_CFG_MSG_EN 1u
@@ -32,10 +32,10 @@ __PORT__ void port_int_disable(void); //at port.s
__PORT__ void port_int_enable(void); //at port.s
/* risc-v 无cpsr,此函数用于读取mstatus,并清除MIE */
__PORT__ cpu_cpsr_t port_cpsr_save(void); //at port.s
/* risc-v 无cpsr,此函数给mstatus赋值 */
__PORT__ void port_cpsr_restore(cpu_cpsr_t cpsr); //at port.s
@@ -90,7 +90,7 @@ __PORT__ void port_cpu_init()
void SysTick_Handler(void) __attribute__((interrupt()));
void SysTick_Handler(void)
{
GET_INT_SP(); /* 切换中断栈 */
GET_INT_SP();
if (tos_knl_is_running())
{
tos_knl_irq_enter();
@@ -98,7 +98,7 @@ void SysTick_Handler(void)
tos_tick_handler();
tos_knl_irq_leave();
}
FREE_INT_SP(); /* 释放中断栈 */
FREE_INT_SP();
}
@@ -108,7 +108,7 @@ __PORT__ k_time_t port_systick_max_delay_millisecond(void)
k_time_t max_millisecond;
uint32_t max_cycle;
max_cycle = 0xffffffff; // systick 是64位,这里用低32位
max_cycle = 0xffffffff;
max_millisecond = (k_time_t)((uint64_t)max_cycle * K_TIME_MILLISEC_PER_SEC / TOS_CFG_CPU_CLOCK); // CLOCK: cycle per second
return max_millisecond;
}
@@ -4,7 +4,7 @@
* Version : V1.0.0
* Date : 2021/06/06
* Description : CH32V20x Device Peripheral Access Layer System Source File.
* For HSE = 32Mhz (CH32V208x/CH32V203RBT6)
* For HSE = 32Mhz (CH32V208x/CH32V203RBT)
* For HSE = 8Mhz (other CH32V203x)
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.