Target: Update RV-STAR config file and fix some typo

Signed-off-by: linzewen <linzewen@nucleisys.com>
This commit is contained in:
linzewen 2021-04-25 01:59:47 -07:00
parent 6c60393567
commit 24a847a111
6 changed files with 29 additions and 16 deletions

View File

@ -15,6 +15,12 @@ C_INCLUDES += -I$(LITEOSTOPDIR)/utils \
-I$(LITEOSTOPDIR)/components/backtrace \ -I$(LITEOSTOPDIR)/components/backtrace \
-I$(LITEOSTOPDIR)/components/bounds_checking_function/include -I$(LITEOSTOPDIR)/components/bounds_checking_function/include
#third party related
C_INCLUDES += -I$(LITEOSTOPDIR)/third_party/bounds_checking_function/include \
-I$(LITEOSTOPDIR)/third_party/bounds_checking_function/src
C_SOURCES += $(wildcard $(LITEOSTOPDIR)/third_party/bounds_checking_function/src/*.c)
# NMSIS related # NMSIS related
C_INCLUDES += -I$(LITEOSTOPDIR)/kernel/arch/risc-v/nuclei/gcc/nmsis/Core/Include \ C_INCLUDES += -I$(LITEOSTOPDIR)/kernel/arch/risc-v/nuclei/gcc/nmsis/Core/Include \
-I$(LITEOSTOPDIR)/kernel/arch/risc-v/nuclei/gcc/nmsis/DSP/Include \ -I$(LITEOSTOPDIR)/kernel/arch/risc-v/nuclei/gcc/nmsis/DSP/Include \

View File

@ -43,12 +43,16 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __cplusplus */ #endif /* __cplusplus */
#include "nuclei_sdk_soc.h"
/*============================================================================= /*=============================================================================
System clock module configuration System clock module configuration
=============================================================================*/ =============================================================================*/
#define OS_SYS_CLOCK (108000000) #define OS_SYS_CLOCK (SOC_TIMER_FREQ)
#define LOSCFG_BASE_CORE_TICK_PER_SECOND (1000UL) #define LOSCFG_BASE_CORE_TICK_PER_SECOND (1000UL)
#define LOSCFG_BASE_CORE_TICK_HW_TIME 0 #define LOSCFG_BASE_CORE_TICK_HW_TIME 0
#define LOSCFG_BASE_CORE_TICK_WTIMER 1
#define LOSCFG_BASE_CORE_SCHED_SLEEP 1
/*============================================================================= /*=============================================================================
Hardware interrupt module configuration Hardware interrupt module configuration
=============================================================================*/ =============================================================================*/
@ -63,7 +67,8 @@ extern "C" {
#define LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE (0x200U) #define LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE (0x200U)
#define LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE (0x130U) #define LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE (0x130U)
#define LOSCFG_BASE_CORE_TIMESLICE 1 #define LOSCFG_BASE_CORE_TIMESLICE 1
#define LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT 10 #define LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT 20000
#define LOSCFG_BASE_CORE_TICK_RESPONSE_MAX 0xFFFFFF
/*============================================================================= /*=============================================================================
Semaphore module configuration Semaphore module configuration
=============================================================================*/ =============================================================================*/

View File

@ -134,6 +134,8 @@ RV-STAR是一款基于GD32VF103 MCU的RISC-V评估开发板提供了板载调
### 编译源码<a name="sectionb2"></a> ### 编译源码<a name="sectionb2"></a>
使用`git clone`复制代码到任意目录下,打开进入到工程根目录下,输入`git submodule update --init --recursive`下载更新子模块。
编译前请在当前控制台中配置`NUCLEI_TOOL_ROOT`路径,假设`Nuclei`文件夹所在路径为`/home/Nuclei`,输入`export NUCLEI_TOOL_ROOT=/home/Nuclei` 。或者使用时make选项增加`NUCLEI_TOOL_ROOT=/home/Nuclei`。 编译前请在当前控制台中配置`NUCLEI_TOOL_ROOT`路径,假设`Nuclei`文件夹所在路径为`/home/Nuclei`,输入`export NUCLEI_TOOL_ROOT=/home/Nuclei` 。或者使用时make选项增加`NUCLEI_TOOL_ROOT=/home/Nuclei`。
配置路径后打开至代码根目录下的/target/riscv_nuclei_gd32vf103_soc_gcc/GCC位置输入如下指令开始编译 配置路径后打开至代码根目录下的/target/riscv_nuclei_gd32vf103_soc_gcc/GCC位置输入如下指令开始编译

View File

@ -117,7 +117,7 @@ uint8_t gd_key_state_get(key_typedef_enum keynum);
/* configure COM port */ /* configure COM port */
void gd_com_init(uint32_t usart_periph); void gd_com_init(uint32_t usart_periph);
/* Defines for LED functio/* Defines for LED / Key functions to new / general API */ /* Defines for LED functions Defines for LED / Key functions to new / general API */
#define gd_rvstar_led_init gd_led_init #define gd_rvstar_led_init gd_led_init
#define gd_rvstar_led_on gd_led_on #define gd_rvstar_led_on gd_led_on
#define gd_rvstar_led_off gd_led_off #define gd_rvstar_led_off gd_led_off

View File

@ -20,6 +20,7 @@
#include "nuclei_sdk_hal.h" #include "nuclei_sdk_hal.h"
#include "task_sample.h" #include "task_sample.h"
#include "target_config.h" #include "target_config.h"
void user_key_exti_config() void user_key_exti_config()
{ {
/* enable the AF clock */ /* enable the AF clock */
@ -38,12 +39,11 @@ void user_key_exti_config()
*/ */
int main(void) int main(void)
{ {
/* USER CODE BEGIN Init */ /* USER CODE BEGIN Init */
gd_rvstar_key_init(WAKEUP_KEY_GPIO_PORT,KEY_MODE_EXTI); gd_rvstar_key_init(WAKEUP_KEY_GPIO_PORT, KEY_MODE_EXTI);
user_key_exti_config(); user_key_exti_config();
RunTaskSample(); RunTaskSample();
while (1) while (1) {
{ }
}
} }
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ /************************ (C) COPYRIGHT Nuclei *****END OF FILE****/

View File

@ -52,23 +52,23 @@ UINT8 __attribute__ ((aligned (8))) g_memStart[OS_SYS_MEM_SIZE];
VOID TaskSampleEntry2(VOID) VOID TaskSampleEntry2(VOID)
{ {
while (1) { while (1) {
LOS_TaskDelay(10000); /* 10 Seconds */
printf("TaskSampleEntry2 running...\n"); printf("TaskSampleEntry2 running...\n");
LOS_TaskDelay(10000); /* 10 Seconds */
} }
} }
VOID TaskSampleEntry1(VOID) VOID TaskSampleEntry1(VOID)
{ {
while (1) { while (1) {
LOS_TaskDelay(2000); /* 2 Seconds */
printf("TaskSampleEntry1 running...\n"); printf("TaskSampleEntry1 running...\n");
LOS_TaskDelay(2000); /* 2 Seconds */
} }
} }
VOID EXTI0_IRQHandler(VOID) VOID EXTI0_IRQHandler(VOID)
{ {
if (RESET != exti_interrupt_flag_get(WAKEUP_KEY_PIN)){ if (RESET != exti_interrupt_flag_get(WAKEUP_KEY_PIN)) {
if(RESET == gd_rvstar_key_state_get(KEY_WAKEUP)){ if (RESET == gd_rvstar_key_state_get(KEY_WAKEUP)) {
HalDisplayTaskInfo(); HalDisplayTaskInfo();
} }
} }
@ -101,7 +101,7 @@ VOID TaskSample(VOID)
} }
HalHwiInit(); HalHwiInit();
HalHwiCreate(EXTI0_IRQn,9,ECLIC_NON_VECTOR_INTERRUPT,EXTI0_IRQHandler,ECLIC_LEVEL_TRIGGER); HalHwiCreate(EXTI0_IRQn, 9, ECLIC_NON_VECTOR_INTERRUPT, EXTI0_IRQHandler, ECLIC_LEVEL_TRIGGER);
} }
VOID RunTaskSample(VOID) VOID RunTaskSample(VOID)