This is sample softwares for Akaria NS31A CPU family. To use this sample softwares, you need the Akaria bmetal library.
-
CUI Menu Demo (
akaria_menu_demo/
)-
A simple example demo of CUI.
-
-
Flash Write sample (
flash_write/
)-
A simple example how to write boot program to Pmod SF3 (SPI Flash).
-
-
Blinking LED sample (
sample_blink_led/
)-
A simple example of blinking LEDs on the board.
-
-
Timer sample (
sample_timer/
)-
Prints sys clock to terminal.
-
-
Clone Akaria bmetal library from github
$ mkdir work && cd work $ git clone git@github.com:nsitexe/akaria-bmetal.git
-
Clone this sample code from github
$ cd akaria-bmetal/test/ $ git clone git@github.com:nsitexe/akaria-ns31-arty.git
Run the command below to build the sample code.
akaria_menu_demo/
)$ cd work/akaria-bmetal $ rm -r build #if the build directory already exists $ mkdir build && cd build $ cmake ../ -G Ninja -DARCH=riscv -DCROSS_COMPILE=riscv64-unknown-elf- -DCC=gcc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=../test/sysroot/ -DDEFCONF=riscv_nsitexe_ns31_arty $ ninja install $ cd ../test/akaria-ns31-arty/akaria_menu_demo $ make
When the build is complete, an ELF file (akaria_ns_bsp.elf
) is generated.
-
Set SW3(Boot ROM SPI) on the Arty-A7 Board to '0', because SW3=1 is reserved
-
Connect the PC and the Arty-A7 Board with a USB cable
-
Connect the Arty-A7 Board and Debugger
-
Launch "Open OCD"
-
Open Terminal. (Set baudrate to 9600 bps)
-
Launch GDB.
$ riscv64-unknown-elf-gdb akaria_ns_bsp.elf
-
Run the following command on GDB:
(gdb) set arch riscv:rv32 (gdb) target remote localhost:3333 (gdb) monitor reset halt (gdb) load (gdb) c * When "load" is executed, The PC is set to program start address.
-
Push BTN0 to boot NS31A (When you set SW2=0)
-
Each sample software starts.
example(akaria_menu_demo
)-
A menu appears in the terminal. Enter the command you want to run
Missing program header. AT_PHDR is not available. ##################################################################### # # # A k a r i a N S B o a r d S u p p o r t P a c k a g e # # # ##################################################################### ==== Select ID to execute each function ================ ID Discription -------------------------------------------------------- * 0 : LED test * t : Print system clock * h : Help ======================================================== Akaria>
-