PlatformIO Debug Failure

I’m trying to Debug a hello world application on HiFive Unleashed using PlatformIO Core (CLI) tool. I’ve setup the utility using this Wiki: https://docs.platformio.org/en/latest/core/installation.html#installation

And used these commands to debug the application:

I’m facing a strange error while starting the debug session:
Error: invalid ELF file, only 32bits files are supported
embedded:startup.tcl:486: Error: ** Programming Failed **

Here are the complete verbose logs:

arshadaleem@lmlpt52:~/platformio/platform-sifive/examples/freedom-e-sdk_hello$ platformio run -e sifive-hifive-unleashed --target upload -v
Processing sifive-hifive-unleashed (platform: sifive; framework: freedom-e-sdk; board: hifive-unleashed; monitor_speed: 115200)
----------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/sifive/hifive-unleashed.html
PLATFORM: SiFive (2.4.0) > HiFive Unleashed
HARDWARE: FU540 1500MHz, 8GB RAM, 32MB Flash
DEBUG: Current (ftdi) On-board (ftdi, qemu, renode)
PACKAGES: 
 - framework-freedom-e-sdk 2.20050003.200818 (2005.0.3) 
 - tool-jlink 1.65200.0 (6.52.0) 
 - tool-openocd-riscv 2.1000.20190927 (10.0) 
 - toolchain-riscv 1.80300.190927 (8.3.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
MethodWrapper(["checkprogsize"], [".pio/build/sifive-hifive-unleashed/firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 17380 bytes from 8589934592 bytes)
Flash: [          ]   0.1% (used 23612 bytes from 33554432 bytes)
text	   data	    bss	    dec	    hex	filename
  13716	   9896	   7484	  31096	   7978	.pio/build/sifive-hifive-unleashed/firmware.elf
<lambda>(["upload"], [".pio/build/sifive-hifive-unleashed/firmware.elf"])
AVAILABLE: ftdi
CURRENT: upload_protocol = ftdi
openocd -c "debug_level 2" -s /home/arshadaleem/.platformio/packages/tool-openocd-riscv -s /share/openocd/scripts -f /home/arshadaleem/.platformio/packages/framework-freedom-e-sdk/bsp/sifive-hifive-unleashed/openocd.cfg -c "program {.pio/build/sifive-hifive-unleashed/firmware.elf}  verify; shutdown;"
Open On-Chip Debugger 0.10.0+dev (SiFive OpenOCD 0.10.0-2019.08.2)
Licensed under GNU GPL v2
For bug reports:
	https://github.com/sifive/freedom-tools/issues
debug_level: 2
adapter speed: 10000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : Hardware thread awareness created
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=2 progbufsize=16
Info : Disabling abstract command reads from CSRs.
Info : Core 0 could not be made part of halt group 1.
Info : Examined RISC-V core; found 5 harts
Info :  hart 0: XLEN=64, misa=0x8000000000101105
Info :  hart 1: currently disabled
Info :  hart 2: currently disabled
Info :  hart 3: currently disabled
Info :  hart 4: currently disabled
Info : datacount=2 progbufsize=16
Info : Disabling abstract command reads from CSRs.
Info : Core 1 could not be made part of halt group 1.
Info : Examined RISC-V core; found 5 harts
Info :  hart 0: currently disabled
Info :  hart 1: XLEN=64, misa=0x800000000014112d
Info :  hart 2: currently disabled
Info :  hart 3: currently disabled
Info :  hart 4: currently disabled
Info : datacount=2 progbufsize=16
Info : Disabling abstract command reads from CSRs.
Info : Core 2 could not be made part of halt group 1.
Info : Examined RISC-V core; found 5 harts
Info :  hart 0: currently disabled
Info :  hart 1: currently disabled
Info :  hart 2: XLEN=64, misa=0x800000000014112d
Info :  hart 3: currently disabled
Info :  hart 4: currently disabled
Info : datacount=2 progbufsize=16
Info : Disabling abstract command reads from CSRs.
Info : Core 3 could not be made part of halt group 1.
Info : Examined RISC-V core; found 5 harts
Info :  hart 0: currently disabled
Info :  hart 1: currently disabled
Info :  hart 2: currently disabled
Info :  hart 3: XLEN=64, misa=0x800000000014112d
Info :  hart 4: currently disabled
Info : datacount=2 progbufsize=16
Info : Disabling abstract command reads from CSRs.
Info : Core 4 could not be made part of halt group 1.
Info : Examined RISC-V core; found 5 harts
Info :  hart 0: currently disabled
Info :  hart 1: currently disabled
Info :  hart 2: currently disabled
Info :  hart 3: currently disabled
Info :  hart 4: XLEN=64, misa=0x800000000014112d
Info : Listening on port 3333 for gdb connections
Info : Found flash device 'issi is25wp256d' (ID 0x0019709d)
Warn : device needs paging or 4-byte addresses - not implemented
cleared protection for sectors 64 through 511 on flash bank 0
Ready for Remote Connections
Info : JTAG tap: riscv.cpu tap/device found: 0x20000913 (mfg: 0x489 (SiFive Inc), part: 0x0000, ver: 0x2)
** Programming Started **
auto erase enabled
Error: invalid ELF file, only 32bits files are supported
embedded:startup.tcl:486: Error: ** Programming Failed **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 545
at file "embedded:startup.tcl", line 486
*** [upload] Error 1
========================================================= [FAILED] Took 0.82 seconds =========================================================
(penv) 

Any pointer in eliminating this error will be much appreciated.

Thanks.

Any use?

(Found by googling the error message…)

Thanks @tgm, I had seen this link before, but doesn’t exactly help me. It appears that in our case, openocd shipped with PlatformIO does not have the support for 64 bit targit, HiFive Unleashed.
I’ve opened an issue with platforIO here: https://github.com/platformio/platform-sifive/issues/9