Unable to upload demo program


(Thinh) #1

Hello, I’ve just cloned the Freedom E300 source code, and I’ve done flashing the .mcs file which come from that source. However, when I tried the latest freedom-e-sdk, I could compile the code, but can’t download it.

Error log:

rom@ROM:~/freedom-e-sdk$ make PROGRAM=hello BOARD=freedom-e300-arty BSP=legacy upload
openocd -f bsp/env/freedom-e300-arty/openocd.cfg &
/home/rom/RISCV_tools/bin/riscv32-unknown-elf-gdb /home/rom/freedom-e-sdk/software/hello//hello --batch -ex “set remotetimeout 240” -ex “target extended-remote localhost:3333” -ex “monitor reset 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-arty.”
Open On-Chip Debugger 0.10.0+dev-00198-g35eed36f (2019-01-17-18:54)
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 '.
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: 0x20000913 (mfg: 0x489 (SiFive, Inc.), part: 0x0000, ver: 0x2)
Info : datacount=1 progbufsize=16
Info : Disabling abstract command reads from CSRs.
Info : Disabling abstract command writes to CSRs.
Info : Examined RISC-V core; found 1 harts
Info : hart 0: XLEN=32, misa=0x40001105
Info : Listening on port 3333 for gdb connections
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting ‘gdb’ connection on tcp/3333
Info : Found flash device ‘micron n25q128’ (ID 0x0018ba20)
0x20401618 in ?? ()
Info : JTAG tap: riscv.cpu tap/device found: 0x20000913 (mfg: 0x489 (SiFive, Inc.), part: 0x0000, ver: 0x2)
JTAG tap: riscv.cpu tap/device found: 0x20000913 (mfg: 0x489 (SiFive, Inc.), part: 0x0000, ver: 0x2)
cleared protection for sectors 64 through 255 on flash bank 0
cleared protection for sectors 64 through 255 on flash bank 0
Loading section .text, size 0x2d1c lma 0x10074
Loading section .rodata, size 0x14 lma 0x12d90
Load failed
shutdown command invoked
shutdown command invoked
A debugging session is active.

Inferior 1 [Remote target] will be detached.

Quit anyway? (y or n) [answered Y; input not from terminal]
Remote connection closed
Successfully uploaded ‘hello’ to freedom-e300-arty.

Step to reproduce:

  • Compile the program (Using make software)
  • Upload the program (Using make upload)

My .mcs image seems to be working correctly? (It show the demo_gpio on UART, with baud rate = 57600)
I’m new on this so any help is appreciate. Thank you


(King) #2

first, I’m sorry that I don’t know how to solve you problem. I wonder that did your test with sirv-e-sdk pass successfully. there is something wrong with my test:
work/build/openocd/prefix/bin/openocd -f bsp/env/sirv-e203-arty/openocd.cfg &
/home/hbking/documents/rocket-chip/e200_opensource/sirv-e-sdk/work/build/riscv-gnu-toolchain/riscv32-unknown-elf/prefix/bin/riscv-none-embed-gdb software/demo_gpio/demo_gpio --batch -ex “set remotetimeout 240” -ex “target extended-remote localhost:3333” -ex “monitor reset halt” -ex “monitor flash protect 0 64 last off” -ex “load” -ex “monitor resume” -ex “monitor shutdown” -ex “quit” &&
echo “Successfully uploaded ‘demo_gpio’ to sirv-e203-arty.”
GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00084-gae68d7da-dirty (2018-09-26-15:31)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
Info : auto-selecting first available session transport “jtag”. To override use ‘transport select <transport>’.
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway…
Error: riscv.cpu: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Unsupported DTM version: 15
Info : Listening on port 3333 for gdb connections
Error: Target not examined yet

Error: Unsupported DTM version: 15
Warn : Flash driver of my_first_flash does not support free_driver_priv()
localhost:3333: Connection timed out.
“monitor” command not supported by this target.
“monitor” command not supported by this target.
You can’t do that when your target is `exec’
“monitor” command not supported by this target.
“monitor” command not supported by this target.
Successfully uploaded ‘demo_gpio’ to sirv-e203-arty.


(King) #3

Do you know the key to this problem? sir.


(Thinh) #4

After trying so hard with the latest build, I’ve decided to give up and checked out an older commit. It just work after that. No more will I fiddle with Freedom Metal until it’s fixed (at least for E300, or E310?).


(Bruce Hoult) #5

My recommendation to everyone is that unless they specifically need features from the new “metal” environment and want to work with bleeding edge code, it’s better to use the “v1_0” branch.


(Thinh) #6

And no one mention that on the readme file or anywhere. Thanks for the tips though, now it will be easier for people to getting started on E310.


(Bruce Hoult) #7

It’s (or general advice to use a commit from September) has been mentioned quite a lot of times here in the forums.

It’s unfortunate that master is not the best thing for new users to check out, but that’s how it is, for the moment.


(Liviu Ionescu) #8

It is usual to store new features in a separate branch (for example I use develop), and only when they are stable merge them in master.

Perhaps this repo can use the same convention.