Program/Debug FRDM-KL82Z

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

Program/Debug FRDM-KL82Z

1,227 Views
stephanfeurer
Contributor I

Hi, I have a FRDM-KL82Z board. But i can't programm nor debug the damn thing. First I used a USB powerplug to run the board. Everything seemed fine, the demo application run. I then wrote a simple program in Keil and connected the board to my computer. The demo application did not run, and the device keeps connecting and disconnecting, showing me a fail.txt on the mass storage device. I tried connecting it with a ULINK-ME but that didn't work either. Has anyone some information on how to program / debug the board?

4 Replies

784 Views
mjbcswitzerland
Specialist V

Stephan

I have no problems using a P&E debugger connected to the FRDM-KL82F.
However, mostly, the on-board OpenSDA is used - see this link for various options: http://www.nxp.com/products/software-and-tools/run-time-software/kinetis-software-and-tools/ides-for...

Since Windows 10 appeared these have become rather shaky and one really needs a Windows 7 PC to be sure that the loaders/debuggers can be loaded/updated.

Not all work though so you need to experiment - recently I have found that the Segger OpenSDA binaries are the best for getting going with debugging; mdeb CMSIS-DAP usually doesn't operate and the Segger USB-MsD loader doesn't work with Win 10 (but does with Win 7); the P&E ones can debug well too but they are very confusing - the ones marked specifically for the boards [CDC, MSD and debugger] won't load because they are too big for the K20 chip and the ones that can debug are not really named in any logical way to be able to locate them  - one can blindly try some of the debugger builds for others (eg the one for K64) and one may work...

For my KL82 work I install the uTasker serial loader: http://www.utasker.com/kinetis/FRDM-KL82Z.html and then USB-MSD operates (fastest and most practical loading technique) and then I just use the Segger OpenSDA one to debug (when needed) and as VCOM for UART activity. Debugging is not often necessary since the board can also be simulated, which makes project development much simpler and faster than traditional debugging methods.

You will need to experiment a bit until you find the best combination for your setup.

Regards

Mark

Professional support for Kinetis: http://www.utasker.com/index.html
Remote desktop one-on-one coaching: http://www.utasker.com/services.html
Getting started to expert videos: https://www.youtube.com/results?search_query=utasker+shorts

784 Views
stephanfeurer
Contributor I

Hi

Unfortunately none of your hints worked, my two boards seemed bricked... well the onboard programmers are bricked.
Somehow my endeavours seemed to get the SWD interface of the KL82Z to work again, which, at this point, I'm not sure if they ever not worked and I just was too stupid to notice. Yay!

A big warning sign on some of the documentation would have been nice, tho :smileywink:

You'll only notice the Windows 10 factor when it's too late...

Regards and thanks for your time.

0 Kudos

784 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Stephan Feurer,

    Please don't worry, the FRDM-KL82Z won't be bricked.

    Now, please tell me what the PC OS you are using? Win7 or win10?

  If you are using Win10, I suggest you to use the JLINK firmware.

  If you are using win7, it won't have any problem, just update your debugger firmware again.

  Now follow my step, and try to update the debugger to JLINK firmware:

1. Download jlink driver from this link and install it:

SEGGER - The Embedded Experts - Downloads - J-Link / J-Trace 

2. unplug your board

(1) press the reset button, and hold on it, at the same time plug your board to the PC, you will find your board is a device named as "BOOTLOADER"

  then release the reset button.

(2) download the JLINK firmware from this link:

SEGGER - The Embedded Experts - Downloads 

(3) Send 18_OpenSDA_FRDM-KL82Z.bin to your "BOOTLOADER"

 And wait it finished.

(4) unplug the board and plug it again.

 You will find your board is a device named as FRDM-KL82

Now you can us the JLINK debugger to program or debug your KL82 board.

Please try it on your "bricked" board.

If you still have question, please kindly let me know!


Have a great day,
Kerry

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

0 Kudos

784 Views
mjbcswitzerland
Specialist V

A couple of further observations:

I have experienced the OpenSDA remaining in its BOOTLOADER mode after doing one of the following:
- Once I loaded the wrong binary to the FRDM-KL82Z (which was linked with the wrong linker script file and so immediately hard-faulted when copying its initial variable values to RAM). With this code on the KL82 the OpenSDA would always remain in the BOOTLOADER mode and I needed to use an external debugger to delete the KL82 flash to recover (I think that I reloaded the OpenSDA debugger too because starting the OpenSDA in BOOTLOADER connected to Win 10 may already cause it to be lost).

- The FRDM boards have a couple of resistors in the processor's power supply line. These can be removed and a jumper added instead, after which current consumption measurements can be performed. On at least one FRDM board (certainly the FRDM-KL26Z; I didn't try on the FRDM-KL82Z) leaving the processor un-powered causes the OpenSDA to boot to its BOOTLOADER mode and not start normally. In case this is connected to Win 10 it causes its debugger program to be destroyed. This case can be recovered without an external debugger by ensuring the main processor is powered and reprogramming on a "safe" PC OS.

With an external debugger available (and the connector on the board present since not all boards have these mounted) recovery is always possible (I have a box full of 0.05" dual row headers ready for soldering in emergencies....).

Finally, the KL82 has a ROM LOADER internally and so it can in fact be programmed/erased via its USB interface using the KinetisFlashTool (as long as the code already loaded hasn't disabled the ROM loader operation).

Regards

Mark

0 Kudos