platformio / platform-shakti

Shakti: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/shakti
Apache License 2.0
28 stars 8 forks source link

Error: invalid ELF file, only 32bits files are supported #7

Closed swathiparthiban96 closed 5 years ago

swathiparthiban96 commented 5 years ago

I get the following error while uploading hello world program to artix7_100t board

64 bit version of the riscv toolchain is used here.

Platformio

valeros commented 5 years ago

Hi @swathiparthiban96 ! That's interesting, I suppose that problem occurs only with artix_100t board? Are you able to debug the board? @sathya281 @johnnavaj Where I can get OpenOCD package do you usually use without PlatformIO? I see there is one in shakti-tools repository, does it differ from the official OpenOCD fork for RISC-V platform?

johnnavaj commented 5 years ago

@valeros yes we use the openocd located in shakti-tools repository. Since that was not updated with in the latest framework of platformio ,for the time being we used to replace the openocd binary with the one in tools-openocd-riscv. And yes it differs from openocd where the frame is inverted to Pseudo Tap for Simpler Hardware to Decode. If you can update the framework-shakti-sdk to the latest commit it will be very helpful. So coming back to the issue i am seeing this for the first time! i never got issues with both boards .

johnnavaj commented 5 years ago

@valeros i am facing this error too now , the firmware elf created does not load via the openocd initiated through pio but gets loaded manually. Using same version of openocd for both(openocd used in shakti-tools).

valeros commented 5 years ago

@johnnavaj That's interesting, but it worked before right? Has anything changed since that moment?

johnnavaj commented 5 years ago

@valeros yes it was working fine before and no i haven't changed anything till the since last PR regarding upload command.

valeros commented 5 years ago

@johnnavaj Let's switch to uploading hex image instead of elf. Please try the next platformio.ini file:

[env:artix7_100t]
platform = https://github.com/platformio/platform-shakti.git#feature/upload-hex-image
framework = shakti-sdk
board = artix7_100t
monitor_speed = 115200
johnnavaj commented 5 years ago

Yes hex image works @valeros could it be something that has changed on how elf images are handled?

valeros commented 5 years ago

@johnnavaj I think it's just an internal OpenOCD limitation.

johnnavaj commented 5 years ago

@valeros I checked the C code for OpenOCD (image.c in src folder) , looks like its taking in 64 type too, looks interesting. Anyways will work with hex now and look into ELF later. Can you update framework-shakti-sdk to the latest containing the shakti-tools soon ?

valeros commented 5 years ago

Hi @johnnavaj I've updated the sdk package. Please retest with the latest platform from development branch.

[env:artix7_100t]
platform = https://github.com/platformio/platform-shakti.git
framework = shakti-sdk
board = artix7_100t
monitor_speed = 115200

Feel free to open a new issue in case there is any problem.