29 Replies Latest reply: Apr 24, 2013 2:35 PM by Brion Finlay RSS

Replaced Freedom KL25 - now OpenSDA doesn't work

Frank Van Hooft Level 1

I've replaced the KL25Z128 on the Freedom board with a replacement KL25Z128 (after I killed the original one). Now when I try to connect to the board in CodeWarrior I get this message:

 

Error 17926. Target MCU mismatch. OpenSDA hardware only supports debugging the resident target processor.

 

Now what? It would appear from this error message that OpenSDA is locked to the "PKL25" processor on the Freedom boards, and placing an "MKL25" processor upsets it. Is this correct?  (And why is it called "OpenSDA" anyway - shouldn't it actually be called "ProprietarySDA" or "ClosedSourceSDA"? But I digress.)

 

Any pointers on fixing this would be appreciated. Thanks.

  • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
    Pedro Augusto Panecatl Salas Employee

    You will not be able to use the board, the mcus installed in the freedom boards are tied to them through their unique Kinetis ID, if the IDs do not match to what the firmware has been taught they should be, the board will not work.

    • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
      Jim Donelson Level 3

      Are you saying that you can not replace the KL25Z128 even with another KL25Z128?

      You have to throw the board away?

      I expected that you could use the SDA to debug your own hardware as long as it was the same chip.

      Things like this have been done in the past, locking a debugger to a particular chip, but never to a unique instance.

      Please say it ain't so!

      • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
        Frank Van Hooft Level 1

        Well I'll be darned if I know why they call this the "Freedom" board with "Open" SDA. I've used many a development board in my time, and this one is close to the top of the list of "Proprietary, closed, limited-use only" boards I've had the misfortune to use. Someone at Freescale had a pretty strong sense of irony when they came up with those product names. Probably shooting for a career in politics.

         

        There's no doubt that the programming interface is locked to the processor. Replacing the processor with an "identical" one most certainly does not work. Do Freescale really expect us to replace the entire board when we wire it to custom hardware and something goes wrong? Apparently they do. And do they tell us this fact on the Freedom board webpage or in the documentation? Not that I've seen.

         

        Perhaps one day the source for the SDA processor will be released. Maybe. It gets asked a lot on these forums, but it hasn't happened yet. Being able to remove that restriction would be a huge step forward.

         

        I've spent the past several days frustratingly attempting to find a way to program the KL25Z128, given that the SDA interface is deliberately broken. What's finally worked has been to take a revision 5 Kinetis KwikStik board, and wiring off the J-Link interface it provides. Here's how to hook it up:

         

        For the 10-pin header J8 on the Kwikstik board:

         

        1 - Vref   (connect to the VCC on your KL25Z128)

        2 - SWDIO

        4 - SWCLK

        9 - GNDdetect - tie this to GND

        3 - 5 - GND

         

        Other pins are no-connect. Note that reset is not connected, nor is it required. (Of course you need to disconnect the SDA chip on the Freedom board - however you do that is up to you.)

         

        The little "power" switch on the KwikStik board must be "off".

         

        Then in CodeWarrior you need to set the debug interface to J-Link. Make sure you select "SWD" in the appropriate sub-menu (tab) - it seems to default to "JTAG" and that won't work.

         

        Finally, with this ugly hardware hacking, I'm back to where I was several days ago - able to program the KL25Z128 again. What a lot of pointless work and wasted time - Freescale certainly isn't making it easy for their customers. I hope this posting helps others. Good luck.

        • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
          pgo Level 3

          Hi Frank,

           

          I quite agree with the comments about OpenSDA and I'm still waiting for the information that would allow me to make use of it in an "open" fashion.  This is certainly what the name implies and is supported by what appears to be official Freescale statement.  Hopefully this will be rectified in the (near?) future.

           

          However, in fairness, the debugger included in the Freedom boards is not opensource nor does it makes claims of being so.  It is a particular application loaded using the OpenSDA bootloader.  I believe it is a closed source debugger firmware produced by P&E micro and I can understand their preference for tying it to a particular chip type to prevent undermining their commercial products.  I believe they have been somewhat stung previously in this area (people using what was meant to be limited use programming interface on a demo board as a general programmer.)  Tying it to a particular chip using the UUID on the chip does seem a bit excessive!

           

          Note that this application is not the same as the OSBDM-JM60 debuggers included on some of the other Freescale boards (e.g many tower boards).  The source code for these is readily available.

           

          bye

        • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
          pgo Level 3

          Hi Frank,

           

          Just to point out some further options.

           

          • There is a CMSIS-DAP OpenSDA plugin that can be loaded into the FRDM-KL25 board that allows it to be used with a range of programs supporting that debugger interface e.g. Keil.  There is some information here:

          The step to use CMSIS-DAP to debug the Freescale freedom board « CooCox Forum

           

          • The latest version of USBDM provides a OpenSDA version that works with the FRDM-KL25.  It supports Codewarrior and provided utilities allow unrestricted programming of any connected Kinetis chip.  It turns the FRDM-KL25 in to a general purpose BDM. It is actually open source.

          http://usbdm.sourceforge.net/

           

          bye

        • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
          Brion Finlay Level 1

          Frank,

           

          I have been trying to reproduce your solution with the kwikstick board but have not yet been able to get it to work. 

           

          I get an error "An error occurred while trying to write memory.  The Debugger can not write memory."

           

          I "disconnected" the SDA chip on the freedom board by cutting jumper J11 per the freedom board schematic.  Is that what you did or did you do something more when removing the SDA chip?

           

          I have examined the lines with an oscilloscope and have confirmed that the kwikstick is sending signals to the freedom board.

           

          Were there any other settings that you changed in the debug configuration for the jlink?

          • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
            pgo Level 3

            Hi Brion,

             

            If the K20 chip (openSDA chip) has the freescale debugger loaded it should by default not interfere with an external BDM connected to the 10 pin connector for the MKL25.

             

            You should NOT remove the link since it is between the connector and the MKL25 target.  It is intended to allow the on-board BDM interface (K20 chip) to program external devices.  Of course the firmware doesn't actually allows this .

             

            bye

        • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
          michaelsteffenfae Employee

          Hi Frank,

          I realized how frustrating it is trying to replace something only to have twice as much work as you start with.  Please understand Freescale made the Freedom board with inexpensive in mind.  If you look on Digikey or Mouser the KL25 chip you replaced costs a little over $4, and the time you have invested in coming up with an alternate way of re-programming it.

           

          Wouldn't you might of been further ahead just replacing the board for $12.95?  Just a thought...

           

          Mike

  • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
    Gurinder Singh Gill Level 1

    I totally agree , Being said "Open" i still haven't read about its source being open, more over There is NO literally NO LINUX Support , Freescale is stick to its silly PE Component which i personally, really don't like, and Great to hear that Freescale has dropped free support : if you want PE Component , well you have to buy it thats sad, now we have to

    1st pay for CW, then for any PE component we need , then for GDB Debugger (Yes OpenSDA sounding open is really not open you even have to pay for even GDB , means how does that sound Open !!)

     

    I am very very Dissapointed

  • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
    Antonio Quevedo Level 2

    Hello,

     

    I had a similar problem with my FRDM board. I bricked the KL25 (I used the Flash app, and loaded an ELF file by mistake, and it protected my processor against program and erase), and replaced it on the board (MKL version). However, my CW10.3 continued debugging the board, until I uninstalled Beta version, and installed Release. From that moment on, the debugger app gives the same error message presented in the original post. I tried it in another computer, with CW beta, and it worked! Again, I installed Release version on the second computer... and now I only get the same error.

     

    If I load the Flasher app, I am still able to load binary files, but I cannot debug it anymore.

     

    Thanks for enlighting me about the problem. Even P&E support cannot find a solution. Now I noticed that I forgot to mention to support that the original KL25 was replaced.

     

    I looked at the workarounds presented by pgo. Using the CMSIS-DAP demands another IDE, since CW does not support it. And I could not find the OpenSDA version for USBDM. Can anyone provide a direct link for the USBDM?

     

    Thanks

    • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
      pgo Level 3

      Hi Antonio,

       

      The OpenSDA version of USBDM is included in the latest version 4.10.4 available at:

       

      USBDM - Browse /Version 4.10.4/Installation at SourceForge.net

       

      It is included as part of the installation (look in the menu USBDM 4.10.4->BDM Flash Images).  You will also need the appropriate driver installation.

       

      bye

      • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
        Antonio Quevedo Level 2

        Thanks. I am just having problems to install the driver. I am using a winXP 32-bit with an AMD 64-bit processor. I suppose I have to use the 32-bit driver... but when I connect my FRDM board with the USBDM loaded, I get an error installing the driver.

         

        I used zadig to install the USBDM driver, and now it works perfectly. I have created a new project using USBDM connection, and now I can debug my project.

         

        Does anyone know how can I change the debugger connection from OpenSDA to USBDM, in projects already generated?

         

        Thanks

      • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
        Brion Finlay Level 1

        pgo,

         

        I have attempted to install USBDM on a freedom board without success.  The problem seems to be with the usb drivers - when I connect the board to the PC, it does not recognize the board or load an USBDM drivers.

         

        I followed these steps to install usbdm:

        1. install USBDM_4_10_4_Win.msi

        2. install USBDM_Drivers_1_0_1_win_x64.msi (I am using Windows 7 64 bit)

        3. hold down reset button on freedom board and attach to PC to put into bootloader mode

        4. load USBDM_OpenSDA.sx by copying from "program files (x86)/pgo/USBDM 4.10.4/FlashImages/MKxx" to the bootloader drive.

        5. detach freedom board

        6. attach freedom board

         

        When attaching the freedom board, there is no indication from Windows 7 that the board has been attached.   Device Manager does not show any loaded USBDM devices.   Codewarrior, when configured per below, cannot identify any USBDM devices.  Using the program "ARM programmer" or "USBDM Firmware Updater", neither is able to detect a BDM device - presumable because the driver is not loaded.

         

        Did I miss a step? 

        • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
          pgo Level 3

          Hi Brion,

           

          I just tried the FRDM-KL25 with a Windows-7 machine and it seemed to work OK.

           

          I was able to update the firmware on board without any problem and when plugged in again it enumerated as an USBDM device.

           

          The OpenSDA bootloaders I tried were:

           

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

           

          Board Name is: FRDM-KL25Z

          MicroBoot Kernel Version is: 1.01

          Bootloader Version is: 1.01

          Application Version is: 0.00

           

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

          Board Name is: FRDM-KL25Z

          MicroBoot Kernel Version is: 1.01

          Bootloader Version is: 1.08

          Application Version is: 0.00


          I updated the Bootloader between these tests to see if the version affected anything.

          The Application version is 0.00 since the USBDM firware doesn't report it correctly (mainly because I have no idea how to).


          Could you do the following:

          • Do you have another PC you can try the process on or even just plugging the board into.
          • Boot the board in Bootloader mode and open the SDA_INFO.HTM file to check what it reports.

           

          bye

          • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
            Brion Finlay Level 1

            It is the MicroBoot Kernel version.    Most of my boards have MicroBoot Kernel version 1.03.   I went through 4 different freedom boards and found 1 that had MicroBoot Kernel Version 1.01.   I followed the same procedure and the USBDM interface enumerated immediately.  It does not enumerate with any of the boards that have MicroBoot Kernel version 1.03.

             

            The original board I tested on

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

             

            Board Name is: FRDM-KL25Z

            MicroBoot Kernel Version is: 1.03

            Bootloader Version is: 1.05

            Application Version is: 0.00

             

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


            I upgraded to 1.08

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

            Board Name is: FRDM-KL25Z

            MicroBoot Kernel Version is: 1.03

            Bootloader Version is: 1.08

            Application Version is: 0.00

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


            The MicroBoot Kernel 1.01:

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

            Board Name is: FRDM-KL25Z

            MicroBoot Kernel Version is: 1.01

            Bootloader Version is: 1.01

            Application Version is: 0.00

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



            In the bootupdateapp release note, there is some information about Microboot 1.03 and about the bootloaders:

            WARNING: If you are running Microboot v1.03 or older on a FRDM-KL25Z board, there is a scenario where interrupting the firmware update at a very specific spot during the update process will cause the board to become secure and unusable. It is very unlikely that this would occur as the entire update process takes about a second and this problem would occur only when replacing one of the many sectors in the flash which are reprogrammed. This flaw was fixed in Microboot v1.03. In order to fix the board, it would have to be shipped to P&E to be recovered.

             

            BOOTUPDATEAPP with Bootloader v1.08 fixes the following issues:

             

             

            v1.05 Fixed binary files download to bootloader. Wrong address was used (0x0000 instead of 0x8000)

                  Fixed led not coming on upon an error

            v1.07 Added Bootloader support for Linux

            v1.08 Future feature additions (undocumented)

             

            Microboot 1.03 made some changes related to memory locations.

             

            I speculate that there are changes in the address where the usbdm needs to load with microboot 1.03?   (considering the info here: Basic OpenSDA Project)

             

            Message was edited by: Brion Finlay

            Some additional information that I neglected to add: When the microboot 1.03 devices are programmed with USBDM and attached to USB, Windows does not enumerate the device at all.  It is like a dead device.  This implies that the USBDM code (which manages the USB device) is not running, which leads me to speculate about a loading problem like memory location.

             

            On the other hand, the OpenSDA LED lights up solid green, which according to the OpenSDA users guide means that OpenSDA MSD Bootloader is running an application normally with no error conditions and no USB activity.

             

            Are there any fixes that can be made for the microboot 1.03?

  • Re: Replaced Freedom KL25 - now OpenSDA doesn't work
    Gurinder Singh Gill Level 1

    I tried USBDM and its working fine for me , i do have an question as freescale stopped supporting linux , there is no Codewarrier 10.3 for linux and CodeWarrier 10.2 dosent support MKL25xxxx Series, so , is there any way setting up CMSIS /USBDM / etc. for gdb debugging under linux.