--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/e2503d02-00b5-4566-b3a0-0c76a1b474ec%40groups.riscv.org.
I did change to use 32-bit compiler and load the program to 0x80 as you instructed. Now RISCV core can execute loaded code and light up LEDs as expected.
Thank Richard and your excellent answer to help me.
Best regards,
Johnny
Sorry to bother you again,
After I further tested some codes as below,
the core seems run away after executed "j 17c <.L2+0xb4>" at address 0xb4.
Did I miss any internal register setting or set the 'wrong' compiler option?
led_flash.o: file format elf32-littleriscv
Disassembly of section .text:
00000000 <main-0x80>:
...
00000080 <main>:
80: fe010113 addi sp,sp,-32
84: 00812e23 sw s0,28(sp)
88: 02010413 addi s0,sp,32
8c: 1a1017b7 lui a5,0x1a101
90: 00010737 lui a4,0x10
94: f0070713 addi a4,a4,-256 # ff00 <.L2+0xfe38>
98: 00e7a023 sw a4,0(a5) # 1a101000 <.L2+0x1a100f38>
9c: 1a1017b7 lui a5,0x1a101
a0: 00878793 addi a5,a5,8 # 1a101008 <.L2+0x1a100f40>
a4: 0000a737 lui a4,0xa
a8: 50070713 addi a4,a4,1280 # a500 <.L2+0xa438>
ac: 00e7a023 sw a4,0(a5)
b0: fe042623 sw zero,-20(s0)
b4: 0c80006f j 17c <.L2+0xb4>
000000b8 <.L3>:
b8: 00000013 nop
bc: fec42783 lw a5,-20(s0)
c0: 00178793 addi a5,a5,1
c4: fef42623 sw a5,-20(s0)
000000c8 <.L2>:
c8: fec42703 lw a4,-20(s0)
cc: 06300793 li a5,99
d0: 0ae7dc63 ble a4,a5,188 <.L2+0xc0>
d4: 1a1017b7 lui a5,0x1a101
d8: 00878793 addi a5,a5,8 # 1a101008 <.L2+0x1a100f40>
dc: 00006737 lui a4,0x6
e0: a0070713 addi a4,a4,-1536 # 5a00 <.L2+0x5938>
e4: 00e7a023 sw a4,0(a5)
e8: 00000793 li a5,0
ec: 00078513 mv a0,a5
f0: 01c12403 lw s0,28(sp)
f4: 02010113 addi sp,sp,32
f8: 00008067 ret