Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bare-Metal not working on Arty-a7-100t #191

Open
Alis-M opened this issue Oct 9, 2023 · 1 comment
Open

Bare-Metal not working on Arty-a7-100t #191

Alis-M opened this issue Oct 9, 2023 · 1 comment

Comments

@Alis-M
Copy link

Alis-M commented Oct 9, 2023

I'm trying to run the bare-metal program on Arty-a7-100t, but I run into an error when trying to download the program on the board:

xsdb% dow -clear boot.elf
Downloading Program -- /home/alis/vivado-risc-v/bare-metal/hello-world/boot.elf
section, .text: 0x80000000 - 0x8000055d
section, .bss: 0x8000055e - 0x8000055f
100% 0MB 0.0MB/s 00:00
Setting PC to Program Start Address 0x80000008
Successfully downloaded /home/alis/vivado-risc-v/bare-metal/hello-world/boot.elf
xsdb% Info: Hart #0 (target 3) Stopped at 0x10f50 (Suspended)
_start() at head.S: 6
6: li sp, BOOT_MEM_END

My understanding is that, when I generate the elf file, the whole .data section is missing. I tried to fix that using a different compiler, but that didn't fix the issue. This is what I get when running "make clean all":

boot.elf: formato del file elf64-littleriscv

Program Header:
0x70000003 off 0x000000000000155e vaddr 0x0000000000000000 paddr 0x0000000000000000 align 20
filesz 0x0000000000000041 memsz 0x0000000000000000 flags r--
LOAD off 0x0000000000001000 vaddr 0x0000000080000000 paddr 0x0000000080000000 align 2
12
filesz 0x000000000000055e memsz 0x000000000000055e flags r-x
LOAD off 0x000000000000055e vaddr 0x000000008000055e paddr 0x000000008000055e align 2**12
filesz 0x0000000000000000 memsz 0x0000000000000002 flags rw-

Sezioni:
Idx Name Size VMA LMA File off Algn
0 .text 0000055e 0000000080000000 0000000080000000 00001000 23
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .bss 00000002 000000008000055e 000000008000055e 0000155e 2
0
ALLOC
2 .riscv.attributes 00000041 0000000000000000 0000000000000000 0000155e 20
CONTENTS, READONLY
3 .comment 0000001b 0000000000000000 0000000000000000 0000159f 2
0
CONTENTS, READONLY
4 .debug_line 000004c6 0000000000000000 0000000000000000 000015ba 20
CONTENTS, READONLY, DEBUGGING, OCTETS
5 .debug_line_str 0000009f 0000000000000000 0000000000000000 00001a80 2
0
CONTENTS, READONLY, DEBUGGING, OCTETS
6 .debug_info 000003b1 0000000000000000 0000000000000000 00001b1f 20
CONTENTS, READONLY, DEBUGGING, OCTETS
7 .debug_abbrev 000001eb 0000000000000000 0000000000000000 00001ed0 2
0
CONTENTS, READONLY, DEBUGGING, OCTETS
8 .debug_aranges 00000090 0000000000000000 0000000000000000 000020c0 24
CONTENTS, READONLY, DEBUGGING, OCTETS
9 .debug_str 000001e1 0000000000000000 0000000000000000 00002150 2
0
CONTENTS, READONLY, DEBUGGING, OCTETS
10 .debug_frame 00000110 0000000000000000 0000000000000000 00002338 2**3
CONTENTS, READONLY, DEBUGGING, OCTETS

Is there any way I can fix this to download and run the program?

@eugene-tarassov
Copy link
Owner

You need to use stop command to stop processor before downloading, and to use con command to continue processor after downloading. Actually, stop is optional - dow stops CPU if not stopped, but you have to use con to run the program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants