Cannot run hello,c on GDB when connected to Ariane via JTAG
#1
Hi
I want to run simple hello.c example So I compiled as following:
riscv64-unknown-elf-gcc hello.c -L linker.lds -o hello.elf
where linker.lds is :

Code:
ENTRY(main)

SECTIONS
{
  // I changed this to the DRAM start addr (0x80000000)
  ROM_BASE = 0x80000000; /* ... but actually position independent */

  . = ROM_BASE;

  .text.init : { *(.text.init) }

  .text : ALIGN(0x100) {
  _TEXT_START_ = .;
      *(.text)
  _TEXT_END_ = .;
  }

  .data : ALIGN(0x100) {
  _DATA_START_ = .;
      *(.data)
  _DATA_END_ = .;
  }

  PROVIDE(_data = ADDR(.data));
  PROVIDE(_data_lma = LOADADDR(.data));
  PROVIDE(_edata = .);

  .bss : ALIGN(0x100) {
  _BSS_START_ = .;
      *(.bss)
  _BSS_END_ = .;
  }

  .rodata : ALIGN(0x100) {
  _RODATA_START_ = .;
      *(.rodata)
      *(.dtb*)
      *(.rodata*)
  _RODATA_END_ = .;
  }
}

and the compilation was successful. Then, I followed the instructions in GITHUB  connected with success to JTAG. the problem that I cannot run the the hello.elf I can only see the disassemble which looks correct. check what I tried:

Code:
~/Desktop/ariane_test/hello$ riscv64-unknown-elf-gdb hello.elf
GNU gdb (GDB) 8.3.50.20191012-git
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=riscv64-unknown-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
   <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello.elf...
(gdb)  target remote localhost:3333
Remote debugging using localhost:3333
0x0000000000010044 in ?? ()
(gdb) load
Loading section .text, size 0xc0a2 lma 0x100b0
Loading section .rodata, size 0xdb8 lma 0x1c160
Loading section .eh_frame, size 0x4 lma 0x1d000
Loading section .init_array, size 0x10 lma 0x1d008
Loading section .fini_array, size 0x8 lma 0x1d018
Loading section .data, size 0x1100 lma 0x1d020
Loading section .sdata, size 0x58 lma 0x1e120
Start address 0x00000000000100c2, load size 57294
Transfer rate: 53 KB/sec, 5729 bytes/write.
(gdb) target exec
A program is being debugged already.  Kill it? (y or n) y
No executable file now.
(gdb) target exec hello.elf
(gdb) load
You can't do that when your target is `exec'
(gdb) run
Don't know how to run.  Try "help target".
Could you please help me, I want to see 'Hello Ariane' printed on the console
Thank you
Reply


Messages In This Thread
Cannot run hello,c on GDB when connected to Ariane via JTAG - by anouarnechi - 04-08-2020, 03:01 PM

Forum Jump: