HiFive1ãã¼ãã¯RISC-Vãåä½ãã(ããããä¸çã§å¯ä¸åç¨ã®ï¼)ããã»ããµãã¼ãã§ããã ãã®ãã¼ãã使ã£ã¦ããã¤ã試è¡ãã¦ã¿ãããã¨ãããã®ã ããä¹ ãã¶ãã«ç«ã¡ä¸ããã®ã§å°ããªãããªã®æå³ãå ¼ãã¦æ´çãã¦ããã
ããã°ã©ã ã®éçºã«ã¯ãSiFiveãå ¬éãã¦ããSDKã使ç¨ãããSDKã«ã¯ãèªåçã«ãã©ãã·ã¥ã«æ¸ãè¾¼ãããã°ã©ã ãå ¥ã£ã¦ãããããã使ãã¨è©¦è¡ãç°¡åã«ãªãã
ã¨ãããããhello world
çãªããã°ã©ã ã ãåä½ããã¦ããããã£ã¹ã¯ã«ä½è£ã®ãã人ã¯ãmake tools
ã§HiFive1ç¨ã®æ§æã®GCCãä½ã£ã¦ããæ¹ãããããã«æãã
make tools
ããã°ã©ã ã®ã³ã³ãã¤ã«ã¯ãmake software
ã§å¯è½ã ãããã§ã³ã³ãã¤ã«ãã¢ãããã¼ãå¯è½ãªããã°ã©ã ã¯software
ãã£ã¬ã¯ããªä»¥ä¸ã§å®ç¾©ããã¦ãããã®ã ã
$ ls -1 software/ coremark coreplexip_welcome demo_gpio dhrystone double_tap_dontboot global_interrupts hello led_fade local_interrupts performance_counters smp
ã³ã³ãã¤ã«ããã
$ cat software/hello/hello.c #include <stdio.h> int main() { puts("hello world!\n"); return 0; } $ make software PROGRAM=hello BOARD=freedom-e300-hifive1
ããã°ã©ã ã®ã¢ãããã¼ããè¡ãã
$ sudo make upload PROGRAM=hello [36/365] work/build/openocd/prefix/bin/openocd -f bsp/env/freedom-e300-hifive1/openocd.cfg & \ /home/msyksphinz/work/freedom-e-sdk/work/build/riscv-gnu-toolchain/riscv64-unknown-elf/prefix/bin/riscv64-unknown-elf-gdb software/hello/hello --batch -ex "set remotetimeout 240" -ex "target extended-remote localhost:3333" -ex "monitor r eset halt" -ex "monitor flash protect 0 64 last off" -ex "load" -ex "monitor resume" -ex "monitor shutdown" -ex "quit" && \ echo "Successfully uploaded 'hello' to freedom-e300-hifive1." Open On-Chip Debugger 0.10.0-dev (2017-07-15-14:57) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html adapter speed: 10000 kHz Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'. Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling" Info : clock speed 10000 kHz Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (<unknown>), part: 0x0e31, ver: 0x1) Info : Examined RISCV core; XLEN=32, misa=0x40001105 riscv.cpu: target state: halted halted at 0x2040036a due to debug interrupt Info : accepting 'gdb' connection on tcp/3333 Info : Found flash device 'issi is25lp128' (ID 0x0018609d) 0x2040036a in __wrap__exit (code=0) at /home/msyksphinz/work/freedom-e-sdk/bsp/libwrap/sys/_exit.c:12 12 write(STDERR_FILENO, "\n", 1); Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (<unknown>), part: 0x0e31, ver: 0x1) JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (<unknown>), part: 0x0e31, ver: 0x1) riscv.cpu: target state: halted riscv.cpu: target state: halted halted at 0x2040036a due to debug interrupt halted at 0x2040036a due to debug interrupt cleared protection for sectors 64 through 255 on flash bank 0 cleared protection for sectors 64 through 255 on flash bank 0 Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (<unknown>), part: 0x0e31, ver: 0x1) riscv.cpu: target state: halted halted at 0x2040036a due to debug interrupt Loading section .init, size 0x78 lma 0x20400000 Loading section .text, size 0xba2e lma 0x20400078 Loading section .rodata, size 0xd2c lma 0x2040baa8 Loading section .eh_frame, size 0x68 lma 0x2040c7d4 Loading section .data, size 0x9d0 lma 0x2040c83c Info : Padding image section 0 with 2 bytes Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (5180). Workaround: increase "set remotetimeout" in GDB Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (5013). Workaround: increase "set remotetimeout" in GDB riscv.cpu: target state: halted halted at 0x80000004 due to software breakpoint riscv.cpu: target state: halted halted at 0x80000004 due to software breakpoint riscv.cpu: target state: halted halted at 0x80000004 due to software breakpoint riscv.cpu: target state: halted halted at 0x80000004 due to software breakpoint riscv.cpu: target state: halted halted at 0x80000004 due to software breakpoint ...
UARTããã®åºåã確èªãããå ´åã¯ãsudo screen /dev/ttyUSB1 115200
ã§ç¢ºèªãããã¨ã