mirror of
https://github.com/Minres/RISCV-VP.git
synced 2025-12-17 08:51:35 +00:00
updates README.md, FW, some names and does some cleanup
This commit is contained in:
1
fw/.gitignore
vendored
Normal file
1
fw/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/fir
|
||||
3
fw/hello-world/.gitignore
vendored
Normal file
3
fw/hello-world/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/hello
|
||||
/hello.dis
|
||||
/firmware.map
|
||||
17
fw/hello-world/Makefile
Normal file
17
fw/hello-world/Makefile
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
TARGET = hello
|
||||
C_SRCS = $(wildcard *.c)
|
||||
HEADERS = $(wildcard *.h)
|
||||
CFLAGS += -O0 -g
|
||||
|
||||
BOARD=tgc_vp
|
||||
LINK_TARGET=link
|
||||
RISCV_ARCH:=rv32imc
|
||||
RISCV_ABI:=ilp32
|
||||
LDFLAGS := -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI)
|
||||
|
||||
compiler := $(shell which riscv32-unknown-elf-gcc)
|
||||
TOOL_DIR=$(dir $(compiler))
|
||||
|
||||
BSP_BASE = ../bsp
|
||||
include $(BSP_BASE)/env/common-gcc.mk
|
||||
24
fw/hello-world/hello.c
Normal file
24
fw/hello-world/hello.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <platform.h>
|
||||
#include "encoding.h"
|
||||
|
||||
int factorial(int i){
|
||||
|
||||
volatile int result = 1;
|
||||
for (int ii = 1; ii <= i; ii++) {
|
||||
result = result * ii;
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
volatile int result = factorial (10);
|
||||
printf("Factorial is %d\n", result);
|
||||
printf("End of execution");
|
||||
return 0;
|
||||
}
|
||||
BIN
fw/hello-world/prebuilt/hello.elf
Executable file
BIN
fw/hello-world/prebuilt/hello.elf
Executable file
Binary file not shown.
Reference in New Issue
Block a user