repair the task shcedule failed problem of arm,update the assign task before pendsv fault
it is OK
|
@ -43,6 +43,6 @@ if ADD_RTTHREAD_FETURES
|
|||
string "BC28 device pin driver path"
|
||||
default "/dev/pin"
|
||||
config ADAPTER_BC28_RESETPIN
|
||||
string "BC28 RESET pin number"
|
||||
int "BC28 RESET pin number"
|
||||
default "100"
|
||||
endif
|
||||
|
|
|
@ -3,7 +3,7 @@ menuconfig USING_EMBEDDED_DATABASE_FLASHDB
|
|||
default n
|
||||
|
||||
if USING_EMBEDDED_DATABASE_FLASHDB
|
||||
comment " fal io is not supported so far"
|
||||
comment "fal io is not supported so far"
|
||||
choice
|
||||
prompt "select io mode"
|
||||
default FDB_USING_FILE_POSIX_MODE
|
||||
|
|
|
@ -5,8 +5,8 @@ MAKEFLAGS += --no-print-directory
|
|||
.PHONY:COMPILE_APP COMPILE_KERNEL
|
||||
|
||||
|
||||
support :=kd233 stm32f407-st-discovery maix-go stm32f407zgt6 aiit-riscv64-board aiit-arm32-board hifive1-rev-B hifive1-emulator k210-emulator cortex-m3-emulator cortex-m4-emulator ok1052-c gapuino stm32f103-nano gd32vf103_rvstar cortex-m0-emulator rv32m1_vega nuvoton-m2354
|
||||
support += xidatong
|
||||
support :=kd233 stm32f407-st-discovery maix-go stm32f407zgt6 aiit-riscv64-board aiit-arm32-board hifive1-rev-B hifive1-emulator k210-emulator cortex-m3-emulator cortex-m4-emulator ok1052-c gapuino stm32f103-nano gd32vf103-rvstar cortex-m0-emulator rv32m1-vega nuvoton-m2354
|
||||
support += xidatong-arm32
|
||||
SRC_DIR :=
|
||||
|
||||
export BOARD ?=kd233
|
||||
|
@ -75,7 +75,7 @@ COMPILE_ALL:
|
|||
$(MAKE) -C $$dir; \
|
||||
done
|
||||
@cp link.mk build/Makefile
|
||||
@$(MAKE) -C build TARGET=XiZi_$(BOARD).elf LINK_FLAGS=LFLAGS
|
||||
@$(MAKE) -C build TARGET=XiZi-$(BOARD).elf LINK_FLAGS=LFLAGS
|
||||
@rm build/Makefile build/make.obj
|
||||
|
||||
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
|
||||
ARM架构系列的开发板有
|
||||
|
||||
aiit-arm32-board nuvoton-m2354 ok1052-c stm32f103-nano stm32f407-st-discovery stm32f407zgt6 xidatong
|
||||
aiit-arm32-board nuvoton-m2354 ok1052-c stm32f103-nano stm32f407-st-discovery stm32f407zgt6 xidatong-arm32
|
||||
|
||||
### RISC-V
|
||||
|
||||
RISC-V架构系列的开发板有
|
||||
|
||||
aiit-riscv64-board gapuino gd32vf103_rvstar hifive1-rev-B kd233 maix-go rv32m1_vega
|
||||
aiit-riscv64-board gapuino gd32vf103-rvstar hifive1-rev-B kd233 maix-go rv32m1-vega
|
||||
|
||||
## 开发环境
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ PendSV_Handler:
|
|||
MOV R7, R11
|
||||
STMIA R1!, {R4 - R7} /* push thread {R8 - R11} high register to thread stack */
|
||||
switch_to_task:
|
||||
BL UpdateRunningTask
|
||||
|
||||
LDR R1, =InterruptToKtask
|
||||
LDR R1, [R1]
|
||||
|
|
|
@ -70,9 +70,6 @@ PendSV_Handler:
|
|||
|
||||
switch_to_task:
|
||||
|
||||
PUSH {lr}
|
||||
BL UpdateRunningTask
|
||||
POP {lr}
|
||||
|
||||
#ifdef TASK_ISOLATION
|
||||
PUSH {lr}
|
||||
|
|
|
@ -21,11 +21,11 @@ SRC_DIR +=gap8
|
|||
endif
|
||||
|
||||
ifeq ($(CONFIG_BOARD_GD32VF103RVSTAR),y)
|
||||
SRC_DIR +=gd32vf103_rvstar
|
||||
SRC_DIR +=gd32vf103-rvstar
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BOARD_RV32M1_VEGA),y)
|
||||
SRC_DIR +=rv32m1_vega
|
||||
SRC_DIR +=rv32m1-vega
|
||||
endif
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* @file arch_interrupt.h
|
||||
* @brief support rv32m1_vega interrupt
|
||||
* @brief support rv32m1-vega interrupt
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2022-02-16
|
|
@ -42,9 +42,9 @@ make BOARD=aiit-arm32-board menuconfig
|
|||
```
|
||||
make BOARD=aiit-arm32-board
|
||||
```
|
||||
>5.如果编译正确无误,会产生XiZi_aiit-arm32-board.elf、XiZi_aiit-arm32-board.bin文件。其中XiZi_aiit-arm32-board.bin需要烧写到设备中进行运行。
|
||||
>5.如果编译正确无误,会产生XiZi-aiit-arm32-board.elf、XiZi-aiit-arm32-board.bin文件。其中XiZi-aiit-arm32-board.bin需要烧写到设备中进行运行。
|
||||
```
|
||||
sudo write build/XiZi_aiit-arm32-board.bin 0x8000000
|
||||
sudo write build/XiZi-aiit-arm32-board.bin 0x8000000
|
||||
```
|
||||
>6.最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
```
|
||||
|
@ -73,7 +73,7 @@ aiit-arm32-board下载连接示意图如下:
|
|||
|
||||
代码根目录下执行st-flash工具烧录
|
||||
```
|
||||
sudo st-flash write build/XiZi_aiit-arm32-board.bin 0x8000000
|
||||
sudo st-flash write build/XiZi-aiit-arm32-board.bin 0x8000000
|
||||
```
|
||||
### 3.1 运行结果
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ export AFLAGS := -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -
|
|||
export LFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||
export CXXFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g
|
||||
|
||||
export APPLFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
export DEFINES := -DHAVE_CCONFIG_H -DSTM32F407xx -DUSE_HAL_DRIVER -DHAVE_SIGINFO
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ make BOARD=aiit-riscv64-board menuconfig
|
|||
```
|
||||
make BOARD=aiit-riscv64-board
|
||||
```
|
||||
>5.如果编译正确无误,会产生XiZi_aiit-riscv64-board.elf、XiZi_aiit-riscv64-board.bin文件。其中XiZi_aiit-riscv64-board.bin需要烧写到设备中进行运行。
|
||||
>5.如果编译正确无误,会产生XiZi-aiit-riscv64-board.elf、XiZi-aiit-riscv64-board.bin文件。其中XiZi-aiit-riscv64-board.bin需要烧写到设备中进行运行。
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
```
|
||||
make BOARD=aiit-riscv64-board distclean
|
||||
|
@ -64,7 +64,7 @@ sudo pip2 install kflash
|
|||
```
|
||||
代码根目录下执行K-Flash工具烧录,-p为USB端口号,视实际情况而定
|
||||
```
|
||||
kflash -t build/XiZi_aiit-riscv64-board.bin -p /dev/ttyUSB0
|
||||
kflash -t build/XiZi-aiit-riscv64-board.bin -p /dev/ttyUSB0
|
||||
```
|
||||
### 3.1 运行结果
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ export CFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -fno-common -ffun
|
|||
export AFLAGS := -c -mcmodel=medany -march=rv64imafdc -mabi=lp64d -x assembler-with-cpp -ggdb
|
||||
export LFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ make BOARD=cortex-m0-emulator menuconfig
|
|||
make BOARD=cortex-m0-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会产生XiZi_cortex-m0-emulator.elf、XiZi_cortex-m0-emulator.bin文件。
|
||||
4.如果编译正确无误,会产生XiZi-cortex-m0-emulator.elf、XiZi-cortex-m0-emulator.bin文件。
|
||||
|
||||
## 3. 运行
|
||||
|
||||
|
@ -168,7 +168,7 @@ sudo apt install qemu-system-arm
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-arm -machine microbit -nographic -kernel build/XiZi_cortex-m0-emulator.elf
|
||||
qemu-system-arm -machine microbit -nographic -kernel build/XiZi-cortex-m0-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -185,11 +185,11 @@ sudo apt install gdb-multiarch
|
|||
并通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-arm -machine microbit -nographic -kernel build/XiZi_cortex-m0-emulator.elf -s -S
|
||||
qemu-system-arm -machine microbit -nographic -kernel build/XiZi-cortex-m0-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行命令
|
||||
|
||||
```
|
||||
gdb-multiarch build/XiZi_cortex-m0-emulator.elf -ex "target remote localhost:1234"
|
||||
gdb-multiarch build/XiZi-cortex-m0-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
||||
|
|
|
@ -2,10 +2,10 @@ export CROSS_COMPILE ?=/usr/bin/arm-none-eabi-
|
|||
|
||||
export CFLAGS := -mcpu=cortex-m0 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -fgnu89-inline -Wa,-mimplicit-it=thumb
|
||||
export AFLAGS := -c -mcpu=cortex-m0 -mthumb -ffunction-sections -fdata-sections -x assembler-with-cpp -Wa,-mimplicit-it=thumb -gdwarf-2
|
||||
export LFLAGS := -mcpu=cortex-m0 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_cortex-m0-emulator.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||
export LFLAGS := -mcpu=cortex-m0 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-cortex-m0-emulator.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||
export CXXFLAGS := -mcpu=cortex-m0 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g
|
||||
|
||||
export APPLFLAGS := -mcpu=cortex-m0 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcpu=cortex-m0 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
|
||||
export DEFINES := -DHAVE_CCONFIG_H -g
|
||||
|
|
|
@ -153,7 +153,7 @@ make BOARD=cortex-m3-emulator menuconfig
|
|||
make BOARD=cortex-m3-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会产生XiZi_cortex-m3-emulator.elf、XiZi_cortex-m3-emulator.bin文件。
|
||||
4.如果编译正确无误,会产生XiZi-cortex-m3-emulator.elf、XiZi-cortex-m3-emulator.bin文件。
|
||||
|
||||
## 3. 运行
|
||||
|
||||
|
@ -168,7 +168,7 @@ sudo apt install qemu-system-arm
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-arm -machine lm3s6965evb -nographic -kernel build/XiZi_cortex-m3-emulator.elf
|
||||
qemu-system-arm -machine lm3s6965evb -nographic -kernel build/XiZi-cortex-m3-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -185,11 +185,11 @@ sudo apt install gdb-multiarch
|
|||
并通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-arm -machine lm3s6965evb -nographic -kernel build/XiZi_cortex-m3-emulator.elf -s -S
|
||||
qemu-system-arm -machine lm3s6965evb -nographic -kernel build/XiZi-cortex-m3-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行`riscv-none-embed-gdb`命令
|
||||
|
||||
```
|
||||
gdb-multiarch build/XiZi_cortex-m3-emulator.elf -ex "target remote localhost:1234"
|
||||
gdb-multiarch build/XiZi-cortex-m3-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
||||
|
|
|
@ -2,10 +2,10 @@ export CROSS_COMPILE ?=/usr/bin/arm-none-eabi-
|
|||
|
||||
export CFLAGS := -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -fgnu89-inline -Wa,-mimplicit-it=thumb
|
||||
export AFLAGS := -c -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -x assembler-with-cpp -Wa,-mimplicit-it=thumb -gdwarf-2
|
||||
export LFLAGS := -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_cortex-m3-emulator.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||
export LFLAGS := -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-cortex-m3-emulator.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||
export CXXFLAGS := -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g
|
||||
|
||||
export APPLFLAGS := -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
|
||||
export DEFINES := -DHAVE_CCONFIG_H
|
||||
|
|
|
@ -161,7 +161,7 @@ make BOARD=cortex-m4-emulator menuconfig
|
|||
make BOARD=cortex-m4-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会产生XiZi_cortex-m4-emulator.elf、XiZi_cortex-m4-emulator.bin文件。
|
||||
4.如果编译正确无误,会产生XiZi-cortex-m4-emulator.elf、XiZi-cortex-m4-emulator.bin文件。
|
||||
|
||||
|
||||
|
||||
|
@ -178,7 +178,7 @@ sudo apt install qemu-system-arm
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi_cortex-m4-emulator.elf
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi-cortex-m4-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -198,11 +198,11 @@ sudo apt install gdb-multiarch
|
|||
并通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi_cortex-m4-emulator.elf -s -S
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi-cortex-m4-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行`riscv-none-embed-gdb`命令
|
||||
|
||||
```
|
||||
gdb-multiarch build/XiZi_cortex-m4-emulator.elf -ex "target remote localhost:1234"
|
||||
gdb-multiarch build/XiZi-cortex-m4-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
|
@ -2,10 +2,10 @@ export CROSS_COMPILE ?=/usr/bin/arm-none-eabi-
|
|||
|
||||
export CFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -fgnu89-inline -Wa,-mimplicit-it=thumb -Werror
|
||||
export AFLAGS := -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -x assembler-with-cpp -Wa,-mimplicit-it=thumb -gdwarf-2
|
||||
export LFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_cortex-m4-emulator.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||
export LFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-cortex-m4-emulator.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||
export CXXFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -Werror
|
||||
|
||||
export APPLFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
|
||||
export DEFINES := -DHAVE_CCONFIG_H -DSTM32F407xx -DUSE_HAL_DRIVER -DHAVE_SIGINFO
|
||||
|
|
|
@ -170,7 +170,7 @@ make BOARD=cortex-m4-emulator menuconfig
|
|||
make BOARD=cortex-m4-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会产生XiZi_cortex-m4-emulator.elf、XiZi_cortex-m4-emulator.bin文件。
|
||||
4.如果编译正确无误,会产生XiZi-cortex-m4-emulator.elf、XiZi-cortex-m4-emulator.bin文件。
|
||||
|
||||
|
||||
|
||||
|
@ -203,7 +203,7 @@ sudo apt install qemu-system-arm
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi_cortex-m4-emulator.elf
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi-cortex-m4-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -224,13 +224,13 @@ sudo apt install gdb-multiarch
|
|||
并通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi_cortex-m4-emulator.elf -s -S
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi-cortex-m4-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行`riscv-none-embed-gdb`命令
|
||||
|
||||
```
|
||||
gdb-multiarch build/XiZi_cortex-m4-emulator.elf -ex "target remote localhost:1234"
|
||||
gdb-multiarch build/XiZi-cortex-m4-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ make BOARD=gapuino menuconfig
|
|||
make BOARD=gapuino
|
||||
```
|
||||
|
||||
4.如果编译正确无误,build文件夹下会产生XiZi_gapuino.elf、XiZi_gapuino.bin文件。
|
||||
4.如果编译正确无误,build文件夹下会产生XiZi-gapuino.elf、XiZi-gapuino.bin文件。
|
||||
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
|
||||
|
@ -172,7 +172,7 @@ screen /dev/ttyUSB0 115200
|
|||
|
||||
5、打开一个新的终端,进入编译生成的elf路径,输入例如:
|
||||
```
|
||||
riscv32-unknown-elf-gdb build/XiZi_gapuino.elf -ex "target remote localhost:3333"
|
||||
riscv32-unknown-elf-gdb build/XiZi-gapuino.elf -ex "target remote localhost:3333"
|
||||
```
|
||||
结果如下图所示:
|
||||

|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
|
||||
export CFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -fgnu89-inline -Werror
|
||||
export AFLAGS := -c -mcmodel=medany -march=rv32imac -mabi=ilp32 -x assembler-with-cpp -ggdb
|
||||
export LFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi_gap8.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
export LFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi-gap8.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ config BOARD_GD32VF103RVSTAR
|
|||
|
||||
source "$KERNEL_DIR/arch/Kconfig"
|
||||
|
||||
menu "gd32vf103_rvstar feature"
|
||||
menu "gd32vf103-rvstar feature"
|
||||
source "$BSP_DIR/third_party_driver/Kconfig"
|
||||
endmenu
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# 从零开始构建矽璓工业物联操作系统:使用risc-v架构的gd32vf103_rvstar 开发板
|
||||
# 从零开始构建矽璓工业物联操作系统:使用risc-v架构的gd32vf103-rvstar 开发板
|
||||
|
||||
[XiUOS](http://xuos.io/) (X Industrial Ubiquitous Operating System) 矽璓工业物联操作系统是一款面向工业物联场景的泛在操作系统,来自泛在操作系统研究计划。所谓泛在操作系统(UOS: Ubiquitous Operating Systems),是支持互联网时代人机物融合泛在计算应用模式的新型操作系统,是传统操作系统概念的泛化与延伸。在泛在操作系统技术体系中,不同的泛在计算设备和泛在应用场景需要符合各自特性的不同UOS,XiUOS即是面向工业物联场景的一种UOS,主要由一个极简的微型实时操作系统(RTOS)内核和其上的智能工业物联框架构成,支持工业物联网(IIoT: Industrial Internet of Things)应用。
|
||||
|
||||
|
@ -83,9 +83,9 @@ export CROSS_COMPILE ?=/opt/Nuclei/gcc/bin/riscv-nuclei-elf-
|
|||
|
||||
若已存在`export CROSS_COMPILE ?=xxxx` 应该将原有的语句注释,再写入上面的语句。
|
||||
|
||||
# 在gd32vf103_rvstar board 上创建第一个应用
|
||||
# 在gd32vf103-rvstar board 上创建第一个应用
|
||||
|
||||
## 1.gd32vf103_rvstar board 简介
|
||||
## 1.gd32vf103-rvstar board 简介
|
||||
|
||||
| 硬件 | 描述 |
|
||||
| -- | -- |
|
||||
|
@ -116,8 +116,8 @@ XiUOS板级当前支持使用UART。
|
|||
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=gd32vf103_rvstar distclean
|
||||
make BOARD=gd32vf103_rvstar menuconfig
|
||||
make BOARD=gd32vf103-rvstar distclean
|
||||
make BOARD=gd32vf103-rvstar menuconfig
|
||||
```
|
||||
|
||||
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后选择Exit保存并退出
|
||||
|
@ -127,15 +127,15 @@ make BOARD=gd32vf103_rvstar menuconfig
|
|||
3.继续执行以下命令,进行编译
|
||||
|
||||
```
|
||||
make BOARD=gd32vf103_rvstar
|
||||
make BOARD=gd32vf103-rvstar
|
||||
```
|
||||
|
||||
4.如果编译正确无误,build文件夹下会产生XiZi_gd32vf103_rvstar.elf、XiZi_gd32vf103_rvstar.bin文件。
|
||||
4.如果编译正确无误,build文件夹下会产生XiZi-gd32vf103-rvstar.elf、XiZi-gd32vf103-rvstar.bin文件。
|
||||
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
|
||||
```
|
||||
make BOARD=gd32vf103_rvstar distclean
|
||||
make BOARD=gd32vf103-rvstar distclean
|
||||
```
|
||||
|
||||
## 3. 烧写及调试执行
|
||||
|
@ -177,7 +177,7 @@ screen /dev/ttyUSB0 115200
|
|||
|
||||
5、打开一个新的终端,进入编译生成的elf路径,输入例如:
|
||||
```
|
||||
riscv-nuclei-elf-gdb build/XiZi_gd32vf103_rvstar.elf -ex "target remote localhost:3333"
|
||||
riscv-nuclei-elf-gdb build/XiZi-gd32vf103-rvstar.elf -ex "target remote localhost:3333"
|
||||
```
|
||||
结果如下图所示:
|
||||

|
|
@ -1,9 +1,9 @@
|
|||
|
||||
export CFLAGS := -march=rv32imac -mabi=ilp32 -fno-common -ffunction-sections -fdata-sections -O0 -ggdb -fgnu89-inline -Werror
|
||||
export AFLAGS := -march=rv32imac -mabi=ilp32 -x assembler-with-cpp -ggdb
|
||||
export LFLAGS := -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi_gd32vf103.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
export LFLAGS := -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi-gd32vf103.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
|
||||
export APPLFLAGS := -nostartfiles -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
export CXXFLAGS := -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
@ -130,7 +130,7 @@ make BOARD=hifive1-emulator menuconfig
|
|||
make BOARD=hifive1-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会在build目录下产生XiZi_hifive1-emulator.elf、XiZi_hifive1-emulator.bin文件。
|
||||
4.如果编译正确无误,会在build目录下产生XiZi-hifive1-emulator.elf、XiZi-hifive1-emulator.bin文件。
|
||||
|
||||
## 3. 运行
|
||||
|
||||
|
@ -153,7 +153,7 @@ sudo make install
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-riscv32 -nographic -machine sifive_e -kernel build/XiZi_hifive1-emulator.elf
|
||||
qemu-system-riscv32 -nographic -machine sifive_e -kernel build/XiZi-hifive1-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -165,11 +165,11 @@ QEMU运行起来后将会在终端上看到信息打印输出
|
|||
利用QEMU可以方便的对XiUOS进行调试,首先通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-riscv32 -nographic -machine sifive_e -kernel build/XiZi_hifive1-emulator.elf -s -S
|
||||
qemu-system-riscv32 -nographic -machine sifive_e -kernel build/XiZi-hifive1-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行`riscv-none-embed-gdb`命令
|
||||
|
||||
```
|
||||
riscv-none-embed-gdb build/XiZi_hifive1-emulator.elf -ex "target remote localhost:1234"
|
||||
riscv-none-embed-gdb build/XiZi-hifive1-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
||||
|
|
|
@ -2,7 +2,7 @@ export CFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -fno-common -ffunct
|
|||
export AFLAGS := -c -mcmodel=medany -march=rv32imac -mabi=ilp32 -x assembler-with-cpp -ggdb
|
||||
export LFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ make BOARD=hifive1-rev-B menuconfig
|
|||
make BOARD=hifive1-rev-B
|
||||
```
|
||||
|
||||
4.如果编译正确无误,build文件夹下会产生XiZi_hifive1-rev-B.elf、XiZi_hifive1-rev-B.bin文件。其中XiZi_hifive1-rev-B.bin需要烧写到设备中进行运行。
|
||||
4.如果编译正确无误,build文件夹下会产生XiZi-hifive1-rev-B.elf、XiZi-hifive1-rev-B.bin文件。其中XiZi-hifive1-rev-B.bin需要烧写到设备中进行运行。
|
||||
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ export CFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -fno-common -ffunct
|
|||
export AFLAGS := -c -mcmodel=medany -march=rv32imac -mabi=ilp32 -x assembler-with-cpp -ggdb
|
||||
export LFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv32imac -mabi=ilp32 -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ make BOARD=k210-emulator menuconfig
|
|||
make BOARD=k210-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会在build目录下产生XiZi_k210-emulator.elf、XiZi_k210-emulator.bin文件。
|
||||
4.如果编译正确无误,会在build目录下产生XiZi-k210-emulator.elf、XiZi-k210-emulator.bin文件。
|
||||
|
||||
## 3. 运行
|
||||
|
||||
|
@ -150,7 +150,7 @@ sudo make install
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-riscv64 -nographic -machine sifive_u -bios build/XiZi_k210-emulator.elf
|
||||
qemu-system-riscv64 -nographic -machine sifive_u -bios build/XiZi-k210-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -162,11 +162,11 @@ QEMU运行起来后将会在终端上看到信息打印输出
|
|||
利用QEMU可以方便的对XiUOS进行调试,首先通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-riscv64 -nographic -machine sifive_u -bios build/XiZi_k210-emulator.elf -s -S
|
||||
qemu-system-riscv64 -nographic -machine sifive_u -bios build/XiZi-k210-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行`riscv-none-embed-gdb`命令
|
||||
|
||||
```
|
||||
riscv-none-embed-gdb build/XiZi_k210-emulator.elf -ex "target remote localhost:1234"
|
||||
riscv-none-embed-gdb build/XiZi-k210-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
export CFLAGS := -mcmodel=medany -march=rv64imac -mabi=lp64 -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -Wa,-g -ggdb -fgnu89-inline -Werror
|
||||
export AFLAGS := -c -mcmodel=medany -march=rv64imac -mabi=lp64 -Wa,-g -ggdb
|
||||
export LFLAGS := -mcmodel=medany -march=rv64imac -mabi=lp64 -nostartfiles -Wl,--gc-sections,-Map=XiZi_kd233.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
export LFLAGS := -mcmodel=medany -march=rv64imac -mabi=lp64 -nostartfiles -Wl,--gc-sections,-Map=XiZi-kd233.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imac -mabi=lp64 -nostartfiles -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imac -mabi=lp64 -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv64imac -mabi=lp64 -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -Wa,-g -ggdb -Werror
|
||||
|
|
|
@ -143,7 +143,7 @@ make BOARD=kd233 menuconfig
|
|||
make BOARD=kd233
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会在build文件夹下生成XiZi_kd233.elf、XiZi_kd233.bin文件。其中XiZi_kd233.bin需要烧写到设备中进行运行。
|
||||
4.如果编译正确无误,会在build文件夹下生成XiZi-kd233.elf、XiZi-kd233.bin文件。其中XiZi-kd233.bin需要烧写到设备中进行运行。
|
||||
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
|
||||
|
@ -178,7 +178,7 @@ sudo pip2 install kflash
|
|||
代码根目录下执行K-Flash工具烧录,-p为USB端口号,视实际情况而定
|
||||
|
||||
```
|
||||
sudo kflash -t build/XiZi_kd233.bin -p /dev/ttyUSB0
|
||||
sudo kflash -t build/XiZi-kd233.bin -p /dev/ttyUSB0
|
||||
```
|
||||
|
||||
### 3.1 运行结果
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
export CFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -fgnu89-inline -Werror
|
||||
export AFLAGS := -c -mcmodel=medany -march=rv64imafdc -mabi=lp64d -x assembler-with-cpp -ggdb
|
||||
export LFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi_kd233.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
export LFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi-kd233.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
|
|
@ -36,7 +36,7 @@ make BOARD=maix-go menuconfig
|
|||
```
|
||||
make BOARD=maix-go
|
||||
```
|
||||
>5.如果编译正确无误,会产生XiZi_maix-go.elf、XiZi_maix-go.bin文件。其中XiZi_maix-go.bin需要烧写到设备中进行运行。
|
||||
>5.如果编译正确无误,会产生XiZi-maix-go.elf、XiZi-maix-go.bin文件。其中XiZi-maix-go.bin需要烧写到设备中进行运行。
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
```
|
||||
make BOARD=maix-go distclean
|
||||
|
@ -64,7 +64,7 @@ sudo pip2 install kflash
|
|||
```
|
||||
代码根目录下执行K-Flash工具烧录,此时ls /dev/ttyUSB*会发现新增2个USB端口,烧录时选择后一个,例如此时新增的是/dev/ttyUSB0和/dev/ttyUSB1,选择/dev/ttyUSB1
|
||||
```
|
||||
kflash -t build/XiZi_kd233.bin -p /dev/ttyUSB1
|
||||
kflash -t build/XiZi-kd233.bin -p /dev/ttyUSB1
|
||||
```
|
||||
### 3.1 运行结果
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ export CFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -fno-common -ffun
|
|||
export AFLAGS := -c -mcmodel=medany -march=rv64imafdc -mabi=lp64d -x assembler-with-cpp -ggdb
|
||||
export LFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi.map,-cref,-u,_start -T $(BSP_ROOT)/link.lds
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
||||
|
|