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

Unable to flash sketch to XMC2GO on Linux #21

Closed
PabloPL opened this issue Nov 26, 2017 · 12 comments
Closed

Unable to flash sketch to XMC2GO on Linux #21

PabloPL opened this issue Nov 26, 2017 · 12 comments
Assignees
Labels

Comments

@PabloPL
Copy link
Contributor

PabloPL commented Nov 26, 2017

Board: XMC2GO
OS: Ubuntu 17.04
Arduino IDE: 1.8.5 (fresh download)
Arduino IDE XMC addon: 1.0.6

Tested using arduino blink sketch, and i'm not able to flash sketch using Arduino IDE (i'm able to do this using ozone from segger).

From IDE log i only see

Picked up JAVA_TOOL_OPTIONS: 
--------------------------
Infineon XMC Flasher Lite
Copyright Infineon Technologies 2017
--------------------------
Linux
Operating System: Linux

Initialisation
--------------------------
Linux

ls /opt/SEGGER/ is returning

lrwxrwxrwx 1 root root   23 paź  6 17:07 JLink -> /opt/SEGGER/JLink_V620e
drwxr-xr-x 8 root root 4096 paź 13 18:07 JLink_V620e
drwxr-xr-x 3 root root 4096 lis 10 14:25 ozone
@PabloPL PabloPL changed the title Unable to flash any sketch to XMC2GO on Linux Unable to flash sketch to XMC2GO on Linux Nov 26, 2017
@PabloPL
Copy link
Contributor Author

PabloPL commented Nov 26, 2017

After doing

ln -s /opt/SEGGER/JLink/libjlinkarm.so /usr/lib/libjlinkarm.so

I was able to flash sketch to board.

Picked up JAVA_TOOL_OPTIONS: 
--------------------------
Infineon XMC Flasher Lite
Copyright Infineon Technologies 2017
--------------------------
Linux
Operating System: Linux

Initialisation
--------------------------
Linux
Loading JLink Library... 
JLink Library Version: V6.20e

Configuring Device
Device Name : XMC1100-0064
Interface   : SWD
Speed       : 4000
File Upload
--------------------------
Uploading /tmp/arduino_build_283508/sketch_nov26a.ino.hex
... Done
--------------------------
... Finished Succesfully

@mhollfelder
Copy link
Contributor

Sorry for the delayed reply to your issue and thank you very much for reporting this problem.

The mentioned problem is strange as we changed the search paths for the flasher some time ago and we thought the problem has been fixed.
We will test it again and try to find out where the problem comes from.

Best regards,

Manuel

@bluetiger9
Copy link

bluetiger9 commented May 26, 2018

Creating the symbolic link from @PabloPL's comment fixes the problem.

Seems that without having the symlink, the uploader tries to load the 32-bit library and this fails on 64-bit systems:

$ ./arduino
...
Exception in thread "main" java.lang.UnsatisfiedLinkError: jlinkarm.JLinkARMLibrary.JLINKARM_GetDLLVersion()I
	at jlinkarm.JLinkARMLibrary.JLINKARM_GetDLLVersion(Native Method)
	at Infineon.JLinkDebugger.GetDLLVersion(Unknown Source)
	at Infineon.XMCDevice.Program(Unknown Source)
	at Infineon.upload.main(Unknown Source)
# BridJ: dlopen error when loading /opt/SEGGER/JLink_V512g/libjlinkarm_x86.so.5.12.7 : /opt/SEGGER/JLink_V512g/libjlinkarm_x86.so.5.12.7: wrong ELF class: ELFCLASS32

Maybe this helps to fix the issue.

Cheers,
Attila

@techpaul
Copy link
Contributor

Is this resolved with release V1.1.1 using newer gcc version?

If not should this be added to Wiki for installation or older version installation?

@StephiB
Copy link

StephiB commented Jun 15, 2018 via email

@techpaul
Copy link
Contributor

Well perhaps we need to add to Wiki the fix suggested by PabloPL above of

"After doing

ln -s /opt/SEGGER/JLink/libjlinkarm.so /usr/lib/libjlinkarm.so

I was able to flash sketch to board.
"

@PabloPL
Copy link
Contributor Author

PabloPL commented Jun 15, 2018

Soon we should be able to use PlatformIO - https://github.com/Infineon/platformio-infineonxmc

@PabloPL
Copy link
Contributor Author

PabloPL commented Jun 15, 2018

@techpaul

Is this resolved with release V1.1.1 using newer gcc version?

I think problem is with XMCFlasher, not with gcc version. For some reason, it's not able to correctly load/use JLink software to flash board.

On my ubuntu install Segger JLink is installed (using deb package from theirs website)
into /opt/SEGGER/JLink directory. If adding symlink in /usr/lib/ fixes problem, maybe it's because XMCFlasher is not searching for libjlinkarm.so inside that directory (/opt)?

@techpaul
Copy link
Contributor

Well I have added a note about this on my Wiki for my fork of the package at

https://github.com/techpaul/XMC-for-Arduino/wiki/Linux-64-bit-Flasher-to-board

Until the Segger installation gets resolved

@PabloPL
Copy link
Contributor Author

PabloPL commented Jun 20, 2018

@techpaul Is there repo for XMCFlasher so we could for example create PR with fix ? This looks like something very easy to do.

@techpaul
Copy link
Contributor

Also @mhollfelder

There is no repo for this to my knowledge.

As this is an Infineon utility based or wholly part of the Segger JLink family, this has to be passed up the support chain for the Linux 64 bit installer to be fixed. Or part of the package beyond what I see being fixed

@sherylll
Copy link
Contributor

Since it seems to be a segger- or XMCFlasher-related problem, I'll close this issue.

Since PlatformIO does not depend on XMCFlasher, if this does not happen with PIO, it should de a problem of XMCFlasher (which to my knowledge is not open-sourced).

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

No branches or pull requests

6 participants