ARM Flashprogrammer failed to detect the FRDM-KL25Z board.

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

ARM Flashprogrammer failed to detect the FRDM-KL25Z board.

Jump to solution
1,470 Views
fmiku
Contributor III

Hi,

I have problem with Arm Flashprogrammer under Linux (Ubuntu 14.04).

The application failed to detect the FRDM-KL25Z(same with KL26Z) board.

USBDM version is 4.12.1-30

Linux version 3.13.0-68-generic (buildd@lgw01-46) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #111-Ubuntu SMP Fri Nov 6 18:17:06 UTC 2015

(I tryed with different 3.13 kernels..)

when I press the "Detect" button the firmware version randomly changes..

Same version works perfectly under windows !

Any idea ?

The FRDM-xxx boards works fine with the original PE's firmware, and i can update the bootloader under Mac/Linux/windows.

Képernyőfotó 2015-12-17 - 15.20.12.png

Képernyőfotó 2015-12-17 - 15.19.53.png

Képernyőfotó 2015-12-17 - 15.18.24.png

Képernyőfotó 2015-12-17 - 15.18.36.png

Tags (2)
1 Solution
906 Views
pgo
Senior Contributor V

Hi Ferenc,

I had to change some of the USB identification when I signed the windows drivers.  This required firmware updates of the BDMs.  It is possible that I have not updated the last Linux build correctly.

Could you check the attached file which is the current rules file and compare it to the one you currently have.  If different, could you try it please?

Three devices should appear for the KL25 board:

  • /dev/usbdmX
  • /dev/ttyACMX
  • /dev/ttyUsbdmX

(Note - this was in a Ubuntu 15 virtual machine under windows).

Thanks

View solution in original post

11 Replies
906 Views
fmiku
Contributor III

The latest Debian package installation failed on Obuntu 14.04 LTS

root@Mac-ubuntu64:/etc/udev/rules.d# dpkg -i /home/fmiku/Downloads/usbdm_4.12.1.60-2-v5-amd64.deb

(Reading database ... 173793 files and directories currently installed.)

Preparing to unpack .../usbdm_4.12.1.60-2-v5-amd64.deb ...

Removing rules file from /etc/udev/rules.d

==================================================================

removed ‘/etc/udev/rules.d/46-usbdm.rules’

Checking for Eclipse directories

==================================================================

Looking for Eclipse in '/usr/local/eclipse*' - Not Found

Looking for Eclipse in '/opt/eclipse*' - Not Found

Looking for Eclipse in '/usr/lib/eclipse*' - Not Found

Checking for KDS directories

==================================================================

Looking for Freescale KDS in '/usr/local/Freescale/KDS_*' - Not Found

Looking for Freescale KDS in '/opt/Freescale/KDS_3.0.0' - Found

Removing USBDM Eclipse CDT plugins from /opt/Freescale/KDS_3.0.0/eclipse

==================================================================

/opt/Freescale/KDS_3.0.0/eclipse/kinetis-design-studio -nosplash -application org.eclipse.equinox.p2.director -uninstallIU net.sourceforge.usbdm.cdt.feature.feature.group

Uninstalling net.sourceforge.usbdm.cdt.feature.feature.group 4.12.1.201509201816.

Operation completed in 15303 ms.

Removing PE files...

removed ‘/opt/Freescale/KDS_3.0.0/eclipse/ProcessorExpert/Config/Compiler/net.sourceforge.usbdm.cdt.arm.toolchain.c.compiler.xlkr’

Checking for Codewarrior directory

==================================================================

Looking for Codewarrior in '/usr/local/Freescale/CodeWarrior_MCU_10.2' - Not Found

Looking for Codewarrior in '/opt/Freescale/CodeWarrior_MCU_10.2' - Not Found

Unpacking usbdm (4.12-1) over (4.12-1) ...

Setting up usbdm (4.12-1) ...

Copying rules file to /etc/udev/rules.d

(Allows USBDM device to be accessed)

==================================================================

‘/usr/share/usbdm/usbdm.rules’ -> ‘/etc/udev/rules.d/46-usbdm.rules’

chmod a+r      /etc/udev/rules.d/46-usbdm.rules

Checking for Eclipse directories

==================================================================

Looking for Eclipse in '/usr/local/eclipse*' - Not Found

Looking for Eclipse in '/opt/eclipse*' - Not Found

Looking for Eclipse in '/usr/lib/eclipse*' - Not Found

Checking for KDS directories

==================================================================

Looking for Freescale KDS in '/usr/local/Freescale/KDS_*' - Not Found

Looking for Freescale KDS in '/opt/Freescale/KDS_3.0.0' - Found

Patching KDS New Project Wizard

/usr/bin/MergeXML /opt/Freescale/KDS_3.0.0/eclipse/plugins/com.freescale.processorexpert.ui.kds.newprojectwizard_* plugin.xml /usr/share/usbdm/WizardPatches/PatchNewWizardPlugin_KDS_3_0_0.xml

/usr/bin/MergeXML: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/bin/MergeXML)

/usr/bin/MergeXML: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/bin/MergeXML)

dpkg: error processing package usbdm (--install):

subprocess installed post-installation script returned error exit status 1

Processing triggers for man-db (2.6.7.1-1ubuntu1) ...

Processing triggers for mime-support (3.54ubuntu1.1) ...

Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...

Errors were encountered while processing:

usbdm

0 Kudos
906 Views
fmiku
Contributor III

The problem is that the Ubuntu 14.04 LTS version have no official release of the latest gcc/glibc.

the currently available version is "libstdc++6/trusty-updates,now 4.8.4-2ubuntu1~14.04 amd64"

and that supports the following glibcxx

#strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX

GLIBCXX_3.4

GLIBCXX_3.4.1

GLIBCXX_3.4.2

GLIBCXX_3.4.3

GLIBCXX_3.4.4

GLIBCXX_3.4.5

GLIBCXX_3.4.6

GLIBCXX_3.4.7

GLIBCXX_3.4.8

GLIBCXX_3.4.9

GLIBCXX_3.4.10

GLIBCXX_3.4.11

GLIBCXX_3.4.12

GLIBCXX_3.4.13

GLIBCXX_3.4.14

GLIBCXX_3.4.15

GLIBCXX_3.4.16

GLIBCXX_3.4.17

GLIBCXX_3.4.18

GLIBCXX_3.4.19

GLIBCXX_DEBUG_MESSAGE_LENGTH

0 Kudos
906 Views
pgo
Senior Contributor V

Hi Ferenc,

The latest release (with the v5 suffix) is only intended for installation on the latest Ubuntu which has changed to GCC V5,

I will have to do another build on LTS as I cannot see how to create one that will work with both.

I should look at building on the target rather that distributing binaries.

bye

0 Kudos
906 Views
fmiku
Contributor III

Hi,

If you build on a LTS version probably will work with newer versions of GCC/distros.

The LTS versions more stable and more compatible with the programs.

Building on a "cutting edge" / testiung  distro is always risky :smileyhappy:

As I see the backside of the Linux is the so fast changing...

Bye

0 Kudos
906 Views
fmiku
Contributor III

Problem solved !

The current USER was no write permission to the libusb devices.

so I added the following line to the "/etc/udev/rules.d/46-usbdm.rules" file.

SUBSYSTEM=="usb", ATTRS{idVendor}=="16d0", MODE="0664", GROUP="plugdev"

and the currend USER have been added to the plugdev group.

(sudo gpasswd -a USER plugdev)

0 Kudos
906 Views
pgo
Senior Contributor V

Hi Ferenc,

I'm glad you solved the problem but I'm puzzled why it was necessary for your setup but not for other machines (such as my test machine).

This is the first time someone has reported this.

The current .rules file seemed to have been all that is necessary.

  • Can you suggest any reason for this?
  • Can you provide the PID and VID of your device in case there is something different?
  • Does the BDM appear as a usbdmxxx device is /dev... (I don't have a Linux box to check on at the moment).

bye

0 Kudos
906 Views
fmiku
Contributor III

Hi,

yeah.. happened only with me :smileyhappy:, I try to google it but not found anything..

this was totally unexpected to me becus I using a JS16 BDM POD for HSC12 controllers and just work fine.

furthermore I using 2 different machine with a slightly different Linux configuration and  both have same result.

so.., the REAL problem is that the current user have no write access to the device over LIBUSB.

I'm not familiar in  the libusb or udev stuff but I think,

your .rules give write permission to the /dev/* entries only but not the /proc/* or /sys/* entries what is used by the libusb.

probably the BDM pod really got a write permission by the following line in the 50-udev-default.rules.

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"

others may using another libusbd devices too and the .rules for that gives permission for the KL25Z too.

(like gsm modems, etc..)

take a look on the following lines.

Note on the DEVTYPE and DRIVER !

BDM POD (this work without any mods)

#udevadm info  -n /dev/usbdm1

P: /devices/pci0000:00/0000:00:15.0/0000:03:00.0/usb3/3-3/3-3.1

N: bus/usb/003/007

S: usbdm1

E: BUSNUM=003

E: DEVLINKS=/dev/usbdm1

E: DEVNAME=/dev/bus/usb/003/007

E: DEVNUM=007

E: DEVPATH=/devices/pci0000:00/0000:00:15.0/0000:03:00.0/usb3/3-3/3-3.1

E: DEVTYPE=usb_device

E: DRIVER=usb

E: ID_BUS=usb

E: ID_MODEL=USBDM_HCS08_HCS12_Coldfire-V1_BDM

E: ID_MODEL_ENC=USBDM\x20HCS08\x2cHCS12\x2cColdfire-V1\x20BDM

E: ID_MODEL_ID=0567

E: ID_REVISION=0410

E: ID_SERIAL=pgo_USBDM_HCS08_HCS12_Coldfire-V1_BDM_USBDM-JS16-0001

E: ID_SERIAL_SHORT=USBDM-JS16-0001

E: ID_USB_INTERFACES=:ffffff:

E: ID_VENDOR=pgo

E: ID_VENDOR_ENC=pgo

E: ID_VENDOR_FROM_DATABASE=MCS

E: ID_VENDOR_ID=16d0

E: MAJOR=189

E: MINOR=262

E: PRODUCT=16d0/567/410

E: SUBSYSTEM=usb

E: TYPE=255/255/255

E: USEC_INITIALIZED=24878036109

KL25Z

#udevadm info  -n /dev/ttyUsbdm0

P: /devices/pci0000:00/0000:00:15.0/0000:03:00.0/usb3/3-3/3-3.1/3-3.1:1.1/tty/ttyACM0

N: ttyACM0

S: serial/by-id/usb-pgo_USBDM_ARM-SWD_for_OpenSDA_USBDM-OPENSDA-0001-if01

S: serial/by-path/pci-0000:03:00.0-usb-0:3.1:1.1

S: ttyUsbdm0

E: DEVLINKS=/dev/serial/by-id/usb-pgo_USBDM_ARM-SWD_for_OpenSDA_USBDM-OPENSDA-0001-if01 /dev/serial/by-path/pci-0000:03:00.0-usb-0:3.1:1.1 /dev/ttyUsbdm0

E: DEVNAME=/dev/ttyACM0

E: DEVPATH=/devices/pci0000:00/0000:00:15.0/0000:03:00.0/usb3/3-3/3-3.1/3-3.1:1.1/tty/ttyACM0

E: ID_BUS=usb

E: ID_MODEL=USBDM_ARM-SWD_for_OpenSDA

E: ID_MODEL_ENC=USBDM\x20ARM-SWD\x20for\x20OpenSDA

E: ID_MODEL_ID=06a5

E: ID_PATH=pci-0000:03:00.0-usb-0:3.1:1.1

E: ID_PATH_TAG=pci-0000_03_00_0-usb-0_3_1_1_1

E: ID_REVISION=0410

E: ID_SERIAL=pgo_USBDM_ARM-SWD_for_OpenSDA_USBDM-OPENSDA-0001

E: ID_SERIAL_SHORT=USBDM-OPENSDA-0001

E: ID_TYPE=generic

E: ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device

E: ID_USB_DRIVER=cdc_acm

E: ID_USB_INTERFACES=:ffffff:020201:0a0000:

E: ID_USB_INTERFACE_NUM=01

E: ID_USB_PROTOCOL_FROM_DATABASE=Interface Association

E: ID_VENDOR=pgo

E: ID_VENDOR_ENC=pgo

E: ID_VENDOR_FROM_DATABASE=MCS

E: ID_VENDOR_ID=16d0

E: MAJOR=166

E: MINOR=0

E: SUBSYSTEM=tty

E: USEC_INITIALIZED=362737750

0 Kudos
907 Views
pgo
Senior Contributor V

Hi Ferenc,

I had to change some of the USB identification when I signed the windows drivers.  This required firmware updates of the BDMs.  It is possible that I have not updated the last Linux build correctly.

Could you check the attached file which is the current rules file and compare it to the one you currently have.  If different, could you try it please?

Three devices should appear for the KL25 board:

  • /dev/usbdmX
  • /dev/ttyACMX
  • /dev/ttyUsbdmX

(Note - this was in a Ubuntu 15 virtual machine under windows).

Thanks

906 Views
fmiku
Contributor III

Hi,

your original and attached versions are mismach @ line 11 on hex number "06A5"

the original is contains UPPER case letter :smileyhappy:

The new rules works fine without any modifycation !

I just noticed your line 2 :smileygrin::smileygrin:. and this is the key why my rules somtime works somtime not, I'm mostly using UPPER case hex numbers ...

so a BIG thanks to you:smileygrin:, that solves lots of my problems... :smileyhappy:

I guess the  virtualization or real machnine not a problem, I'm using these on MAC with VMWare, and real machnine too, both works fine.

ohh, i got a question.. MAC version of the usbdm projkect ? :smileyhappy: (under https://www.macports.org ?)

Bye

906 Views
pgo
Senior Contributor V

Hi Ferenc,

The comment reflects the fact that I was caught out by the need for lower case.  Even after adding the comment I still got it wrong!

I'm a bit amazed that anyone would write code to parse hex number and not accept upper or lower case.

Anyway - I'm glad we have found the reason.  Sorry for any aggravation caused.

About a MAC version - I don't have access to a MAC machine.  I tried running using a virtual machine but it was very painful and unreliable as well as glacial speed.

In theory it should be possible since the MAC is BSD(?) based and there is a port of wxwidgets as well.

bye

906 Views
fmiku
Contributor III

Hi,

Im not agraveted on this because I know the life is hard who hates the windows platform :smileygrin:

so i always looking for a free/Linux/macports tools and I mostly like the command line tools.

I glad to see the Kinetis devtools are available on Linux/Mac platforms, and I hope the Kinetis-KEA devices will be supported soon.

the hardest thing was to find a free assembler/tool for the Freescale HCS12 (X) controllers.

currently no any GUI or Eclipse integration but i can use perfectly.

0 Kudos