OpenSDA not functioning in Ubuntu 12.04

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OpenSDA not functioning in Ubuntu 12.04

Jump to solution
2,926 Views
bonzo
NXP Employee
NXP Employee

KDS Beta 1.0

Ubuntu 12.04 64-bit running in VirtualBox on a Win7 64-bit host.

 

I was able to install KDS and compile a PEx “blinky” version for FRDM-KL25Z.  I can use the latest firmware to drag and drop the .s19 file onto the FRDM-KL25Z board after installing the latest bootloader and MSD files.

 

But I am unable to connect to opensda.  I have installed the necessary drivers and ran the P&E script (setup.sh). 

The debugger is recognized.  It just won’t connect (see below for Debugger menu).  It seems it can’t find the programming algorithm and the reason might be that “P&E” is not a legal Linux directory name.


I have contacted P&E but have not heard any response.  It's been almost a week.

 

brad@brad-M4700:/opt/Freescale/KDS_1.0/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_1.0.3.201403301338/lin/gdi$ ls -al

total 1608

drwxr-xr-x 3 root root    4096 Apr  8 12:53 .

drwxr-xr-x 3 root root    4096 Apr  8 12:53 ..

drwxr-xr-x 2 root root   65536 Apr  8 12:53 P&E

-rwxr-xr-x 1 root root 1570339 Mar 29 08:22 unit_ngs_arm_internal.so

brad@brad-M4700:/opt/Freescale/KDS_1.0/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_1.0.3.201403301338/lin/gdi$ cd P&E

[1] 7181

bash: cd: P: No such file or directory

E: command not found

[1]+ Exit 1 cd P

brad@brad-M4700:/opt/Freescale/KDS_1.0/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_1.0.3.201403301338/lin/gdi$

 

Here is the terminal output from KDS:

 

P&E GDB Server, Version 2.02.00.03

Copyright 2014, P&E Microcomputer Systems Inc, All rights reserved

 

Loading library /opt/Freescale/KDS_1.0/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_1.0.3.201403301338/lin/gdi/unit_ngs_arm_internal.so ... Done.

 

Command line arguments: -device=KL25Z128M4 -startserver -serverport=7224 -interface=OPENSDA -port=USB1 -speed=5000 -USE_CYCLONEPRO_RELAYS=0 -FORCE_MASS_ERASE=1 

Device selected is kl25z128m4

User Specified Hardware Selection : Interface=OPENSDA and Port=USB1

Connecting to target.

OpenSDA detected - Flash Version 1.14

 

Forcing mass erase...

 

Device is KL25Z128M4.

 

Mode is In-Circuit Debug.

 

'Kinetis' is a registered trademark of Freescale.

 

(C)opyright 2012, P&E Microcomputer Systems, Inc. (www.pemicro.com)

API version is 101

 

PE-ERROR: Algorithm /opt/Freescale/KDS_1.0/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_1.0.3.201403301338/lin/gdi/P&E/ not found

Target Disconnected.

PE-ERROR: Target XML File for kl25z128m4 not found

Target Disconnected.

Server running Connection from "127.0.0.1" via 127.0.0.1

PE-ERROR: Target is not connected

Disconnected from "127.0.0.1" via 127.0.0.1

Labels (1)
1 Solution
1,797 Views
bonzo
NXP Employee
NXP Employee

I tested on Ubuntu 12.04 32-bit.

I am able to debug using OpenSDA and CMSIS-DAP.

Brad

View solution in original post

0 Kudos
Reply
7 Replies
1,797 Views
przemys_aww_grz
Contributor I

I've just stumbled upon the very same issue. Quick strace session has shown that the gdb server process is trying to write to a file called /opt/Freescale/KDS_1.0.1/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_1.0.4.201404181439/lin/gdi/P&E/pedebug_arm_kl25z128m4.add

and fails, because of denied access:

3079  open("/opt/Freescale/KDS_1.0.1/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_1.0.4.201404181439/lin/gdi/P&E/pedebug_arm_kl25z128m4.add", O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = -1 EACCES (Permission denied)

In my case the problem was solved by chown/chmod of P&E directory.

I guess it failed, because the software was installed as root, and then I used a different user to run it, but I believe it should work in such a configuration (I expect software to write any files somewhere under my home directory). It's a pretty lame bug, and absolutely misleading error message.

0 Kudos
Reply
1,797 Views
BlackNight
NXP Employee
NXP Employee

Hi Brad,

I do not have your environment, but it works for me at least under Windows. I have pinged P&E so they could provide some more insights. I have pasted below as reference the console output on my machine.

Erich

-------------------------------------------------------------

P&E GDB Server, Version 2.02.00.01

Copyright 2014, P&E Microcomputer Systems Inc, All rights reserved

Loading library C:\Freescale\KDS_1.0.1\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_1.0.4.201404181439\win32\gdi\unit_ngs_arm_internal.dll ... Done.

Command line arguments: -device=KL25Z128M4 -startserver -serverport=7224 -interface=OPENSDA -port=USB1 -speed=5000 -USE_CYCLONEPRO_RELAYS=0 -FORCE_MASS_ERASE=0

Device selected is kl25z128m4

User Specified Hardware Selection : Interface=OPENSDA and Port=USB1

Connecting to target.

OpenSDA detected - Flash Version 1.14

Device is KL25Z128M4.

Mode is In-Circuit Debug.

'Kinetis' is a registered trademark of Freescale.

(C)opyright 2012, P&E Microcomputer Systems, Inc. (www.pemicro.com)

API version is 101

Server running on 127.0.0.1:7224

Connection from "127.0.0.1" via 127.0.0.1

Copyright 2012 P&E Microcomputer Systems,Inc.

Command Line :C:\Freescale\KDS_1.0.1\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_1.0.4.201404181439\win32\pegdbserver_console -device=KL25Z128M4 -startserver -serverport=7224 -interface=OPENSDA -port=USB1 -speed=5000 -USE_CYCLONEPRO_RELAYS=0 -FORCE_MAS

CMD>RE

Initializing.

Target has been RESET and is active.

CMD>CM C:\Freescale\KDS_1.0.1\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_1.0.4.201404181439\win32\gdi\P&E\kl25z128m4_pflash_pipeline.arp

Initializing.

Initialized.

;version 1.03, 07/17/2013, Copyright P&E Microcomputer Systems, www.pemicro.com [mk_128k_n_pflash_m0]

;device freescale, kl25z128m4, 1x32x32k, desc=pflash_pipeline

;begin_cs device=$00000000, length=$00020000, ram=$20000000

Loading programming algorithm ...

Done.

CMD>EM

Erasing.

Module has been erased.

Initializing.

Initialized.

;version 1.03, 07/17/2013, Copyright P&E Microcomputer Systems, www.pemicro.com  [mk_128k_n_pflash_m0]

;device freescale, kl25z128m4, 1x32x32k, desc=pflash_pipeline

;begin_cs device=$00000000, length=$00020000, ram=$20000000

Loading programming algorithm ...

Done.

CMD>PM

Programming.

Processing Object File Data ...

                             

.

Programmed.

CMD>VC

Verifying object file CRC-16 to device ranges ...

   block 00000000-000000BF ...

Ok.

   block 00000400-000009AF ...

Ok.

   Checksum Verification Successful. (Cumulative CRC-16=$D191)

CMD>RE

Initializing.

Target has been RESET and is active.

Preset breakpoint encountered.

Preset breakpoint encountered.

Interrupt command received. Halting execution.

Interrupt command received. Halting execution.

Disconnected from "127.0.0.1" via 127.0.0.1

CTRL-C Pressed. Terminating Gracefully...

Target Disconnected.

0 Kudos
Reply
1,796 Views
bonzo
NXP Employee
NXP Employee

So I tried the latest version of KDS 1.0.1.

Still have problems.  See my new post here:  OpenSDA not working for KDS V1.0.1 in Linux.

0 Kudos
Reply
1,797 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Brad,

Is it possible for you to give a try in Linux 12.04 LTS 32bits?


Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,797 Views
bonzo
NXP Employee
NXP Employee

It is possible.  I have another PC with native Ubuntu 12.04 LTS 32-bit.

But have you confirmed it works in this environment?  It takes a lot of time to set everything up properly.

--Brad

1,797 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Brad,

I got confirmation from the Program Manager that for Linux it is only 32 bit and NOT 64 bit. 64 bit will likely come in the KDS v2.0 release in October.

Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,798 Views
bonzo
NXP Employee
NXP Employee

I tested on Ubuntu 12.04 32-bit.

I am able to debug using OpenSDA and CMSIS-DAP.

Brad

0 Kudos
Reply