From c6998b204d3d817a6c2cd0eeb020fd89b09b372e Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Fri, 9 Dec 2016 15:42:45 -0800 Subject: demo_gpio: Correct trap_entry handling to enable timer/ext interrupts --- bsp/env/freedom-e300-arty/init.c | 3 ++- bsp/env/freedom-e300-arty/start.S | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 120000 bsp/env/freedom-e300-arty/start.S (limited to 'bsp/env/freedom-e300-arty') diff --git a/bsp/env/freedom-e300-arty/init.c b/bsp/env/freedom-e300-arty/init.c index 36272f7..4313808 100644 --- a/bsp/env/freedom-e300-arty/init.c +++ b/bsp/env/freedom-e300-arty/init.c @@ -5,6 +5,7 @@ #include "encoding.h" extern int main(int argc, char** argv); +extern void trap_entry(); uint32_t get_cpu_freq() { @@ -55,7 +56,7 @@ void _init() printf("core freq at %d Hz\n", get_cpu_freq()); - write_csr(mtvec, &handle_trap); + write_csr(mtvec, &trap_entry); _exit(main(0, NULL)); } diff --git a/bsp/env/freedom-e300-arty/start.S b/bsp/env/freedom-e300-arty/start.S new file mode 120000 index 0000000..028e9bf --- /dev/null +++ b/bsp/env/freedom-e300-arty/start.S @@ -0,0 +1 @@ +../freedom-e300-hifive1/start.S \ No newline at end of file -- cgit v1.2.3 From a68a562a49da111ff722a1651dd6f74604d3247b Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Fri, 9 Dec 2016 17:27:06 -0800 Subject: demo_gpio: Make the demo more interesting with interrupts that actually do things. --- bsp/env/freedom-e300-arty/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bsp/env/freedom-e300-arty') diff --git a/bsp/env/freedom-e300-arty/init.c b/bsp/env/freedom-e300-arty/init.c index 4313808..37e9725 100644 --- a/bsp/env/freedom-e300-arty/init.c +++ b/bsp/env/freedom-e300-arty/init.c @@ -44,7 +44,7 @@ uintptr_t handle_trap(uintptr_t mcause, uintptr_t epc) #endif } else { - write(1, "trap\n", 5); + write(1, "Unhandled Trap:\n", 16); _exit(1 + mcause); } return epc; -- cgit v1.2.3